Chromium Code Reviews| 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 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1667 : DefineAsRegister(result); | 1667 : DefineAsRegister(result); |
| 1668 } | 1668 } |
| 1669 | 1669 |
| 1670 | 1670 |
| 1671 LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) { | 1671 LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) { |
| 1672 return new LStoreGlobal(UseRegisterAtStart(instr->value())); | 1672 return new LStoreGlobal(UseRegisterAtStart(instr->value())); |
| 1673 } | 1673 } |
| 1674 | 1674 |
| 1675 | 1675 |
| 1676 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { | 1676 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
| 1677 return DefineAsRegister( | 1677 ASSERT(instr->representation().IsTagged()); |
| 1678 new LLoadNamedField(UseRegisterAtStart(instr->object()))); | 1678 LOperand* obj = UseRegisterAtStart(instr->object()); |
| 1679 return DefineAsRegister(new LLoadNamedField(obj)); | |
| 1679 } | 1680 } |
| 1680 | 1681 |
| 1681 | 1682 |
| 1682 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { | 1683 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { |
| 1683 LOperand* object = UseFixed(instr->object(), eax); | 1684 LOperand* object = UseFixed(instr->object(), eax); |
| 1684 LLoadNamedGeneric* result = new LLoadNamedGeneric(object); | 1685 LLoadNamedGeneric* result = new LLoadNamedGeneric(object); |
| 1685 return MarkAsCall(DefineFixed(result, eax), instr); | 1686 return MarkAsCall(DefineFixed(result, eax), instr); |
| 1686 } | 1687 } |
| 1687 | 1688 |
| 1688 | 1689 |
| 1689 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( | 1690 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( |
| 1690 HLoadFunctionPrototype* instr) { | 1691 HLoadFunctionPrototype* instr) { |
| 1691 return AssignEnvironment(DefineAsRegister( | 1692 return AssignEnvironment(DefineAsRegister( |
| 1692 new LLoadFunctionPrototype(UseRegister(instr->function()), | 1693 new LLoadFunctionPrototype(UseRegister(instr->function()), |
| 1693 TempRegister()))); | 1694 TempRegister()))); |
| 1694 } | 1695 } |
| 1695 | 1696 |
| 1696 | 1697 |
| 1697 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) { | 1698 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) { |
| 1698 LOperand* input = UseRegisterAtStart(instr->value()); | 1699 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1699 return DefineSameAsFirst(new LLoadElements(input)); | 1700 return DefineSameAsFirst(new LLoadElements(input)); |
| 1700 } | 1701 } |
| 1701 | 1702 |
| 1702 | 1703 |
| 1703 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( | 1704 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( |
| 1704 HLoadKeyedFastElement* instr) { | 1705 HLoadKeyedFastElement* instr) { |
| 1705 Representation r = instr->representation(); | 1706 ASSERT(instr->representation().IsTagged()); |
| 1706 LOperand* obj = UseRegisterAtStart(instr->object()); | 1707 LOperand* obj = UseRegisterAtStart(instr->object()); |
| 1707 ASSERT(instr->key()->representation().IsInteger32()); | 1708 ASSERT(instr->key()->representation().IsInteger32()); |
|
Kevin Millikin (Chromium)
2011/01/11 11:31:56
Move this assert up by the other one?
fschneider
2011/01/11 11:41:49
Done.
| |
| 1708 LOperand* key = UseRegisterAtStart(instr->key()); | 1709 LOperand* key = UseRegisterAtStart(instr->key()); |
| 1709 LOperand* load_result = NULL; | 1710 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key); |
| 1710 // Double needs an extra temp, because the result is converted from heap | 1711 return AssignEnvironment(DefineSameAsFirst(result)); |
| 1711 // number to a double register. | |
| 1712 if (r.IsDouble()) load_result = TempRegister(); | |
| 1713 LLoadKeyedFastElement* load = new LLoadKeyedFastElement(obj, | |
| 1714 key, | |
| 1715 load_result); | |
| 1716 LInstruction* result = r.IsDouble() | |
| 1717 ? DefineAsRegister(load) | |
| 1718 : DefineSameAsFirst(load); | |
| 1719 return AssignEnvironment(result); | |
| 1720 } | 1712 } |
| 1721 | 1713 |
| 1722 | 1714 |
| 1723 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 1715 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
| 1724 LOperand* object = UseFixed(instr->object(), edx); | 1716 LOperand* object = UseFixed(instr->object(), edx); |
| 1725 LOperand* key = UseFixed(instr->key(), eax); | 1717 LOperand* key = UseFixed(instr->key(), eax); |
| 1726 | 1718 |
| 1727 LLoadKeyedGeneric* result = new LLoadKeyedGeneric(object, key); | 1719 LLoadKeyedGeneric* result = new LLoadKeyedGeneric(object, key); |
| 1728 return MarkAsCall(DefineFixed(result, eax), instr); | 1720 return MarkAsCall(DefineFixed(result, eax), instr); |
| 1729 } | 1721 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1770 | 1762 |
| 1771 LOperand* val = needs_write_barrier | 1763 LOperand* val = needs_write_barrier |
| 1772 ? UseTempRegister(instr->value()) | 1764 ? UseTempRegister(instr->value()) |
| 1773 : UseRegister(instr->value()); | 1765 : UseRegister(instr->value()); |
| 1774 | 1766 |
| 1775 // We only need a scratch register if we have a write barrier or we | 1767 // We only need a scratch register if we have a write barrier or we |
| 1776 // have a store into the properties array (not in-object-property). | 1768 // have a store into the properties array (not in-object-property). |
| 1777 LOperand* temp = (!instr->is_in_object() || needs_write_barrier) | 1769 LOperand* temp = (!instr->is_in_object() || needs_write_barrier) |
| 1778 ? TempRegister() : NULL; | 1770 ? TempRegister() : NULL; |
| 1779 | 1771 |
| 1780 return new LStoreNamedField(obj, | 1772 return new LStoreNamedField(obj, val, temp); |
| 1781 instr->name(), | |
| 1782 val, | |
| 1783 instr->is_in_object(), | |
| 1784 instr->offset(), | |
| 1785 temp, | |
| 1786 needs_write_barrier, | |
| 1787 instr->transition()); | |
| 1788 } | 1773 } |
| 1789 | 1774 |
| 1790 | 1775 |
| 1791 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 1776 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
| 1792 LOperand* obj = UseFixed(instr->object(), edx); | 1777 LOperand* obj = UseFixed(instr->object(), edx); |
| 1793 LOperand* val = UseFixed(instr->value(), eax); | 1778 LOperand* val = UseFixed(instr->value(), eax); |
| 1794 | 1779 |
| 1795 LStoreNamedGeneric* result = new LStoreNamedGeneric(obj, instr->name(), val); | 1780 LStoreNamedGeneric* result = new LStoreNamedGeneric(obj, val); |
| 1796 return MarkAsCall(result, instr); | 1781 return MarkAsCall(result, instr); |
| 1797 } | 1782 } |
| 1798 | 1783 |
| 1799 | 1784 |
| 1800 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { | 1785 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { |
| 1801 return MarkAsCall(DefineFixed(new LArrayLiteral, eax), instr); | 1786 return MarkAsCall(DefineFixed(new LArrayLiteral, eax), instr); |
| 1802 } | 1787 } |
| 1803 | 1788 |
| 1804 | 1789 |
| 1805 LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) { | 1790 LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1943 void LPointerMap::PrintTo(StringStream* stream) { | 1928 void LPointerMap::PrintTo(StringStream* stream) { |
| 1944 stream->Add("{"); | 1929 stream->Add("{"); |
| 1945 for (int i = 0; i < pointer_operands_.length(); ++i) { | 1930 for (int i = 0; i < pointer_operands_.length(); ++i) { |
| 1946 if (i != 0) stream->Add(";"); | 1931 if (i != 0) stream->Add(";"); |
| 1947 pointer_operands_[i]->PrintTo(stream); | 1932 pointer_operands_[i]->PrintTo(stream); |
| 1948 } | 1933 } |
| 1949 stream->Add("} @%d", position()); | 1934 stream->Add("} @%d", position()); |
| 1950 } | 1935 } |
| 1951 | 1936 |
| 1952 } } // namespace v8::internal | 1937 } } // namespace v8::internal |
| OLD | NEW |