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

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

Issue 1376303002: PPC: [turbofan] Call ArgumentsAccessStub to materialize arguments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | src/ppc/code-stubs-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex); 287 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex);
288 __ bind(&done); 288 __ bind(&done);
289 289
290 SetVar(new_target_var, r3, r5, r6); 290 SetVar(new_target_var, r3, r5, r6);
291 } 291 }
292 292
293 Variable* arguments = scope()->arguments(); 293 Variable* arguments = scope()->arguments();
294 if (arguments != NULL) { 294 if (arguments != NULL) {
295 // Function uses arguments object. 295 // Function uses arguments object.
296 Comment cmnt(masm_, "[ Allocate arguments object"); 296 Comment cmnt(masm_, "[ Allocate arguments object");
297 DCHECK(r4.is(ArgumentsAccessNewDescriptor::function()));
297 if (!function_in_register_r4) { 298 if (!function_in_register_r4) {
298 // Load this again, if it's used by the local context below. 299 // Load this again, if it's used by the local context below.
299 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 300 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
300 } else {
301 __ mr(r6, r4);
302 } 301 }
303 // Receiver is just before the parameters on the caller's stack. 302 // Receiver is just before the parameters on the caller's stack.
304 int num_parameters = info->scope()->num_parameters(); 303 int num_parameters = info->scope()->num_parameters();
305 int offset = num_parameters * kPointerSize; 304 int offset = num_parameters * kPointerSize;
306 __ addi(r5, fp, Operand(StandardFrameConstants::kCallerSPOffset + offset)); 305 __ LoadSmiLiteral(ArgumentsAccessNewDescriptor::parameter_count(),
307 __ LoadSmiLiteral(r4, Smi::FromInt(num_parameters)); 306 Smi::FromInt(num_parameters));
308 __ Push(r6, r5, r4); 307 __ addi(ArgumentsAccessNewDescriptor::parameter_pointer(), fp,
308 Operand(StandardFrameConstants::kCallerSPOffset + offset));
309 309
310 // Arguments to ArgumentsAccessStub: 310 // Arguments to ArgumentsAccessStub:
311 // function, receiver address, parameter count. 311 // function, parameter pointer, parameter count.
312 // The stub will rewrite receiver and parameter count if the previous 312 // The stub will rewrite parameter pointer and parameter count if the
313 // stack frame was an arguments adapter frame. 313 // previous stack frame was an arguments adapter frame.
314 ArgumentsAccessStub::Type type; 314 bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters();
315 if (is_strict(language_mode()) || !has_simple_parameters()) { 315 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType(
316 type = ArgumentsAccessStub::NEW_STRICT; 316 is_unmapped, literal()->has_duplicate_parameters());
317 } else if (literal()->has_duplicate_parameters()) {
318 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
319 } else {
320 type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
321 }
322 ArgumentsAccessStub stub(isolate(), type); 317 ArgumentsAccessStub stub(isolate(), type);
323 __ CallStub(&stub); 318 __ CallStub(&stub);
324 319
325 SetVar(arguments, r3, r4, r5); 320 SetVar(arguments, r3, r4, r5);
326 } 321 }
327 322
328 if (FLAG_trace) { 323 if (FLAG_trace) {
329 __ CallRuntime(Runtime::kTraceEnter, 0); 324 __ CallRuntime(Runtime::kTraceEnter, 0);
330 } 325 }
331 326
(...skipping 4891 matching lines...) Expand 10 before | Expand all | Expand 10 after
5223 return ON_STACK_REPLACEMENT; 5218 return ON_STACK_REPLACEMENT;
5224 } 5219 }
5225 5220
5226 DCHECK(interrupt_address == 5221 DCHECK(interrupt_address ==
5227 isolate->builtins()->OsrAfterStackCheck()->entry()); 5222 isolate->builtins()->OsrAfterStackCheck()->entry());
5228 return OSR_AFTER_STACK_CHECK; 5223 return OSR_AFTER_STACK_CHECK;
5229 } 5224 }
5230 } // namespace internal 5225 } // namespace internal
5231 } // namespace v8 5226 } // namespace v8
5232 #endif // V8_TARGET_ARCH_PPC 5227 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698