OLD | NEW |
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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 if (arguments != NULL) { | 276 if (arguments != NULL) { |
277 // Function uses arguments object. | 277 // Function uses arguments object. |
278 Comment cmnt(masm_, "[ Allocate arguments object"); | 278 Comment cmnt(masm_, "[ Allocate arguments object"); |
279 if (!function_in_register_r4) { | 279 if (!function_in_register_r4) { |
280 // Load this again, if it's used by the local context below. | 280 // Load this again, if it's used by the local context below. |
281 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 281 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
282 } | 282 } |
283 if (is_strict(language_mode()) || !has_simple_parameters()) { | 283 if (is_strict(language_mode()) || !has_simple_parameters()) { |
284 FastNewStrictArgumentsStub stub(isolate()); | 284 FastNewStrictArgumentsStub stub(isolate()); |
285 __ CallStub(&stub); | 285 __ CallStub(&stub); |
| 286 } else if (literal()->has_duplicate_parameters()) { |
| 287 __ Push(r4); |
| 288 __ CallRuntime(Runtime::kNewSloppyArguments_Generic); |
286 } else { | 289 } else { |
287 DCHECK(r4.is(ArgumentsAccessNewDescriptor::function())); | 290 FastNewSloppyArgumentsStub stub(isolate()); |
288 // Receiver is just before the parameters on the caller's stack. | |
289 int num_parameters = info->scope()->num_parameters(); | |
290 int offset = num_parameters * kPointerSize; | |
291 __ LoadSmiLiteral(ArgumentsAccessNewDescriptor::parameter_count(), | |
292 Smi::FromInt(num_parameters)); | |
293 __ addi(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, | |
294 Operand(StandardFrameConstants::kCallerSPOffset + offset)); | |
295 | |
296 // Arguments to ArgumentsAccessStub: | |
297 // function, parameter pointer, parameter count. | |
298 // The stub will rewrite parameter pointer and parameter count if the | |
299 // previous stack frame was an arguments adapter frame. | |
300 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( | |
301 literal()->has_duplicate_parameters()); | |
302 ArgumentsAccessStub stub(isolate(), type); | |
303 __ CallStub(&stub); | 291 __ CallStub(&stub); |
304 } | 292 } |
305 | 293 |
306 SetVar(arguments, r3, r4, r5); | 294 SetVar(arguments, r3, r4, r5); |
307 } | 295 } |
308 | 296 |
309 if (FLAG_trace) { | 297 if (FLAG_trace) { |
310 __ CallRuntime(Runtime::kTraceEnter); | 298 __ CallRuntime(Runtime::kTraceEnter); |
311 } | 299 } |
312 | 300 |
(...skipping 4266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4579 return ON_STACK_REPLACEMENT; | 4567 return ON_STACK_REPLACEMENT; |
4580 } | 4568 } |
4581 | 4569 |
4582 DCHECK(interrupt_address == | 4570 DCHECK(interrupt_address == |
4583 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4571 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4584 return OSR_AFTER_STACK_CHECK; | 4572 return OSR_AFTER_STACK_CHECK; |
4585 } | 4573 } |
4586 } // namespace internal | 4574 } // namespace internal |
4587 } // namespace v8 | 4575 } // namespace v8 |
4588 #endif // V8_TARGET_ARCH_PPC | 4576 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |