| OLD | NEW |
| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 2491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2502 | 2502 |
| 2503 CallConstructStub stub(isolate()); | 2503 CallConstructStub stub(isolate()); |
| 2504 CallIC(stub.GetCode()); | 2504 CallIC(stub.GetCode()); |
| 2505 OperandStackDepthDecrement(arg_count + 1); | 2505 OperandStackDepthDecrement(arg_count + 1); |
| 2506 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); | 2506 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); |
| 2507 RestoreContext(); | 2507 RestoreContext(); |
| 2508 context()->Plug(v0); | 2508 context()->Plug(v0); |
| 2509 } | 2509 } |
| 2510 | 2510 |
| 2511 | 2511 |
| 2512 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | |
| 2513 SuperCallReference* super_call_ref = | |
| 2514 expr->expression()->AsSuperCallReference(); | |
| 2515 DCHECK_NOT_NULL(super_call_ref); | |
| 2516 | |
| 2517 // Push the super constructor target on the stack (may be null, | |
| 2518 // but the Construct builtin can deal with that properly). | |
| 2519 VisitForAccumulatorValue(super_call_ref->this_function_var()); | |
| 2520 __ AssertFunction(result_register()); | |
| 2521 __ ld(result_register(), | |
| 2522 FieldMemOperand(result_register(), HeapObject::kMapOffset)); | |
| 2523 __ ld(result_register(), | |
| 2524 FieldMemOperand(result_register(), Map::kPrototypeOffset)); | |
| 2525 PushOperand(result_register()); | |
| 2526 | |
| 2527 // Push the arguments ("left-to-right") on the stack. | |
| 2528 ZoneList<Expression*>* args = expr->arguments(); | |
| 2529 int arg_count = args->length(); | |
| 2530 for (int i = 0; i < arg_count; i++) { | |
| 2531 VisitForStackValue(args->at(i)); | |
| 2532 } | |
| 2533 | |
| 2534 // Call the construct call builtin that handles allocation and | |
| 2535 // constructor invocation. | |
| 2536 SetConstructCallPosition(expr); | |
| 2537 | |
| 2538 // Load new target into a3. | |
| 2539 VisitForAccumulatorValue(super_call_ref->new_target_var()); | |
| 2540 __ mov(a3, result_register()); | |
| 2541 | |
| 2542 // Load function and argument count into a1 and a0. | |
| 2543 __ li(a0, Operand(arg_count)); | |
| 2544 __ ld(a1, MemOperand(sp, arg_count * kPointerSize)); | |
| 2545 | |
| 2546 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | |
| 2547 OperandStackDepthDecrement(arg_count + 1); | |
| 2548 | |
| 2549 RecordJSReturnSite(expr); | |
| 2550 RestoreContext(); | |
| 2551 context()->Plug(v0); | |
| 2552 } | |
| 2553 | |
| 2554 | |
| 2555 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2512 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
| 2556 ZoneList<Expression*>* args = expr->arguments(); | 2513 ZoneList<Expression*>* args = expr->arguments(); |
| 2557 DCHECK(args->length() == 1); | 2514 DCHECK(args->length() == 1); |
| 2558 | 2515 |
| 2559 VisitForAccumulatorValue(args->at(0)); | 2516 VisitForAccumulatorValue(args->at(0)); |
| 2560 | 2517 |
| 2561 Label materialize_true, materialize_false; | 2518 Label materialize_true, materialize_false; |
| 2562 Label* if_true = NULL; | 2519 Label* if_true = NULL; |
| 2563 Label* if_false = NULL; | 2520 Label* if_false = NULL; |
| 2564 Label* fall_through = NULL; | 2521 Label* fall_through = NULL; |
| (...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3601 reinterpret_cast<uint64_t>( | 3558 reinterpret_cast<uint64_t>( |
| 3602 isolate->builtins()->OnStackReplacement()->entry())); | 3559 isolate->builtins()->OnStackReplacement()->entry())); |
| 3603 return ON_STACK_REPLACEMENT; | 3560 return ON_STACK_REPLACEMENT; |
| 3604 } | 3561 } |
| 3605 | 3562 |
| 3606 | 3563 |
| 3607 } // namespace internal | 3564 } // namespace internal |
| 3608 } // namespace v8 | 3565 } // namespace v8 |
| 3609 | 3566 |
| 3610 #endif // V8_TARGET_ARCH_MIPS64 | 3567 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |