Index: src/full-codegen/x64/full-codegen-x64.cc |
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc |
index 891b5201a305978412ad9be8fbf3e917a7f9c963..f3b1c21aca6c253e0e3367b9757abe6e37902f46 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -254,21 +254,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; |
- |
- __ Move(RestParamAccessDescriptor::parameter_count(), |
- Smi::FromInt(num_parameters)); |
- __ leap(RestParamAccessDescriptor::parameter_pointer(), |
- Operand(rbp, StandardFrameConstants::kCallerSPOffset + offset)); |
- __ Move(RestParamAccessDescriptor::rest_parameter_index(), |
- Smi::FromInt(rest_index)); |
- function_in_register = false; |
- |
- RestParamAccessStub stub(isolate()); |
+ if (!function_in_register) { |
+ __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
+ } |
+ FastNewRestParameterStub stub(isolate()); |
__ CallStub(&stub); |
- |
+ function_in_register = false; |
SetVar(rest_param, rax, rbx, rdx); |
} |