Index: src/full-codegen/x87/full-codegen-x87.cc |
diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc |
index f355780a21d92004372b35aae3d952ebbf9a45a1..a5a939d03b4429247bc72b0c9ca8c976ceeef626 100644 |
--- a/src/full-codegen/x87/full-codegen-x87.cc |
+++ b/src/full-codegen/x87/full-codegen-x87.cc |
@@ -249,20 +249,12 @@ void FullCodeGenerator::Generate() { |
Variable* rest_param = scope()->rest_parameter(&rest_index); |
if (rest_param) { |
Comment cmnt(masm_, "[ Allocate rest parameter array"); |
- |
- int num_parameters = info->scope()->num_parameters(); |
- int offset = num_parameters * kPointerSize; |
- |
- __ mov(RestParamAccessDescriptor::parameter_count(), |
- Immediate(Smi::FromInt(num_parameters))); |
- __ lea(RestParamAccessDescriptor::parameter_pointer(), |
- Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset)); |
- __ mov(RestParamAccessDescriptor::rest_parameter_index(), |
- Immediate(Smi::FromInt(rest_index))); |
- function_in_register = false; |
- |
- RestParamAccessStub stub(isolate()); |
+ if (!function_in_register) { |
+ __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
+ } |
+ FastNewRestParameterStub stub(isolate()); |
__ CallStub(&stub); |
+ function_in_register = false; |
SetVar(rest_param, eax, ebx, edx); |
} |