Index: src/ic/x64/handler-compiler-x64.cc |
diff --git a/src/ic/x64/handler-compiler-x64.cc b/src/ic/x64/handler-compiler-x64.cc |
index 1538f12ac8141d6ce986b44cedf29c99e0f5f6c5..13b5fa804c2280ba01404b6dbf63f3bf43fc5eb9 100644 |
--- a/src/ic/x64/handler-compiler-x64.cc |
+++ b/src/ic/x64/handler-compiler-x64.cc |
@@ -255,7 +255,7 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( |
void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
MacroAssembler* masm, Handle<HeapType> type, Register receiver, |
- Handle<JSFunction> getter) { |
+ Register holder, int accessor_index, int expected_arguments) { |
// ----------- S t a t e ------------- |
// -- rax : receiver |
// -- rcx : name |
@@ -264,7 +264,7 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
{ |
FrameScope scope(masm, StackFrame::INTERNAL); |
- if (!getter.is_null()) { |
+ if (accessor_index >= 0) { |
// Call the JavaScript getter with the receiver on the stack. |
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
// Swap in the global receiver. |
@@ -273,8 +273,14 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
} |
__ Push(receiver); |
ParameterCount actual(0); |
- ParameterCount expected(getter); |
- __ InvokeFunction(getter, expected, actual, CALL_FUNCTION, |
+ ParameterCount expected(expected_arguments); |
+ Register scratch = holder; |
+ __ movp(scratch, FieldOperand(holder, HeapObject::kMapOffset)); |
+ __ LoadInstanceDescriptors(scratch, scratch); |
+ __ movp(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset( |
+ accessor_index))); |
+ __ movp(rdi, FieldOperand(scratch, AccessorPair::kGetterOffset)); |
+ __ InvokeFunction(rdi, expected, actual, CALL_FUNCTION, |
NullCallWrapper()); |
} else { |
// If we generate a global code snippet for deoptimization only, remember |