| Index: src/arm64/builtins-arm64.cc
|
| diff --git a/src/arm64/builtins-arm64.cc b/src/arm64/builtins-arm64.cc
|
| index d14d94b94e6403c038953d9ecc59f268f40038a4..9c8a67b43d3ffb63381fdc1b67779f864b8d917d 100644
|
| --- a/src/arm64/builtins-arm64.cc
|
| +++ b/src/arm64/builtins-arm64.cc
|
| @@ -48,13 +48,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm,
|
| // -----------------------------------
|
| __ AssertFunction(x1);
|
|
|
| - // Make sure we operate in the context of the called function (for example
|
| - // ConstructStubs implemented in C++ will be run in the context of the caller
|
| - // instead of the callee, due to the way that [[Construct]] is defined for
|
| - // ordinary functions).
|
| - // TODO(bmeurer): Can we make this more robust?
|
| - __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset));
|
| -
|
| // Insert extra arguments.
|
| int num_extra_args = 0;
|
| if (extra_args == NEEDS_CALLED_FUNCTION) {
|
| @@ -65,14 +58,7 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm,
|
| }
|
|
|
| // JumpToExternalReference expects x0 to contain the number of arguments
|
| - // including the receiver and the extra arguments. But x0 is only valid
|
| - // if the called function is marked as DontAdaptArguments, otherwise we
|
| - // need to load the argument count from the SharedFunctionInfo.
|
| - __ Ldr(x2, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset));
|
| - __ Ldrsw(
|
| - x2, FieldMemOperand(x2, SharedFunctionInfo::kFormalParameterCountOffset));
|
| - __ Cmp(x2, SharedFunctionInfo::kDontAdaptArgumentsSentinel);
|
| - __ Csel(x0, x0, x2, eq);
|
| + // including the receiver and the extra arguments.
|
| __ Add(x0, x0, num_extra_args + 1);
|
|
|
| __ JumpToExternalReference(ExternalReference(id, masm->isolate()));
|
|
|