| 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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
| 8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 2486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2497 | 2497 |
| 2498 CallConstructStub stub(isolate()); | 2498 CallConstructStub stub(isolate()); |
| 2499 CallIC(stub.GetCode()); | 2499 CallIC(stub.GetCode()); |
| 2500 OperandStackDepthDecrement(arg_count + 1); | 2500 OperandStackDepthDecrement(arg_count + 1); |
| 2501 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); | 2501 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); |
| 2502 RestoreContext(); | 2502 RestoreContext(); |
| 2503 context()->Plug(r3); | 2503 context()->Plug(r3); |
| 2504 } | 2504 } |
| 2505 | 2505 |
| 2506 | 2506 |
| 2507 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | |
| 2508 SuperCallReference* super_call_ref = | |
| 2509 expr->expression()->AsSuperCallReference(); | |
| 2510 DCHECK_NOT_NULL(super_call_ref); | |
| 2511 | |
| 2512 // Push the super constructor target on the stack (may be null, | |
| 2513 // but the Construct builtin can deal with that properly). | |
| 2514 VisitForAccumulatorValue(super_call_ref->this_function_var()); | |
| 2515 __ AssertFunction(result_register()); | |
| 2516 __ LoadP(result_register(), | |
| 2517 FieldMemOperand(result_register(), HeapObject::kMapOffset)); | |
| 2518 __ LoadP(result_register(), | |
| 2519 FieldMemOperand(result_register(), Map::kPrototypeOffset)); | |
| 2520 PushOperand(result_register()); | |
| 2521 | |
| 2522 // Push the arguments ("left-to-right") on the stack. | |
| 2523 ZoneList<Expression*>* args = expr->arguments(); | |
| 2524 int arg_count = args->length(); | |
| 2525 for (int i = 0; i < arg_count; i++) { | |
| 2526 VisitForStackValue(args->at(i)); | |
| 2527 } | |
| 2528 | |
| 2529 // Call the construct call builtin that handles allocation and | |
| 2530 // constructor invocation. | |
| 2531 SetConstructCallPosition(expr); | |
| 2532 | |
| 2533 // Load new target into r6. | |
| 2534 VisitForAccumulatorValue(super_call_ref->new_target_var()); | |
| 2535 __ mr(r6, result_register()); | |
| 2536 | |
| 2537 // Load function and argument count into r1 and r0. | |
| 2538 __ mov(r3, Operand(arg_count)); | |
| 2539 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize)); | |
| 2540 | |
| 2541 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | |
| 2542 OperandStackDepthDecrement(arg_count + 1); | |
| 2543 | |
| 2544 RecordJSReturnSite(expr); | |
| 2545 RestoreContext(); | |
| 2546 context()->Plug(r3); | |
| 2547 } | |
| 2548 | |
| 2549 | |
| 2550 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2507 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
| 2551 ZoneList<Expression*>* args = expr->arguments(); | 2508 ZoneList<Expression*>* args = expr->arguments(); |
| 2552 DCHECK(args->length() == 1); | 2509 DCHECK(args->length() == 1); |
| 2553 | 2510 |
| 2554 VisitForAccumulatorValue(args->at(0)); | 2511 VisitForAccumulatorValue(args->at(0)); |
| 2555 | 2512 |
| 2556 Label materialize_true, materialize_false; | 2513 Label materialize_true, materialize_false; |
| 2557 Label* if_true = NULL; | 2514 Label* if_true = NULL; |
| 2558 Label* if_false = NULL; | 2515 Label* if_false = NULL; |
| 2559 Label* fall_through = NULL; | 2516 Label* fall_through = NULL; |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3576 | 3533 |
| 3577 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3534 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 3578 | 3535 |
| 3579 DCHECK(interrupt_address == | 3536 DCHECK(interrupt_address == |
| 3580 isolate->builtins()->OnStackReplacement()->entry()); | 3537 isolate->builtins()->OnStackReplacement()->entry()); |
| 3581 return ON_STACK_REPLACEMENT; | 3538 return ON_STACK_REPLACEMENT; |
| 3582 } | 3539 } |
| 3583 } // namespace internal | 3540 } // namespace internal |
| 3584 } // namespace v8 | 3541 } // namespace v8 |
| 3585 #endif // V8_TARGET_ARCH_PPC | 3542 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |