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

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

Issue 6158004: Remove duplicate members from some LIR instruction by using the HIR accessors... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 explicit LConstantT(Handle<Object> value) : value_(value) { } 1094 explicit LConstantT(Handle<Object> value) : value_(value) { }
1095 Handle<Object> value() const { return value_; } 1095 Handle<Object> value() const { return value_; }
1096 1096
1097 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") 1097 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1098 1098
1099 private: 1099 private:
1100 Handle<Object> value_; 1100 Handle<Object> value_;
1101 }; 1101 };
1102 1102
1103 1103
1104 class LBranch: public LUnaryOperation<1> { 1104 class LBranch: public LUnaryOperation<0> {
1105 public: 1105 public:
1106 LBranch(LOperand* input, int true_block_id, int false_block_id) 1106 LBranch(LOperand* input, int true_block_id, int false_block_id)
1107 : LUnaryOperation<1>(input), 1107 : LUnaryOperation<0>(input),
1108 true_block_id_(true_block_id), 1108 true_block_id_(true_block_id),
1109 false_block_id_(false_block_id) { } 1109 false_block_id_(false_block_id) { }
1110 1110
1111 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") 1111 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1112 DECLARE_HYDROGEN_ACCESSOR(Value) 1112 DECLARE_HYDROGEN_ACCESSOR(Value)
1113 1113
1114 virtual void PrintDataTo(StringStream* stream); 1114 virtual void PrintDataTo(StringStream* stream);
1115 virtual bool IsControl() const { return true; } 1115 virtual bool IsControl() const { return true; }
1116 1116
1117 int true_block_id() const { return true_block_id_; } 1117 int true_block_id() const { return true_block_id_; }
1118 int false_block_id() const { return false_block_id_; } 1118 int false_block_id() const { return false_block_id_; }
1119 1119
1120 private: 1120 private:
1121 int true_block_id_; 1121 int true_block_id_;
1122 int false_block_id_; 1122 int false_block_id_;
1123 }; 1123 };
1124 1124
1125 1125
1126 class LCmpMapAndBranch: public LUnaryOperation<1> { 1126 class LCmpMapAndBranch: public LUnaryOperation<0> {
1127 public: 1127 public:
1128 explicit LCmpMapAndBranch(LOperand* value) : LUnaryOperation<1>(value) { } 1128 explicit LCmpMapAndBranch(LOperand* value) : LUnaryOperation<0>(value) { }
1129 1129
1130 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") 1130 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1131 DECLARE_HYDROGEN_ACCESSOR(CompareMapAndBranch) 1131 DECLARE_HYDROGEN_ACCESSOR(CompareMapAndBranch)
1132 1132
1133 virtual bool IsControl() const { return true; } 1133 virtual bool IsControl() const { return true; }
1134 1134
1135 Handle<Map> map() const { return hydrogen()->map(); } 1135 Handle<Map> map() const { return hydrogen()->map(); }
1136 int true_block_id() const { 1136 int true_block_id() const {
1137 return hydrogen()->true_destination()->block_id(); 1137 return hydrogen()->true_destination()->block_id();
1138 } 1138 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 virtual void CompileToNative(LCodeGen* generator); 1234 virtual void CompileToNative(LCodeGen* generator);
1235 virtual const char* Mnemonic() const; 1235 virtual const char* Mnemonic() const;
1236 1236
1237 Token::Value op() const { return op_; } 1237 Token::Value op() const { return op_; }
1238 1238
1239 private: 1239 private:
1240 Token::Value op_; 1240 Token::Value op_;
1241 }; 1241 };
1242 1242
1243 1243
1244 class LReturn: public LUnaryOperation<1> { 1244 class LReturn: public LUnaryOperation<0> {
1245 public: 1245 public:
1246 explicit LReturn(LOperand* use) : LUnaryOperation<1>(use) { } 1246 explicit LReturn(LOperand* use) : LUnaryOperation<0>(use) { }
1247 1247
1248 DECLARE_CONCRETE_INSTRUCTION(Return, "return") 1248 DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1249 }; 1249 };
1250 1250
1251 1251
1252 class LLoadNamedField: public LUnaryOperation<1> { 1252 class LLoadNamedField: public LUnaryOperation<1> {
1253 public: 1253 public:
1254 explicit LLoadNamedField(LOperand* object) : LUnaryOperation<1>(object) { } 1254 explicit LLoadNamedField(LOperand* object) : LUnaryOperation<1>(object) { }
1255 1255
1256 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") 1256 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 class LLoadElements: public LUnaryOperation<1> { 1289 class LLoadElements: public LUnaryOperation<1> {
1290 public: 1290 public:
1291 explicit LLoadElements(LOperand* obj) : LUnaryOperation<1>(obj) { } 1291 explicit LLoadElements(LOperand* obj) : LUnaryOperation<1>(obj) { }
1292 1292
1293 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") 1293 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1294 }; 1294 };
1295 1295
1296 1296
1297 class LLoadKeyedFastElement: public LBinaryOperation { 1297 class LLoadKeyedFastElement: public LBinaryOperation {
1298 public: 1298 public:
1299 LLoadKeyedFastElement(LOperand* elements, 1299 LLoadKeyedFastElement(LOperand* elements, LOperand* key)
1300 LOperand* key, 1300 : LBinaryOperation(elements, key) { }
1301 LOperand* load_result)
1302 : LBinaryOperation(elements, key),
1303 load_result_(load_result) { }
1304 1301
1305 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") 1302 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
1306 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) 1303 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
1307 1304
1308 LOperand* elements() const { return left(); } 1305 LOperand* elements() const { return left(); }
1309 LOperand* key() const { return right(); } 1306 LOperand* key() const { return right(); }
1310 LOperand* load_result() const { return load_result_; }
1311
1312 private:
1313 LOperand* load_result_;
1314 }; 1307 };
1315 1308
1316 1309
1317 class LLoadKeyedGeneric: public LBinaryOperation { 1310 class LLoadKeyedGeneric: public LBinaryOperation {
1318 public: 1311 public:
1319 LLoadKeyedGeneric(LOperand* obj, LOperand* key) 1312 LLoadKeyedGeneric(LOperand* obj, LOperand* key)
1320 : LBinaryOperation(obj, key) { } 1313 : LBinaryOperation(obj, key) { }
1321 1314
1322 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") 1315 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1323 1316
1324 LOperand* object() const { return left(); } 1317 LOperand* object() const { return left(); }
1325 LOperand* key() const { return right(); } 1318 LOperand* key() const { return right(); }
1326 }; 1319 };
1327 1320
1328 1321
1329 class LLoadGlobal: public LTemplateInstruction<1> { 1322 class LLoadGlobal: public LTemplateInstruction<1> {
1330 public: 1323 public:
1331 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global") 1324 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global")
1332 DECLARE_HYDROGEN_ACCESSOR(LoadGlobal) 1325 DECLARE_HYDROGEN_ACCESSOR(LoadGlobal)
1333 }; 1326 };
1334 1327
1335 1328
1336 class LStoreGlobal: public LUnaryOperation<1> { 1329 class LStoreGlobal: public LUnaryOperation<0> {
1337 public: 1330 public:
1338 explicit LStoreGlobal(LOperand* value) : LUnaryOperation<1>(value) {} 1331 explicit LStoreGlobal(LOperand* value) : LUnaryOperation<0>(value) {}
1339 1332
1340 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global") 1333 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global")
1341 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal) 1334 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal)
1342 }; 1335 };
1343 1336
1344 1337
1345 class LPushArgument: public LUnaryOperation<1> { 1338 class LPushArgument: public LUnaryOperation<0> {
1346 public: 1339 public:
1347 explicit LPushArgument(LOperand* argument) : LUnaryOperation<1>(argument) {} 1340 explicit LPushArgument(LOperand* argument) : LUnaryOperation<0>(argument) {}
1348 1341
1349 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") 1342 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1350 }; 1343 };
1351 1344
1352 1345
1353 class LGlobalObject: public LTemplateInstruction<1> { 1346 class LGlobalObject: public LTemplateInstruction<1> {
1354 public: 1347 public:
1355 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") 1348 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
1356 }; 1349 };
1357 1350
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 1530
1538 bool needs_check() const { return needs_check_; } 1531 bool needs_check() const { return needs_check_; }
1539 1532
1540 private: 1533 private:
1541 bool needs_check_; 1534 bool needs_check_;
1542 }; 1535 };
1543 1536
1544 1537
1545 class LStoreNamed: public LTemplateInstruction<0> { 1538 class LStoreNamed: public LTemplateInstruction<0> {
1546 public: 1539 public:
1547 LStoreNamed(LOperand* obj, Handle<Object> name, LOperand* val) 1540 LStoreNamed(LOperand* obj, LOperand* val) : object_(obj), value_(val) { }
1548 : object_(obj), name_(name), value_(val) { }
1549 1541
1550 DECLARE_INSTRUCTION(StoreNamed) 1542 DECLARE_INSTRUCTION(StoreNamed)
1543 DECLARE_HYDROGEN_ACCESSOR(StoreNamed)
1551 1544
1552 virtual void PrintDataTo(StringStream* stream); 1545 virtual void PrintDataTo(StringStream* stream);
1553 1546
1554 LOperand* object() const { return object_; } 1547 LOperand* object() const { return object_; }
1555 Handle<Object> name() const { return name_; } 1548 Handle<Object> name() const { return hydrogen()->name(); }
1556 LOperand* value() const { return value_; } 1549 LOperand* value() const { return value_; }
1557 1550
1558 private: 1551 private:
1559 LOperand* object_; 1552 LOperand* object_;
1560 Handle<Object> name_;
1561 LOperand* value_; 1553 LOperand* value_;
1562 }; 1554 };
1563 1555
1564 1556
1565 class LStoreNamedField: public LStoreNamed { 1557 class LStoreNamedField: public LStoreNamed {
1566 public: 1558 public:
1567 LStoreNamedField(LOperand* obj, 1559 LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp)
1568 Handle<Object> name, 1560 : LStoreNamed(obj, val), temp_(temp) { }
1569 LOperand* val,
1570 bool in_object,
1571 int offset,
1572 LOperand* temp,
1573 bool needs_write_barrier,
1574 Handle<Map> transition)
1575 : LStoreNamed(obj, name, val),
1576 is_in_object_(in_object),
1577 offset_(offset),
1578 temp_(temp),
1579 needs_write_barrier_(needs_write_barrier),
1580 transition_(transition) { }
1581 1561
1582 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") 1562 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1563 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1583 1564
1584 bool is_in_object() { return is_in_object_; } 1565 bool is_in_object() { return hydrogen()->is_in_object(); }
1585 int offset() { return offset_; } 1566 int offset() { return hydrogen()->offset(); }
1586 LOperand* temp() { return temp_; } 1567 LOperand* temp() { return temp_; }
1587 bool needs_write_barrier() { return needs_write_barrier_; } 1568 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1588 Handle<Map> transition() const { return transition_; } 1569 Handle<Map> transition() const { return hydrogen()->transition(); }
1589 void set_transition(Handle<Map> map) { transition_ = map; }
1590 1570
1591 private: 1571 private:
1592 bool is_in_object_;
1593 int offset_;
1594 LOperand* temp_; 1572 LOperand* temp_;
1595 bool needs_write_barrier_;
1596 Handle<Map> transition_;
1597 }; 1573 };
1598 1574
1599 1575
1600 class LStoreNamedGeneric: public LStoreNamed { 1576 class LStoreNamedGeneric: public LStoreNamed {
1601 public: 1577 public:
1602 LStoreNamedGeneric(LOperand* obj, 1578 LStoreNamedGeneric(LOperand* obj, LOperand* val)
1603 Handle<Object> name, 1579 : LStoreNamed(obj, val) { }
1604 LOperand* val)
1605 : LStoreNamed(obj, name, val) { }
1606 1580
1607 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") 1581 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1582 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1608 }; 1583 };
1609 1584
1610 1585
1611 class LStoreKeyed: public LTemplateInstruction<0> { 1586 class LStoreKeyed: public LTemplateInstruction<0> {
1612 public: 1587 public:
1613 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) 1588 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val)
1614 : object_(obj), key_(key), value_(val) { } 1589 : object_(obj), key_(key), value_(val) { }
1615 1590
1616 DECLARE_INSTRUCTION(StoreKeyed) 1591 DECLARE_INSTRUCTION(StoreKeyed)
1617 1592
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2115 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2141 }; 2116 };
2142 2117
2143 #undef DECLARE_HYDROGEN_ACCESSOR 2118 #undef DECLARE_HYDROGEN_ACCESSOR
2144 #undef DECLARE_INSTRUCTION 2119 #undef DECLARE_INSTRUCTION
2145 #undef DECLARE_CONCRETE_INSTRUCTION 2120 #undef DECLARE_CONCRETE_INSTRUCTION
2146 2121
2147 } } // namespace v8::internal 2122 } } // namespace v8::internal
2148 2123
2149 #endif // V8_IA32_LITHIUM_IA32_H_ 2124 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698