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 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); | 1949 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); |
1950 } | 1950 } |
1951 | 1951 |
1952 | 1952 |
1953 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( | 1953 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( |
1954 HLoadKeyedFastElement* instr) { | 1954 HLoadKeyedFastElement* instr) { |
1955 ASSERT(instr->representation().IsTagged()); | 1955 ASSERT(instr->representation().IsTagged()); |
1956 ASSERT(instr->key()->representation().IsInteger32()); | 1956 ASSERT(instr->key()->representation().IsInteger32()); |
1957 LOperand* obj = UseRegisterAtStart(instr->object()); | 1957 LOperand* obj = UseRegisterAtStart(instr->object()); |
1958 LOperand* key = UseRegisterAtStart(instr->key()); | 1958 LOperand* key = UseRegisterAtStart(instr->key()); |
1959 LLoadKeyedFastElement* result = new(zone()) LLoadKeyedFastElement(obj, key); | 1959 LLoadKeyedFastElement* result = |
| 1960 new(zone()) LLoadKeyedFastElement(obj, |
| 1961 key, |
| 1962 instr->index_offset()); |
1960 if (instr->RequiresHoleCheck()) AssignEnvironment(result); | 1963 if (instr->RequiresHoleCheck()) AssignEnvironment(result); |
1961 return DefineAsRegister(result); | 1964 return DefineAsRegister(result); |
1962 } | 1965 } |
1963 | 1966 |
1964 | 1967 |
1965 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( | 1968 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( |
1966 HLoadKeyedFastDoubleElement* instr) { | 1969 HLoadKeyedFastDoubleElement* instr) { |
1967 ASSERT(instr->representation().IsDouble()); | 1970 ASSERT(instr->representation().IsDouble()); |
1968 ASSERT(instr->key()->representation().IsInteger32()); | 1971 ASSERT(instr->key()->representation().IsInteger32()); |
1969 LOperand* elements = UseTempRegister(instr->elements()); | 1972 LOperand* elements = UseTempRegister(instr->elements()); |
1970 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 1973 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
1971 LLoadKeyedFastDoubleElement* result = | 1974 LLoadKeyedFastDoubleElement* result = |
1972 new(zone()) LLoadKeyedFastDoubleElement(elements, key); | 1975 new(zone()) LLoadKeyedFastDoubleElement(elements, |
| 1976 key, |
| 1977 instr->index_offset()); |
1973 return AssignEnvironment(DefineAsRegister(result)); | 1978 return AssignEnvironment(DefineAsRegister(result)); |
1974 } | 1979 } |
1975 | 1980 |
1976 | 1981 |
1977 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( | 1982 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( |
1978 HLoadKeyedSpecializedArrayElement* instr) { | 1983 HLoadKeyedSpecializedArrayElement* instr) { |
1979 ElementsKind elements_kind = instr->elements_kind(); | 1984 ElementsKind elements_kind = instr->elements_kind(); |
1980 ASSERT( | 1985 ASSERT( |
1981 (instr->representation().IsInteger32() && | 1986 (instr->representation().IsInteger32() && |
1982 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && | 1987 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
1983 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || | 1988 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
1984 (instr->representation().IsDouble() && | 1989 (instr->representation().IsDouble() && |
1985 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || | 1990 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
1986 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); | 1991 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
1987 ASSERT(instr->key()->representation().IsInteger32()); | 1992 ASSERT(instr->key()->representation().IsInteger32()); |
1988 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1993 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
1989 LOperand* key = UseRegisterOrConstant(instr->key()); | 1994 LOperand* key = UseRegisterOrConstant(instr->key()); |
1990 LLoadKeyedSpecializedArrayElement* result = | 1995 LLoadKeyedSpecializedArrayElement* result = |
1991 new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, key); | 1996 new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, |
| 1997 key, |
| 1998 instr->index_offset()); |
1992 LInstruction* load_instr = DefineAsRegister(result); | 1999 LInstruction* load_instr = DefineAsRegister(result); |
1993 // An unsigned int array load might overflow and cause a deopt, make sure it | 2000 // An unsigned int array load might overflow and cause a deopt, make sure it |
1994 // has an environment. | 2001 // has an environment. |
1995 return (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) ? | 2002 return (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) ? |
1996 AssignEnvironment(load_instr) : load_instr; | 2003 AssignEnvironment(load_instr) : load_instr; |
1997 } | 2004 } |
1998 | 2005 |
1999 | 2006 |
2000 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 2007 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
2001 LOperand* object = UseFixed(instr->object(), r1); | 2008 LOperand* object = UseFixed(instr->object(), r1); |
(...skipping 12 matching lines...) Expand all Loading... |
2014 ASSERT(instr->object()->representation().IsTagged()); | 2021 ASSERT(instr->object()->representation().IsTagged()); |
2015 ASSERT(instr->key()->representation().IsInteger32()); | 2022 ASSERT(instr->key()->representation().IsInteger32()); |
2016 | 2023 |
2017 LOperand* obj = UseTempRegister(instr->object()); | 2024 LOperand* obj = UseTempRegister(instr->object()); |
2018 LOperand* val = needs_write_barrier | 2025 LOperand* val = needs_write_barrier |
2019 ? UseTempRegister(instr->value()) | 2026 ? UseTempRegister(instr->value()) |
2020 : UseRegisterAtStart(instr->value()); | 2027 : UseRegisterAtStart(instr->value()); |
2021 LOperand* key = needs_write_barrier | 2028 LOperand* key = needs_write_barrier |
2022 ? UseTempRegister(instr->key()) | 2029 ? UseTempRegister(instr->key()) |
2023 : UseRegisterOrConstantAtStart(instr->key()); | 2030 : UseRegisterOrConstantAtStart(instr->key()); |
2024 return new(zone()) LStoreKeyedFastElement(obj, key, val); | 2031 return new(zone()) LStoreKeyedFastElement(obj, |
| 2032 key, |
| 2033 val, |
| 2034 instr->index_offset()); |
2025 } | 2035 } |
2026 | 2036 |
2027 | 2037 |
2028 LInstruction* LChunkBuilder::DoStoreKeyedFastDoubleElement( | 2038 LInstruction* LChunkBuilder::DoStoreKeyedFastDoubleElement( |
2029 HStoreKeyedFastDoubleElement* instr) { | 2039 HStoreKeyedFastDoubleElement* instr) { |
2030 ASSERT(instr->value()->representation().IsDouble()); | 2040 ASSERT(instr->value()->representation().IsDouble()); |
2031 ASSERT(instr->elements()->representation().IsTagged()); | 2041 ASSERT(instr->elements()->representation().IsTagged()); |
2032 ASSERT(instr->key()->representation().IsInteger32()); | 2042 ASSERT(instr->key()->representation().IsInteger32()); |
2033 | 2043 |
2034 LOperand* elements = UseRegisterAtStart(instr->elements()); | 2044 LOperand* elements = UseRegisterAtStart(instr->elements()); |
2035 LOperand* val = UseTempRegister(instr->value()); | 2045 LOperand* val = UseTempRegister(instr->value()); |
2036 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2046 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
2037 | 2047 |
2038 return new(zone()) LStoreKeyedFastDoubleElement(elements, key, val); | 2048 return new(zone()) LStoreKeyedFastDoubleElement(elements, |
| 2049 key, |
| 2050 val, |
| 2051 instr->index_offset()); |
2039 } | 2052 } |
2040 | 2053 |
2041 | 2054 |
2042 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( | 2055 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
2043 HStoreKeyedSpecializedArrayElement* instr) { | 2056 HStoreKeyedSpecializedArrayElement* instr) { |
2044 ElementsKind elements_kind = instr->elements_kind(); | 2057 ElementsKind elements_kind = instr->elements_kind(); |
2045 ASSERT( | 2058 ASSERT( |
2046 (instr->value()->representation().IsInteger32() && | 2059 (instr->value()->representation().IsInteger32() && |
2047 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && | 2060 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
2048 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || | 2061 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
2049 (instr->value()->representation().IsDouble() && | 2062 (instr->value()->representation().IsDouble() && |
2050 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || | 2063 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
2051 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); | 2064 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
2052 ASSERT(instr->external_pointer()->representation().IsExternal()); | 2065 ASSERT(instr->external_pointer()->representation().IsExternal()); |
2053 ASSERT(instr->key()->representation().IsInteger32()); | 2066 ASSERT(instr->key()->representation().IsInteger32()); |
2054 | 2067 |
2055 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 2068 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
2056 bool val_is_temp_register = | 2069 bool val_is_temp_register = |
2057 elements_kind == EXTERNAL_PIXEL_ELEMENTS || | 2070 elements_kind == EXTERNAL_PIXEL_ELEMENTS || |
2058 elements_kind == EXTERNAL_FLOAT_ELEMENTS; | 2071 elements_kind == EXTERNAL_FLOAT_ELEMENTS; |
2059 LOperand* val = val_is_temp_register | 2072 LOperand* val = val_is_temp_register |
2060 ? UseTempRegister(instr->value()) | 2073 ? UseTempRegister(instr->value()) |
2061 : UseRegister(instr->value()); | 2074 : UseRegister(instr->value()); |
2062 LOperand* key = UseRegisterOrConstant(instr->key()); | 2075 LOperand* key = UseRegisterOrConstant(instr->key()); |
2063 | 2076 |
2064 return new(zone()) LStoreKeyedSpecializedArrayElement(external_pointer, | 2077 return new(zone()) LStoreKeyedSpecializedArrayElement(external_pointer, |
2065 key, | 2078 key, |
2066 val); | 2079 val, |
| 2080 instr->index_offset()); |
2067 } | 2081 } |
2068 | 2082 |
2069 | 2083 |
2070 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 2084 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
2071 LOperand* obj = UseFixed(instr->object(), r2); | 2085 LOperand* obj = UseFixed(instr->object(), r2); |
2072 LOperand* key = UseFixed(instr->key(), r1); | 2086 LOperand* key = UseFixed(instr->key(), r1); |
2073 LOperand* val = UseFixed(instr->value(), r0); | 2087 LOperand* val = UseFixed(instr->value(), r0); |
2074 | 2088 |
2075 ASSERT(instr->object()->representation().IsTagged()); | 2089 ASSERT(instr->object()->representation().IsTagged()); |
2076 ASSERT(instr->key()->representation().IsTagged()); | 2090 ASSERT(instr->key()->representation().IsTagged()); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 | 2391 |
2378 | 2392 |
2379 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2393 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2380 LOperand* object = UseRegister(instr->object()); | 2394 LOperand* object = UseRegister(instr->object()); |
2381 LOperand* index = UseRegister(instr->index()); | 2395 LOperand* index = UseRegister(instr->index()); |
2382 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2396 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2383 } | 2397 } |
2384 | 2398 |
2385 | 2399 |
2386 } } // namespace v8::internal | 2400 } } // namespace v8::internal |
OLD | NEW |