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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 V(IsUndetectableAndBranch) \ | 112 V(IsUndetectableAndBranch) \ |
113 V(JSArrayLength) \ | 113 V(JSArrayLength) \ |
114 V(Label) \ | 114 V(Label) \ |
115 V(LazyBailout) \ | 115 V(LazyBailout) \ |
116 V(LoadContextSlot) \ | 116 V(LoadContextSlot) \ |
117 V(LoadElements) \ | 117 V(LoadElements) \ |
118 V(LoadExternalArrayPointer) \ | 118 V(LoadExternalArrayPointer) \ |
119 V(LoadFunctionPrototype) \ | 119 V(LoadFunctionPrototype) \ |
120 V(LoadGlobalCell) \ | 120 V(LoadGlobalCell) \ |
121 V(LoadGlobalGeneric) \ | 121 V(LoadGlobalGeneric) \ |
122 V(LoadKeyedFastElement) \ | 122 V(LoadKeyed) \ |
123 V(LoadKeyedFastDoubleElement) \ | |
124 V(LoadKeyedGeneric) \ | 123 V(LoadKeyedGeneric) \ |
125 V(LoadKeyedSpecializedArrayElement) \ | |
126 V(LoadNamedField) \ | 124 V(LoadNamedField) \ |
127 V(LoadNamedFieldPolymorphic) \ | 125 V(LoadNamedFieldPolymorphic) \ |
128 V(LoadNamedGeneric) \ | 126 V(LoadNamedGeneric) \ |
129 V(MapEnumLength) \ | 127 V(MapEnumLength) \ |
130 V(MathFloorOfDiv) \ | 128 V(MathFloorOfDiv) \ |
131 V(MathMinMax) \ | 129 V(MathMinMax) \ |
132 V(MathPowHalf) \ | 130 V(MathPowHalf) \ |
133 V(ModI) \ | 131 V(ModI) \ |
134 V(MulI) \ | 132 V(MulI) \ |
135 V(NumberTagD) \ | 133 V(NumberTagD) \ |
136 V(NumberTagI) \ | 134 V(NumberTagI) \ |
137 V(NumberTagU) \ | 135 V(NumberTagU) \ |
138 V(NumberUntagD) \ | 136 V(NumberUntagD) \ |
139 V(ObjectLiteral) \ | 137 V(ObjectLiteral) \ |
140 V(OsrEntry) \ | 138 V(OsrEntry) \ |
141 V(OuterContext) \ | 139 V(OuterContext) \ |
142 V(Parameter) \ | 140 V(Parameter) \ |
143 V(Power) \ | 141 V(Power) \ |
144 V(Random) \ | 142 V(Random) \ |
145 V(PushArgument) \ | 143 V(PushArgument) \ |
146 V(RegExpLiteral) \ | 144 V(RegExpLiteral) \ |
147 V(Return) \ | 145 V(Return) \ |
148 V(ShiftI) \ | 146 V(ShiftI) \ |
149 V(SmiTag) \ | 147 V(SmiTag) \ |
150 V(SmiUntag) \ | 148 V(SmiUntag) \ |
151 V(StackCheck) \ | 149 V(StackCheck) \ |
152 V(StoreContextSlot) \ | 150 V(StoreContextSlot) \ |
153 V(StoreGlobalCell) \ | 151 V(StoreGlobalCell) \ |
154 V(StoreGlobalGeneric) \ | 152 V(StoreGlobalGeneric) \ |
155 V(StoreKeyedFastDoubleElement) \ | 153 V(StoreKeyed) \ |
156 V(StoreKeyedFastElement) \ | |
157 V(StoreKeyedGeneric) \ | 154 V(StoreKeyedGeneric) \ |
158 V(StoreKeyedSpecializedArrayElement) \ | |
159 V(StoreNamedField) \ | 155 V(StoreNamedField) \ |
160 V(StoreNamedGeneric) \ | 156 V(StoreNamedGeneric) \ |
161 V(StringAdd) \ | 157 V(StringAdd) \ |
162 V(StringCharCodeAt) \ | 158 V(StringCharCodeAt) \ |
163 V(StringCharFromCode) \ | 159 V(StringCharFromCode) \ |
164 V(StringCompareAndBranch) \ | 160 V(StringCompareAndBranch) \ |
165 V(StringLength) \ | 161 V(StringLength) \ |
166 V(SubI) \ | 162 V(SubI) \ |
167 V(TaggedToI) \ | 163 V(TaggedToI) \ |
168 V(ThisFunction) \ | 164 V(ThisFunction) \ |
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 inputs_[0] = object; | 1378 inputs_[0] = object; |
1383 } | 1379 } |
1384 | 1380 |
1385 LOperand* object() { return inputs_[0]; } | 1381 LOperand* object() { return inputs_[0]; } |
1386 | 1382 |
1387 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, | 1383 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, |
1388 "load-external-array-pointer") | 1384 "load-external-array-pointer") |
1389 }; | 1385 }; |
1390 | 1386 |
1391 | 1387 |
1392 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> { | 1388 class LLoadKeyed: public LTemplateInstruction<1, 2, 0> { |
1393 public: | 1389 public: |
1394 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { | 1390 LLoadKeyed(LOperand* elements, LOperand* key) { |
1395 inputs_[0] = elements; | 1391 inputs_[0] = elements; |
1396 inputs_[1] = key; | 1392 inputs_[1] = key; |
1397 } | 1393 } |
1398 | 1394 |
1399 LOperand* elements() { return inputs_[0]; } | 1395 LOperand* elements() { |
| 1396 ASSERT(!is_external()); |
| 1397 return inputs_[0]; |
| 1398 } |
| 1399 LOperand* external_pointer() { |
| 1400 ASSERT(is_external()); |
| 1401 return inputs_[0]; |
| 1402 } |
1400 LOperand* key() { return inputs_[1]; } | 1403 LOperand* key() { return inputs_[1]; } |
| 1404 ElementsKind elements_kind() const { |
| 1405 return hydrogen()->elements_kind(); |
| 1406 } |
| 1407 bool is_external() const { |
| 1408 return hydrogen()->is_external(); |
| 1409 } |
1401 | 1410 |
1402 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") | 1411 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
1403 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) | 1412 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
1404 | 1413 |
1405 uint32_t additional_index() const { return hydrogen()->index_offset(); } | 1414 uint32_t additional_index() const { return hydrogen()->index_offset(); } |
1406 }; | 1415 }; |
1407 | |
1408 | |
1409 class LLoadKeyedFastDoubleElement: public LTemplateInstruction<1, 2, 0> { | |
1410 public: | |
1411 LLoadKeyedFastDoubleElement(LOperand* elements, LOperand* key) { | |
1412 inputs_[0] = elements; | |
1413 inputs_[1] = key; | |
1414 } | |
1415 | |
1416 LOperand* elements() { return inputs_[0]; } | |
1417 LOperand* key() { return inputs_[1]; } | |
1418 | |
1419 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement, | |
1420 "load-keyed-fast-double-element") | |
1421 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastDoubleElement) | |
1422 | |
1423 uint32_t additional_index() const { return hydrogen()->index_offset(); } | |
1424 }; | |
1425 | 1416 |
1426 | 1417 |
1427 inline static bool ExternalArrayOpRequiresTemp( | 1418 inline static bool ExternalArrayOpRequiresTemp( |
1428 Representation key_representation, | 1419 Representation key_representation, |
1429 ElementsKind elements_kind) { | 1420 ElementsKind elements_kind) { |
1430 // Operations that require the key to be divided by two to be converted into | 1421 // Operations that require the key to be divided by two to be converted into |
1431 // an index cannot fold the scale operation into a load and need an extra | 1422 // an index cannot fold the scale operation into a load and need an extra |
1432 // temp register to do the work. | 1423 // temp register to do the work. |
1433 return key_representation.IsTagged() && | 1424 return key_representation.IsTagged() && |
1434 (elements_kind == EXTERNAL_BYTE_ELEMENTS || | 1425 (elements_kind == EXTERNAL_BYTE_ELEMENTS || |
1435 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || | 1426 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || |
1436 elements_kind == EXTERNAL_PIXEL_ELEMENTS); | 1427 elements_kind == EXTERNAL_PIXEL_ELEMENTS); |
1437 } | 1428 } |
1438 | 1429 |
1439 | 1430 |
1440 class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> { | |
1441 public: | |
1442 LLoadKeyedSpecializedArrayElement(LOperand* external_pointer, LOperand* key) { | |
1443 inputs_[0] = external_pointer; | |
1444 inputs_[1] = key; | |
1445 } | |
1446 | |
1447 LOperand* external_pointer() { return inputs_[0]; } | |
1448 LOperand* key() { return inputs_[1]; } | |
1449 | |
1450 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement, | |
1451 "load-keyed-specialized-array-element") | |
1452 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement) | |
1453 | |
1454 ElementsKind elements_kind() const { | |
1455 return hydrogen()->elements_kind(); | |
1456 } | |
1457 uint32_t additional_index() const { return hydrogen()->index_offset(); } | |
1458 }; | |
1459 | |
1460 | |
1461 class LLoadKeyedGeneric: public LTemplateInstruction<1, 3, 0> { | 1431 class LLoadKeyedGeneric: public LTemplateInstruction<1, 3, 0> { |
1462 public: | 1432 public: |
1463 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { | 1433 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { |
1464 inputs_[0] = context; | 1434 inputs_[0] = context; |
1465 inputs_[1] = obj; | 1435 inputs_[1] = obj; |
1466 inputs_[2] = key; | 1436 inputs_[2] = key; |
1467 } | 1437 } |
1468 | 1438 |
1469 LOperand* context() { return inputs_[0]; } | 1439 LOperand* context() { return inputs_[0]; } |
1470 LOperand* object() { return inputs_[1]; } | 1440 LOperand* object() { return inputs_[1]; } |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1999 | 1969 |
2000 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") | 1970 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") |
2001 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) | 1971 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) |
2002 | 1972 |
2003 virtual void PrintDataTo(StringStream* stream); | 1973 virtual void PrintDataTo(StringStream* stream); |
2004 Handle<Object> name() const { return hydrogen()->name(); } | 1974 Handle<Object> name() const { return hydrogen()->name(); } |
2005 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } | 1975 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } |
2006 }; | 1976 }; |
2007 | 1977 |
2008 | 1978 |
2009 class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> { | 1979 class LStoreKeyed: public LTemplateInstruction<0, 3, 0> { |
2010 public: | 1980 public: |
2011 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) { | 1981 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { |
2012 inputs_[0] = obj; | 1982 inputs_[0] = obj; |
2013 inputs_[1] = key; | 1983 inputs_[1] = key; |
2014 inputs_[2] = val; | 1984 inputs_[2] = val; |
2015 } | 1985 } |
2016 | 1986 |
2017 LOperand* object() { return inputs_[0]; } | 1987 bool is_external() const { return hydrogen()->is_external(); } |
| 1988 LOperand* object() { |
| 1989 ASSERT(!is_external()); |
| 1990 return inputs_[0]; |
| 1991 } |
| 1992 LOperand* external_pointer() { |
| 1993 ASSERT(is_external()); |
| 1994 return inputs_[0]; |
| 1995 } |
2018 LOperand* key() { return inputs_[1]; } | 1996 LOperand* key() { return inputs_[1]; } |
2019 LOperand* value() { return inputs_[2]; } | 1997 LOperand* value() { return inputs_[2]; } |
| 1998 ElementsKind elements_kind() const { |
| 1999 return hydrogen()->elements_kind(); |
| 2000 } |
2020 | 2001 |
2021 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, | 2002 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
2022 "store-keyed-fast-element") | 2003 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
2023 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement) | |
2024 | 2004 |
2025 virtual void PrintDataTo(StringStream* stream); | 2005 virtual void PrintDataTo(StringStream* stream); |
2026 uint32_t additional_index() const { return hydrogen()->index_offset(); } | 2006 uint32_t additional_index() const { return hydrogen()->index_offset(); } |
2027 }; | |
2028 | |
2029 | |
2030 class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> { | |
2031 public: | |
2032 LStoreKeyedFastDoubleElement(LOperand* elements, | |
2033 LOperand* key, | |
2034 LOperand* val) { | |
2035 inputs_[0] = elements; | |
2036 inputs_[1] = key; | |
2037 inputs_[2] = val; | |
2038 } | |
2039 | |
2040 LOperand* elements() { return inputs_[0]; } | |
2041 LOperand* key() { return inputs_[1]; } | |
2042 LOperand* value() { return inputs_[2]; } | |
2043 | |
2044 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement, | |
2045 "store-keyed-fast-double-element") | |
2046 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastDoubleElement) | |
2047 | |
2048 virtual void PrintDataTo(StringStream* stream); | |
2049 | |
2050 uint32_t additional_index() const { return hydrogen()->index_offset(); } | |
2051 | |
2052 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } | 2007 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } |
2053 }; | 2008 }; |
2054 | 2009 |
2055 | 2010 |
2056 class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> { | |
2057 public: | |
2058 LStoreKeyedSpecializedArrayElement(LOperand* external_pointer, | |
2059 LOperand* key, | |
2060 LOperand* val) { | |
2061 inputs_[0] = external_pointer; | |
2062 inputs_[1] = key; | |
2063 inputs_[2] = val; | |
2064 } | |
2065 | |
2066 LOperand* external_pointer() { return inputs_[0]; } | |
2067 LOperand* key() { return inputs_[1]; } | |
2068 LOperand* value() { return inputs_[2]; } | |
2069 | |
2070 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement, | |
2071 "store-keyed-specialized-array-element") | |
2072 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement) | |
2073 | |
2074 ElementsKind elements_kind() const { | |
2075 return hydrogen()->elements_kind(); | |
2076 } | |
2077 uint32_t additional_index() const { return hydrogen()->index_offset(); } | |
2078 }; | |
2079 | |
2080 | |
2081 class LStoreKeyedGeneric: public LTemplateInstruction<0, 4, 0> { | 2011 class LStoreKeyedGeneric: public LTemplateInstruction<0, 4, 0> { |
2082 public: | 2012 public: |
2083 LStoreKeyedGeneric(LOperand* context, | 2013 LStoreKeyedGeneric(LOperand* context, |
2084 LOperand* object, | 2014 LOperand* object, |
2085 LOperand* key, | 2015 LOperand* key, |
2086 LOperand* value) { | 2016 LOperand* value) { |
2087 inputs_[0] = context; | 2017 inputs_[0] = context; |
2088 inputs_[1] = object; | 2018 inputs_[1] = object; |
2089 inputs_[2] = key; | 2019 inputs_[2] = key; |
2090 inputs_[3] = value; | 2020 inputs_[3] = value; |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2739 | 2669 |
2740 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2670 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2741 }; | 2671 }; |
2742 | 2672 |
2743 #undef DECLARE_HYDROGEN_ACCESSOR | 2673 #undef DECLARE_HYDROGEN_ACCESSOR |
2744 #undef DECLARE_CONCRETE_INSTRUCTION | 2674 #undef DECLARE_CONCRETE_INSTRUCTION |
2745 | 2675 |
2746 } } // namespace v8::internal | 2676 } } // namespace v8::internal |
2747 | 2677 |
2748 #endif // V8_IA32_LITHIUM_IA32_H_ | 2678 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |