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 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1833 LOperand* elements = UseRegisterAtStart(instr->elements()); | 1833 LOperand* elements = UseRegisterAtStart(instr->elements()); |
1834 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 1834 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
1835 LLoadKeyedFastDoubleElement* result = | 1835 LLoadKeyedFastDoubleElement* result = |
1836 new LLoadKeyedFastDoubleElement(elements, key); | 1836 new LLoadKeyedFastDoubleElement(elements, key); |
1837 return AssignEnvironment(DefineAsRegister(result)); | 1837 return AssignEnvironment(DefineAsRegister(result)); |
1838 } | 1838 } |
1839 | 1839 |
1840 | 1840 |
1841 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( | 1841 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( |
1842 HLoadKeyedSpecializedArrayElement* instr) { | 1842 HLoadKeyedSpecializedArrayElement* instr) { |
1843 JSObject::ElementsKind elements_kind = instr->elements_kind(); | 1843 ElementsKind elements_kind = instr->elements_kind(); |
1844 Representation representation(instr->representation()); | 1844 Representation representation(instr->representation()); |
1845 ASSERT( | 1845 ASSERT( |
1846 (representation.IsInteger32() && | 1846 (representation.IsInteger32() && |
1847 (elements_kind != JSObject::EXTERNAL_FLOAT_ELEMENTS) && | 1847 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
1848 (elements_kind != JSObject::EXTERNAL_DOUBLE_ELEMENTS)) || | 1848 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
1849 (representation.IsDouble() && | 1849 (representation.IsDouble() && |
1850 ((elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) || | 1850 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
1851 (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS)))); | 1851 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
1852 ASSERT(instr->key()->representation().IsInteger32()); | 1852 ASSERT(instr->key()->representation().IsInteger32()); |
1853 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1853 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
1854 LOperand* key = UseRegisterOrConstant(instr->key()); | 1854 LOperand* key = UseRegisterOrConstant(instr->key()); |
1855 LLoadKeyedSpecializedArrayElement* result = | 1855 LLoadKeyedSpecializedArrayElement* result = |
1856 new LLoadKeyedSpecializedArrayElement(external_pointer, key); | 1856 new LLoadKeyedSpecializedArrayElement(external_pointer, key); |
1857 LInstruction* load_instr = DefineAsRegister(result); | 1857 LInstruction* load_instr = DefineAsRegister(result); |
1858 // An unsigned int array load might overflow and cause a deopt, make sure it | 1858 // An unsigned int array load might overflow and cause a deopt, make sure it |
1859 // has an environment. | 1859 // has an environment. |
1860 return (elements_kind == JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS) ? | 1860 return (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) ? |
1861 AssignEnvironment(load_instr) : load_instr; | 1861 AssignEnvironment(load_instr) : load_instr; |
1862 } | 1862 } |
1863 | 1863 |
1864 | 1864 |
1865 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 1865 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
1866 LOperand* object = UseFixed(instr->object(), rdx); | 1866 LOperand* object = UseFixed(instr->object(), rdx); |
1867 LOperand* key = UseFixed(instr->key(), rax); | 1867 LOperand* key = UseFixed(instr->key(), rax); |
1868 | 1868 |
1869 LLoadKeyedGeneric* result = new LLoadKeyedGeneric(object, key); | 1869 LLoadKeyedGeneric* result = new LLoadKeyedGeneric(object, key); |
1870 return MarkAsCall(DefineFixed(result, rax), instr); | 1870 return MarkAsCall(DefineFixed(result, rax), instr); |
(...skipping 29 matching lines...) Expand all Loading... |
1900 LOperand* val = UseTempRegister(instr->value()); | 1900 LOperand* val = UseTempRegister(instr->value()); |
1901 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 1901 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
1902 | 1902 |
1903 return new LStoreKeyedFastDoubleElement(elements, key, val); | 1903 return new LStoreKeyedFastDoubleElement(elements, key, val); |
1904 } | 1904 } |
1905 | 1905 |
1906 | 1906 |
1907 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( | 1907 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
1908 HStoreKeyedSpecializedArrayElement* instr) { | 1908 HStoreKeyedSpecializedArrayElement* instr) { |
1909 Representation representation(instr->value()->representation()); | 1909 Representation representation(instr->value()->representation()); |
1910 JSObject::ElementsKind elements_kind = instr->elements_kind(); | 1910 ElementsKind elements_kind = instr->elements_kind(); |
1911 ASSERT( | 1911 ASSERT( |
1912 (representation.IsInteger32() && | 1912 (representation.IsInteger32() && |
1913 (elements_kind != JSObject::EXTERNAL_FLOAT_ELEMENTS) && | 1913 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
1914 (elements_kind != JSObject::EXTERNAL_DOUBLE_ELEMENTS)) || | 1914 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
1915 (representation.IsDouble() && | 1915 (representation.IsDouble() && |
1916 ((elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) || | 1916 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
1917 (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS)))); | 1917 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
1918 ASSERT(instr->external_pointer()->representation().IsExternal()); | 1918 ASSERT(instr->external_pointer()->representation().IsExternal()); |
1919 ASSERT(instr->key()->representation().IsInteger32()); | 1919 ASSERT(instr->key()->representation().IsInteger32()); |
1920 | 1920 |
1921 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1921 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
1922 bool val_is_temp_register = | 1922 bool val_is_temp_register = |
1923 elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS || | 1923 elements_kind == EXTERNAL_PIXEL_ELEMENTS || |
1924 elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS; | 1924 elements_kind == EXTERNAL_FLOAT_ELEMENTS; |
1925 LOperand* val = val_is_temp_register | 1925 LOperand* val = val_is_temp_register |
1926 ? UseTempRegister(instr->value()) | 1926 ? UseTempRegister(instr->value()) |
1927 : UseRegister(instr->value()); | 1927 : UseRegister(instr->value()); |
1928 LOperand* key = UseRegisterOrConstant(instr->key()); | 1928 LOperand* key = UseRegisterOrConstant(instr->key()); |
1929 | 1929 |
1930 return new LStoreKeyedSpecializedArrayElement(external_pointer, | 1930 return new LStoreKeyedSpecializedArrayElement(external_pointer, |
1931 key, | 1931 key, |
1932 val); | 1932 val); |
1933 } | 1933 } |
1934 | 1934 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2168 LOperand* key = UseOrConstantAtStart(instr->key()); | 2168 LOperand* key = UseOrConstantAtStart(instr->key()); |
2169 LOperand* object = UseOrConstantAtStart(instr->object()); | 2169 LOperand* object = UseOrConstantAtStart(instr->object()); |
2170 LIn* result = new LIn(key, object); | 2170 LIn* result = new LIn(key, object); |
2171 return MarkAsCall(DefineFixed(result, rax), instr); | 2171 return MarkAsCall(DefineFixed(result, rax), instr); |
2172 } | 2172 } |
2173 | 2173 |
2174 | 2174 |
2175 } } // namespace v8::internal | 2175 } } // namespace v8::internal |
2176 | 2176 |
2177 #endif // V8_TARGET_ARCH_X64 | 2177 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |