Index: src/arm/builtins-arm.cc |
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc |
index 723587704c3e9b5210c109add473397bd431f54e..e067457bc02a7620d027b22d6f945f4678e442ae 100644 |
--- a/src/arm/builtins-arm.cc |
+++ b/src/arm/builtins-arm.cc |
@@ -32,13 +32,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, |
// ----------------------------------- |
__ AssertFunction(r1); |
- // 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(r1, JSFunction::kContextOffset)); |
- |
// Insert extra arguments. |
int num_extra_args = 0; |
if (extra_args == NEEDS_CALLED_FUNCTION) { |
@@ -49,15 +42,7 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, |
} |
// JumpToExternalReference expects r0 to contain the number of arguments |
- // including the receiver and the extra arguments. But r0 is only valid |
- // if the called function is marked as DontAdaptArguments, otherwise we |
- // need to load the argument count from the SharedFunctionInfo. |
- __ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
- __ ldr(r2, |
- FieldMemOperand(r2, SharedFunctionInfo::kFormalParameterCountOffset)); |
- __ SmiUntag(r2); |
- __ cmp(r2, Operand(SharedFunctionInfo::kDontAdaptArgumentsSentinel)); |
- __ mov(r0, r2, LeaveCC, ne); |
+ // including the receiver and the extra arguments. |
__ add(r0, r0, Operand(num_extra_args + 1)); |
__ JumpToExternalReference(ExternalReference(id, masm->isolate())); |