Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 1272673003: [es6] Re-implement rest parameters via desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Oops. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 // Return and remove the on-stack parameters. 1133 // Return and remove the on-stack parameters.
1134 __ bind(&done); 1134 __ bind(&done);
1135 __ ret(3 * kPointerSize); 1135 __ ret(3 * kPointerSize);
1136 1136
1137 // Do the runtime call to allocate the arguments object. 1137 // Do the runtime call to allocate the arguments object.
1138 __ bind(&runtime); 1138 __ bind(&runtime);
1139 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); 1139 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1);
1140 } 1140 }
1141 1141
1142 1142
1143 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
1144 // esp[0] : return address
1145 // esp[4] : language mode
1146 // esp[8] : index of rest parameter
1147 // esp[12] : number of parameters
1148 // esp[16] : receiver displacement
1149
1150 // Check if the calling frame is an arguments adaptor frame.
1151 Label runtime;
1152 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
1153 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset));
1154 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1155 __ j(not_equal, &runtime);
1156
1157 // Patch the arguments.length and the parameters pointer.
1158 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset));
1159 __ mov(Operand(esp, 3 * kPointerSize), ecx);
1160 __ lea(edx, Operand(edx, ecx, times_2,
1161 StandardFrameConstants::kCallerSPOffset));
1162 __ mov(Operand(esp, 4 * kPointerSize), edx);
1163
1164 __ bind(&runtime);
1165 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1);
1166 }
1167
1168
1169 void RegExpExecStub::Generate(MacroAssembler* masm) { 1143 void RegExpExecStub::Generate(MacroAssembler* masm) {
1170 // Just jump directly to runtime if native RegExp is not selected at compile 1144 // Just jump directly to runtime if native RegExp is not selected at compile
1171 // time or if regexp entry in generated code is turned off runtime switch or 1145 // time or if regexp entry in generated code is turned off runtime switch or
1172 // at compilation. 1146 // at compilation.
1173 #ifdef V8_INTERPRETED_REGEXP 1147 #ifdef V8_INTERPRETED_REGEXP
1174 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); 1148 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
1175 #else // V8_INTERPRETED_REGEXP 1149 #else // V8_INTERPRETED_REGEXP
1176 1150
1177 // Stack frame on entry. 1151 // Stack frame on entry.
1178 // esp[0]: return address 1152 // esp[0]: return address
(...skipping 4392 matching lines...) Expand 10 before | Expand all | Expand 10 after
5571 Operand(ebp, 7 * kPointerSize), NULL); 5545 Operand(ebp, 7 * kPointerSize), NULL);
5572 } 5546 }
5573 5547
5574 5548
5575 #undef __ 5549 #undef __
5576 5550
5577 } // namespace internal 5551 } // namespace internal
5578 } // namespace v8 5552 } // namespace v8
5579 5553
5580 #endif // V8_TARGET_ARCH_IA32 5554 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | src/parser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698