OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1574 inputs_[1] = key; | 1574 inputs_[1] = key; |
1575 } | 1575 } |
1576 LOperand* elements() { return inputs_[0]; } | 1576 LOperand* elements() { return inputs_[0]; } |
1577 LOperand* key() { return inputs_[1]; } | 1577 LOperand* key() { return inputs_[1]; } |
1578 ElementsKind elements_kind() const { | 1578 ElementsKind elements_kind() const { |
1579 return hydrogen()->elements_kind(); | 1579 return hydrogen()->elements_kind(); |
1580 } | 1580 } |
1581 bool is_external() const { | 1581 bool is_external() const { |
1582 return hydrogen()->is_external(); | 1582 return hydrogen()->is_external(); |
1583 } | 1583 } |
| 1584 bool is_fixed_typed_array() const { |
| 1585 return hydrogen()->is_fixed_typed_array(); |
| 1586 } |
| 1587 bool is_typed_elements() const { |
| 1588 return is_external() || is_fixed_typed_array(); |
| 1589 } |
1584 | 1590 |
1585 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1591 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
1586 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1592 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
1587 | 1593 |
1588 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1594 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1589 uint32_t additional_index() const { return hydrogen()->index_offset(); } | 1595 uint32_t additional_index() const { return hydrogen()->index_offset(); } |
1590 bool key_is_smi() { | 1596 bool key_is_smi() { |
1591 return hydrogen()->key()->representation().IsTagged(); | 1597 return hydrogen()->key()->representation().IsTagged(); |
1592 } | 1598 } |
1593 }; | 1599 }; |
1594 | 1600 |
1595 | 1601 |
1596 inline static bool ExternalArrayOpRequiresTemp( | 1602 inline static bool ExternalArrayOpRequiresTemp( |
1597 Representation key_representation, | 1603 Representation key_representation, |
1598 ElementsKind elements_kind) { | 1604 ElementsKind elements_kind) { |
1599 // Operations that require the key to be divided by two to be converted into | 1605 // Operations that require the key to be divided by two to be converted into |
1600 // an index cannot fold the scale operation into a load and need an extra | 1606 // an index cannot fold the scale operation into a load and need an extra |
1601 // temp register to do the work. | 1607 // temp register to do the work. |
1602 return key_representation.IsSmi() && | 1608 return key_representation.IsSmi() && |
1603 (elements_kind == EXTERNAL_BYTE_ELEMENTS || | 1609 (elements_kind == EXTERNAL_BYTE_ELEMENTS || |
1604 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || | 1610 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || |
1605 elements_kind == EXTERNAL_PIXEL_ELEMENTS); | 1611 elements_kind == EXTERNAL_PIXEL_ELEMENTS || |
| 1612 elements_kind == UINT8_ELEMENTS || |
| 1613 elements_kind == INT8_ELEMENTS || |
| 1614 elements_kind == UINT8_CLAMPED_ELEMENTS); |
1606 } | 1615 } |
1607 | 1616 |
1608 | 1617 |
1609 class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 1618 class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> { |
1610 public: | 1619 public: |
1611 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { | 1620 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { |
1612 inputs_[0] = context; | 1621 inputs_[0] = context; |
1613 inputs_[1] = obj; | 1622 inputs_[1] = obj; |
1614 inputs_[2] = key; | 1623 inputs_[2] = key; |
1615 } | 1624 } |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2225 | 2234 |
2226 class LStoreKeyed V8_FINAL : public LTemplateInstruction<0, 3, 0> { | 2235 class LStoreKeyed V8_FINAL : public LTemplateInstruction<0, 3, 0> { |
2227 public: | 2236 public: |
2228 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { | 2237 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { |
2229 inputs_[0] = obj; | 2238 inputs_[0] = obj; |
2230 inputs_[1] = key; | 2239 inputs_[1] = key; |
2231 inputs_[2] = val; | 2240 inputs_[2] = val; |
2232 } | 2241 } |
2233 | 2242 |
2234 bool is_external() const { return hydrogen()->is_external(); } | 2243 bool is_external() const { return hydrogen()->is_external(); } |
| 2244 bool is_fixed_typed_array() const { |
| 2245 return hydrogen()->is_fixed_typed_array(); |
| 2246 } |
| 2247 bool is_typed_elements() const { |
| 2248 return is_external() || is_fixed_typed_array(); |
| 2249 } |
2235 LOperand* elements() { return inputs_[0]; } | 2250 LOperand* elements() { return inputs_[0]; } |
2236 LOperand* key() { return inputs_[1]; } | 2251 LOperand* key() { return inputs_[1]; } |
2237 LOperand* value() { return inputs_[2]; } | 2252 LOperand* value() { return inputs_[2]; } |
2238 ElementsKind elements_kind() const { | 2253 ElementsKind elements_kind() const { |
2239 return hydrogen()->elements_kind(); | 2254 return hydrogen()->elements_kind(); |
2240 } | 2255 } |
2241 | 2256 |
2242 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") | 2257 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
2243 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2258 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
2244 | 2259 |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2851 | 2866 |
2852 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2867 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2853 }; | 2868 }; |
2854 | 2869 |
2855 #undef DECLARE_HYDROGEN_ACCESSOR | 2870 #undef DECLARE_HYDROGEN_ACCESSOR |
2856 #undef DECLARE_CONCRETE_INSTRUCTION | 2871 #undef DECLARE_CONCRETE_INSTRUCTION |
2857 | 2872 |
2858 } } // namespace v8::internal | 2873 } } // namespace v8::internal |
2859 | 2874 |
2860 #endif // V8_IA32_LITHIUM_IA32_H_ | 2875 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |