Index: src/x64/builtins-x64.cc |
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
index aef91640a01687f133f5dcd68770c416b278968b..088eb43b6010504526939d84678b3e23f8bcfb10 100644 |
--- a/src/x64/builtins-x64.cc |
+++ b/src/x64/builtins-x64.cc |
@@ -374,9 +374,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
__ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); |
Handle<Code> code = |
masm->isolate()->builtins()->HandleApiCallConstruct(); |
- ParameterCount expected(0); |
- __ InvokeCode(code, expected, expected, RelocInfo::CODE_TARGET, |
- CALL_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); |
+ __ SetCallKind(rcx, CALL_AS_METHOD); |
+ __ Call(code, RelocInfo::CODE_TARGET); |
} else { |
ParameterCount actual(rax); |
__ InvokeFunction(rdi, actual, CALL_FUNCTION, |
@@ -1307,7 +1306,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// -- rax : actual number of arguments |
// -- rbx : expected number of arguments |
// -- rcx : call kind information |
- // -- rdx : code entry to call |
+ // -- rdi: function (passed through to callee) |
// ----------------------------------- |
Label invoke, dont_adapt_arguments; |
@@ -1315,6 +1314,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
__ IncrementCounter(counters->arguments_adaptors(), 1); |
Label enough, too_few; |
+ __ movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset)); |
__ cmpq(rax, rbx); |
__ j(less, &too_few); |
__ cmpq(rbx, Immediate(SharedFunctionInfo::kDontAdaptArgumentsSentinel)); |