Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Side by Side Diff: src/ia32/lithium-ia32.h

Issue 10382055: Array index computation dehoisting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 inputs_[0] = object; 1221 inputs_[0] = object;
1222 } 1222 }
1223 1223
1224 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, 1224 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
1225 "load-external-array-pointer") 1225 "load-external-array-pointer")
1226 }; 1226 };
1227 1227
1228 1228
1229 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> { 1229 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
1230 public: 1230 public:
1231 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { 1231 LLoadKeyedFastElement(LOperand* elements,
1232 LOperand* key,
1233 uint32_t additional_index)
1234 : additional_index_(additional_index) {
1232 inputs_[0] = elements; 1235 inputs_[0] = elements;
1233 inputs_[1] = key; 1236 inputs_[1] = key;
1234 } 1237 }
1235 1238
1236 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") 1239 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
1237 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) 1240 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
1238 1241
1239 LOperand* elements() { return inputs_[0]; } 1242 LOperand* elements() { return inputs_[0]; }
1240 LOperand* key() { return inputs_[1]; } 1243 LOperand* key() { return inputs_[1]; }
1244 uint32_t additional_index() const { return additional_index_; }
1245 void set_additional_index(uint32_t additional_index) {
1246 additional_index_ = additional_index;
1247 }
1248
1249 private:
1250 uint32_t additional_index_;
Jakob Kummerow 2012/05/08 13:46:26 You don't need to pass this value to the LInstruct
Massi 2012/05/14 13:48:52 Done.
1241 }; 1251 };
1242 1252
1243 1253
1244 class LLoadKeyedFastDoubleElement: public LTemplateInstruction<1, 2, 0> { 1254 class LLoadKeyedFastDoubleElement: public LTemplateInstruction<1, 2, 0> {
1245 public: 1255 public:
1246 LLoadKeyedFastDoubleElement(LOperand* elements, 1256 LLoadKeyedFastDoubleElement(LOperand* elements,
1247 LOperand* key) { 1257 LOperand* key,
1258 uint32_t additional_index)
1259 : additional_index_(additional_index) {
1248 inputs_[0] = elements; 1260 inputs_[0] = elements;
1249 inputs_[1] = key; 1261 inputs_[1] = key;
1250 } 1262 }
1251 1263
1252 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement, 1264 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement,
1253 "load-keyed-fast-double-element") 1265 "load-keyed-fast-double-element")
1254 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastDoubleElement) 1266 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastDoubleElement)
1255 1267
1256 LOperand* elements() { return inputs_[0]; } 1268 LOperand* elements() { return inputs_[0]; }
1257 LOperand* key() { return inputs_[1]; } 1269 LOperand* key() { return inputs_[1]; }
1270 uint32_t additional_index() const { return additional_index_; }
1271 void set_additional_index(uint32_t additional_index) {
1272 additional_index_ = additional_index;
1273 }
1274
1275 private:
1276 uint32_t additional_index_;
1258 }; 1277 };
1259 1278
1260 1279
1261 class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> { 1280 class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> {
1262 public: 1281 public:
1263 LLoadKeyedSpecializedArrayElement(LOperand* external_pointer, 1282 LLoadKeyedSpecializedArrayElement(LOperand* external_pointer,
1264 LOperand* key) { 1283 LOperand* key,
1284 uint32_t additional_index)
1285 : additional_index_(additional_index) {
1265 inputs_[0] = external_pointer; 1286 inputs_[0] = external_pointer;
1266 inputs_[1] = key; 1287 inputs_[1] = key;
1267 } 1288 }
1268 1289
1269 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement, 1290 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement,
1270 "load-keyed-specialized-array-element") 1291 "load-keyed-specialized-array-element")
1271 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement) 1292 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement)
1272 1293
1273 LOperand* external_pointer() { return inputs_[0]; } 1294 LOperand* external_pointer() { return inputs_[0]; }
1274 LOperand* key() { return inputs_[1]; } 1295 LOperand* key() { return inputs_[1]; }
1275 ElementsKind elements_kind() const { 1296 ElementsKind elements_kind() const {
1276 return hydrogen()->elements_kind(); 1297 return hydrogen()->elements_kind();
1277 } 1298 }
1299 uint32_t additional_index() const { return additional_index_; }
1300 void set_additional_index(uint32_t additional_index) {
1301 additional_index_ = additional_index;
1302 }
1303
1304 private:
1305 uint32_t additional_index_;
1278 }; 1306 };
1279 1307
1280 1308
1281 class LLoadKeyedGeneric: public LTemplateInstruction<1, 3, 0> { 1309 class LLoadKeyedGeneric: public LTemplateInstruction<1, 3, 0> {
1282 public: 1310 public:
1283 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { 1311 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) {
1284 inputs_[0] = context; 1312 inputs_[0] = context;
1285 inputs_[1] = obj; 1313 inputs_[1] = obj;
1286 inputs_[2] = key; 1314 inputs_[2] = key;
1287 } 1315 }
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 LOperand* context() { return inputs_[0]; } 1781 LOperand* context() { return inputs_[0]; }
1754 LOperand* object() { return inputs_[1]; } 1782 LOperand* object() { return inputs_[1]; }
1755 LOperand* value() { return inputs_[2]; } 1783 LOperand* value() { return inputs_[2]; }
1756 Handle<Object> name() const { return hydrogen()->name(); } 1784 Handle<Object> name() const { return hydrogen()->name(); }
1757 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } 1785 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
1758 }; 1786 };
1759 1787
1760 1788
1761 class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> { 1789 class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
1762 public: 1790 public:
1763 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) { 1791 LStoreKeyedFastElement(LOperand* obj,
1792 LOperand* key,
1793 LOperand* val,
1794 uint32_t additional_index)
1795 : additional_index_(additional_index) {
1764 inputs_[0] = obj; 1796 inputs_[0] = obj;
1765 inputs_[1] = key; 1797 inputs_[1] = key;
1766 inputs_[2] = val; 1798 inputs_[2] = val;
1767 } 1799 }
1768 1800
1769 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, 1801 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
1770 "store-keyed-fast-element") 1802 "store-keyed-fast-element")
1771 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement) 1803 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
1772 1804
1773 virtual void PrintDataTo(StringStream* stream); 1805 virtual void PrintDataTo(StringStream* stream);
1774 1806
1775 LOperand* object() { return inputs_[0]; } 1807 LOperand* object() { return inputs_[0]; }
1776 LOperand* key() { return inputs_[1]; } 1808 LOperand* key() { return inputs_[1]; }
1777 LOperand* value() { return inputs_[2]; } 1809 LOperand* value() { return inputs_[2]; }
1810 uint32_t additional_index() const { return additional_index_; }
1811 void set_additional_index(uint32_t additional_index) {
1812 additional_index_ = additional_index;
1813 }
1814
1815 private:
1816 uint32_t additional_index_;
1778 }; 1817 };
1779 1818
1780 1819
1781 class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> { 1820 class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> {
1782 public: 1821 public:
1783 LStoreKeyedFastDoubleElement(LOperand* elements, 1822 LStoreKeyedFastDoubleElement(LOperand* elements,
1784 LOperand* key, 1823 LOperand* key,
1785 LOperand* val) { 1824 LOperand* val,
1825 uint32_t additional_index)
1826 : additional_index_(additional_index) {
1786 inputs_[0] = elements; 1827 inputs_[0] = elements;
1787 inputs_[1] = key; 1828 inputs_[1] = key;
1788 inputs_[2] = val; 1829 inputs_[2] = val;
1789 } 1830 }
1790 1831
1791 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement, 1832 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement,
1792 "store-keyed-fast-double-element") 1833 "store-keyed-fast-double-element")
1793 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastDoubleElement) 1834 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastDoubleElement)
1794 1835
1795 virtual void PrintDataTo(StringStream* stream); 1836 virtual void PrintDataTo(StringStream* stream);
1796 1837
1797 LOperand* elements() { return inputs_[0]; } 1838 LOperand* elements() { return inputs_[0]; }
1798 LOperand* key() { return inputs_[1]; } 1839 LOperand* key() { return inputs_[1]; }
1799 LOperand* value() { return inputs_[2]; } 1840 LOperand* value() { return inputs_[2]; }
1841 uint32_t additional_index() const { return additional_index_; }
1842 void set_additional_index(uint32_t additional_index) {
1843 additional_index_ = additional_index;
1844 }
1800 1845
1801 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } 1846 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
1847
1848 private:
1849 uint32_t additional_index_;
1802 }; 1850 };
1803 1851
1804 1852
1805 class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> { 1853 class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> {
1806 public: 1854 public:
1807 LStoreKeyedSpecializedArrayElement(LOperand* external_pointer, 1855 LStoreKeyedSpecializedArrayElement(LOperand* external_pointer,
1808 LOperand* key, 1856 LOperand* key,
1809 LOperand* val) { 1857 LOperand* val,
1858 uint32_t additional_index)
1859 : additional_index_(additional_index) {
1810 inputs_[0] = external_pointer; 1860 inputs_[0] = external_pointer;
1811 inputs_[1] = key; 1861 inputs_[1] = key;
1812 inputs_[2] = val; 1862 inputs_[2] = val;
1813 } 1863 }
1814 1864
1815 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement, 1865 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,
1816 "store-keyed-specialized-array-element") 1866 "store-keyed-specialized-array-element")
1817 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement) 1867 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement)
1818 1868
1819 LOperand* external_pointer() { return inputs_[0]; } 1869 LOperand* external_pointer() { return inputs_[0]; }
1820 LOperand* key() { return inputs_[1]; } 1870 LOperand* key() { return inputs_[1]; }
1821 LOperand* value() { return inputs_[2]; } 1871 LOperand* value() { return inputs_[2]; }
1822 ElementsKind elements_kind() const { 1872 ElementsKind elements_kind() const {
1823 return hydrogen()->elements_kind(); 1873 return hydrogen()->elements_kind();
1824 } 1874 }
1875 uint32_t additional_index() const { return additional_index_; }
1876 void set_additional_index(uint32_t additional_index) {
1877 additional_index_ = additional_index;
1878 }
1879
1880 private:
1881 uint32_t additional_index_;
1825 }; 1882 };
1826 1883
1827 1884
1828 class LStoreKeyedGeneric: public LTemplateInstruction<0, 4, 0> { 1885 class LStoreKeyedGeneric: public LTemplateInstruction<0, 4, 0> {
1829 public: 1886 public:
1830 LStoreKeyedGeneric(LOperand* context, 1887 LStoreKeyedGeneric(LOperand* context,
1831 LOperand* object, 1888 LOperand* object,
1832 LOperand* key, 1889 LOperand* key,
1833 LOperand* value) { 1890 LOperand* value) {
1834 inputs_[0] = context; 1891 inputs_[0] = context;
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 2569
2513 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2570 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2514 }; 2571 };
2515 2572
2516 #undef DECLARE_HYDROGEN_ACCESSOR 2573 #undef DECLARE_HYDROGEN_ACCESSOR
2517 #undef DECLARE_CONCRETE_INSTRUCTION 2574 #undef DECLARE_CONCRETE_INSTRUCTION
2518 2575
2519 } } // namespace v8::internal 2576 } } // namespace v8::internal
2520 2577
2521 #endif // V8_IA32_LITHIUM_IA32_H_ 2578 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698