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

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

Issue 1235153006: [es6] re-implement rest parameters via desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refactor Scope::TempScope Created 5 years, 5 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 // Return and remove the on-stack parameters. 1136 // Return and remove the on-stack parameters.
1137 __ bind(&done); 1137 __ bind(&done);
1138 __ ret(3 * kPointerSize); 1138 __ ret(3 * kPointerSize);
1139 1139
1140 // Do the runtime call to allocate the arguments object. 1140 // Do the runtime call to allocate the arguments object.
1141 __ bind(&runtime); 1141 __ bind(&runtime);
1142 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); 1142 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1);
1143 } 1143 }
1144 1144
1145 1145
1146 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
1147 // esp[0] : return address
1148 // esp[4] : language mode
1149 // esp[8] : index of rest parameter
1150 // esp[12] : number of parameters
1151 // esp[16] : receiver displacement
1152
1153 // Check if the calling frame is an arguments adaptor frame.
1154 Label runtime;
1155 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
1156 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset));
1157 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1158 __ j(not_equal, &runtime);
1159
1160 // Patch the arguments.length and the parameters pointer.
1161 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset));
1162 __ mov(Operand(esp, 3 * kPointerSize), ecx);
1163 __ lea(edx, Operand(edx, ecx, times_2,
1164 StandardFrameConstants::kCallerSPOffset));
1165 __ mov(Operand(esp, 4 * kPointerSize), edx);
1166
1167 __ bind(&runtime);
1168 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1);
1169 }
1170
1171
1172 void RegExpExecStub::Generate(MacroAssembler* masm) { 1146 void RegExpExecStub::Generate(MacroAssembler* masm) {
1173 // Just jump directly to runtime if native RegExp is not selected at compile 1147 // Just jump directly to runtime if native RegExp is not selected at compile
1174 // time or if regexp entry in generated code is turned off runtime switch or 1148 // time or if regexp entry in generated code is turned off runtime switch or
1175 // at compilation. 1149 // at compilation.
1176 #ifdef V8_INTERPRETED_REGEXP 1150 #ifdef V8_INTERPRETED_REGEXP
1177 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); 1151 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
1178 #else // V8_INTERPRETED_REGEXP 1152 #else // V8_INTERPRETED_REGEXP
1179 1153
1180 // Stack frame on entry. 1154 // Stack frame on entry.
1181 // esp[0]: return address 1155 // esp[0]: return address
(...skipping 4303 matching lines...) Expand 10 before | Expand all | Expand 10 after
5485 Operand(ebp, 7 * kPointerSize), NULL); 5459 Operand(ebp, 7 * kPointerSize), NULL);
5486 } 5460 }
5487 5461
5488 5462
5489 #undef __ 5463 #undef __
5490 5464
5491 } // namespace internal 5465 } // namespace internal
5492 } // namespace v8 5466 } // namespace v8
5493 5467
5494 #endif // V8_TARGET_ARCH_IA32 5468 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698