| 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 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1878 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); | 1878 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); |
| 1879 } | 1879 } |
| 1880 | 1880 |
| 1881 | 1881 |
| 1882 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( | 1882 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( |
| 1883 HLoadKeyedFastElement* instr) { | 1883 HLoadKeyedFastElement* instr) { |
| 1884 ASSERT(instr->representation().IsTagged()); | 1884 ASSERT(instr->representation().IsTagged()); |
| 1885 ASSERT(instr->key()->representation().IsInteger32()); | 1885 ASSERT(instr->key()->representation().IsInteger32()); |
| 1886 LOperand* obj = UseRegisterAtStart(instr->object()); | 1886 LOperand* obj = UseRegisterAtStart(instr->object()); |
| 1887 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 1887 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 1888 LLoadKeyedFastElement* result = new(zone()) LLoadKeyedFastElement(obj, key); | 1888 LLoadKeyedFastElement* result = |
| 1889 new(zone()) LLoadKeyedFastElement(obj, key, instr->index_offset()); |
| 1889 if (instr->RequiresHoleCheck()) AssignEnvironment(result); | 1890 if (instr->RequiresHoleCheck()) AssignEnvironment(result); |
| 1890 return DefineAsRegister(result); | 1891 return DefineAsRegister(result); |
| 1891 } | 1892 } |
| 1892 | 1893 |
| 1893 | 1894 |
| 1894 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( | 1895 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( |
| 1895 HLoadKeyedFastDoubleElement* instr) { | 1896 HLoadKeyedFastDoubleElement* instr) { |
| 1896 ASSERT(instr->representation().IsDouble()); | 1897 ASSERT(instr->representation().IsDouble()); |
| 1897 ASSERT(instr->key()->representation().IsInteger32()); | 1898 ASSERT(instr->key()->representation().IsInteger32()); |
| 1898 LOperand* elements = UseRegisterAtStart(instr->elements()); | 1899 LOperand* elements = UseRegisterAtStart(instr->elements()); |
| 1899 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 1900 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 1900 LLoadKeyedFastDoubleElement* result = | 1901 LLoadKeyedFastDoubleElement* result = |
| 1901 new(zone()) LLoadKeyedFastDoubleElement(elements, key); | 1902 new(zone()) LLoadKeyedFastDoubleElement(elements, |
| 1903 key, |
| 1904 instr->index_offset()); |
| 1902 return AssignEnvironment(DefineAsRegister(result)); | 1905 return AssignEnvironment(DefineAsRegister(result)); |
| 1903 } | 1906 } |
| 1904 | 1907 |
| 1905 | 1908 |
| 1906 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( | 1909 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( |
| 1907 HLoadKeyedSpecializedArrayElement* instr) { | 1910 HLoadKeyedSpecializedArrayElement* instr) { |
| 1908 ElementsKind elements_kind = instr->elements_kind(); | 1911 ElementsKind elements_kind = instr->elements_kind(); |
| 1909 ASSERT( | 1912 ASSERT( |
| 1910 (instr->representation().IsInteger32() && | 1913 (instr->representation().IsInteger32() && |
| 1911 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && | 1914 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
| 1912 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || | 1915 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
| 1913 (instr->representation().IsDouble() && | 1916 (instr->representation().IsDouble() && |
| 1914 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || | 1917 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
| 1915 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); | 1918 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
| 1916 ASSERT(instr->key()->representation().IsInteger32()); | 1919 ASSERT(instr->key()->representation().IsInteger32()); |
| 1917 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1920 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
| 1918 LOperand* key = UseRegisterOrConstant(instr->key()); | 1921 LOperand* key = UseRegisterOrConstant(instr->key()); |
| 1919 LLoadKeyedSpecializedArrayElement* result = | 1922 LLoadKeyedSpecializedArrayElement* result = |
| 1920 new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, key); | 1923 new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, |
| 1924 key, |
| 1925 instr->index_offset()); |
| 1921 LInstruction* load_instr = DefineAsRegister(result); | 1926 LInstruction* load_instr = DefineAsRegister(result); |
| 1922 // An unsigned int array load might overflow and cause a deopt, make sure it | 1927 // An unsigned int array load might overflow and cause a deopt, make sure it |
| 1923 // has an environment. | 1928 // has an environment. |
| 1924 return (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) ? | 1929 return (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) ? |
| 1925 AssignEnvironment(load_instr) : load_instr; | 1930 AssignEnvironment(load_instr) : load_instr; |
| 1926 } | 1931 } |
| 1927 | 1932 |
| 1928 | 1933 |
| 1929 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 1934 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
| 1930 LOperand* object = UseFixed(instr->object(), rdx); | 1935 LOperand* object = UseFixed(instr->object(), rdx); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1942 ASSERT(instr->object()->representation().IsTagged()); | 1947 ASSERT(instr->object()->representation().IsTagged()); |
| 1943 ASSERT(instr->key()->representation().IsInteger32()); | 1948 ASSERT(instr->key()->representation().IsInteger32()); |
| 1944 | 1949 |
| 1945 LOperand* obj = UseTempRegister(instr->object()); | 1950 LOperand* obj = UseTempRegister(instr->object()); |
| 1946 LOperand* val = needs_write_barrier | 1951 LOperand* val = needs_write_barrier |
| 1947 ? UseTempRegister(instr->value()) | 1952 ? UseTempRegister(instr->value()) |
| 1948 : UseRegisterAtStart(instr->value()); | 1953 : UseRegisterAtStart(instr->value()); |
| 1949 LOperand* key = needs_write_barrier | 1954 LOperand* key = needs_write_barrier |
| 1950 ? UseTempRegister(instr->key()) | 1955 ? UseTempRegister(instr->key()) |
| 1951 : UseRegisterOrConstantAtStart(instr->key()); | 1956 : UseRegisterOrConstantAtStart(instr->key()); |
| 1952 return new(zone()) LStoreKeyedFastElement(obj, key, val); | 1957 return new(zone()) |
| 1958 LStoreKeyedFastElement(obj, key, val, instr->index_offset()); |
| 1953 } | 1959 } |
| 1954 | 1960 |
| 1955 | 1961 |
| 1956 LInstruction* LChunkBuilder::DoStoreKeyedFastDoubleElement( | 1962 LInstruction* LChunkBuilder::DoStoreKeyedFastDoubleElement( |
| 1957 HStoreKeyedFastDoubleElement* instr) { | 1963 HStoreKeyedFastDoubleElement* instr) { |
| 1958 ASSERT(instr->value()->representation().IsDouble()); | 1964 ASSERT(instr->value()->representation().IsDouble()); |
| 1959 ASSERT(instr->elements()->representation().IsTagged()); | 1965 ASSERT(instr->elements()->representation().IsTagged()); |
| 1960 ASSERT(instr->key()->representation().IsInteger32()); | 1966 ASSERT(instr->key()->representation().IsInteger32()); |
| 1961 | 1967 |
| 1962 LOperand* elements = UseRegisterAtStart(instr->elements()); | 1968 LOperand* elements = UseRegisterAtStart(instr->elements()); |
| 1963 LOperand* val = UseTempRegister(instr->value()); | 1969 LOperand* val = UseTempRegister(instr->value()); |
| 1964 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 1970 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 1965 | 1971 |
| 1966 return new(zone()) LStoreKeyedFastDoubleElement(elements, key, val); | 1972 return new(zone()) |
| 1973 LStoreKeyedFastDoubleElement(elements, key, val, instr->index_offset()); |
| 1967 } | 1974 } |
| 1968 | 1975 |
| 1969 | 1976 |
| 1970 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( | 1977 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
| 1971 HStoreKeyedSpecializedArrayElement* instr) { | 1978 HStoreKeyedSpecializedArrayElement* instr) { |
| 1972 ElementsKind elements_kind = instr->elements_kind(); | 1979 ElementsKind elements_kind = instr->elements_kind(); |
| 1973 ASSERT( | 1980 ASSERT( |
| 1974 (instr->value()->representation().IsInteger32() && | 1981 (instr->value()->representation().IsInteger32() && |
| 1975 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && | 1982 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
| 1976 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || | 1983 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
| 1977 (instr->value()->representation().IsDouble() && | 1984 (instr->value()->representation().IsDouble() && |
| 1978 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || | 1985 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
| 1979 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); | 1986 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
| 1980 ASSERT(instr->external_pointer()->representation().IsExternal()); | 1987 ASSERT(instr->external_pointer()->representation().IsExternal()); |
| 1981 ASSERT(instr->key()->representation().IsInteger32()); | 1988 ASSERT(instr->key()->representation().IsInteger32()); |
| 1982 | 1989 |
| 1983 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1990 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
| 1984 bool val_is_temp_register = | 1991 bool val_is_temp_register = |
| 1985 elements_kind == EXTERNAL_PIXEL_ELEMENTS || | 1992 elements_kind == EXTERNAL_PIXEL_ELEMENTS || |
| 1986 elements_kind == EXTERNAL_FLOAT_ELEMENTS; | 1993 elements_kind == EXTERNAL_FLOAT_ELEMENTS; |
| 1987 LOperand* val = val_is_temp_register | 1994 LOperand* val = val_is_temp_register |
| 1988 ? UseTempRegister(instr->value()) | 1995 ? UseTempRegister(instr->value()) |
| 1989 : UseRegister(instr->value()); | 1996 : UseRegister(instr->value()); |
| 1990 LOperand* key = UseRegisterOrConstant(instr->key()); | 1997 LOperand* key = UseRegisterOrConstant(instr->key()); |
| 1991 | 1998 |
| 1992 return new(zone()) LStoreKeyedSpecializedArrayElement(external_pointer, | 1999 return new(zone()) LStoreKeyedSpecializedArrayElement(external_pointer, |
| 1993 key, | 2000 key, |
| 1994 val); | 2001 val, |
| 2002 instr->index_offset()); |
| 1995 } | 2003 } |
| 1996 | 2004 |
| 1997 | 2005 |
| 1998 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 2006 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
| 1999 LOperand* object = UseFixed(instr->object(), rdx); | 2007 LOperand* object = UseFixed(instr->object(), rdx); |
| 2000 LOperand* key = UseFixed(instr->key(), rcx); | 2008 LOperand* key = UseFixed(instr->key(), rcx); |
| 2001 LOperand* value = UseFixed(instr->value(), rax); | 2009 LOperand* value = UseFixed(instr->value(), rax); |
| 2002 | 2010 |
| 2003 ASSERT(instr->object()->representation().IsTagged()); | 2011 ASSERT(instr->object()->representation().IsTagged()); |
| 2004 ASSERT(instr->key()->representation().IsTagged()); | 2012 ASSERT(instr->key()->representation().IsTagged()); |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2315 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2323 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2316 LOperand* object = UseRegister(instr->object()); | 2324 LOperand* object = UseRegister(instr->object()); |
| 2317 LOperand* index = UseTempRegister(instr->index()); | 2325 LOperand* index = UseTempRegister(instr->index()); |
| 2318 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2326 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2319 } | 2327 } |
| 2320 | 2328 |
| 2321 | 2329 |
| 2322 } } // namespace v8::internal | 2330 } } // namespace v8::internal |
| 2323 | 2331 |
| 2324 #endif // V8_TARGET_ARCH_X64 | 2332 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |