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 97b948b1500a444d15da8177d2c42a7e63d5835b..be1438be9b20800d5e930bb4f4db565672a7e09d 100644 |
--- a/src/ic/x64/handler-compiler-x64.cc |
+++ b/src/ic/x64/handler-compiler-x64.cc |
@@ -181,9 +181,16 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( |
call_data_undefined = true; |
__ LoadRoot(data, Heap::kUndefinedValueRootIndex); |
} else { |
- __ movp(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
- __ movp(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
- __ movp(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
+ if (optimization.is_constant_call()) { |
+ __ movp(data, |
+ FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
+ __ movp(data, |
+ FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
+ __ movp(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
+ } else { |
+ __ movp(data, |
+ FieldOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); |
+ } |
__ movp(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); |
} |
@@ -200,7 +207,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( |
RelocInfo::EXTERNAL_REFERENCE); |
// Jump to stub. |
- CallApiAccessorStub stub(isolate, is_store, call_data_undefined); |
+ CallApiAccessorStub stub(isolate, is_store, call_data_undefined, |
+ !optimization.is_constant_call()); |
__ TailCallStub(&stub); |
} |