Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 82f910056466503164e54c9850a8038dd579f974..e557285a484e925c3d3561adaad37441b788ff2e 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -32,6 +32,7 @@ |
#include "bootstrapper.h" |
#include "code-stubs.h" |
#include "regexp-macro-assembler.h" |
+#include "stub-cache.h" |
namespace v8 { |
namespace internal { |
@@ -2359,6 +2360,34 @@ void MathPowStub::Generate(MacroAssembler* masm) { |
} |
+void StringLengthStub::Generate(MacroAssembler* masm) { |
+ Label miss; |
+ Register receiver; |
+ if (kind() == Code::KEYED_LOAD_IC) { |
+ // ----------- S t a t e ------------- |
+ // -- rax : key |
+ // -- rdx : receiver |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ __ Cmp(rax, masm->isolate()->factory()->length_symbol()); |
+ receiver = rdx; |
+ } else { |
+ ASSERT(kind() == Code::LOAD_IC); |
+ // ----------- S t a t e ------------- |
+ // -- rax : receiver |
+ // -- rcx : name |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ receiver = rax; |
+ } |
+ |
+ StubCompiler::GenerateLoadStringLength(masm, receiver, r8, r9, &miss, |
+ support_wrapper_); |
+ __ bind(&miss); |
+ StubCompiler::GenerateLoadMiss(masm, kind()); |
+} |
+ |
+ |
void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
// The key is in rdx and the parameter count is in rax. |