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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 public: | 865 public: |
866 LBoundsCheck(LOperand* index, LOperand* length) { | 866 LBoundsCheck(LOperand* index, LOperand* length) { |
867 inputs_[0] = index; | 867 inputs_[0] = index; |
868 inputs_[1] = length; | 868 inputs_[1] = length; |
869 } | 869 } |
870 | 870 |
871 LOperand* index() { return inputs_[0]; } | 871 LOperand* index() { return inputs_[0]; } |
872 LOperand* length() { return inputs_[1]; } | 872 LOperand* length() { return inputs_[1]; } |
873 | 873 |
874 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") | 874 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") |
| 875 DECLARE_HYDROGEN_ACCESSOR(BoundsCheck) |
875 }; | 876 }; |
876 | 877 |
877 | 878 |
878 class LBitI: public LTemplateInstruction<1, 2, 0> { | 879 class LBitI: public LTemplateInstruction<1, 2, 0> { |
879 public: | 880 public: |
880 LBitI(LOperand* left, LOperand* right) { | 881 LBitI(LOperand* left, LOperand* right) { |
881 inputs_[0] = left; | 882 inputs_[0] = left; |
882 inputs_[1] = right; | 883 inputs_[1] = right; |
883 } | 884 } |
884 | 885 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement, | 1271 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement, |
1271 "load-keyed-fast-double-element") | 1272 "load-keyed-fast-double-element") |
1272 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastDoubleElement) | 1273 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastDoubleElement) |
1273 | 1274 |
1274 LOperand* elements() { return inputs_[0]; } | 1275 LOperand* elements() { return inputs_[0]; } |
1275 LOperand* key() { return inputs_[1]; } | 1276 LOperand* key() { return inputs_[1]; } |
1276 uint32_t additional_index() const { return hydrogen()->index_offset(); } | 1277 uint32_t additional_index() const { return hydrogen()->index_offset(); } |
1277 }; | 1278 }; |
1278 | 1279 |
1279 | 1280 |
| 1281 inline static bool ExternalArrayOpRequiresTemp( |
| 1282 Representation key_representation, |
| 1283 ElementsKind elements_kind) { |
| 1284 // Operations that require the key to be divided by two to be converted into |
| 1285 // an index cannot fold the scale operation into a load and need an extra |
| 1286 // temp register to do the work. |
| 1287 return key_representation.IsTagged() && |
| 1288 (elements_kind == EXTERNAL_BYTE_ELEMENTS || |
| 1289 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || |
| 1290 elements_kind == EXTERNAL_PIXEL_ELEMENTS); |
| 1291 } |
| 1292 |
| 1293 |
1280 class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> { | 1294 class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> { |
1281 public: | 1295 public: |
1282 LLoadKeyedSpecializedArrayElement(LOperand* external_pointer, LOperand* key) { | 1296 LLoadKeyedSpecializedArrayElement(LOperand* external_pointer, LOperand* key) { |
1283 inputs_[0] = external_pointer; | 1297 inputs_[0] = external_pointer; |
1284 inputs_[1] = key; | 1298 inputs_[1] = key; |
1285 } | 1299 } |
1286 | 1300 |
1287 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement, | 1301 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement, |
1288 "load-keyed-specialized-array-element") | 1302 "load-keyed-specialized-array-element") |
1289 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement) | 1303 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement) |
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2491 | 2505 |
2492 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2506 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2493 }; | 2507 }; |
2494 | 2508 |
2495 #undef DECLARE_HYDROGEN_ACCESSOR | 2509 #undef DECLARE_HYDROGEN_ACCESSOR |
2496 #undef DECLARE_CONCRETE_INSTRUCTION | 2510 #undef DECLARE_CONCRETE_INSTRUCTION |
2497 | 2511 |
2498 } } // namespace v8::internal | 2512 } } // namespace v8::internal |
2499 | 2513 |
2500 #endif // V8_IA32_LITHIUM_IA32_H_ | 2514 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |