Index: src/ia32/builtins-ia32.cc |
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc |
index 08e2fa9ec129b8853b841b89b3c8309e750cd92f..93db4a4bb5430ecc9a42312584d8f7bbfa7a58b7 100644 |
--- a/src/ia32/builtins-ia32.cc |
+++ b/src/ia32/builtins-ia32.cc |
@@ -33,13 +33,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, |
// ----------------------------------- |
__ AssertFunction(edi); |
- // 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? |
- __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
- |
// Insert extra arguments. |
int num_extra_args = 0; |
if (extra_args == NEEDS_CALLED_FUNCTION) { |
@@ -53,21 +46,8 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, |
} |
// JumpToExternalReference expects eax to contain the number of arguments |
- // including the receiver and the extra arguments. But eax is only valid |
- // if the called function is marked as DontAdaptArguments, otherwise we |
- // need to load the argument count from the SharedFunctionInfo. |
- Label argc, done_argc; |
- __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
- __ mov(ebx, |
- FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset)); |
- __ SmiUntag(ebx); |
- __ cmp(ebx, SharedFunctionInfo::kDontAdaptArgumentsSentinel); |
- __ j(equal, &argc, Label::kNear); |
- __ lea(eax, Operand(ebx, num_extra_args + 1)); |
- __ jmp(&done_argc, Label::kNear); |
- __ bind(&argc); |
+ // including the receiver and the extra arguments. |
__ add(eax, Immediate(num_extra_args + 1)); |
- __ bind(&done_argc); |
__ JumpToExternalReference(ExternalReference(id, masm->isolate())); |
} |