| 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 3445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3456 // code. Fetch it from the context. | 3456 // code. Fetch it from the context. |
| 3457 __ ld(at, ContextMemOperand(cp, Context::CLOSURE_INDEX)); | 3457 __ ld(at, ContextMemOperand(cp, Context::CLOSURE_INDEX)); |
| 3458 } else { | 3458 } else { |
| 3459 DCHECK(closure_scope->is_function_scope()); | 3459 DCHECK(closure_scope->is_function_scope()); |
| 3460 __ ld(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 3460 __ ld(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 3461 } | 3461 } |
| 3462 PushOperand(at); | 3462 PushOperand(at); |
| 3463 } | 3463 } |
| 3464 | 3464 |
| 3465 | 3465 |
| 3466 // ---------------------------------------------------------------------------- | |
| 3467 // Non-local control flow support. | |
| 3468 | |
| 3469 void FullCodeGenerator::EnterFinallyBlock() { | |
| 3470 DCHECK(!result_register().is(a1)); | |
| 3471 // Store pending message while executing finally block. | |
| 3472 ExternalReference pending_message_obj = | |
| 3473 ExternalReference::address_of_pending_message_obj(isolate()); | |
| 3474 __ li(at, Operand(pending_message_obj)); | |
| 3475 __ ld(a1, MemOperand(at)); | |
| 3476 PushOperand(a1); | |
| 3477 | |
| 3478 ClearPendingMessage(); | |
| 3479 } | |
| 3480 | |
| 3481 | |
| 3482 void FullCodeGenerator::ExitFinallyBlock() { | |
| 3483 DCHECK(!result_register().is(a1)); | |
| 3484 // Restore pending message from stack. | |
| 3485 PopOperand(a1); | |
| 3486 ExternalReference pending_message_obj = | |
| 3487 ExternalReference::address_of_pending_message_obj(isolate()); | |
| 3488 __ li(at, Operand(pending_message_obj)); | |
| 3489 __ sd(a1, MemOperand(at)); | |
| 3490 } | |
| 3491 | |
| 3492 | |
| 3493 void FullCodeGenerator::ClearPendingMessage() { | |
| 3494 DCHECK(!result_register().is(a1)); | |
| 3495 ExternalReference pending_message_obj = | |
| 3496 ExternalReference::address_of_pending_message_obj(isolate()); | |
| 3497 __ LoadRoot(a1, Heap::kTheHoleValueRootIndex); | |
| 3498 __ li(at, Operand(pending_message_obj)); | |
| 3499 __ sd(a1, MemOperand(at)); | |
| 3500 } | |
| 3501 | |
| 3502 | |
| 3503 void FullCodeGenerator::DeferredCommands::EmitCommands() { | |
| 3504 __ Pop(result_register()); // Restore the accumulator. | |
| 3505 __ Pop(a1); // Get the token. | |
| 3506 for (DeferredCommand cmd : commands_) { | |
| 3507 Label skip; | |
| 3508 __ li(at, Operand(Smi::FromInt(cmd.token))); | |
| 3509 __ Branch(&skip, ne, a1, Operand(at)); | |
| 3510 switch (cmd.command) { | |
| 3511 case kReturn: | |
| 3512 codegen_->EmitUnwindAndReturn(); | |
| 3513 break; | |
| 3514 case kThrow: | |
| 3515 __ Push(result_register()); | |
| 3516 __ CallRuntime(Runtime::kReThrow); | |
| 3517 break; | |
| 3518 case kContinue: | |
| 3519 codegen_->EmitContinue(cmd.target); | |
| 3520 break; | |
| 3521 case kBreak: | |
| 3522 codegen_->EmitBreak(cmd.target); | |
| 3523 break; | |
| 3524 } | |
| 3525 __ bind(&skip); | |
| 3526 } | |
| 3527 } | |
| 3528 | |
| 3529 #undef __ | 3466 #undef __ |
| 3530 | 3467 |
| 3531 | 3468 |
| 3532 void BackEdgeTable::PatchAt(Code* unoptimized_code, | 3469 void BackEdgeTable::PatchAt(Code* unoptimized_code, |
| 3533 Address pc, | 3470 Address pc, |
| 3534 BackEdgeState target_state, | 3471 BackEdgeState target_state, |
| 3535 Code* replacement_code) { | 3472 Code* replacement_code) { |
| 3536 static const int kInstrSize = Assembler::kInstrSize; | 3473 static const int kInstrSize = Assembler::kInstrSize; |
| 3537 Address pc_immediate_load_address = | 3474 Address pc_immediate_load_address = |
| 3538 Assembler::target_address_from_return_address(pc); | 3475 Assembler::target_address_from_return_address(pc); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3601 reinterpret_cast<uint64_t>( | 3538 reinterpret_cast<uint64_t>( |
| 3602 isolate->builtins()->OnStackReplacement()->entry())); | 3539 isolate->builtins()->OnStackReplacement()->entry())); |
| 3603 return ON_STACK_REPLACEMENT; | 3540 return ON_STACK_REPLACEMENT; |
| 3604 } | 3541 } |
| 3605 | 3542 |
| 3606 | 3543 |
| 3607 } // namespace internal | 3544 } // namespace internal |
| 3608 } // namespace v8 | 3545 } // namespace v8 |
| 3609 | 3546 |
| 3610 #endif // V8_TARGET_ARCH_MIPS64 | 3547 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |