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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 274 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
275 __ bind(&done); 275 __ bind(&done);
276 276
277 SetVar(new_target_var, r0, r2, r3); 277 SetVar(new_target_var, r0, r2, r3);
278 } 278 }
279 279
280 Variable* arguments = scope()->arguments(); 280 Variable* arguments = scope()->arguments();
281 if (arguments != NULL) { 281 if (arguments != NULL) {
282 // Function uses arguments object. 282 // Function uses arguments object.
283 Comment cmnt(masm_, "[ Allocate arguments object"); 283 Comment cmnt(masm_, "[ Allocate arguments object");
284 DCHECK(r1.is(ArgumentsAccessNewDescriptor::function()));
284 if (!function_in_register_r1) { 285 if (!function_in_register_r1) {
285 // Load this again, if it's used by the local context below. 286 // Load this again, if it's used by the local context below.
286 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 287 __ ldr(r1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
287 } else {
288 __ mov(r3, r1);
289 } 288 }
290 // Receiver is just before the parameters on the caller's stack. 289 // Receiver is just before the parameters on the caller's stack.
291 int num_parameters = info->scope()->num_parameters(); 290 int num_parameters = info->scope()->num_parameters();
292 int offset = num_parameters * kPointerSize; 291 int offset = num_parameters * kPointerSize;
293 292 __ mov(ArgumentsAccessNewDescriptor::parameter_count(),
294 __ add(r2, fp, Operand(StandardFrameConstants::kCallerSPOffset + offset)); 293 Operand(Smi::FromInt(num_parameters)));
295 __ mov(r1, Operand(Smi::FromInt(num_parameters))); 294 __ add(ArgumentsAccessNewDescriptor::parameter_pointer(), fp,
296 __ Push(r3, r2, r1); 295 Operand(StandardFrameConstants::kCallerSPOffset + offset));
297 296
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 bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters();
303 if (is_strict(language_mode()) || !has_simple_parameters()) { 302 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType(
304 type = ArgumentsAccessStub::NEW_STRICT; 303 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 ArgumentsAccessStub stub(isolate(), type); 304 ArgumentsAccessStub stub(isolate(), type);
311 __ CallStub(&stub); 305 __ CallStub(&stub);
312 306
313 SetVar(arguments, r0, r1, r2); 307 SetVar(arguments, r0, r1, r2);
314 } 308 }
315 309
316 if (FLAG_trace) { 310 if (FLAG_trace) {
317 __ CallRuntime(Runtime::kTraceEnter, 0); 311 __ CallRuntime(Runtime::kTraceEnter, 0);
318 } 312 }
319 313
(...skipping 4939 matching lines...) Expand 10 before | Expand all | Expand 10 after
5259 DCHECK(interrupt_address == 5253 DCHECK(interrupt_address ==
5260 isolate->builtins()->OsrAfterStackCheck()->entry()); 5254 isolate->builtins()->OsrAfterStackCheck()->entry());
5261 return OSR_AFTER_STACK_CHECK; 5255 return OSR_AFTER_STACK_CHECK;
5262 } 5256 }
5263 5257
5264 5258
5265 } // namespace internal 5259 } // namespace internal
5266 } // namespace v8 5260 } // namespace v8
5267 5261
5268 #endif // V8_TARGET_ARCH_ARM 5262 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698