| 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 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1800 HLoadKeyedFastElement* instr) { | 1800 HLoadKeyedFastElement* instr) { |
| 1801 ASSERT(instr->representation().IsTagged()); | 1801 ASSERT(instr->representation().IsTagged()); |
| 1802 ASSERT(instr->key()->representation().IsInteger32()); | 1802 ASSERT(instr->key()->representation().IsInteger32()); |
| 1803 LOperand* obj = UseRegisterAtStart(instr->object()); | 1803 LOperand* obj = UseRegisterAtStart(instr->object()); |
| 1804 LOperand* key = UseRegisterAtStart(instr->key()); | 1804 LOperand* key = UseRegisterAtStart(instr->key()); |
| 1805 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key); | 1805 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key); |
| 1806 return AssignEnvironment(DefineSameAsFirst(result)); | 1806 return AssignEnvironment(DefineSameAsFirst(result)); |
| 1807 } | 1807 } |
| 1808 | 1808 |
| 1809 | 1809 |
| 1810 LInstruction* LChunkBuilder::DoLoadPixelArrayElement( | 1810 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( |
| 1811 HLoadPixelArrayElement* instr) { | 1811 HLoadKeyedSpecializedArrayElement* instr) { |
| 1812 // TODO(danno): Add support for other external array types. |
| 1813 if (instr->array_type() != kExternalPixelArray) { |
| 1814 Abort("unsupported load for external array type."); |
| 1815 } |
| 1816 |
| 1812 ASSERT(instr->representation().IsInteger32()); | 1817 ASSERT(instr->representation().IsInteger32()); |
| 1813 ASSERT(instr->key()->representation().IsInteger32()); | 1818 ASSERT(instr->key()->representation().IsInteger32()); |
| 1814 LOperand* external_pointer = | 1819 LOperand* external_pointer = |
| 1815 UseRegisterAtStart(instr->external_pointer()); | 1820 UseRegisterAtStart(instr->external_pointer()); |
| 1816 LOperand* key = UseRegisterAtStart(instr->key()); | 1821 LOperand* key = UseRegisterAtStart(instr->key()); |
| 1817 LLoadPixelArrayElement* result = | 1822 LLoadKeyedSpecializedArrayElement* result = |
| 1818 new LLoadPixelArrayElement(external_pointer, key); | 1823 new LLoadKeyedSpecializedArrayElement(external_pointer, |
| 1824 key, |
| 1825 instr->array_type()); |
| 1819 return DefineAsRegister(result); | 1826 return DefineAsRegister(result); |
| 1820 } | 1827 } |
| 1821 | 1828 |
| 1822 | 1829 |
| 1823 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 1830 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
| 1824 LOperand* object = UseFixed(instr->object(), r1); | 1831 LOperand* object = UseFixed(instr->object(), r1); |
| 1825 LOperand* key = UseFixed(instr->key(), r0); | 1832 LOperand* key = UseFixed(instr->key(), r0); |
| 1826 | 1833 |
| 1827 LInstruction* result = | 1834 LInstruction* result = |
| 1828 DefineFixed(new LLoadKeyedGeneric(object, key), r0); | 1835 DefineFixed(new LLoadKeyedGeneric(object, key), r0); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1842 ? UseTempRegister(instr->value()) | 1849 ? UseTempRegister(instr->value()) |
| 1843 : UseRegisterAtStart(instr->value()); | 1850 : UseRegisterAtStart(instr->value()); |
| 1844 LOperand* key = needs_write_barrier | 1851 LOperand* key = needs_write_barrier |
| 1845 ? UseTempRegister(instr->key()) | 1852 ? UseTempRegister(instr->key()) |
| 1846 : UseRegisterOrConstantAtStart(instr->key()); | 1853 : UseRegisterOrConstantAtStart(instr->key()); |
| 1847 | 1854 |
| 1848 return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val)); | 1855 return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val)); |
| 1849 } | 1856 } |
| 1850 | 1857 |
| 1851 | 1858 |
| 1852 LInstruction* LChunkBuilder::DoStorePixelArrayElement( | 1859 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
| 1853 HStorePixelArrayElement* instr) { | 1860 HStoreKeyedSpecializedArrayElement* instr) { |
| 1861 // TODO(danno): Add support for other external array types. |
| 1862 if (instr->array_type() != kExternalPixelArray) { |
| 1863 Abort("unsupported store for external array type."); |
| 1864 } |
| 1865 |
| 1854 ASSERT(instr->value()->representation().IsInteger32()); | 1866 ASSERT(instr->value()->representation().IsInteger32()); |
| 1855 ASSERT(instr->external_pointer()->representation().IsExternal()); | 1867 ASSERT(instr->external_pointer()->representation().IsExternal()); |
| 1856 ASSERT(instr->key()->representation().IsInteger32()); | 1868 ASSERT(instr->key()->representation().IsInteger32()); |
| 1857 | 1869 |
| 1858 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1870 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
| 1859 LOperand* value = UseTempRegister(instr->value()); // changed by clamp. | 1871 LOperand* value = UseTempRegister(instr->value()); // changed by clamp. |
| 1860 LOperand* key = UseRegister(instr->key()); | 1872 LOperand* key = UseRegister(instr->key()); |
| 1861 | 1873 |
| 1862 return new LStorePixelArrayElement(external_pointer, key, value); | 1874 return new LStoreKeyedSpecializedArrayElement(external_pointer, |
| 1875 key, |
| 1876 value, |
| 1877 instr->array_type()); |
| 1863 } | 1878 } |
| 1864 | 1879 |
| 1865 | 1880 |
| 1866 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 1881 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
| 1867 LOperand* obj = UseFixed(instr->object(), r2); | 1882 LOperand* obj = UseFixed(instr->object(), r2); |
| 1868 LOperand* key = UseFixed(instr->key(), r1); | 1883 LOperand* key = UseFixed(instr->key(), r1); |
| 1869 LOperand* val = UseFixed(instr->value(), r0); | 1884 LOperand* val = UseFixed(instr->value(), r0); |
| 1870 | 1885 |
| 1871 ASSERT(instr->object()->representation().IsTagged()); | 1886 ASSERT(instr->object()->representation().IsTagged()); |
| 1872 ASSERT(instr->key()->representation().IsTagged()); | 1887 ASSERT(instr->key()->representation().IsTagged()); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2067 | 2082 |
| 2068 | 2083 |
| 2069 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2084 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2070 HEnvironment* outer = current_block_->last_environment()->outer(); | 2085 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 2071 current_block_->UpdateEnvironment(outer); | 2086 current_block_->UpdateEnvironment(outer); |
| 2072 return NULL; | 2087 return NULL; |
| 2073 } | 2088 } |
| 2074 | 2089 |
| 2075 | 2090 |
| 2076 } } // namespace v8::internal | 2091 } } // namespace v8::internal |
| OLD | NEW |