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 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 1780 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |
1781 LOperand* context = UseFixed(instr->context(), esi); | 1781 LOperand* context = UseFixed(instr->context(), esi); |
1782 LOperand* global_object = UseFixed(instr->global_object(), eax); | 1782 LOperand* global_object = UseFixed(instr->global_object(), eax); |
1783 LLoadGlobalGeneric* result = new LLoadGlobalGeneric(context, global_object); | 1783 LLoadGlobalGeneric* result = new LLoadGlobalGeneric(context, global_object); |
1784 return MarkAsCall(DefineFixed(result, eax), instr); | 1784 return MarkAsCall(DefineFixed(result, eax), instr); |
1785 } | 1785 } |
1786 | 1786 |
1787 | 1787 |
1788 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { | 1788 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { |
1789 LStoreGlobalCell* result = | 1789 LStoreGlobalCell* result = |
1790 new LStoreGlobalCell(UseRegisterAtStart(instr->value())); | 1790 new LStoreGlobalCell(UseTempRegister(instr->value()), |
| 1791 TempRegister(), |
| 1792 TempRegister()); |
1791 return instr->check_hole_value() ? AssignEnvironment(result) : result; | 1793 return instr->check_hole_value() ? AssignEnvironment(result) : result; |
1792 } | 1794 } |
1793 | 1795 |
1794 | 1796 |
1795 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) { | 1797 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) { |
1796 LOperand* context = UseFixed(instr->context(), esi); | 1798 LOperand* context = UseFixed(instr->context(), esi); |
1797 LOperand* global_object = UseFixed(instr->global_object(), edx); | 1799 LOperand* global_object = UseFixed(instr->global_object(), edx); |
1798 LOperand* value = UseFixed(instr->value(), eax); | 1800 LOperand* value = UseFixed(instr->value(), eax); |
1799 LStoreGlobalGeneric* result = | 1801 LStoreGlobalGeneric* result = |
1800 new LStoreGlobalGeneric(context, global_object, value); | 1802 new LStoreGlobalGeneric(context, global_object, value); |
1801 return MarkAsCall(result, instr); | 1803 return MarkAsCall(result, instr); |
1802 } | 1804 } |
1803 | 1805 |
1804 | 1806 |
1805 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 1807 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
1806 LOperand* context = UseRegisterAtStart(instr->value()); | 1808 LOperand* context = UseRegisterAtStart(instr->value()); |
1807 return DefineAsRegister(new LLoadContextSlot(context)); | 1809 return DefineAsRegister(new LLoadContextSlot(context)); |
1808 } | 1810 } |
1809 | 1811 |
1810 | 1812 |
1811 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { | 1813 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
1812 LOperand* context; | |
1813 LOperand* value; | 1814 LOperand* value; |
1814 LOperand* temp; | 1815 LOperand* temp; |
| 1816 LOperand* context = UseRegister(instr->context()); |
1815 if (instr->NeedsWriteBarrier()) { | 1817 if (instr->NeedsWriteBarrier()) { |
1816 context = UseTempRegister(instr->context()); | |
1817 value = UseTempRegister(instr->value()); | 1818 value = UseTempRegister(instr->value()); |
1818 temp = TempRegister(); | 1819 temp = TempRegister(); |
1819 } else { | 1820 } else { |
1820 context = UseRegister(instr->context()); | |
1821 value = UseRegister(instr->value()); | 1821 value = UseRegister(instr->value()); |
1822 temp = NULL; | 1822 temp = NULL; |
1823 } | 1823 } |
1824 return new LStoreContextSlot(context, value, temp); | 1824 return new LStoreContextSlot(context, value, temp); |
1825 } | 1825 } |
1826 | 1826 |
1827 | 1827 |
1828 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { | 1828 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
1829 ASSERT(instr->representation().IsTagged()); | 1829 ASSERT(instr->representation().IsTagged()); |
1830 LOperand* obj = UseRegisterAtStart(instr->object()); | 1830 LOperand* obj = UseRegisterAtStart(instr->object()); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 } | 1938 } |
1939 | 1939 |
1940 | 1940 |
1941 LInstruction* LChunkBuilder::DoStoreKeyedFastElement( | 1941 LInstruction* LChunkBuilder::DoStoreKeyedFastElement( |
1942 HStoreKeyedFastElement* instr) { | 1942 HStoreKeyedFastElement* instr) { |
1943 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 1943 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
1944 ASSERT(instr->value()->representation().IsTagged()); | 1944 ASSERT(instr->value()->representation().IsTagged()); |
1945 ASSERT(instr->object()->representation().IsTagged()); | 1945 ASSERT(instr->object()->representation().IsTagged()); |
1946 ASSERT(instr->key()->representation().IsInteger32()); | 1946 ASSERT(instr->key()->representation().IsInteger32()); |
1947 | 1947 |
1948 LOperand* obj = UseTempRegister(instr->object()); | 1948 LOperand* obj = UseRegister(instr->object()); |
1949 LOperand* val = needs_write_barrier | 1949 LOperand* val = needs_write_barrier |
1950 ? UseTempRegister(instr->value()) | 1950 ? UseTempRegister(instr->value()) |
1951 : UseRegisterAtStart(instr->value()); | 1951 : UseRegisterAtStart(instr->value()); |
1952 LOperand* key = needs_write_barrier | 1952 LOperand* key = needs_write_barrier |
1953 ? UseTempRegister(instr->key()) | 1953 ? UseTempRegister(instr->key()) |
1954 : UseRegisterOrConstantAtStart(instr->key()); | 1954 : UseRegisterOrConstantAtStart(instr->key()); |
1955 | 1955 |
1956 return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val)); | 1956 return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val)); |
1957 } | 1957 } |
1958 | 1958 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 | 2015 |
2016 LStoreKeyedGeneric* result = | 2016 LStoreKeyedGeneric* result = |
2017 new LStoreKeyedGeneric(context, object, key, value); | 2017 new LStoreKeyedGeneric(context, object, key, value); |
2018 return MarkAsCall(result, instr); | 2018 return MarkAsCall(result, instr); |
2019 } | 2019 } |
2020 | 2020 |
2021 | 2021 |
2022 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { | 2022 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
2023 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2023 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
2024 | 2024 |
2025 LOperand* obj = needs_write_barrier | 2025 LOperand* obj; |
2026 ? UseTempRegister(instr->object()) | 2026 if (needs_write_barrier) { |
2027 : UseRegisterAtStart(instr->object()); | 2027 obj = instr->is_in_object() |
| 2028 ? UseRegister(instr->object()) |
| 2029 : UseTempRegister(instr->object()); |
| 2030 } else { |
| 2031 obj = UseRegisterAtStart(instr->object()); |
| 2032 } |
2028 | 2033 |
2029 LOperand* val = needs_write_barrier | 2034 LOperand* val = needs_write_barrier |
2030 ? UseTempRegister(instr->value()) | 2035 ? UseTempRegister(instr->value()) |
2031 : UseRegister(instr->value()); | 2036 : UseRegister(instr->value()); |
2032 | 2037 |
2033 // We only need a scratch register if we have a write barrier or we | 2038 // We only need a scratch register if we have a write barrier or we |
2034 // have a store into the properties array (not in-object-property). | 2039 // have a store into the properties array (not in-object-property). |
2035 LOperand* temp = (!instr->is_in_object() || needs_write_barrier) | 2040 LOperand* temp = (!instr->is_in_object() || needs_write_barrier) |
2036 ? TempRegister() | 2041 ? TempRegister() |
2037 : NULL; | 2042 : NULL; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2259 LOperand* key = UseOrConstantAtStart(instr->key()); | 2264 LOperand* key = UseOrConstantAtStart(instr->key()); |
2260 LOperand* object = UseOrConstantAtStart(instr->object()); | 2265 LOperand* object = UseOrConstantAtStart(instr->object()); |
2261 LIn* result = new LIn(context, key, object); | 2266 LIn* result = new LIn(context, key, object); |
2262 return MarkAsCall(DefineFixed(result, eax), instr); | 2267 return MarkAsCall(DefineFixed(result, eax), instr); |
2263 } | 2268 } |
2264 | 2269 |
2265 | 2270 |
2266 } } // namespace v8::internal | 2271 } } // namespace v8::internal |
2267 | 2272 |
2268 #endif // V8_TARGET_ARCH_IA32 | 2273 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |