Commit 04afb10f authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

Migrate StringLengthStub to TF builtin

Bug: 
Change-Id: I58ce9a0f42dfa81c8e8affa2377c5cc0d08a35e2
Reviewed-on: https://chromium-review.googlesource.com/691714
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48222}
parent 0a346fc2
......@@ -213,6 +213,7 @@ namespace internal {
ASM(LoadIC_Getter_ForDeopt) \
TFH(LoadIC_Miss, LoadWithVector) \
TFH(LoadIC_Slow, LoadWithVector) \
TFH(LoadIC_StringLength, LoadWithVector) \
TFH(LoadIC_Uninitialized, LoadWithVector) \
TFH(StoreIC_Miss, StoreWithVector) \
ASM(StoreIC_Setter_ForDeopt) \
......
......@@ -13,6 +13,13 @@
namespace v8 {
namespace internal {
TF_BUILTIN(LoadIC_StringLength, CodeStubAssembler) {
Node* value = Parameter(Descriptor::kReceiver);
Node* string = LoadJSValueValue(value);
Node* result = LoadStringLength(string);
Return(result);
}
TF_BUILTIN(KeyedLoadIC_IndexedString, CodeStubAssembler) {
Node* receiver = Parameter(Descriptor::kReceiver);
Node* index = Parameter(Descriptor::kName);
......
......@@ -339,14 +339,6 @@ TF_STUB(ElementsTransitionAndStoreStub, CodeStubAssembler) {
}
}
// TODO(ishell): move to builtins-handler-gen.
TF_STUB(StringLengthStub, CodeStubAssembler) {
Node* value = Parameter(Descriptor::kReceiver);
Node* string = LoadJSValueValue(value);
Node* result = LoadStringLength(string);
Return(result);
}
TF_STUB(TransitionElementsKindStub, CodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* object = Parameter(Descriptor::kObject);
......
......@@ -47,7 +47,6 @@ class Node;
V(ArrayNoArgumentConstructor) \
V(ArraySingleArgumentConstructor) \
V(ArrayNArgumentsConstructor) \
V(StringLength) \
V(InternalArrayNoArgumentConstructor) \
V(InternalArraySingleArgumentConstructor) \
V(ElementsTransitionAndStore) \
......@@ -462,14 +461,6 @@ class TurboFanCodeStub : public CodeStub {
namespace v8 {
namespace internal {
class StringLengthStub : public TurboFanCodeStub {
public:
explicit StringLengthStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector);
DEFINE_TURBOFAN_CODE_STUB(StringLength, TurboFanCodeStub);
};
class StoreInterceptorStub : public TurboFanCodeStub {
public:
explicit StoreInterceptorStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
......
......@@ -867,7 +867,7 @@ class RuntimeCallTimer final {
V(LoadIC_NonReceiver) \
V(LoadIC_Premonomorphic) \
V(LoadIC_SlowStub) \
V(LoadIC_StringLengthStub) \
V(LoadIC_StringLength) \
V(StoreIC_HandlerCacheHit_Accessor) \
V(StoreIC_NonReceiver) \
V(StoreIC_Premonomorphic) \
......
......@@ -719,9 +719,8 @@ Handle<Object> LoadIC::GetMapIndependentHandler(LookupIterator* lookup) {
if (receiver->IsStringWrapper() &&
*lookup->name() == isolate()->heap()->length_string()) {
TRACE_HANDLER_STATS(isolate(), LoadIC_StringLengthStub);
StringLengthStub string_length_stub(isolate());
return string_length_stub.GetCode();
TRACE_HANDLER_STATS(isolate(), LoadIC_StringLength);
return BUILTIN_CODE(isolate(), LoadIC_StringLength);
}
// Use specialized code for getting prototype of functions.
......
......@@ -108,8 +108,7 @@ TEST(RunStringLengthStub) {
Isolate* isolate = scope.main_isolate();
Zone* zone = scope.main_zone();
StringLengthStub stub(isolate);
StubTester tester(isolate, zone, &stub);
StubTester tester(isolate, zone, Builtins::kLoadIC_StringLength);
// Actuall call through to the stub, verifying its result.
const char* testString = "Und das Lamm schrie HURZ!";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment