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

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.cc

Issue 1348773002: [turbofan] Call ArgumentsAccessStub to materialize arguments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: One more variant. 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/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); 276 __ mov(eax, Immediate(isolate()->factory()->undefined_value()));
277 277
278 __ bind(&done); 278 __ bind(&done);
279 SetVar(new_target_var, eax, ebx, edx); 279 SetVar(new_target_var, eax, ebx, edx);
280 } 280 }
281 281
282 Variable* arguments = scope()->arguments(); 282 Variable* arguments = scope()->arguments();
283 if (arguments != NULL) { 283 if (arguments != NULL) {
284 // Function uses arguments object. 284 // Function uses arguments object.
285 Comment cmnt(masm_, "[ Allocate arguments object"); 285 Comment cmnt(masm_, "[ Allocate arguments object");
286 if (function_in_register) { 286 DCHECK(edi.is(ArgumentsAccessNewDescriptor::function()));
287 __ push(edi); 287 if (!function_in_register) {
288 } else { 288 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
289 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
290 } 289 }
291 // Receiver is just before the parameters on the caller's stack. 290 // Receiver is just before the parameters on the caller's stack.
292 int num_parameters = info->scope()->num_parameters(); 291 int num_parameters = info->scope()->num_parameters();
293 int offset = num_parameters * kPointerSize; 292 int offset = num_parameters * kPointerSize;
294 __ lea(edx, 293 __ mov(ArgumentsAccessNewDescriptor::parameter_count(),
294 Immediate(Smi::FromInt(num_parameters)));
295 __ lea(ArgumentsAccessNewDescriptor::parameter_pointer(),
295 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset)); 296 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset));
296 __ push(edx);
297 __ push(Immediate(Smi::FromInt(num_parameters)));
298 // Arguments to ArgumentsAccessStub: 297 // Arguments to ArgumentsAccessStub:
299 // function, receiver address, parameter count. 298 // function, parameter pointer, parameter count.
300 // The stub will rewrite receiver and parameter count if the previous 299 // The stub will rewrite parameter pointer and parameter count if the
301 // stack frame was an arguments adapter frame. 300 // previous stack frame was an arguments adapter frame.
302 ArgumentsAccessStub::Type type; 301 ArgumentsAccessStub::Type type;
303 if (is_strict(language_mode()) || !has_simple_parameters()) { 302 if (is_strict(language_mode()) || !has_simple_parameters()) {
304 type = ArgumentsAccessStub::NEW_STRICT; 303 type = ArgumentsAccessStub::NEW_STRICT;
305 } else if (literal()->has_duplicate_parameters()) { 304 } else if (literal()->has_duplicate_parameters()) {
306 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; 305 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
307 } else { 306 } else {
308 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; 307 type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
309 } 308 }
310 309
311 ArgumentsAccessStub stub(isolate(), type); 310 ArgumentsAccessStub stub(isolate(), type);
(...skipping 4839 matching lines...) Expand 10 before | Expand all | Expand 10 after
5151 Assembler::target_address_at(call_target_address, 5150 Assembler::target_address_at(call_target_address,
5152 unoptimized_code)); 5151 unoptimized_code));
5153 return OSR_AFTER_STACK_CHECK; 5152 return OSR_AFTER_STACK_CHECK;
5154 } 5153 }
5155 5154
5156 5155
5157 } // namespace internal 5156 } // namespace internal
5158 } // namespace v8 5157 } // namespace v8
5159 5158
5160 #endif // V8_TARGET_ARCH_IA32 5159 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698