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 == UINT8_ELEMENTS || elements_kind == INT8_ELEMENTS || | 1620 (elements_kind == EXTERNAL_INT8_ELEMENTS || |
1621 elements_kind == UINT8_CLAMPED_ELEMENTS); | 1621 elements_kind == EXTERNAL_UINT8_ELEMENTS || |
| 1622 elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS || |
| 1623 elements_kind == UINT8_ELEMENTS || |
| 1624 elements_kind == INT8_ELEMENTS || |
| 1625 elements_kind == UINT8_CLAMPED_ELEMENTS); |
1622 } | 1626 } |
1623 | 1627 |
1624 | 1628 |
1625 class LLoadKeyed final : public LTemplateInstruction<1, 2, 0> { | 1629 class LLoadKeyed final : public LTemplateInstruction<1, 2, 0> { |
1626 public: | 1630 public: |
1627 LLoadKeyed(LOperand* elements, LOperand* key) { | 1631 LLoadKeyed(LOperand* elements, LOperand* key) { |
1628 inputs_[0] = elements; | 1632 inputs_[0] = elements; |
1629 inputs_[1] = key; | 1633 inputs_[1] = key; |
1630 } | 1634 } |
1631 | 1635 |
1632 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1636 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
1633 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1637 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
1634 | 1638 |
| 1639 bool is_external() const { |
| 1640 return hydrogen()->is_external(); |
| 1641 } |
1635 bool is_fixed_typed_array() const { | 1642 bool is_fixed_typed_array() const { |
1636 return hydrogen()->is_fixed_typed_array(); | 1643 return hydrogen()->is_fixed_typed_array(); |
1637 } | 1644 } |
| 1645 bool is_typed_elements() const { |
| 1646 return is_external() || is_fixed_typed_array(); |
| 1647 } |
1638 LOperand* elements() { return inputs_[0]; } | 1648 LOperand* elements() { return inputs_[0]; } |
1639 LOperand* key() { return inputs_[1]; } | 1649 LOperand* key() { return inputs_[1]; } |
1640 void PrintDataTo(StringStream* stream) override; | 1650 void PrintDataTo(StringStream* stream) override; |
1641 uint32_t base_offset() const { return hydrogen()->base_offset(); } | 1651 uint32_t base_offset() const { return hydrogen()->base_offset(); } |
1642 ElementsKind elements_kind() const { | 1652 ElementsKind elements_kind() const { |
1643 return hydrogen()->elements_kind(); | 1653 return hydrogen()->elements_kind(); |
1644 } | 1654 } |
1645 }; | 1655 }; |
1646 | 1656 |
1647 | 1657 |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2218 | 2228 |
2219 | 2229 |
2220 class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> { | 2230 class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> { |
2221 public: | 2231 public: |
2222 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) { | 2232 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) { |
2223 inputs_[0] = object; | 2233 inputs_[0] = object; |
2224 inputs_[1] = key; | 2234 inputs_[1] = key; |
2225 inputs_[2] = value; | 2235 inputs_[2] = value; |
2226 } | 2236 } |
2227 | 2237 |
| 2238 bool is_external() const { return hydrogen()->is_external(); } |
2228 bool is_fixed_typed_array() const { | 2239 bool is_fixed_typed_array() const { |
2229 return hydrogen()->is_fixed_typed_array(); | 2240 return hydrogen()->is_fixed_typed_array(); |
2230 } | 2241 } |
| 2242 bool is_typed_elements() const { |
| 2243 return is_external() || is_fixed_typed_array(); |
| 2244 } |
2231 LOperand* elements() { return inputs_[0]; } | 2245 LOperand* elements() { return inputs_[0]; } |
2232 LOperand* key() { return inputs_[1]; } | 2246 LOperand* key() { return inputs_[1]; } |
2233 LOperand* value() { return inputs_[2]; } | 2247 LOperand* value() { return inputs_[2]; } |
2234 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } | 2248 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } |
2235 | 2249 |
2236 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") | 2250 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
2237 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2251 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
2238 | 2252 |
2239 void PrintDataTo(StringStream* stream) override; | 2253 void PrintDataTo(StringStream* stream) override; |
2240 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } | 2254 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2901 | 2915 |
2902 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2916 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2903 }; | 2917 }; |
2904 | 2918 |
2905 #undef DECLARE_HYDROGEN_ACCESSOR | 2919 #undef DECLARE_HYDROGEN_ACCESSOR |
2906 #undef DECLARE_CONCRETE_INSTRUCTION | 2920 #undef DECLARE_CONCRETE_INSTRUCTION |
2907 | 2921 |
2908 } } // namespace v8::int | 2922 } } // namespace v8::int |
2909 | 2923 |
2910 #endif // V8_X64_LITHIUM_X64_H_ | 2924 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |