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 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 | 1658 |
1659 | 1659 |
1660 void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 1660 void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
1661 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1661 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1662 Move(expr->context(), eax); | 1662 Move(expr->context(), eax); |
1663 } | 1663 } |
1664 | 1664 |
1665 | 1665 |
1666 Register FastCodeGenerator::result_register() { return eax; } | 1666 Register FastCodeGenerator::result_register() { return eax; } |
1667 | 1667 |
| 1668 |
| 1669 Register FastCodeGenerator::context_register() { return esi; } |
| 1670 |
| 1671 |
| 1672 void FastCodeGenerator::StoreFrameField(int frame_offset, Register value) { |
| 1673 ASSERT_EQ(POINTER_SIZE_ALIGN(frame_offset), frame_offset); |
| 1674 __ mov(Operand(ebp, frame_offset), value); |
| 1675 } |
| 1676 |
| 1677 |
| 1678 void FastCodeGenerator::LoadContextField(Register dst, int context_index) { |
| 1679 __ mov(dst, Operand(context_register(), Context::SlotOffset(context_index))); |
| 1680 } |
| 1681 |
| 1682 |
1668 // ---------------------------------------------------------------------------- | 1683 // ---------------------------------------------------------------------------- |
1669 // Non-local control flow support. | 1684 // Non-local control flow support. |
1670 | 1685 |
1671 void FastCodeGenerator::EnterFinallyBlock() { | 1686 void FastCodeGenerator::EnterFinallyBlock() { |
1672 // Cook return address on top of stack (smi encoded Code* delta) | 1687 // Cook return address on top of stack (smi encoded Code* delta) |
1673 ASSERT(!result_register().is(edx)); | 1688 ASSERT(!result_register().is(edx)); |
1674 __ mov(edx, Operand(esp, 0)); | 1689 __ mov(edx, Operand(esp, 0)); |
1675 __ sub(Operand(edx), Immediate(masm_->CodeObject())); | 1690 __ sub(Operand(edx), Immediate(masm_->CodeObject())); |
1676 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); | 1691 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
1677 ASSERT_EQ(0, kSmiTag); | 1692 ASSERT_EQ(0, kSmiTag); |
(...skipping 19 matching lines...) Expand all Loading... |
1697 | 1712 |
1698 | 1713 |
1699 void FastCodeGenerator::ThrowException() { | 1714 void FastCodeGenerator::ThrowException() { |
1700 __ push(result_register()); | 1715 __ push(result_register()); |
1701 __ CallRuntime(Runtime::kThrow, 1); | 1716 __ CallRuntime(Runtime::kThrow, 1); |
1702 } | 1717 } |
1703 | 1718 |
1704 #undef __ | 1719 #undef __ |
1705 | 1720 |
1706 } } // namespace v8::internal | 1721 } } // namespace v8::internal |
OLD | NEW |