Index: src/ppc/builtins-ppc.cc |
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc |
index 590a242aee5ff083c1d466e19ccb420baafae008..4e23f38102c9eb4d3702d1d84c2c844678ad64e6 100644 |
--- a/src/ppc/builtins-ppc.cc |
+++ b/src/ppc/builtins-ppc.cc |
@@ -21,8 +21,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id, |
BuiltinExtraArguments extra_args) { |
// ----------- S t a t e ------------- |
// -- r3 : number of arguments excluding receiver |
- // (only guaranteed when the called function |
- // is not marked as DontAdaptArguments) |
// -- r4 : called function |
// -- sp[0] : last argument |
// -- ... |
@@ -31,13 +29,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id, |
// ----------------------------------- |
__ AssertFunction(r4); |
- // 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? |
- __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); |
- |
// Insert extra arguments. |
int num_extra_args = 0; |
if (extra_args == NEEDS_CALLED_FUNCTION) { |
@@ -48,24 +39,7 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id, |
} |
// JumpToExternalReference expects r3 to contain the number of arguments |
- // including the receiver and the extra arguments. But r3 is only valid |
- // if the called function is marked as DontAdaptArguments, otherwise we |
- // need to load the argument count from the SharedFunctionInfo. |
- __ LoadP(r5, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
- __ LoadWordArith( |
- r5, FieldMemOperand(r5, SharedFunctionInfo::kFormalParameterCountOffset)); |
-#if !V8_TARGET_ARCH_PPC64 |
- __ SmiUntag(r5); |
-#endif |
- __ cmpi(r5, Operand(SharedFunctionInfo::kDontAdaptArgumentsSentinel)); |
- if (CpuFeatures::IsSupported(ISELECT)) { |
- __ isel(ne, r3, r5, r3); |
- } else { |
- Label skip; |
- __ beq(&skip); |
- __ mr(r3, r5); |
- __ bind(&skip); |
- } |
+ // including the receiver and the extra arguments. |
__ addi(r3, r3, Operand(num_extra_args + 1)); |
__ JumpToExternalReference(ExternalReference(id, masm->isolate())); |