OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4522 | 4522 |
4523 void FullCodeGenerator::EnterFinallyBlock() { | 4523 void FullCodeGenerator::EnterFinallyBlock() { |
4524 ASSERT(!result_register().is(a1)); | 4524 ASSERT(!result_register().is(a1)); |
4525 // Store result register while executing finally block. | 4525 // Store result register while executing finally block. |
4526 __ push(result_register()); | 4526 __ push(result_register()); |
4527 // Cook return address in link register to stack (smi encoded Code* delta). | 4527 // Cook return address in link register to stack (smi encoded Code* delta). |
4528 __ Subu(a1, ra, Operand(masm_->CodeObject())); | 4528 __ Subu(a1, ra, Operand(masm_->CodeObject())); |
4529 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); | 4529 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
4530 STATIC_ASSERT(0 == kSmiTag); | 4530 STATIC_ASSERT(0 == kSmiTag); |
4531 __ Addu(a1, a1, Operand(a1)); // Convert to smi. | 4531 __ Addu(a1, a1, Operand(a1)); // Convert to smi. |
| 4532 |
| 4533 // Store result register while executing finally block. |
| 4534 __ push(a1); |
| 4535 |
| 4536 // Store pending message while executing finally block. |
| 4537 ExternalReference pending_message_obj = |
| 4538 ExternalReference::address_of_pending_message_obj(isolate()); |
| 4539 __ li(at, Operand(pending_message_obj)); |
| 4540 __ lw(a1, MemOperand(at)); |
| 4541 __ push(a1); |
| 4542 |
| 4543 ExternalReference has_pending_message = |
| 4544 ExternalReference::address_of_has_pending_message(isolate()); |
| 4545 __ li(at, Operand(has_pending_message)); |
| 4546 __ lw(a1, MemOperand(at)); |
| 4547 __ push(a1); |
| 4548 |
| 4549 ExternalReference pending_message_script = |
| 4550 ExternalReference::address_of_pending_message_script(isolate()); |
| 4551 __ li(at, Operand(pending_message_script)); |
| 4552 __ lw(a1, MemOperand(at)); |
4532 __ push(a1); | 4553 __ push(a1); |
4533 } | 4554 } |
4534 | 4555 |
4535 | 4556 |
4536 void FullCodeGenerator::ExitFinallyBlock() { | 4557 void FullCodeGenerator::ExitFinallyBlock() { |
4537 ASSERT(!result_register().is(a1)); | 4558 ASSERT(!result_register().is(a1)); |
| 4559 // Restore pending message from stack. |
| 4560 __ pop(a1); |
| 4561 ExternalReference pending_message_script = |
| 4562 ExternalReference::address_of_pending_message_script(isolate()); |
| 4563 __ li(at, Operand(pending_message_script)); |
| 4564 __ sw(a1, MemOperand(at)); |
| 4565 |
| 4566 __ pop(a1); |
| 4567 ExternalReference has_pending_message = |
| 4568 ExternalReference::address_of_has_pending_message(isolate()); |
| 4569 __ li(at, Operand(has_pending_message)); |
| 4570 __ sw(a1, MemOperand(at)); |
| 4571 |
| 4572 __ pop(a1); |
| 4573 ExternalReference pending_message_obj = |
| 4574 ExternalReference::address_of_pending_message_obj(isolate()); |
| 4575 __ li(at, Operand(pending_message_obj)); |
| 4576 __ sw(a1, MemOperand(at)); |
| 4577 |
4538 // Restore result register from stack. | 4578 // Restore result register from stack. |
4539 __ pop(a1); | 4579 __ pop(a1); |
| 4580 |
4540 // Uncook return address and return. | 4581 // Uncook return address and return. |
4541 __ pop(result_register()); | 4582 __ pop(result_register()); |
4542 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); | 4583 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
4543 __ sra(a1, a1, 1); // Un-smi-tag value. | 4584 __ sra(a1, a1, 1); // Un-smi-tag value. |
4544 __ Addu(at, a1, Operand(masm_->CodeObject())); | 4585 __ Addu(at, a1, Operand(masm_->CodeObject())); |
4545 __ Jump(at); | 4586 __ Jump(at); |
4546 } | 4587 } |
4547 | 4588 |
4548 | 4589 |
4549 #undef __ | 4590 #undef __ |
(...skipping 22 matching lines...) Expand all Loading... |
4572 *context_length = 0; | 4613 *context_length = 0; |
4573 return previous_; | 4614 return previous_; |
4574 } | 4615 } |
4575 | 4616 |
4576 | 4617 |
4577 #undef __ | 4618 #undef __ |
4578 | 4619 |
4579 } } // namespace v8::internal | 4620 } } // namespace v8::internal |
4580 | 4621 |
4581 #endif // V8_TARGET_ARCH_MIPS | 4622 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |