| 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 } | |
| 1590 | 1584 |
| 1591 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1585 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
| 1592 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1586 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
| 1593 | 1587 |
| 1594 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1588 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 1595 uint32_t additional_index() const { return hydrogen()->index_offset(); } | 1589 uint32_t additional_index() const { return hydrogen()->index_offset(); } |
| 1596 bool key_is_smi() { | 1590 bool key_is_smi() { |
| 1597 return hydrogen()->key()->representation().IsTagged(); | 1591 return hydrogen()->key()->representation().IsTagged(); |
| 1598 } | 1592 } |
| 1599 }; | 1593 }; |
| 1600 | 1594 |
| 1601 | 1595 |
| 1602 inline static bool ExternalArrayOpRequiresTemp( | 1596 inline static bool ExternalArrayOpRequiresTemp( |
| 1603 Representation key_representation, | 1597 Representation key_representation, |
| 1604 ElementsKind elements_kind) { | 1598 ElementsKind elements_kind) { |
| 1605 // Operations that require the key to be divided by two to be converted into | 1599 // Operations that require the key to be divided by two to be converted into |
| 1606 // an index cannot fold the scale operation into a load and need an extra | 1600 // an index cannot fold the scale operation into a load and need an extra |
| 1607 // temp register to do the work. | 1601 // temp register to do the work. |
| 1608 return key_representation.IsSmi() && | 1602 return key_representation.IsSmi() && |
| 1609 (elements_kind == EXTERNAL_BYTE_ELEMENTS || | 1603 (elements_kind == EXTERNAL_BYTE_ELEMENTS || |
| 1610 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || | 1604 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || |
| 1611 elements_kind == EXTERNAL_PIXEL_ELEMENTS || | 1605 elements_kind == EXTERNAL_PIXEL_ELEMENTS); |
| 1612 elements_kind == UINT8_ELEMENTS || | |
| 1613 elements_kind == INT8_ELEMENTS || | |
| 1614 elements_kind == UINT8_CLAMPED_ELEMENTS); | |
| 1615 } | 1606 } |
| 1616 | 1607 |
| 1617 | 1608 |
| 1618 class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 1609 class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> { |
| 1619 public: | 1610 public: |
| 1620 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { | 1611 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { |
| 1621 inputs_[0] = context; | 1612 inputs_[0] = context; |
| 1622 inputs_[1] = obj; | 1613 inputs_[1] = obj; |
| 1623 inputs_[2] = key; | 1614 inputs_[2] = key; |
| 1624 } | 1615 } |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2234 | 2225 |
| 2235 class LStoreKeyed V8_FINAL : public LTemplateInstruction<0, 3, 0> { | 2226 class LStoreKeyed V8_FINAL : public LTemplateInstruction<0, 3, 0> { |
| 2236 public: | 2227 public: |
| 2237 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { | 2228 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { |
| 2238 inputs_[0] = obj; | 2229 inputs_[0] = obj; |
| 2239 inputs_[1] = key; | 2230 inputs_[1] = key; |
| 2240 inputs_[2] = val; | 2231 inputs_[2] = val; |
| 2241 } | 2232 } |
| 2242 | 2233 |
| 2243 bool is_external() const { return hydrogen()->is_external(); } | 2234 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 } | |
| 2250 LOperand* elements() { return inputs_[0]; } | 2235 LOperand* elements() { return inputs_[0]; } |
| 2251 LOperand* key() { return inputs_[1]; } | 2236 LOperand* key() { return inputs_[1]; } |
| 2252 LOperand* value() { return inputs_[2]; } | 2237 LOperand* value() { return inputs_[2]; } |
| 2253 ElementsKind elements_kind() const { | 2238 ElementsKind elements_kind() const { |
| 2254 return hydrogen()->elements_kind(); | 2239 return hydrogen()->elements_kind(); |
| 2255 } | 2240 } |
| 2256 | 2241 |
| 2257 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") | 2242 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
| 2258 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2243 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
| 2259 | 2244 |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2866 | 2851 |
| 2867 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2852 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2868 }; | 2853 }; |
| 2869 | 2854 |
| 2870 #undef DECLARE_HYDROGEN_ACCESSOR | 2855 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2871 #undef DECLARE_CONCRETE_INSTRUCTION | 2856 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2872 | 2857 |
| 2873 } } // namespace v8::internal | 2858 } } // namespace v8::internal |
| 2874 | 2859 |
| 2875 #endif // V8_IA32_LITHIUM_IA32_H_ | 2860 #endif // V8_IA32_LITHIUM_IA32_H_ |
| OLD | NEW |