OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1683 | 1683 |
1684 | 1684 |
1685 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) { | 1685 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) { |
1686 LOperand* input = UseRegisterAtStart(instr->value()); | 1686 LOperand* input = UseRegisterAtStart(instr->value()); |
1687 return DefineSameAsFirst(new LLoadElements(input)); | 1687 return DefineSameAsFirst(new LLoadElements(input)); |
1688 } | 1688 } |
1689 | 1689 |
1690 | 1690 |
1691 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( | 1691 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( |
1692 HLoadKeyedFastElement* instr) { | 1692 HLoadKeyedFastElement* instr) { |
1693 Representation r = instr->representation(); | 1693 ASSERT(instr->representation().IsTagged()); |
1694 LOperand* obj = UseRegisterAtStart(instr->object()); | 1694 LOperand* obj = UseRegisterAtStart(instr->object()); |
1695 ASSERT(instr->key()->representation().IsInteger32()); | 1695 ASSERT(instr->key()->representation().IsInteger32()); |
Kevin Millikin (Chromium)
2011/01/11 11:31:56
Put this precondition assert right after the other
fschneider
2011/01/11 11:41:49
Done.
| |
1696 LOperand* key = UseRegisterAtStart(instr->key()); | 1696 LOperand* key = UseRegisterAtStart(instr->key()); |
1697 LOperand* load_result = NULL; | 1697 LInstruction* result = new LLoadKeyedFastElement(obj, key); |
1698 // Double needs an extra temp, because the result is converted from heap | 1698 return AssignEnvironment(DefineSameAsFirst(result)); |
1699 // number to a double register. | |
1700 if (r.IsDouble()) load_result = TempRegister(); | |
1701 LInstruction* result = new LLoadKeyedFastElement(obj, | |
1702 key, | |
1703 load_result); | |
1704 if (r.IsDouble()) { | |
1705 result = DefineAsRegister(result); | |
1706 } else { | |
1707 result = DefineSameAsFirst(result); | |
1708 } | |
1709 return AssignEnvironment(result); | |
1710 } | 1699 } |
1711 | 1700 |
1712 | 1701 |
1713 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 1702 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
1714 LOperand* object = UseFixed(instr->object(), r1); | 1703 LOperand* object = UseFixed(instr->object(), r1); |
1715 LOperand* key = UseFixed(instr->key(), r0); | 1704 LOperand* key = UseFixed(instr->key(), r0); |
1716 | 1705 |
1717 LInstruction* result = | 1706 LInstruction* result = |
1718 DefineFixed(new LLoadKeyedGeneric(object, key), r0); | 1707 DefineFixed(new LLoadKeyedGeneric(object, key), r0); |
1719 return MarkAsCall(result, instr); | 1708 return MarkAsCall(result, instr); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1756 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 1745 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
1757 | 1746 |
1758 LOperand* obj = needs_write_barrier | 1747 LOperand* obj = needs_write_barrier |
1759 ? UseTempRegister(instr->object()) | 1748 ? UseTempRegister(instr->object()) |
1760 : UseRegisterAtStart(instr->object()); | 1749 : UseRegisterAtStart(instr->object()); |
1761 | 1750 |
1762 LOperand* val = needs_write_barrier | 1751 LOperand* val = needs_write_barrier |
1763 ? UseTempRegister(instr->value()) | 1752 ? UseTempRegister(instr->value()) |
1764 : UseRegister(instr->value()); | 1753 : UseRegister(instr->value()); |
1765 | 1754 |
1766 return new LStoreNamedField(obj, | 1755 return new LStoreNamedField(obj, val); |
1767 instr->name(), | |
1768 val, | |
1769 instr->is_in_object(), | |
1770 instr->offset(), | |
1771 needs_write_barrier, | |
1772 instr->transition()); | |
1773 } | 1756 } |
1774 | 1757 |
1775 | 1758 |
1776 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 1759 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
1777 LOperand* obj = UseFixed(instr->object(), r1); | 1760 LOperand* obj = UseFixed(instr->object(), r1); |
1778 LOperand* val = UseFixed(instr->value(), r0); | 1761 LOperand* val = UseFixed(instr->value(), r0); |
1779 | 1762 |
1780 LInstruction* result = new LStoreNamedGeneric(obj, instr->name(), val); | 1763 LInstruction* result = new LStoreNamedGeneric(obj, val); |
1781 return MarkAsCall(result, instr); | 1764 return MarkAsCall(result, instr); |
1782 } | 1765 } |
1783 | 1766 |
1784 | 1767 |
1785 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { | 1768 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { |
1786 return MarkAsCall(DefineFixed(new LArrayLiteral, r0), instr); | 1769 return MarkAsCall(DefineFixed(new LArrayLiteral, r0), instr); |
1787 } | 1770 } |
1788 | 1771 |
1789 | 1772 |
1790 LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) { | 1773 LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1930 void LPointerMap::PrintTo(StringStream* stream) const { | 1913 void LPointerMap::PrintTo(StringStream* stream) const { |
1931 stream->Add("{"); | 1914 stream->Add("{"); |
1932 for (int i = 0; i < pointer_operands_.length(); ++i) { | 1915 for (int i = 0; i < pointer_operands_.length(); ++i) { |
1933 if (i != 0) stream->Add(";"); | 1916 if (i != 0) stream->Add(";"); |
1934 pointer_operands_[i]->PrintTo(stream); | 1917 pointer_operands_[i]->PrintTo(stream); |
1935 } | 1918 } |
1936 stream->Add("} @%d", position()); | 1919 stream->Add("} @%d", position()); |
1937 } | 1920 } |
1938 | 1921 |
1939 } } // namespace v8::internal | 1922 } } // namespace v8::internal |
OLD | NEW |