Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index a0a53862f7533d6be5d336e5e7cbf04ca32e3365..e899997e68bfeef595db27a861f919ac6af98fa6 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -2698,6 +2698,43 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback( |
} |
+Handle<Code> LoadStubCompiler::CompileLoadViaGetter( |
+ Handle<String> name, |
+ Handle<JSObject> receiver, |
+ Handle<JSObject> holder, |
+ Handle<JSFunction> getter) { |
+ // ----------- S t a t e ------------- |
+ // -- rax : receiver |
+ // -- rcx : name |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ Label miss; |
+ |
+ // Check that the maps haven't changed. |
+ __ JumpIfSmi(rax, &miss); |
+ CheckPrototypes(receiver, rax, holder, rbx, rdx, rdi, name, &miss); |
+ |
+ { |
+ FrameScope scope(masm(), StackFrame::INTERNAL); |
+ |
+ // Call the JavaScript getter with the receiver on the stack. |
+ __ push(rax); |
+ __ InvokeFunction(getter, ParameterCount(0), CALL_FUNCTION, |
+ NullCallWrapper(), CALL_AS_METHOD); |
+ |
+ // Restore context register. |
+ __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
+ } |
+ __ ret(0); |
+ |
+ __ bind(&miss); |
+ GenerateLoadMiss(masm(), Code::LOAD_IC); |
+ |
+ // Return the generated code. |
+ return GetCode(CALLBACKS, name); |
+} |
+ |
+ |
Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, |
Handle<JSObject> holder, |
Handle<JSFunction> value, |