Index: src/full-codegen/ia32/full-codegen-ia32.cc |
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc |
index 73ccf3154b626ff506a857e90ffbfb9e0fbc99c7..2a70cfb7d77a4fdf40571b46d7dbc84eceb5fd7d 100644 |
--- a/src/full-codegen/ia32/full-codegen-ia32.cc |
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc |
@@ -259,20 +259,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); |
} |