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