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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 V(ClassOfTest) \ | 119 V(ClassOfTest) \ |
120 V(LeaveInlined) \ | 120 V(LeaveInlined) \ |
121 V(LoadContextSlot) \ | 121 V(LoadContextSlot) \ |
122 V(LoadElements) \ | 122 V(LoadElements) \ |
123 V(LoadFunctionPrototype) \ | 123 V(LoadFunctionPrototype) \ |
124 V(LoadGlobal) \ | 124 V(LoadGlobal) \ |
125 V(LoadKeyedFastElement) \ | 125 V(LoadKeyedFastElement) \ |
126 V(LoadKeyedGeneric) \ | 126 V(LoadKeyedGeneric) \ |
127 V(LoadNamedField) \ | 127 V(LoadNamedField) \ |
128 V(LoadNamedGeneric) \ | 128 V(LoadNamedGeneric) \ |
129 V(LoadPixelArrayElement) \ | |
130 V(LoadPixelArrayExternalPointer) \ | |
129 V(Mod) \ | 131 V(Mod) \ |
130 V(Mul) \ | 132 V(Mul) \ |
131 V(ObjectLiteral) \ | 133 V(ObjectLiteral) \ |
132 V(OsrEntry) \ | 134 V(OsrEntry) \ |
133 V(OuterContext) \ | 135 V(OuterContext) \ |
134 V(Parameter) \ | 136 V(Parameter) \ |
137 V(PixelArrayLength) \ | |
135 V(Power) \ | 138 V(Power) \ |
136 V(PushArgument) \ | 139 V(PushArgument) \ |
137 V(RegExpLiteral) \ | 140 V(RegExpLiteral) \ |
138 V(Return) \ | 141 V(Return) \ |
139 V(Sar) \ | 142 V(Sar) \ |
140 V(Shl) \ | 143 V(Shl) \ |
141 V(Shr) \ | 144 V(Shr) \ |
142 V(Simulate) \ | 145 V(Simulate) \ |
143 V(StackCheck) \ | 146 V(StackCheck) \ |
144 V(StoreContextSlot) \ | 147 V(StoreContextSlot) \ |
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1326 return Representation::Tagged(); | 1329 return Representation::Tagged(); |
1327 } | 1330 } |
1328 | 1331 |
1329 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed_array_length") | 1332 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed_array_length") |
1330 | 1333 |
1331 protected: | 1334 protected: |
1332 virtual bool DataEquals(HValue* other) const { return true; } | 1335 virtual bool DataEquals(HValue* other) const { return true; } |
1333 }; | 1336 }; |
1334 | 1337 |
1335 | 1338 |
1339 class HPixelArrayLength: public HUnaryOperation { | |
1340 public: | |
1341 explicit HPixelArrayLength(HValue* value) : HUnaryOperation(value) { | |
1342 set_representation(Representation::Integer32()); | |
1343 SetFlag(kDependsOnArrayLengths); | |
Mads Ager (chromium)
2011/02/07 11:36:06
Can you ever change the length of a pixel array? I
danno
2011/02/08 09:25:57
Done.
| |
1344 SetFlag(kUseGVN); | |
1345 } | |
1346 | |
1347 virtual Representation RequiredInputRepresentation(int index) const { | |
1348 return Representation::Tagged(); | |
1349 } | |
1350 | |
1351 DECLARE_CONCRETE_INSTRUCTION(PixelArrayLength, "pixel_array_length") | |
1352 | |
1353 protected: | |
1354 virtual bool DataEquals(HValue* other) const { return true; } | |
1355 }; | |
1356 | |
1357 | |
1336 class HBitNot: public HUnaryOperation { | 1358 class HBitNot: public HUnaryOperation { |
1337 public: | 1359 public: |
1338 explicit HBitNot(HValue* value) : HUnaryOperation(value) { | 1360 explicit HBitNot(HValue* value) : HUnaryOperation(value) { |
1339 set_representation(Representation::Integer32()); | 1361 set_representation(Representation::Integer32()); |
1340 SetFlag(kUseGVN); | 1362 SetFlag(kUseGVN); |
1341 SetFlag(kTruncatingToInt32); | 1363 SetFlag(kTruncatingToInt32); |
1342 } | 1364 } |
1343 | 1365 |
1344 virtual Representation RequiredInputRepresentation(int index) const { | 1366 virtual Representation RequiredInputRepresentation(int index) const { |
1345 return Representation::Integer32(); | 1367 return Representation::Integer32(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1444 return Representation::Tagged(); | 1466 return Representation::Tagged(); |
1445 } | 1467 } |
1446 | 1468 |
1447 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") | 1469 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") |
1448 | 1470 |
1449 protected: | 1471 protected: |
1450 virtual bool DataEquals(HValue* other) const { return true; } | 1472 virtual bool DataEquals(HValue* other) const { return true; } |
1451 }; | 1473 }; |
1452 | 1474 |
1453 | 1475 |
1476 class HLoadPixelArrayExternalPointer: public HUnaryOperation { | |
1477 public: | |
1478 explicit HLoadPixelArrayExternalPointer(HValue* value) | |
1479 : HUnaryOperation(value) { | |
1480 set_representation(Representation::Tagged()); | |
danno
2011/02/07 09:47:27
This isn't right: This pointer isn't tagged, it's
Mads Ager (chromium)
2011/02/07 11:36:06
Doesn't this have to depend on something? You shou
Mads Ager (chromium)
2011/02/07 11:36:06
I don't think we have raw C++ pointers in the syst
Kevin Millikin (Chromium)
2011/02/07 12:39:08
This is almost right. We have a raw pointer to an
danno
2011/02/08 09:25:57
I don't think this needs to depend on anything. It
danno
2011/02/08 09:25:57
After discussion with Kevin, I implemented 2)
On
| |
1481 SetFlag(kUseGVN); | |
1482 } | |
1483 | |
1484 virtual Representation RequiredInputRepresentation(int index) const { | |
1485 return Representation::Tagged(); | |
1486 } | |
1487 | |
1488 DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayExternalPointer, | |
1489 "load-pixel-array-external-pointer") | |
1490 | |
1491 protected: | |
1492 virtual bool DataEquals(HValue* other) const { return true; } | |
1493 }; | |
1494 | |
1495 | |
1454 class HCheckMap: public HUnaryOperation { | 1496 class HCheckMap: public HUnaryOperation { |
1455 public: | 1497 public: |
1456 HCheckMap(HValue* value, Handle<Map> map) | 1498 HCheckMap(HValue* value, Handle<Map> map) |
1457 : HUnaryOperation(value), map_(map) { | 1499 : HUnaryOperation(value), map_(map) { |
1458 set_representation(Representation::Tagged()); | 1500 set_representation(Representation::Tagged()); |
1459 SetFlag(kUseGVN); | 1501 SetFlag(kUseGVN); |
1460 SetFlag(kDependsOnMaps); | 1502 SetFlag(kDependsOnMaps); |
1461 } | 1503 } |
1462 | 1504 |
1463 virtual bool IsCheckInstruction() const { return true; } | 1505 virtual bool IsCheckInstruction() const { return true; } |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2822 } | 2864 } |
2823 | 2865 |
2824 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, | 2866 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, |
2825 "load_keyed_fast_element") | 2867 "load_keyed_fast_element") |
2826 | 2868 |
2827 protected: | 2869 protected: |
2828 virtual bool DataEquals(HValue* other) const { return true; } | 2870 virtual bool DataEquals(HValue* other) const { return true; } |
2829 }; | 2871 }; |
2830 | 2872 |
2831 | 2873 |
2874 class HLoadPixelArrayElement: public HBinaryOperation { | |
2875 public: | |
2876 HLoadPixelArrayElement(HValue* external_elements, HValue* key) | |
2877 : HBinaryOperation(external_elements, key) { | |
2878 set_representation(Representation::Integer32()); | |
2879 } | |
2880 | |
2881 virtual void PrintDataTo(StringStream* stream) const; | |
2882 | |
2883 virtual Representation RequiredInputRepresentation(int index) const { | |
2884 // The key is supposed to be Integer32, but the base pointer | |
2885 // for the element load is a naked pointer. | |
2886 return (index == 1) ? Representation::Integer32() | |
2887 : Representation::None(); | |
danno
2011/02/07 09:47:27
None() isn't consistent with HLoadPixelArrayExtern
Mads Ager (chromium)
2011/02/07 11:36:06
Here it is a requirement and therefore None tells
danno
2011/02/08 09:25:57
Done.
| |
2888 } | |
2889 | |
2890 HValue* external_pointer() const { return OperandAt(0); } | |
2891 HValue* key() const { return OperandAt(1); } | |
2892 | |
2893 DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayElement, | |
2894 "load_pixel_array_element") | |
2895 | |
2896 protected: | |
2897 virtual bool DataEquals(HValue* other) const { return true; } | |
Mads Ager (chromium)
2011/02/07 11:36:06
Since you are not using GVN you should not impleme
Kevin Millikin (Chromium)
2011/02/07 12:39:08
I think it's safe to use GVN for this. Right now,
danno
2011/02/08 09:25:57
Whoops. Forgot the kUseGVN. These should be GVNed.
danno
2011/02/08 09:25:57
I added a flag kDependsOnPixelArrayElements. Later
| |
2898 }; | |
2899 | |
2900 | |
2832 class HLoadKeyedGeneric: public HLoadKeyed { | 2901 class HLoadKeyedGeneric: public HLoadKeyed { |
2833 public: | 2902 public: |
2834 HLoadKeyedGeneric(HValue* obj, HValue* key) : HLoadKeyed(obj, key) { | 2903 HLoadKeyedGeneric(HValue* obj, HValue* key) : HLoadKeyed(obj, key) { |
2835 SetAllSideEffects(); | 2904 SetAllSideEffects(); |
2836 } | 2905 } |
2837 | 2906 |
2838 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load_keyed_generic") | 2907 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load_keyed_generic") |
2839 }; | 2908 }; |
2840 | 2909 |
2841 | 2910 |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3177 HValue* object() const { return left(); } | 3246 HValue* object() const { return left(); } |
3178 HValue* key() const { return right(); } | 3247 HValue* key() const { return right(); } |
3179 }; | 3248 }; |
3180 | 3249 |
3181 #undef DECLARE_INSTRUCTION | 3250 #undef DECLARE_INSTRUCTION |
3182 #undef DECLARE_CONCRETE_INSTRUCTION | 3251 #undef DECLARE_CONCRETE_INSTRUCTION |
3183 | 3252 |
3184 } } // namespace v8::internal | 3253 } } // namespace v8::internal |
3185 | 3254 |
3186 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3255 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |