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 06e43301000c6f77341a4c4a1e265ed097f29e78..4de6e610fa5d5cda032951f3b071afd242e05ee3 100644 |
--- a/src/full-codegen/ia32/full-codegen-ia32.cc |
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc |
@@ -254,6 +254,27 @@ void FullCodeGenerator::Generate() { |
SetVar(new_target_var, edx, ebx, ecx); |
} |
+ // Possibly allocate RestParameters |
+ int rest_index; |
+ 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; |
+ |
+ __ lea(edx, Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset)); |
+ __ push(edx); |
+ __ push(Immediate(Smi::FromInt(num_parameters))); |
+ __ push(Immediate(Smi::FromInt(rest_index))); |
+ __ push(Immediate(Smi::FromInt(language_mode()))); |
+ function_in_register = false; |
+ |
+ RestParamAccessStub stub(isolate()); |
+ __ CallStub(&stub); |
+ SetVar(rest_param, eax, ebx, edx); |
+ } |
+ |
Variable* arguments = scope()->arguments(); |
if (arguments != NULL) { |
// Function uses arguments object. |