Index: src/x64/stub-cache-x64.cc |
=================================================================== |
--- src/x64/stub-cache-x64.cc (revision 2533) |
+++ src/x64/stub-cache-x64.cc (working copy) |
@@ -327,7 +327,7 @@ |
// ----------------------------------- |
Label miss; |
- __ movq(rax, (Operand(rsp, kPointerSize))); |
+ __ movq(rax, Operand(rsp, kPointerSize)); |
GenerateLoadConstant(object, holder, rax, rbx, rdx, value, name, &miss); |
__ bind(&miss); |
GenerateLoadMiss(masm(), Code::LOAD_IC); |
@@ -348,7 +348,7 @@ |
// ----------------------------------- |
Label miss; |
- __ movq(rax, (Operand(rsp, kPointerSize))); |
+ __ movq(rax, Operand(rsp, kPointerSize)); |
GenerateLoadField(object, holder, rax, rbx, rdx, index, name, &miss); |
__ bind(&miss); |
GenerateLoadMiss(masm(), Code::LOAD_IC); |
@@ -381,7 +381,7 @@ |
__ IncrementCounter(&Counters::named_load_global_inline, 1); |
// Get the receiver from the stack. |
- __ movq(rax, (Operand(rsp, kPointerSize))); |
+ __ movq(rax, Operand(rsp, kPointerSize)); |
// If the object is the holder then we know that it's a global |
// object which can only happen for contextual loads. In this case, |
@@ -476,6 +476,36 @@ |
} |
+Object* KeyedLoadStubCompiler::CompileLoadField(String* name, |
+ JSObject* receiver, |
+ JSObject* holder, |
+ int index) { |
+ // ----------- S t a t e ------------- |
+ // -- rsp[0] : return address |
+ // -- rsp[8] : name |
+ // -- rsp[16] : receiver |
+ // ----------------------------------- |
+ Label miss; |
+ |
+ __ movq(rax, Operand(rsp, kPointerSize)); |
+ __ movq(rcx, Operand(rsp, 2 * kPointerSize)); |
+ __ IncrementCounter(&Counters::keyed_load_field, 1); |
+ |
+ // Check that the name has not changed. |
+ __ Cmp(rax, Handle<String>(name)); |
+ __ j(not_equal, &miss); |
+ |
+ GenerateLoadField(receiver, holder, rcx, rbx, rdx, index, name, &miss); |
+ |
+ __ bind(&miss); |
+ __ DecrementCounter(&Counters::keyed_load_field, 1); |
+ GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
+ |
+ // Return the generated code. |
+ return GetCode(FIELD, name); |
+} |
+ |
+ |
// TODO(1241006): Avoid having lazy compile stubs specialized by the |
// number of arguments. It is not needed anymore. |
Object* StubCompiler::CompileLazyCompile(Code::Flags flags) { |