| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 V(Return) \ | 153 V(Return) \ |
| 154 V(SeqStringGetChar) \ | 154 V(SeqStringGetChar) \ |
| 155 V(SeqStringSetChar) \ | 155 V(SeqStringSetChar) \ |
| 156 V(ShiftI) \ | 156 V(ShiftI) \ |
| 157 V(SmiTag) \ | 157 V(SmiTag) \ |
| 158 V(SmiUntag) \ | 158 V(SmiUntag) \ |
| 159 V(StackCheck) \ | 159 V(StackCheck) \ |
| 160 V(StoreCodeEntry) \ | 160 V(StoreCodeEntry) \ |
| 161 V(StoreContextSlot) \ | 161 V(StoreContextSlot) \ |
| 162 V(StoreGlobalCell) \ | 162 V(StoreGlobalCell) \ |
| 163 V(StoreGlobalGeneric) \ | |
| 164 V(StoreKeyed) \ | 163 V(StoreKeyed) \ |
| 165 V(StoreKeyedGeneric) \ | 164 V(StoreKeyedGeneric) \ |
| 166 V(StoreNamedField) \ | 165 V(StoreNamedField) \ |
| 167 V(StoreNamedGeneric) \ | 166 V(StoreNamedGeneric) \ |
| 168 V(StringAdd) \ | 167 V(StringAdd) \ |
| 169 V(StringCharCodeAt) \ | 168 V(StringCharCodeAt) \ |
| 170 V(StringCharFromCode) \ | 169 V(StringCharFromCode) \ |
| 171 V(StringCompareAndBranch) \ | 170 V(StringCompareAndBranch) \ |
| 172 V(SubI) \ | 171 V(SubI) \ |
| 173 V(TaggedToI) \ | 172 V(TaggedToI) \ |
| (...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1574 inputs_[1] = key; | 1573 inputs_[1] = key; |
| 1575 } | 1574 } |
| 1576 LOperand* elements() { return inputs_[0]; } | 1575 LOperand* elements() { return inputs_[0]; } |
| 1577 LOperand* key() { return inputs_[1]; } | 1576 LOperand* key() { return inputs_[1]; } |
| 1578 ElementsKind elements_kind() const { | 1577 ElementsKind elements_kind() const { |
| 1579 return hydrogen()->elements_kind(); | 1578 return hydrogen()->elements_kind(); |
| 1580 } | 1579 } |
| 1581 bool is_external() const { | 1580 bool is_external() const { |
| 1582 return hydrogen()->is_external(); | 1581 return hydrogen()->is_external(); |
| 1583 } | 1582 } |
| 1583 bool is_fixed_typed_array() const { |
| 1584 return hydrogen()->is_fixed_typed_array(); |
| 1585 } |
| 1586 bool is_typed_elements() const { |
| 1587 return is_external() || is_fixed_typed_array(); |
| 1588 } |
| 1584 | 1589 |
| 1585 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1590 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
| 1586 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1591 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
| 1587 | 1592 |
| 1588 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1593 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 1589 uint32_t additional_index() const { return hydrogen()->index_offset(); } | 1594 uint32_t additional_index() const { return hydrogen()->index_offset(); } |
| 1590 bool key_is_smi() { | 1595 bool key_is_smi() { |
| 1591 return hydrogen()->key()->representation().IsTagged(); | 1596 return hydrogen()->key()->representation().IsTagged(); |
| 1592 } | 1597 } |
| 1593 }; | 1598 }; |
| 1594 | 1599 |
| 1595 | 1600 |
| 1596 inline static bool ExternalArrayOpRequiresTemp( | 1601 inline static bool ExternalArrayOpRequiresTemp( |
| 1597 Representation key_representation, | 1602 Representation key_representation, |
| 1598 ElementsKind elements_kind) { | 1603 ElementsKind elements_kind) { |
| 1599 // Operations that require the key to be divided by two to be converted into | 1604 // 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 | 1605 // an index cannot fold the scale operation into a load and need an extra |
| 1601 // temp register to do the work. | 1606 // temp register to do the work. |
| 1602 return key_representation.IsSmi() && | 1607 return key_representation.IsSmi() && |
| 1603 (elements_kind == EXTERNAL_BYTE_ELEMENTS || | 1608 (elements_kind == EXTERNAL_BYTE_ELEMENTS || |
| 1604 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || | 1609 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || |
| 1605 elements_kind == EXTERNAL_PIXEL_ELEMENTS); | 1610 elements_kind == EXTERNAL_PIXEL_ELEMENTS || |
| 1611 elements_kind == UINT8_ELEMENTS || |
| 1612 elements_kind == INT8_ELEMENTS || |
| 1613 elements_kind == UINT8_CLAMPED_ELEMENTS); |
| 1606 } | 1614 } |
| 1607 | 1615 |
| 1608 | 1616 |
| 1609 class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 1617 class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> { |
| 1610 public: | 1618 public: |
| 1611 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { | 1619 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { |
| 1612 inputs_[0] = context; | 1620 inputs_[0] = context; |
| 1613 inputs_[1] = obj; | 1621 inputs_[1] = obj; |
| 1614 inputs_[2] = key; | 1622 inputs_[2] = key; |
| 1615 } | 1623 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1653 inputs_[0] = value; | 1661 inputs_[0] = value; |
| 1654 } | 1662 } |
| 1655 | 1663 |
| 1656 LOperand* value() { return inputs_[0]; } | 1664 LOperand* value() { return inputs_[0]; } |
| 1657 | 1665 |
| 1658 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") | 1666 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") |
| 1659 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) | 1667 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) |
| 1660 }; | 1668 }; |
| 1661 | 1669 |
| 1662 | 1670 |
| 1663 class LStoreGlobalGeneric V8_FINAL : public LTemplateInstruction<0, 3, 0> { | |
| 1664 public: | |
| 1665 LStoreGlobalGeneric(LOperand* context, | |
| 1666 LOperand* global_object, | |
| 1667 LOperand* value) { | |
| 1668 inputs_[0] = context; | |
| 1669 inputs_[1] = global_object; | |
| 1670 inputs_[2] = value; | |
| 1671 } | |
| 1672 | |
| 1673 LOperand* context() { return inputs_[0]; } | |
| 1674 LOperand* global_object() { return inputs_[1]; } | |
| 1675 LOperand* value() { return inputs_[2]; } | |
| 1676 | |
| 1677 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic") | |
| 1678 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric) | |
| 1679 | |
| 1680 Handle<Object> name() const { return hydrogen()->name(); } | |
| 1681 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } | |
| 1682 }; | |
| 1683 | |
| 1684 | |
| 1685 class LLoadContextSlot V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1671 class LLoadContextSlot V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1686 public: | 1672 public: |
| 1687 explicit LLoadContextSlot(LOperand* context) { | 1673 explicit LLoadContextSlot(LOperand* context) { |
| 1688 inputs_[0] = context; | 1674 inputs_[0] = context; |
| 1689 } | 1675 } |
| 1690 | 1676 |
| 1691 LOperand* context() { return inputs_[0]; } | 1677 LOperand* context() { return inputs_[0]; } |
| 1692 | 1678 |
| 1693 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") | 1679 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") |
| 1694 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) | 1680 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 | 1842 |
| 1857 int arity() const { return hydrogen()->argument_count() - 1; } | 1843 int arity() const { return hydrogen()->argument_count() - 1; } |
| 1858 }; | 1844 }; |
| 1859 | 1845 |
| 1860 | 1846 |
| 1861 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { | 1847 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { |
| 1862 public: | 1848 public: |
| 1863 LCallWithDescriptor(const CallInterfaceDescriptor* descriptor, | 1849 LCallWithDescriptor(const CallInterfaceDescriptor* descriptor, |
| 1864 ZoneList<LOperand*>& operands, | 1850 ZoneList<LOperand*>& operands, |
| 1865 Zone* zone) | 1851 Zone* zone) |
| 1866 : descriptor_(descriptor), | 1852 : inputs_(descriptor->environment_length() + 1, zone) { |
| 1867 inputs_(descriptor->environment_length() + 1, zone) { | |
| 1868 ASSERT(descriptor->environment_length() + 1 == operands.length()); | 1853 ASSERT(descriptor->environment_length() + 1 == operands.length()); |
| 1869 inputs_.AddAll(operands, zone); | 1854 inputs_.AddAll(operands, zone); |
| 1870 } | 1855 } |
| 1871 | 1856 |
| 1872 LOperand* target() const { return inputs_[0]; } | 1857 LOperand* target() const { return inputs_[0]; } |
| 1873 | 1858 |
| 1874 private: | 1859 private: |
| 1875 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") | 1860 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") |
| 1876 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) | 1861 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) |
| 1877 | 1862 |
| 1878 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1863 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 1879 | 1864 |
| 1880 int arity() const { return hydrogen()->argument_count() - 1; } | 1865 int arity() const { return hydrogen()->argument_count() - 1; } |
| 1881 | 1866 |
| 1882 const CallInterfaceDescriptor* descriptor_; | |
| 1883 ZoneList<LOperand*> inputs_; | 1867 ZoneList<LOperand*> inputs_; |
| 1884 | 1868 |
| 1885 // Iterator support. | 1869 // Iterator support. |
| 1886 virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); } | 1870 virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); } |
| 1887 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; } | 1871 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; } |
| 1888 | 1872 |
| 1889 virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; } | 1873 virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; } |
| 1890 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; } | 1874 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; } |
| 1891 }; | 1875 }; |
| 1892 | 1876 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2225 | 2209 |
| 2226 class LStoreKeyed V8_FINAL : public LTemplateInstruction<0, 3, 0> { | 2210 class LStoreKeyed V8_FINAL : public LTemplateInstruction<0, 3, 0> { |
| 2227 public: | 2211 public: |
| 2228 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { | 2212 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { |
| 2229 inputs_[0] = obj; | 2213 inputs_[0] = obj; |
| 2230 inputs_[1] = key; | 2214 inputs_[1] = key; |
| 2231 inputs_[2] = val; | 2215 inputs_[2] = val; |
| 2232 } | 2216 } |
| 2233 | 2217 |
| 2234 bool is_external() const { return hydrogen()->is_external(); } | 2218 bool is_external() const { return hydrogen()->is_external(); } |
| 2219 bool is_fixed_typed_array() const { |
| 2220 return hydrogen()->is_fixed_typed_array(); |
| 2221 } |
| 2222 bool is_typed_elements() const { |
| 2223 return is_external() || is_fixed_typed_array(); |
| 2224 } |
| 2235 LOperand* elements() { return inputs_[0]; } | 2225 LOperand* elements() { return inputs_[0]; } |
| 2236 LOperand* key() { return inputs_[1]; } | 2226 LOperand* key() { return inputs_[1]; } |
| 2237 LOperand* value() { return inputs_[2]; } | 2227 LOperand* value() { return inputs_[2]; } |
| 2238 ElementsKind elements_kind() const { | 2228 ElementsKind elements_kind() const { |
| 2239 return hydrogen()->elements_kind(); | 2229 return hydrogen()->elements_kind(); |
| 2240 } | 2230 } |
| 2241 | 2231 |
| 2242 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") | 2232 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
| 2243 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2233 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
| 2244 | 2234 |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2851 | 2841 |
| 2852 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2842 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2853 }; | 2843 }; |
| 2854 | 2844 |
| 2855 #undef DECLARE_HYDROGEN_ACCESSOR | 2845 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2856 #undef DECLARE_CONCRETE_INSTRUCTION | 2846 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2857 | 2847 |
| 2858 } } // namespace v8::internal | 2848 } } // namespace v8::internal |
| 2859 | 2849 |
| 2860 #endif // V8_IA32_LITHIUM_IA32_H_ | 2850 #endif // V8_IA32_LITHIUM_IA32_H_ |
| OLD | NEW |