OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_X87_LITHIUM_X87_H_ | 5 #ifndef V8_X87_LITHIUM_X87_H_ |
6 #define V8_X87_LITHIUM_X87_H_ | 6 #define V8_X87_LITHIUM_X87_H_ |
7 | 7 |
8 #include "src/hydrogen.h" | 8 #include "src/hydrogen.h" |
9 #include "src/lithium.h" | 9 #include "src/lithium.h" |
10 #include "src/lithium-allocator.h" | 10 #include "src/lithium-allocator.h" |
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 public: | 1642 public: |
1643 LLoadKeyed(LOperand* elements, LOperand* key) { | 1643 LLoadKeyed(LOperand* elements, LOperand* key) { |
1644 inputs_[0] = elements; | 1644 inputs_[0] = elements; |
1645 inputs_[1] = key; | 1645 inputs_[1] = key; |
1646 } | 1646 } |
1647 LOperand* elements() { return inputs_[0]; } | 1647 LOperand* elements() { return inputs_[0]; } |
1648 LOperand* key() { return inputs_[1]; } | 1648 LOperand* key() { return inputs_[1]; } |
1649 ElementsKind elements_kind() const { | 1649 ElementsKind elements_kind() const { |
1650 return hydrogen()->elements_kind(); | 1650 return hydrogen()->elements_kind(); |
1651 } | 1651 } |
| 1652 bool is_external() const { |
| 1653 return hydrogen()->is_external(); |
| 1654 } |
1652 bool is_fixed_typed_array() const { | 1655 bool is_fixed_typed_array() const { |
1653 return hydrogen()->is_fixed_typed_array(); | 1656 return hydrogen()->is_fixed_typed_array(); |
1654 } | 1657 } |
| 1658 bool is_typed_elements() const { |
| 1659 return is_external() || is_fixed_typed_array(); |
| 1660 } |
1655 | 1661 |
1656 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1662 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
1657 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1663 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
1658 | 1664 |
1659 void PrintDataTo(StringStream* stream) override; | 1665 void PrintDataTo(StringStream* stream) override; |
1660 uint32_t base_offset() const { return hydrogen()->base_offset(); } | 1666 uint32_t base_offset() const { return hydrogen()->base_offset(); } |
1661 bool key_is_smi() { | 1667 bool key_is_smi() { |
1662 return hydrogen()->key()->representation().IsTagged(); | 1668 return hydrogen()->key()->representation().IsTagged(); |
1663 } | 1669 } |
1664 }; | 1670 }; |
1665 | 1671 |
1666 | 1672 |
1667 inline static bool ExternalArrayOpRequiresTemp( | 1673 inline static bool ExternalArrayOpRequiresTemp( |
1668 Representation key_representation, | 1674 Representation key_representation, |
1669 ElementsKind elements_kind) { | 1675 ElementsKind elements_kind) { |
1670 // Operations that require the key to be divided by two to be converted into | 1676 // Operations that require the key to be divided by two to be converted into |
1671 // an index cannot fold the scale operation into a load and need an extra | 1677 // an index cannot fold the scale operation into a load and need an extra |
1672 // temp register to do the work. | 1678 // temp register to do the work. |
1673 return key_representation.IsSmi() && | 1679 return key_representation.IsSmi() && |
1674 (elements_kind == UINT8_ELEMENTS || elements_kind == INT8_ELEMENTS || | 1680 (elements_kind == EXTERNAL_INT8_ELEMENTS || |
1675 elements_kind == UINT8_CLAMPED_ELEMENTS); | 1681 elements_kind == EXTERNAL_UINT8_ELEMENTS || |
| 1682 elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS || |
| 1683 elements_kind == UINT8_ELEMENTS || |
| 1684 elements_kind == INT8_ELEMENTS || |
| 1685 elements_kind == UINT8_CLAMPED_ELEMENTS); |
1676 } | 1686 } |
1677 | 1687 |
1678 | 1688 |
1679 class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> { | 1689 class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> { |
1680 public: | 1690 public: |
1681 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key, | 1691 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key, |
1682 LOperand* vector) { | 1692 LOperand* vector) { |
1683 inputs_[0] = context; | 1693 inputs_[0] = context; |
1684 inputs_[1] = obj; | 1694 inputs_[1] = obj; |
1685 inputs_[2] = key; | 1695 inputs_[2] = key; |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2246 | 2256 |
2247 | 2257 |
2248 class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> { | 2258 class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> { |
2249 public: | 2259 public: |
2250 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { | 2260 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { |
2251 inputs_[0] = obj; | 2261 inputs_[0] = obj; |
2252 inputs_[1] = key; | 2262 inputs_[1] = key; |
2253 inputs_[2] = val; | 2263 inputs_[2] = val; |
2254 } | 2264 } |
2255 | 2265 |
| 2266 bool is_external() const { return hydrogen()->is_external(); } |
2256 bool is_fixed_typed_array() const { | 2267 bool is_fixed_typed_array() const { |
2257 return hydrogen()->is_fixed_typed_array(); | 2268 return hydrogen()->is_fixed_typed_array(); |
2258 } | 2269 } |
| 2270 bool is_typed_elements() const { |
| 2271 return is_external() || is_fixed_typed_array(); |
| 2272 } |
2259 LOperand* elements() { return inputs_[0]; } | 2273 LOperand* elements() { return inputs_[0]; } |
2260 LOperand* key() { return inputs_[1]; } | 2274 LOperand* key() { return inputs_[1]; } |
2261 LOperand* value() { return inputs_[2]; } | 2275 LOperand* value() { return inputs_[2]; } |
2262 ElementsKind elements_kind() const { | 2276 ElementsKind elements_kind() const { |
2263 return hydrogen()->elements_kind(); | 2277 return hydrogen()->elements_kind(); |
2264 } | 2278 } |
2265 | 2279 |
2266 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") | 2280 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
2267 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2281 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
2268 | 2282 |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2930 | 2944 |
2931 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2945 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2932 }; | 2946 }; |
2933 | 2947 |
2934 #undef DECLARE_HYDROGEN_ACCESSOR | 2948 #undef DECLARE_HYDROGEN_ACCESSOR |
2935 #undef DECLARE_CONCRETE_INSTRUCTION | 2949 #undef DECLARE_CONCRETE_INSTRUCTION |
2936 | 2950 |
2937 } } // namespace v8::internal | 2951 } } // namespace v8::internal |
2938 | 2952 |
2939 #endif // V8_X87_LITHIUM_X87_H_ | 2953 #endif // V8_X87_LITHIUM_X87_H_ |
OLD | NEW |