Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: src/ia32/lithium-ia32.h

Issue 11238016: Consolidated all the key store/load classes in the Hydrogen and Lithium (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Last batch of comment response, formatting issues. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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() { return inputs_[0]; }
1400 LOperand* key() { return inputs_[1]; } 1396 LOperand* key() { return inputs_[1]; }
1397 ElementsKind elements_kind() const {
1398 return hydrogen()->elements_kind();
1399 }
1400 bool is_external() const {
1401 return hydrogen()->is_external();
1402 }
1401 1403
1402 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") 1404 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
1403 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) 1405 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
1404 1406
1405 uint32_t additional_index() const { return hydrogen()->index_offset(); } 1407 uint32_t additional_index() const { return hydrogen()->index_offset(); }
1406 }; 1408 };
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 1409
1426 1410
1427 inline static bool ExternalArrayOpRequiresTemp( 1411 inline static bool ExternalArrayOpRequiresTemp(
1428 Representation key_representation, 1412 Representation key_representation,
1429 ElementsKind elements_kind) { 1413 ElementsKind elements_kind) {
1430 // Operations that require the key to be divided by two to be converted into 1414 // 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 1415 // an index cannot fold the scale operation into a load and need an extra
1432 // temp register to do the work. 1416 // temp register to do the work.
1433 return key_representation.IsTagged() && 1417 return key_representation.IsTagged() &&
1434 (elements_kind == EXTERNAL_BYTE_ELEMENTS || 1418 (elements_kind == EXTERNAL_BYTE_ELEMENTS ||
1435 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || 1419 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS ||
1436 elements_kind == EXTERNAL_PIXEL_ELEMENTS); 1420 elements_kind == EXTERNAL_PIXEL_ELEMENTS);
1437 } 1421 }
1438 1422
1439 1423
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> { 1424 class LLoadKeyedGeneric: public LTemplateInstruction<1, 3, 0> {
1462 public: 1425 public:
1463 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { 1426 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) {
1464 inputs_[0] = context; 1427 inputs_[0] = context;
1465 inputs_[1] = obj; 1428 inputs_[1] = obj;
1466 inputs_[2] = key; 1429 inputs_[2] = key;
1467 } 1430 }
1468 1431
1469 LOperand* context() { return inputs_[0]; } 1432 LOperand* context() { return inputs_[0]; }
1470 LOperand* object() { return inputs_[1]; } 1433 LOperand* object() { return inputs_[1]; }
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 1962
2000 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") 1963 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
2001 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) 1964 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
2002 1965
2003 virtual void PrintDataTo(StringStream* stream); 1966 virtual void PrintDataTo(StringStream* stream);
2004 Handle<Object> name() const { return hydrogen()->name(); } 1967 Handle<Object> name() const { return hydrogen()->name(); }
2005 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } 1968 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
2006 }; 1969 };
2007 1970
2008 1971
2009 class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> { 1972 class LStoreKeyed: public LTemplateInstruction<0, 3, 0> {
2010 public: 1973 public:
2011 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) { 1974 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) {
2012 inputs_[0] = obj; 1975 inputs_[0] = obj;
2013 inputs_[1] = key; 1976 inputs_[1] = key;
2014 inputs_[2] = val; 1977 inputs_[2] = val;
2015 } 1978 }
2016 1979
2017 LOperand* object() { return inputs_[0]; } 1980 bool is_external() const { return hydrogen()->is_external(); }
1981 LOperand* elements() { return inputs_[0]; }
2018 LOperand* key() { return inputs_[1]; } 1982 LOperand* key() { return inputs_[1]; }
2019 LOperand* value() { return inputs_[2]; } 1983 LOperand* value() { return inputs_[2]; }
1984 ElementsKind elements_kind() const {
1985 return hydrogen()->elements_kind();
1986 }
2020 1987
2021 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, 1988 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed")
2022 "store-keyed-fast-element") 1989 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
2023 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
2024 1990
2025 virtual void PrintDataTo(StringStream* stream); 1991 virtual void PrintDataTo(StringStream* stream);
2026 uint32_t additional_index() const { return hydrogen()->index_offset(); } 1992 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(); } 1993 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
2053 }; 1994 };
2054 1995
2055 1996
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> { 1997 class LStoreKeyedGeneric: public LTemplateInstruction<0, 4, 0> {
2082 public: 1998 public:
2083 LStoreKeyedGeneric(LOperand* context, 1999 LStoreKeyedGeneric(LOperand* context,
2084 LOperand* object, 2000 LOperand* object,
2085 LOperand* key, 2001 LOperand* key,
2086 LOperand* value) { 2002 LOperand* value) {
2087 inputs_[0] = context; 2003 inputs_[0] = context;
2088 inputs_[1] = object; 2004 inputs_[1] = object;
2089 inputs_[2] = key; 2005 inputs_[2] = key;
2090 inputs_[3] = value; 2006 inputs_[3] = value;
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
2739 2655
2740 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2656 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2741 }; 2657 };
2742 2658
2743 #undef DECLARE_HYDROGEN_ACCESSOR 2659 #undef DECLARE_HYDROGEN_ACCESSOR
2744 #undef DECLARE_CONCRETE_INSTRUCTION 2660 #undef DECLARE_CONCRETE_INSTRUCTION
2745 2661
2746 } } // namespace v8::internal 2662 } } // namespace v8::internal
2747 2663
2748 #endif // V8_IA32_LITHIUM_IA32_H_ 2664 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698