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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 FastNewRestParameterStub stub(isolate()); | 269 FastNewRestParameterStub stub(isolate()); |
270 __ CallStub(&stub); | 270 __ CallStub(&stub); |
271 function_in_register_r4 = false; | 271 function_in_register_r4 = false; |
272 SetVar(rest_param, r3, r4, r5); | 272 SetVar(rest_param, r3, r4, r5); |
273 } | 273 } |
274 | 274 |
275 Variable* arguments = scope()->arguments(); | 275 Variable* arguments = scope()->arguments(); |
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 DCHECK(r4.is(ArgumentsAccessNewDescriptor::function())); | |
280 if (!function_in_register_r4) { | 279 if (!function_in_register_r4) { |
281 // 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. |
282 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 281 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
283 } | 282 } |
284 // Receiver is just before the parameters on the caller's stack. | 283 if (is_strict(language_mode()) || !has_simple_parameters()) { |
285 int num_parameters = info->scope()->num_parameters(); | 284 FastNewStrictArgumentsStub stub(isolate()); |
286 int offset = num_parameters * kPointerSize; | 285 __ CallStub(&stub); |
287 __ LoadSmiLiteral(ArgumentsAccessNewDescriptor::parameter_count(), | 286 } else { |
288 Smi::FromInt(num_parameters)); | 287 DCHECK(r4.is(ArgumentsAccessNewDescriptor::function())); |
289 __ addi(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, | 288 // Receiver is just before the parameters on the caller's stack. |
290 Operand(StandardFrameConstants::kCallerSPOffset + offset)); | 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)); |
291 | 295 |
292 // Arguments to ArgumentsAccessStub: | 296 // Arguments to ArgumentsAccessStub: |
293 // function, parameter pointer, parameter count. | 297 // function, parameter pointer, parameter count. |
294 // The stub will rewrite parameter pointer and parameter count if the | 298 // The stub will rewrite parameter pointer and parameter count if the |
295 // previous stack frame was an arguments adapter frame. | 299 // previous stack frame was an arguments adapter frame. |
296 bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters(); | 300 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( |
297 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( | 301 literal()->has_duplicate_parameters()); |
298 is_unmapped, literal()->has_duplicate_parameters()); | 302 ArgumentsAccessStub stub(isolate(), type); |
299 ArgumentsAccessStub stub(isolate(), type); | 303 __ CallStub(&stub); |
300 __ CallStub(&stub); | 304 } |
301 | 305 |
302 SetVar(arguments, r3, r4, r5); | 306 SetVar(arguments, r3, r4, r5); |
303 } | 307 } |
304 | 308 |
305 if (FLAG_trace) { | 309 if (FLAG_trace) { |
306 __ CallRuntime(Runtime::kTraceEnter); | 310 __ CallRuntime(Runtime::kTraceEnter); |
307 } | 311 } |
308 | 312 |
309 // Visit the declarations and body unless there is an illegal | 313 // Visit the declarations and body unless there is an illegal |
310 // redeclaration. | 314 // redeclaration. |
(...skipping 4307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4618 return ON_STACK_REPLACEMENT; | 4622 return ON_STACK_REPLACEMENT; |
4619 } | 4623 } |
4620 | 4624 |
4621 DCHECK(interrupt_address == | 4625 DCHECK(interrupt_address == |
4622 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4626 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4623 return OSR_AFTER_STACK_CHECK; | 4627 return OSR_AFTER_STACK_CHECK; |
4624 } | 4628 } |
4625 } // namespace internal | 4629 } // namespace internal |
4626 } // namespace v8 | 4630 } // namespace v8 |
4627 #endif // V8_TARGET_ARCH_PPC | 4631 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |