OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1640 __ LoadRoot(ip, Heap::kFalseValueRootIndex); | 1640 __ LoadRoot(ip, Heap::kFalseValueRootIndex); |
1641 __ push(ip); | 1641 __ push(ip); |
1642 __ jmp(saved_false); | 1642 __ jmp(saved_false); |
1643 break; | 1643 break; |
1644 } | 1644 } |
1645 true_label_ = saved_true; | 1645 true_label_ = saved_true; |
1646 false_label_ = saved_false; | 1646 false_label_ = saved_false; |
1647 // Convert current context to test context: End post-test code. | 1647 // Convert current context to test context: End post-test code. |
1648 } | 1648 } |
1649 | 1649 |
| 1650 |
1650 void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 1651 void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
1651 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1652 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1652 Move(expr->context(), r0); | 1653 Move(expr->context(), r0); |
1653 } | 1654 } |
1654 | 1655 |
1655 | 1656 |
1656 Register FastCodeGenerator::result_register() { return r0; } | 1657 Register FastCodeGenerator::result_register() { return r0; } |
1657 | 1658 |
| 1659 // ---------------------------------------------------------------------------- |
| 1660 // Non-local control flow support. |
| 1661 |
| 1662 void FastCodeGenerator::EnterFinallyBlock() { |
| 1663 // Cook return address in link register to stack (smi encoded Code* delta) |
| 1664 __ sub(r1, lr, Operand(masm_->CodeObject())); |
| 1665 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
| 1666 ASSERT_EQ(0, kSmiTag); |
| 1667 __ add(r1, r1, Operand(r1)); // Convert to smi. |
| 1668 __ push(r1); |
| 1669 // Store result register while executing finally block. |
| 1670 __ push(r0); |
| 1671 } |
| 1672 |
| 1673 |
| 1674 void FastCodeGenerator::ReturnFromFinallyBlock() { |
| 1675 // Restore result register from stack. |
| 1676 __ pop(r0); |
| 1677 // Uncook return address and return. |
| 1678 __ pop(r1); |
| 1679 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
| 1680 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 1681 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 1682 } |
| 1683 |
| 1684 |
| 1685 void FastCodeGenerator::ThrowException() { |
| 1686 __ push(r0); |
| 1687 __ CallRuntime(Runtime::kThrow, 1); |
| 1688 } |
| 1689 |
| 1690 |
1658 #undef __ | 1691 #undef __ |
1659 | 1692 |
1660 | |
1661 } } // namespace v8::internal | 1693 } } // namespace v8::internal |
OLD | NEW |