OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1822 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 1822 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
1823 LLoadKeyedFastDoubleElement* result = | 1823 LLoadKeyedFastDoubleElement* result = |
1824 new(zone()) LLoadKeyedFastDoubleElement(elements, key); | 1824 new(zone()) LLoadKeyedFastDoubleElement(elements, key); |
1825 return AssignEnvironment(DefineAsRegister(result)); | 1825 return AssignEnvironment(DefineAsRegister(result)); |
1826 } | 1826 } |
1827 | 1827 |
1828 | 1828 |
1829 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( | 1829 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( |
1830 HLoadKeyedSpecializedArrayElement* instr) { | 1830 HLoadKeyedSpecializedArrayElement* instr) { |
1831 ElementsKind elements_kind = instr->elements_kind(); | 1831 ElementsKind elements_kind = instr->elements_kind(); |
1832 Representation representation(instr->representation()); | |
1833 ASSERT( | 1832 ASSERT( |
1834 (representation.IsInteger32() && | 1833 (instr->representation().IsInteger32() && |
1835 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && | 1834 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
1836 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || | 1835 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
1837 (representation.IsDouble() && | 1836 (instr->representation().IsDouble() && |
1838 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || | 1837 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
1839 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); | 1838 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
1840 ASSERT(instr->key()->representation().IsInteger32() || | 1839 ASSERT(instr->key()->representation().IsInteger32() || |
1841 instr->key()->representation().IsTagged()); | 1840 instr->key()->representation().IsTagged()); |
1842 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1841 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
1843 LOperand* key = UseRegisterOrConstant(instr->key()); | 1842 LOperand* key = UseRegisterOrConstant(instr->key()); |
1844 LLoadKeyedSpecializedArrayElement* result = | 1843 LLoadKeyedSpecializedArrayElement* result = |
1845 new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, key); | 1844 new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, key); |
1846 LInstruction* load_instr = DefineAsRegister(result); | 1845 LInstruction* load_instr = DefineAsRegister(result); |
1847 // An unsigned int array load might overflow and cause a deopt, make sure it | 1846 // An unsigned int array load might overflow and cause a deopt, make sure it |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 LOperand* elements = UseRegisterAtStart(instr->elements()); | 1889 LOperand* elements = UseRegisterAtStart(instr->elements()); |
1891 LOperand* val = UseTempRegister(instr->value()); | 1890 LOperand* val = UseTempRegister(instr->value()); |
1892 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 1891 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
1893 | 1892 |
1894 return new(zone()) LStoreKeyedFastDoubleElement(elements, key, val); | 1893 return new(zone()) LStoreKeyedFastDoubleElement(elements, key, val); |
1895 } | 1894 } |
1896 | 1895 |
1897 | 1896 |
1898 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( | 1897 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
1899 HStoreKeyedSpecializedArrayElement* instr) { | 1898 HStoreKeyedSpecializedArrayElement* instr) { |
1900 Representation representation(instr->value()->representation()); | |
1901 ElementsKind elements_kind = instr->elements_kind(); | 1899 ElementsKind elements_kind = instr->elements_kind(); |
1902 ASSERT( | 1900 ASSERT( |
1903 (representation.IsInteger32() && | 1901 (instr->value()->representation().IsInteger32() && |
1904 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && | 1902 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
1905 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || | 1903 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
1906 (representation.IsDouble() && | 1904 (instr->value()->representation().IsDouble() && |
1907 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || | 1905 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
1908 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); | 1906 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
1909 ASSERT(instr->external_pointer()->representation().IsExternal()); | 1907 ASSERT(instr->external_pointer()->representation().IsExternal()); |
1910 ASSERT(instr->key()->representation().IsInteger32() || | 1908 ASSERT(instr->key()->representation().IsInteger32() || |
1911 instr->key()->representation().IsTagged()); | 1909 instr->key()->representation().IsTagged()); |
1912 | 1910 |
1913 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1911 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
1914 bool val_is_temp_register = | 1912 bool val_is_temp_register = |
1915 elements_kind == EXTERNAL_PIXEL_ELEMENTS || | 1913 elements_kind == EXTERNAL_PIXEL_ELEMENTS || |
1916 elements_kind == EXTERNAL_FLOAT_ELEMENTS; | 1914 elements_kind == EXTERNAL_FLOAT_ELEMENTS; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2250 | 2248 |
2251 | 2249 |
2252 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2250 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2253 LOperand* object = UseRegister(instr->object()); | 2251 LOperand* object = UseRegister(instr->object()); |
2254 LOperand* index = UseRegister(instr->index()); | 2252 LOperand* index = UseRegister(instr->index()); |
2255 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2253 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2256 } | 2254 } |
2257 | 2255 |
2258 | 2256 |
2259 } } // namespace v8::internal | 2257 } } // namespace v8::internal |
OLD | NEW |