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