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_X64_LITHIUM_X64_H_ | 5 #ifndef V8_X64_LITHIUM_X64_H_ |
6 #define V8_X64_LITHIUM_X64_H_ | 6 #define V8_X64_LITHIUM_X64_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 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1610 }; | 1610 }; |
1611 | 1611 |
1612 | 1612 |
1613 inline static bool ExternalArrayOpRequiresTemp( | 1613 inline static bool ExternalArrayOpRequiresTemp( |
1614 Representation key_representation, | 1614 Representation key_representation, |
1615 ElementsKind elements_kind) { | 1615 ElementsKind elements_kind) { |
1616 // Operations that require the key to be divided by two to be converted into | 1616 // Operations that require the key to be divided by two to be converted into |
1617 // an index cannot fold the scale operation into a load and need an extra | 1617 // an index cannot fold the scale operation into a load and need an extra |
1618 // temp register to do the work. | 1618 // temp register to do the work. |
1619 return SmiValuesAre31Bits() && key_representation.IsSmi() && | 1619 return SmiValuesAre31Bits() && key_representation.IsSmi() && |
1620 (elements_kind == EXTERNAL_INT8_ELEMENTS || | 1620 (elements_kind == UINT8_ELEMENTS || elements_kind == INT8_ELEMENTS || |
1621 elements_kind == EXTERNAL_UINT8_ELEMENTS || | 1621 elements_kind == UINT8_CLAMPED_ELEMENTS); |
1622 elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS || | |
1623 elements_kind == UINT8_ELEMENTS || | |
1624 elements_kind == INT8_ELEMENTS || | |
1625 elements_kind == UINT8_CLAMPED_ELEMENTS); | |
1626 } | 1622 } |
1627 | 1623 |
1628 | 1624 |
1629 class LLoadKeyed final : public LTemplateInstruction<1, 2, 0> { | 1625 class LLoadKeyed final : public LTemplateInstruction<1, 2, 0> { |
1630 public: | 1626 public: |
1631 LLoadKeyed(LOperand* elements, LOperand* key) { | 1627 LLoadKeyed(LOperand* elements, LOperand* key) { |
1632 inputs_[0] = elements; | 1628 inputs_[0] = elements; |
1633 inputs_[1] = key; | 1629 inputs_[1] = key; |
1634 } | 1630 } |
1635 | 1631 |
1636 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1632 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
1637 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1633 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
1638 | 1634 |
1639 bool is_external() const { | |
1640 return hydrogen()->is_external(); | |
1641 } | |
1642 bool is_fixed_typed_array() const { | 1635 bool is_fixed_typed_array() const { |
1643 return hydrogen()->is_fixed_typed_array(); | 1636 return hydrogen()->is_fixed_typed_array(); |
1644 } | 1637 } |
1645 bool is_typed_elements() const { | |
1646 return is_external() || is_fixed_typed_array(); | |
1647 } | |
1648 LOperand* elements() { return inputs_[0]; } | 1638 LOperand* elements() { return inputs_[0]; } |
1649 LOperand* key() { return inputs_[1]; } | 1639 LOperand* key() { return inputs_[1]; } |
1650 void PrintDataTo(StringStream* stream) override; | 1640 void PrintDataTo(StringStream* stream) override; |
1651 uint32_t base_offset() const { return hydrogen()->base_offset(); } | 1641 uint32_t base_offset() const { return hydrogen()->base_offset(); } |
1652 ElementsKind elements_kind() const { | 1642 ElementsKind elements_kind() const { |
1653 return hydrogen()->elements_kind(); | 1643 return hydrogen()->elements_kind(); |
1654 } | 1644 } |
1655 }; | 1645 }; |
1656 | 1646 |
1657 | 1647 |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 | 2218 |
2229 | 2219 |
2230 class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> { | 2220 class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> { |
2231 public: | 2221 public: |
2232 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) { | 2222 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) { |
2233 inputs_[0] = object; | 2223 inputs_[0] = object; |
2234 inputs_[1] = key; | 2224 inputs_[1] = key; |
2235 inputs_[2] = value; | 2225 inputs_[2] = value; |
2236 } | 2226 } |
2237 | 2227 |
2238 bool is_external() const { return hydrogen()->is_external(); } | |
2239 bool is_fixed_typed_array() const { | 2228 bool is_fixed_typed_array() const { |
2240 return hydrogen()->is_fixed_typed_array(); | 2229 return hydrogen()->is_fixed_typed_array(); |
2241 } | 2230 } |
2242 bool is_typed_elements() const { | |
2243 return is_external() || is_fixed_typed_array(); | |
2244 } | |
2245 LOperand* elements() { return inputs_[0]; } | 2231 LOperand* elements() { return inputs_[0]; } |
2246 LOperand* key() { return inputs_[1]; } | 2232 LOperand* key() { return inputs_[1]; } |
2247 LOperand* value() { return inputs_[2]; } | 2233 LOperand* value() { return inputs_[2]; } |
2248 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } | 2234 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } |
2249 | 2235 |
2250 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") | 2236 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
2251 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2237 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
2252 | 2238 |
2253 void PrintDataTo(StringStream* stream) override; | 2239 void PrintDataTo(StringStream* stream) override; |
2254 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } | 2240 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2915 | 2901 |
2916 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2902 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2917 }; | 2903 }; |
2918 | 2904 |
2919 #undef DECLARE_HYDROGEN_ACCESSOR | 2905 #undef DECLARE_HYDROGEN_ACCESSOR |
2920 #undef DECLARE_CONCRETE_INSTRUCTION | 2906 #undef DECLARE_CONCRETE_INSTRUCTION |
2921 | 2907 |
2922 } } // namespace v8::int | 2908 } } // namespace v8::int |
2923 | 2909 |
2924 #endif // V8_X64_LITHIUM_X64_H_ | 2910 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |