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_CRANKSHAFT_X64_LITHIUM_X64_H_ | 5 #ifndef V8_CRANKSHAFT_X64_LITHIUM_X64_H_ |
6 #define V8_CRANKSHAFT_X64_LITHIUM_X64_H_ | 6 #define V8_CRANKSHAFT_X64_LITHIUM_X64_H_ |
7 | 7 |
8 #include "src/crankshaft/hydrogen.h" | 8 #include "src/crankshaft/hydrogen.h" |
9 #include "src/crankshaft/lithium.h" | 9 #include "src/crankshaft/lithium.h" |
10 #include "src/crankshaft/lithium-allocator.h" | 10 #include "src/crankshaft/lithium-allocator.h" |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 ElementsKind elements_kind) { | 1584 ElementsKind elements_kind) { |
1585 // Operations that require the key to be divided by two to be converted into | 1585 // Operations that require the key to be divided by two to be converted into |
1586 // an index cannot fold the scale operation into a load and need an extra | 1586 // an index cannot fold the scale operation into a load and need an extra |
1587 // temp register to do the work. | 1587 // temp register to do the work. |
1588 return SmiValuesAre31Bits() && key_representation.IsSmi() && | 1588 return SmiValuesAre31Bits() && key_representation.IsSmi() && |
1589 (elements_kind == UINT8_ELEMENTS || elements_kind == INT8_ELEMENTS || | 1589 (elements_kind == UINT8_ELEMENTS || elements_kind == INT8_ELEMENTS || |
1590 elements_kind == UINT8_CLAMPED_ELEMENTS); | 1590 elements_kind == UINT8_CLAMPED_ELEMENTS); |
1591 } | 1591 } |
1592 | 1592 |
1593 | 1593 |
1594 class LLoadKeyed final : public LTemplateInstruction<1, 2, 0> { | 1594 class LLoadKeyed final : public LTemplateInstruction<1, 3, 0> { |
1595 public: | 1595 public: |
1596 LLoadKeyed(LOperand* elements, LOperand* key) { | 1596 LLoadKeyed(LOperand* elements, LOperand* key, LOperand* backing_store_owner) { |
1597 inputs_[0] = elements; | 1597 inputs_[0] = elements; |
1598 inputs_[1] = key; | 1598 inputs_[1] = key; |
| 1599 inputs_[2] = backing_store_owner; |
1599 } | 1600 } |
1600 | 1601 |
1601 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1602 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
1602 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1603 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
1603 | 1604 |
1604 bool is_fixed_typed_array() const { | 1605 bool is_fixed_typed_array() const { |
1605 return hydrogen()->is_fixed_typed_array(); | 1606 return hydrogen()->is_fixed_typed_array(); |
1606 } | 1607 } |
1607 LOperand* elements() { return inputs_[0]; } | 1608 LOperand* elements() { return inputs_[0]; } |
1608 LOperand* key() { return inputs_[1]; } | 1609 LOperand* key() { return inputs_[1]; } |
| 1610 LOperand* backing_store_owner() { return inputs_[2]; } |
1609 void PrintDataTo(StringStream* stream) override; | 1611 void PrintDataTo(StringStream* stream) override; |
1610 uint32_t base_offset() const { return hydrogen()->base_offset(); } | 1612 uint32_t base_offset() const { return hydrogen()->base_offset(); } |
1611 ElementsKind elements_kind() const { | 1613 ElementsKind elements_kind() const { |
1612 return hydrogen()->elements_kind(); | 1614 return hydrogen()->elements_kind(); |
1613 } | 1615 } |
1614 }; | 1616 }; |
1615 | 1617 |
1616 | 1618 |
1617 class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> { | 1619 class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> { |
1618 public: | 1620 public: |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") | 2122 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") |
2121 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) | 2123 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) |
2122 | 2124 |
2123 void PrintDataTo(StringStream* stream) override; | 2125 void PrintDataTo(StringStream* stream) override; |
2124 | 2126 |
2125 Handle<Object> name() const { return hydrogen()->name(); } | 2127 Handle<Object> name() const { return hydrogen()->name(); } |
2126 LanguageMode language_mode() { return hydrogen()->language_mode(); } | 2128 LanguageMode language_mode() { return hydrogen()->language_mode(); } |
2127 }; | 2129 }; |
2128 | 2130 |
2129 | 2131 |
2130 class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> { | 2132 class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { |
2131 public: | 2133 public: |
2132 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) { | 2134 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value, |
| 2135 LOperand* backing_store_owner) { |
2133 inputs_[0] = object; | 2136 inputs_[0] = object; |
2134 inputs_[1] = key; | 2137 inputs_[1] = key; |
2135 inputs_[2] = value; | 2138 inputs_[2] = value; |
| 2139 inputs_[3] = backing_store_owner; |
2136 } | 2140 } |
2137 | 2141 |
2138 bool is_fixed_typed_array() const { | 2142 bool is_fixed_typed_array() const { |
2139 return hydrogen()->is_fixed_typed_array(); | 2143 return hydrogen()->is_fixed_typed_array(); |
2140 } | 2144 } |
2141 LOperand* elements() { return inputs_[0]; } | 2145 LOperand* elements() { return inputs_[0]; } |
2142 LOperand* key() { return inputs_[1]; } | 2146 LOperand* key() { return inputs_[1]; } |
2143 LOperand* value() { return inputs_[2]; } | 2147 LOperand* value() { return inputs_[2]; } |
| 2148 LOperand* backing_store_owner() { return inputs_[3]; } |
2144 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } | 2149 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } |
2145 | 2150 |
2146 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") | 2151 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
2147 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2152 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
2148 | 2153 |
2149 void PrintDataTo(StringStream* stream) override; | 2154 void PrintDataTo(StringStream* stream) override; |
2150 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } | 2155 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } |
2151 uint32_t base_offset() const { return hydrogen()->base_offset(); } | 2156 uint32_t base_offset() const { return hydrogen()->base_offset(); } |
2152 }; | 2157 }; |
2153 | 2158 |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2777 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2773 }; | 2778 }; |
2774 | 2779 |
2775 #undef DECLARE_HYDROGEN_ACCESSOR | 2780 #undef DECLARE_HYDROGEN_ACCESSOR |
2776 #undef DECLARE_CONCRETE_INSTRUCTION | 2781 #undef DECLARE_CONCRETE_INSTRUCTION |
2777 | 2782 |
2778 } // namespace internal | 2783 } // namespace internal |
2779 } // namespace v8 | 2784 } // namespace v8 |
2780 | 2785 |
2781 #endif // V8_CRANKSHAFT_X64_LITHIUM_X64_H_ | 2786 #endif // V8_CRANKSHAFT_X64_LITHIUM_X64_H_ |
OLD | NEW |