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

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: Rebased. 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
297 __ push(Immediate(Smi::FromInt(num_parameters)));
298 // Arguments to ArgumentsAccessStub: 298 // Arguments to ArgumentsAccessStub:
299 // function, receiver address, parameter count. 299 // function, parameter pointer, parameter count.
300 // The stub will rewrite receiver and parameter count if the previous 300 // The stub will rewrite parameter pointer and parameter count if the
301 // stack frame was an arguments adapter frame. 301 // previous stack frame was an arguments adapter frame.
302 ArgumentsAccessStub::Type type; 302 bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters();
303 if (is_strict(language_mode()) || !has_simple_parameters()) { 303 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType(
304 type = ArgumentsAccessStub::NEW_STRICT; 304 is_unmapped, literal()->has_duplicate_parameters());
305 } else if (literal()->has_duplicate_parameters()) {
306 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
307 } else {
308 type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
309 }
310
311 ArgumentsAccessStub stub(isolate(), type); 305 ArgumentsAccessStub stub(isolate(), type);
312 __ CallStub(&stub); 306 __ CallStub(&stub);
313 307
314 SetVar(arguments, eax, ebx, edx); 308 SetVar(arguments, eax, ebx, edx);
315 } 309 }
316 310
317 if (FLAG_trace) { 311 if (FLAG_trace) {
318 __ CallRuntime(Runtime::kTraceEnter, 0); 312 __ CallRuntime(Runtime::kTraceEnter, 0);
319 } 313 }
320 314
(...skipping 4811 matching lines...) Expand 10 before | Expand all | Expand 10 after
5132 Assembler::target_address_at(call_target_address, 5126 Assembler::target_address_at(call_target_address,
5133 unoptimized_code)); 5127 unoptimized_code));
5134 return OSR_AFTER_STACK_CHECK; 5128 return OSR_AFTER_STACK_CHECK;
5135 } 5129 }
5136 5130
5137 5131
5138 } // namespace internal 5132 } // namespace internal
5139 } // namespace v8 5133 } // namespace v8
5140 5134
5141 #endif // V8_TARGET_ARCH_IA32 5135 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698