Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 819 bool NeedsEnvironment() const { | 819 bool NeedsEnvironment() const { |
| 820 return CanDeoptimize() || CanBeDeoptimizationTarget(); | 820 return CanDeoptimize() || CanBeDeoptimizationTarget(); |
| 821 } | 821 } |
| 822 | 822 |
| 823 virtual bool CanBeDeoptimizationTarget() const { | 823 virtual bool CanBeDeoptimizationTarget() const { |
| 824 return false; | 824 return false; |
| 825 } | 825 } |
| 826 | 826 |
| 827 void InheritDeoptTargetAfter(Instruction* other); | 827 void InheritDeoptTargetAfter(Instruction* other); |
| 828 | 828 |
| 829 virtual bool MayThrow() const = 0; | |
|
Kevin Millikin (Google)
2013/05/08 11:42:00
There's an extra space after const for some reason
Florian Schneider
2013/05/08 17:10:55
Done.
| |
| 830 | |
| 829 protected: | 831 protected: |
| 830 // Fetch deopt id without checking if this computation can deoptimize. | 832 // Fetch deopt id without checking if this computation can deoptimize. |
| 831 intptr_t GetDeoptId() const { | 833 intptr_t GetDeoptId() const { |
| 832 return deopt_id_; | 834 return deopt_id_; |
| 833 } | 835 } |
| 834 | 836 |
| 835 private: | 837 private: |
| 836 friend class Definition; // Needed for InsertBefore, InsertAfter. | 838 friend class Definition; // Needed for InsertBefore, InsertAfter. |
| 837 | 839 |
| 838 // Classes that set deopt_id_. | 840 // Classes that set deopt_id_. |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1009 | 1011 |
| 1010 MoveOperands* MoveOperandsAt(intptr_t index) const { return moves_[index]; } | 1012 MoveOperands* MoveOperandsAt(intptr_t index) const { return moves_[index]; } |
| 1011 | 1013 |
| 1012 void SetSrcSlotAt(intptr_t index, const Location& loc); | 1014 void SetSrcSlotAt(intptr_t index, const Location& loc); |
| 1013 void SetDestSlotAt(intptr_t index, const Location& loc); | 1015 void SetDestSlotAt(intptr_t index, const Location& loc); |
| 1014 | 1016 |
| 1015 intptr_t NumMoves() const { return moves_.length(); } | 1017 intptr_t NumMoves() const { return moves_.length(); } |
| 1016 | 1018 |
| 1017 virtual void PrintTo(BufferFormatter* f) const; | 1019 virtual void PrintTo(BufferFormatter* f) const; |
| 1018 | 1020 |
| 1021 virtual bool MayThrow() const { return false; } | |
| 1022 | |
| 1019 private: | 1023 private: |
| 1020 GrowableArray<MoveOperands*> moves_; // Elements cannot be null. | 1024 GrowableArray<MoveOperands*> moves_; // Elements cannot be null. |
| 1021 | 1025 |
| 1022 DISALLOW_COPY_AND_ASSIGN(ParallelMoveInstr); | 1026 DISALLOW_COPY_AND_ASSIGN(ParallelMoveInstr); |
| 1023 }; | 1027 }; |
| 1024 | 1028 |
| 1025 | 1029 |
| 1026 // Basic block entries are administrative nodes. There is a distinguished | 1030 // Basic block entries are administrative nodes. There is a distinguished |
| 1027 // graph entry with no predecessor. Joins are the only nodes with multiple | 1031 // graph entry with no predecessor. Joins are the only nodes with multiple |
| 1028 // predecessors. Targets are all other basic block entries. The types | 1032 // predecessors. Targets are all other basic block entries. The types |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1114 // BlockEntry environment is copied to Goto and Branch instructions | 1118 // BlockEntry environment is copied to Goto and Branch instructions |
| 1115 // when we insert new blocks targeting this block. | 1119 // when we insert new blocks targeting this block. |
| 1116 return true; | 1120 return true; |
| 1117 } | 1121 } |
| 1118 | 1122 |
| 1119 virtual bool CanDeoptimize() const { return false; } | 1123 virtual bool CanDeoptimize() const { return false; } |
| 1120 | 1124 |
| 1121 virtual EffectSet Effects() const { return EffectSet::None(); } | 1125 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 1122 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 1126 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 1123 | 1127 |
| 1128 virtual bool MayThrow() const { return false; } | |
| 1129 | |
| 1124 intptr_t try_index() const { return try_index_; } | 1130 intptr_t try_index() const { return try_index_; } |
| 1125 | 1131 |
| 1126 BitVector* loop_info() const { return loop_info_; } | 1132 BitVector* loop_info() const { return loop_info_; } |
| 1127 void set_loop_info(BitVector* loop_info) { | 1133 void set_loop_info(BitVector* loop_info) { |
| 1128 loop_info_ = loop_info; | 1134 loop_info_ = loop_info; |
| 1129 } | 1135 } |
| 1130 | 1136 |
| 1131 virtual BlockEntryInstr* GetBlock() const { | 1137 virtual BlockEntryInstr* GetBlock() const { |
| 1132 return const_cast<BlockEntryInstr*>(this); | 1138 return const_cast<BlockEntryInstr*>(this); |
| 1133 } | 1139 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1240 virtual intptr_t PredecessorCount() const { return 0; } | 1246 virtual intptr_t PredecessorCount() const { return 0; } |
| 1241 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { | 1247 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { |
| 1242 UNREACHABLE(); | 1248 UNREACHABLE(); |
| 1243 return NULL; | 1249 return NULL; |
| 1244 } | 1250 } |
| 1245 virtual intptr_t SuccessorCount() const; | 1251 virtual intptr_t SuccessorCount() const; |
| 1246 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; | 1252 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; |
| 1247 | 1253 |
| 1248 void AddCatchEntry(CatchBlockEntryInstr* entry) { catch_entries_.Add(entry); } | 1254 void AddCatchEntry(CatchBlockEntryInstr* entry) { catch_entries_.Add(entry); } |
| 1249 | 1255 |
| 1256 CatchBlockEntryInstr* GetCatchEntry(intptr_t index); | |
| 1257 | |
| 1250 virtual void PrepareEntry(FlowGraphCompiler* compiler); | 1258 virtual void PrepareEntry(FlowGraphCompiler* compiler); |
| 1251 | 1259 |
| 1252 GrowableArray<Definition*>* initial_definitions() { | 1260 GrowableArray<Definition*>* initial_definitions() { |
| 1253 return &initial_definitions_; | 1261 return &initial_definitions_; |
| 1254 } | 1262 } |
| 1255 ConstantInstr* constant_null(); | 1263 ConstantInstr* constant_null(); |
| 1256 | 1264 |
| 1257 intptr_t spill_slot_count() const { return spill_slot_count_; } | 1265 intptr_t spill_slot_count() const { return spill_slot_count_; } |
| 1258 void set_spill_slot_count(intptr_t count) { | 1266 void set_spill_slot_count(intptr_t count) { |
| 1259 ASSERT(count >= 0); | 1267 ASSERT(count >= 0); |
| 1260 spill_slot_count_ = count; | 1268 spill_slot_count_ = count; |
| 1261 } | 1269 } |
| 1262 | 1270 |
| 1271 // Number of stack slots reserved for compiling try-catch. For functions | |
| 1272 // without try-catch, this is 0. Otherwise, it is the number of local | |
| 1273 // variables. | |
| 1274 intptr_t fixed_slot_count() const { return fixed_slot_count_; } | |
| 1275 void set_fixed_slot_count(intptr_t count) { | |
| 1276 ASSERT(count >= 0); | |
| 1277 fixed_slot_count_ = count; | |
| 1278 } | |
| 1263 TargetEntryInstr* normal_entry() const { return normal_entry_; } | 1279 TargetEntryInstr* normal_entry() const { return normal_entry_; } |
| 1264 | 1280 |
| 1265 const ParsedFunction& parsed_function() const { | 1281 const ParsedFunction& parsed_function() const { |
| 1266 return parsed_function_; | 1282 return parsed_function_; |
| 1267 } | 1283 } |
| 1268 | 1284 |
| 1285 const GrowableArray<CatchBlockEntryInstr*>& catch_entries() const { | |
| 1286 return catch_entries_; | |
| 1287 } | |
| 1288 | |
| 1269 virtual void PrintTo(BufferFormatter* f) const; | 1289 virtual void PrintTo(BufferFormatter* f) const; |
| 1270 | 1290 |
| 1271 private: | 1291 private: |
| 1272 virtual void ClearPredecessors() {} | 1292 virtual void ClearPredecessors() {} |
| 1273 virtual void AddPredecessor(BlockEntryInstr* predecessor) { UNREACHABLE(); } | 1293 virtual void AddPredecessor(BlockEntryInstr* predecessor) { UNREACHABLE(); } |
| 1274 | 1294 |
| 1275 const ParsedFunction& parsed_function_; | 1295 const ParsedFunction& parsed_function_; |
| 1276 TargetEntryInstr* normal_entry_; | 1296 TargetEntryInstr* normal_entry_; |
| 1277 GrowableArray<CatchBlockEntryInstr*> catch_entries_; | 1297 GrowableArray<CatchBlockEntryInstr*> catch_entries_; |
| 1278 GrowableArray<Definition*> initial_definitions_; | 1298 GrowableArray<Definition*> initial_definitions_; |
| 1279 intptr_t spill_slot_count_; | 1299 intptr_t spill_slot_count_; |
| 1300 intptr_t fixed_slot_count_; // For try-catch in optimized code. | |
| 1280 | 1301 |
| 1281 DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr); | 1302 DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr); |
| 1282 }; | 1303 }; |
| 1283 | 1304 |
| 1284 | 1305 |
| 1285 class JoinEntryInstr : public BlockEntryInstr { | 1306 class JoinEntryInstr : public BlockEntryInstr { |
| 1286 public: | 1307 public: |
| 1287 JoinEntryInstr(intptr_t block_id, intptr_t try_index) | 1308 JoinEntryInstr(intptr_t block_id, intptr_t try_index) |
| 1288 : BlockEntryInstr(block_id, try_index), | 1309 : BlockEntryInstr(block_id, try_index), |
| 1289 predecessors_(2), // Two is the assumed to be the common case. | 1310 predecessors_(2), // Two is the assumed to be the common case. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1409 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { | 1430 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { |
| 1410 ASSERT((index == 0) && (predecessor_ != NULL)); | 1431 ASSERT((index == 0) && (predecessor_ != NULL)); |
| 1411 return predecessor_; | 1432 return predecessor_; |
| 1412 } | 1433 } |
| 1413 | 1434 |
| 1414 // Returns try index for the try block to which this catch handler | 1435 // Returns try index for the try block to which this catch handler |
| 1415 // corresponds. | 1436 // corresponds. |
| 1416 intptr_t catch_try_index() const { | 1437 intptr_t catch_try_index() const { |
| 1417 return catch_try_index_; | 1438 return catch_try_index_; |
| 1418 } | 1439 } |
| 1440 GrowableArray<Definition*>* initial_definitions() { | |
| 1441 return &initial_definitions_; | |
| 1442 } | |
| 1419 | 1443 |
| 1420 virtual void PrepareEntry(FlowGraphCompiler* compiler); | 1444 virtual void PrepareEntry(FlowGraphCompiler* compiler); |
| 1421 | 1445 |
| 1422 virtual void PrintTo(BufferFormatter* f) const; | 1446 virtual void PrintTo(BufferFormatter* f) const; |
| 1423 | 1447 |
| 1424 private: | 1448 private: |
| 1425 friend class BlockEntryInstr; // Access to predecessor_ when inlining. | 1449 friend class BlockEntryInstr; // Access to predecessor_ when inlining. |
| 1426 | 1450 |
| 1427 virtual void ClearPredecessors() { predecessor_ = NULL; } | 1451 virtual void ClearPredecessors() { predecessor_ = NULL; } |
| 1428 virtual void AddPredecessor(BlockEntryInstr* predecessor) { | 1452 virtual void AddPredecessor(BlockEntryInstr* predecessor) { |
| 1429 ASSERT(predecessor_ == NULL); | 1453 ASSERT(predecessor_ == NULL); |
| 1430 predecessor_ = predecessor; | 1454 predecessor_ = predecessor; |
| 1431 } | 1455 } |
| 1432 | 1456 |
| 1433 BlockEntryInstr* predecessor_; | 1457 BlockEntryInstr* predecessor_; |
| 1434 const Array& catch_handler_types_; | 1458 const Array& catch_handler_types_; |
| 1435 const intptr_t catch_try_index_; | 1459 const intptr_t catch_try_index_; |
| 1460 GrowableArray<Definition*> initial_definitions_; | |
| 1436 | 1461 |
| 1437 DISALLOW_COPY_AND_ASSIGN(CatchBlockEntryInstr); | 1462 DISALLOW_COPY_AND_ASSIGN(CatchBlockEntryInstr); |
| 1438 }; | 1463 }; |
| 1439 | 1464 |
| 1440 | 1465 |
| 1441 // Abstract super-class of all instructions that define a value (Bind, Phi). | 1466 // Abstract super-class of all instructions that define a value (Bind, Phi). |
| 1442 class Definition : public Instruction { | 1467 class Definition : public Instruction { |
| 1443 public: | 1468 public: |
| 1444 enum UseKind { kEffect, kValue }; | 1469 enum UseKind { kEffect, kValue }; |
| 1445 | 1470 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1654 virtual void InferRange(); | 1679 virtual void InferRange(); |
| 1655 | 1680 |
| 1656 BitVector* reaching_defs() const { | 1681 BitVector* reaching_defs() const { |
| 1657 return reaching_defs_; | 1682 return reaching_defs_; |
| 1658 } | 1683 } |
| 1659 | 1684 |
| 1660 void set_reaching_defs(BitVector* reaching_defs) { | 1685 void set_reaching_defs(BitVector* reaching_defs) { |
| 1661 reaching_defs_ = reaching_defs; | 1686 reaching_defs_ = reaching_defs; |
| 1662 } | 1687 } |
| 1663 | 1688 |
| 1689 virtual bool MayThrow() const { return false; } | |
| 1690 | |
| 1664 private: | 1691 private: |
| 1665 // Direct access to inputs_ in order to resize it due to unreachable | 1692 // Direct access to inputs_ in order to resize it due to unreachable |
| 1666 // predecessors. | 1693 // predecessors. |
| 1667 friend class ConstantPropagator; | 1694 friend class ConstantPropagator; |
| 1668 | 1695 |
| 1669 void RawSetInputAt(intptr_t i, Value* value) { inputs_[i] = value; } | 1696 void RawSetInputAt(intptr_t i, Value* value) { inputs_[i] = value; } |
| 1670 | 1697 |
| 1671 JoinEntryInstr* block_; | 1698 JoinEntryInstr* block_; |
| 1672 GrowableArray<Value*> inputs_; | 1699 GrowableArray<Value*> inputs_; |
| 1673 bool is_alive_; | 1700 bool is_alive_; |
| 1674 Representation representation_; | 1701 Representation representation_; |
| 1675 | 1702 |
| 1676 BitVector* reaching_defs_; | 1703 BitVector* reaching_defs_; |
| 1677 | 1704 |
| 1678 DISALLOW_COPY_AND_ASSIGN(PhiInstr); | 1705 DISALLOW_COPY_AND_ASSIGN(PhiInstr); |
| 1679 }; | 1706 }; |
| 1680 | 1707 |
| 1681 | 1708 |
| 1682 class ParameterInstr : public Definition { | 1709 class ParameterInstr : public Definition { |
| 1683 public: | 1710 public: |
| 1684 ParameterInstr(intptr_t index, GraphEntryInstr* block) | 1711 ParameterInstr(intptr_t index, BlockEntryInstr* block) |
| 1685 : index_(index), block_(block) { } | 1712 : index_(index), block_(block) { } |
| 1686 | 1713 |
| 1687 DECLARE_INSTRUCTION(Parameter) | 1714 DECLARE_INSTRUCTION(Parameter) |
| 1688 | 1715 |
| 1689 intptr_t index() const { return index_; } | 1716 intptr_t index() const { return index_; } |
| 1690 | 1717 |
| 1691 // Get the block entry for that instruction. | 1718 // Get the block entry for that instruction. |
| 1692 virtual BlockEntryInstr* GetBlock() const { return block_; } | 1719 virtual BlockEntryInstr* GetBlock() const { return block_; } |
| 1693 | 1720 |
| 1694 virtual intptr_t ArgumentCount() const { return 0; } | 1721 virtual intptr_t ArgumentCount() const { return 0; } |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 1706 | 1733 |
| 1707 virtual intptr_t Hashcode() const { | 1734 virtual intptr_t Hashcode() const { |
| 1708 UNREACHABLE(); | 1735 UNREACHABLE(); |
| 1709 return 0; | 1736 return 0; |
| 1710 } | 1737 } |
| 1711 | 1738 |
| 1712 virtual void PrintOperandsTo(BufferFormatter* f) const; | 1739 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 1713 | 1740 |
| 1714 virtual CompileType ComputeType() const; | 1741 virtual CompileType ComputeType() const; |
| 1715 | 1742 |
| 1743 virtual bool MayThrow() const { return false; } | |
| 1744 | |
| 1716 private: | 1745 private: |
| 1717 virtual void RawSetInputAt(intptr_t i, Value* value) { UNREACHABLE(); } | 1746 virtual void RawSetInputAt(intptr_t i, Value* value) { UNREACHABLE(); } |
| 1718 | 1747 |
| 1719 const intptr_t index_; | 1748 const intptr_t index_; |
| 1720 GraphEntryInstr* block_; | 1749 BlockEntryInstr* block_; |
| 1721 | 1750 |
| 1722 DISALLOW_COPY_AND_ASSIGN(ParameterInstr); | 1751 DISALLOW_COPY_AND_ASSIGN(ParameterInstr); |
| 1723 }; | 1752 }; |
| 1724 | 1753 |
| 1725 | 1754 |
| 1726 class PushArgumentInstr : public Definition { | 1755 class PushArgumentInstr : public Definition { |
| 1727 public: | 1756 public: |
| 1728 explicit PushArgumentInstr(Value* value) : locs_(NULL) { | 1757 explicit PushArgumentInstr(Value* value) : locs_(NULL) { |
| 1729 SetInputAt(0, value); | 1758 SetInputAt(0, value); |
| 1730 set_use_kind(kEffect); // Override the default. | 1759 set_use_kind(kEffect); // Override the default. |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 1755 UNREACHABLE(); | 1784 UNREACHABLE(); |
| 1756 return 0; | 1785 return 0; |
| 1757 } | 1786 } |
| 1758 | 1787 |
| 1759 virtual bool CanDeoptimize() const { return false; } | 1788 virtual bool CanDeoptimize() const { return false; } |
| 1760 | 1789 |
| 1761 virtual EffectSet Effects() const { return EffectSet::None(); } | 1790 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 1762 | 1791 |
| 1763 virtual void PrintOperandsTo(BufferFormatter* f) const; | 1792 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 1764 | 1793 |
| 1794 virtual bool MayThrow() const { return false; } | |
| 1795 | |
| 1765 private: | 1796 private: |
| 1766 virtual void RawSetInputAt(intptr_t i, Value* value) { | 1797 virtual void RawSetInputAt(intptr_t i, Value* value) { |
| 1767 ASSERT(i == 0); | 1798 ASSERT(i == 0); |
| 1768 value_ = value; | 1799 value_ = value; |
| 1769 } | 1800 } |
| 1770 | 1801 |
| 1771 Value* value_; | 1802 Value* value_; |
| 1772 LocationSummary* locs_; | 1803 LocationSummary* locs_; |
| 1773 | 1804 |
| 1774 DISALLOW_COPY_AND_ASSIGN(PushArgumentInstr); | 1805 DISALLOW_COPY_AND_ASSIGN(PushArgumentInstr); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 1797 virtual bool CanBeDeoptimizationTarget() const { | 1828 virtual bool CanBeDeoptimizationTarget() const { |
| 1798 // Return instruction might turn into a Goto instruction after inlining. | 1829 // Return instruction might turn into a Goto instruction after inlining. |
| 1799 // Every Goto must have an environment. | 1830 // Every Goto must have an environment. |
| 1800 return true; | 1831 return true; |
| 1801 } | 1832 } |
| 1802 | 1833 |
| 1803 virtual bool CanDeoptimize() const { return false; } | 1834 virtual bool CanDeoptimize() const { return false; } |
| 1804 | 1835 |
| 1805 virtual EffectSet Effects() const { return EffectSet::None(); } | 1836 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 1806 | 1837 |
| 1838 virtual bool MayThrow() const { return false; } | |
| 1839 | |
| 1807 private: | 1840 private: |
| 1808 const intptr_t token_pos_; | 1841 const intptr_t token_pos_; |
| 1809 | 1842 |
| 1810 DISALLOW_COPY_AND_ASSIGN(ReturnInstr); | 1843 DISALLOW_COPY_AND_ASSIGN(ReturnInstr); |
| 1811 }; | 1844 }; |
| 1812 | 1845 |
| 1813 | 1846 |
| 1814 class ThrowInstr : public TemplateInstruction<0> { | 1847 class ThrowInstr : public TemplateInstruction<0> { |
| 1815 public: | 1848 public: |
| 1816 explicit ThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { } | 1849 explicit ThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { } |
| 1817 | 1850 |
| 1818 DECLARE_INSTRUCTION(Throw) | 1851 DECLARE_INSTRUCTION(Throw) |
| 1819 | 1852 |
| 1820 virtual intptr_t ArgumentCount() const { return 1; } | 1853 virtual intptr_t ArgumentCount() const { return 1; } |
| 1821 | 1854 |
| 1822 intptr_t token_pos() const { return token_pos_; } | 1855 intptr_t token_pos() const { return token_pos_; } |
| 1823 | 1856 |
| 1824 virtual bool CanDeoptimize() const { return true; } | 1857 virtual bool CanDeoptimize() const { return true; } |
| 1825 | 1858 |
| 1826 virtual EffectSet Effects() const { return EffectSet::None(); } | 1859 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 1827 | 1860 |
| 1861 virtual bool MayThrow() const { return true; } | |
| 1862 | |
| 1828 private: | 1863 private: |
| 1829 const intptr_t token_pos_; | 1864 const intptr_t token_pos_; |
| 1830 | 1865 |
| 1831 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); | 1866 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); |
| 1832 }; | 1867 }; |
| 1833 | 1868 |
| 1834 | 1869 |
| 1835 class ReThrowInstr : public TemplateInstruction<0> { | 1870 class ReThrowInstr : public TemplateInstruction<0> { |
| 1836 public: | 1871 public: |
| 1837 explicit ReThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { } | 1872 explicit ReThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { } |
| 1838 | 1873 |
| 1839 DECLARE_INSTRUCTION(ReThrow) | 1874 DECLARE_INSTRUCTION(ReThrow) |
| 1840 | 1875 |
| 1841 virtual intptr_t ArgumentCount() const { return 2; } | 1876 virtual intptr_t ArgumentCount() const { return 2; } |
| 1842 | 1877 |
| 1843 intptr_t token_pos() const { return token_pos_; } | 1878 intptr_t token_pos() const { return token_pos_; } |
| 1844 | 1879 |
| 1845 virtual bool CanDeoptimize() const { return true; } | 1880 virtual bool CanDeoptimize() const { return true; } |
| 1846 | 1881 |
| 1847 virtual EffectSet Effects() const { return EffectSet::None(); } | 1882 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 1848 | 1883 |
| 1884 virtual bool MayThrow() const { return true; } | |
| 1885 | |
| 1849 private: | 1886 private: |
| 1850 const intptr_t token_pos_; | 1887 const intptr_t token_pos_; |
| 1851 | 1888 |
| 1852 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr); | 1889 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr); |
| 1853 }; | 1890 }; |
| 1854 | 1891 |
| 1855 | 1892 |
| 1856 class GotoInstr : public TemplateInstruction<0> { | 1893 class GotoInstr : public TemplateInstruction<0> { |
| 1857 public: | 1894 public: |
| 1858 explicit GotoInstr(JoinEntryInstr* entry) | 1895 explicit GotoInstr(JoinEntryInstr* entry) |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 1888 | 1925 |
| 1889 ParallelMoveInstr* GetParallelMove() { | 1926 ParallelMoveInstr* GetParallelMove() { |
| 1890 if (parallel_move_ == NULL) { | 1927 if (parallel_move_ == NULL) { |
| 1891 parallel_move_ = new ParallelMoveInstr(); | 1928 parallel_move_ = new ParallelMoveInstr(); |
| 1892 } | 1929 } |
| 1893 return parallel_move_; | 1930 return parallel_move_; |
| 1894 } | 1931 } |
| 1895 | 1932 |
| 1896 virtual void PrintTo(BufferFormatter* f) const; | 1933 virtual void PrintTo(BufferFormatter* f) const; |
| 1897 | 1934 |
| 1935 virtual bool MayThrow() const { return false; } | |
| 1936 | |
| 1898 private: | 1937 private: |
| 1899 JoinEntryInstr* successor_; | 1938 JoinEntryInstr* successor_; |
| 1900 | 1939 |
| 1901 // Parallel move that will be used by linear scan register allocator to | 1940 // Parallel move that will be used by linear scan register allocator to |
| 1902 // connect live ranges at the end of the block and resolve phis. | 1941 // connect live ranges at the end of the block and resolve phis. |
| 1903 ParallelMoveInstr* parallel_move_; | 1942 ParallelMoveInstr* parallel_move_; |
| 1904 }; | 1943 }; |
| 1905 | 1944 |
| 1906 | 1945 |
| 1907 class ControlInstruction : public Instruction { | 1946 class ControlInstruction : public Instruction { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1982 void set_constant_target(TargetEntryInstr* target) { | 2021 void set_constant_target(TargetEntryInstr* target) { |
| 1983 ASSERT(target == true_successor() || target == false_successor()); | 2022 ASSERT(target == true_successor() || target == false_successor()); |
| 1984 constant_target_ = target; | 2023 constant_target_ = target; |
| 1985 } | 2024 } |
| 1986 TargetEntryInstr* constant_target() const { | 2025 TargetEntryInstr* constant_target() const { |
| 1987 return constant_target_; | 2026 return constant_target_; |
| 1988 } | 2027 } |
| 1989 | 2028 |
| 1990 virtual void InheritDeoptTarget(Instruction* other); | 2029 virtual void InheritDeoptTarget(Instruction* other); |
| 1991 | 2030 |
| 2031 virtual bool MayThrow() const; | |
| 2032 | |
| 1992 private: | 2033 private: |
| 1993 virtual void RawSetInputAt(intptr_t i, Value* value); | 2034 virtual void RawSetInputAt(intptr_t i, Value* value); |
| 1994 | 2035 |
| 1995 ComparisonInstr* comparison_; | 2036 ComparisonInstr* comparison_; |
| 1996 const bool is_checked_; | 2037 const bool is_checked_; |
| 1997 | 2038 |
| 1998 ConstrainedCompileType* constrained_type_; | 2039 ConstrainedCompileType* constrained_type_; |
| 1999 | 2040 |
| 2000 TargetEntryInstr* constant_target_; | 2041 TargetEntryInstr* constant_target_; |
| 2001 | 2042 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 2012 DECLARE_INSTRUCTION(StoreContext) | 2053 DECLARE_INSTRUCTION(StoreContext) |
| 2013 | 2054 |
| 2014 virtual intptr_t ArgumentCount() const { return 0; } | 2055 virtual intptr_t ArgumentCount() const { return 0; } |
| 2015 | 2056 |
| 2016 Value* value() const { return inputs_[0]; } | 2057 Value* value() const { return inputs_[0]; } |
| 2017 | 2058 |
| 2018 virtual bool CanDeoptimize() const { return false; } | 2059 virtual bool CanDeoptimize() const { return false; } |
| 2019 | 2060 |
| 2020 virtual EffectSet Effects() const { return EffectSet::None(); } | 2061 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2021 | 2062 |
| 2063 virtual bool MayThrow() const { return false; } | |
| 2064 | |
| 2022 private: | 2065 private: |
| 2023 DISALLOW_COPY_AND_ASSIGN(StoreContextInstr); | 2066 DISALLOW_COPY_AND_ASSIGN(StoreContextInstr); |
| 2024 }; | 2067 }; |
| 2025 | 2068 |
| 2026 | 2069 |
| 2027 template<intptr_t N> | 2070 template<intptr_t N> |
| 2028 class TemplateDefinition : public Definition { | 2071 class TemplateDefinition : public Definition { |
| 2029 public: | 2072 public: |
| 2030 TemplateDefinition<N>() : locs_(NULL) { } | 2073 TemplateDefinition<N>() : locs_(NULL) { } |
| 2031 | 2074 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2065 | 2108 |
| 2066 Value* value() const { return inputs_[0]; } | 2109 Value* value() const { return inputs_[0]; } |
| 2067 | 2110 |
| 2068 virtual CompileType ComputeType() const; | 2111 virtual CompileType ComputeType() const; |
| 2069 virtual bool RecomputeType(); | 2112 virtual bool RecomputeType(); |
| 2070 | 2113 |
| 2071 virtual bool CanDeoptimize() const { return false; } | 2114 virtual bool CanDeoptimize() const { return false; } |
| 2072 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2115 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 2073 virtual EffectSet Effects() const { return EffectSet::None(); } | 2116 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2074 | 2117 |
| 2118 virtual bool MayThrow() const { return false; } | |
| 2119 | |
| 2075 private: | 2120 private: |
| 2076 DISALLOW_COPY_AND_ASSIGN(RedefinitionInstr); | 2121 DISALLOW_COPY_AND_ASSIGN(RedefinitionInstr); |
| 2077 }; | 2122 }; |
| 2078 | 2123 |
| 2079 | 2124 |
| 2080 class RangeBoundary : public ValueObject { | 2125 class RangeBoundary : public ValueObject { |
| 2081 public: | 2126 public: |
| 2082 enum Kind { kUnknown, kSymbol, kConstant }; | 2127 enum Kind { kUnknown, kSymbol, kConstant }; |
| 2083 | 2128 |
| 2084 RangeBoundary() : kind_(kUnknown), value_(0), offset_(0) { } | 2129 RangeBoundary() : kind_(kUnknown), value_(0), offset_(0) { } |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2256 | 2301 |
| 2257 virtual bool CanDeoptimize() const { return false; } | 2302 virtual bool CanDeoptimize() const { return false; } |
| 2258 | 2303 |
| 2259 virtual EffectSet Effects() const { return EffectSet::None(); } | 2304 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2260 | 2305 |
| 2261 virtual bool AttributesEqual(Instruction* other) const { | 2306 virtual bool AttributesEqual(Instruction* other) const { |
| 2262 UNREACHABLE(); | 2307 UNREACHABLE(); |
| 2263 return false; | 2308 return false; |
| 2264 } | 2309 } |
| 2265 | 2310 |
| 2311 virtual bool MayThrow() const { return false; } | |
| 2312 | |
| 2266 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2313 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2267 | 2314 |
| 2268 Value* value() const { return inputs_[0]; } | 2315 Value* value() const { return inputs_[0]; } |
| 2269 Range* constraint() const { return constraint_; } | 2316 Range* constraint() const { return constraint_; } |
| 2270 | 2317 |
| 2271 virtual void InferRange(); | 2318 virtual void InferRange(); |
| 2272 | 2319 |
| 2273 void AddDependency(Definition* defn) { | 2320 void AddDependency(Definition* defn) { |
| 2274 Value* val = new Value(defn); | 2321 Value* val = new Value(defn); |
| 2275 defn->AddInputUse(val); | 2322 defn->AddInputUse(val); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2314 | 2361 |
| 2315 virtual bool CanDeoptimize() const { return false; } | 2362 virtual bool CanDeoptimize() const { return false; } |
| 2316 | 2363 |
| 2317 virtual void InferRange(); | 2364 virtual void InferRange(); |
| 2318 | 2365 |
| 2319 virtual bool AllowsCSE() const { return true; } | 2366 virtual bool AllowsCSE() const { return true; } |
| 2320 virtual EffectSet Effects() const { return EffectSet::None(); } | 2367 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2321 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2368 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 2322 virtual bool AttributesEqual(Instruction* other) const; | 2369 virtual bool AttributesEqual(Instruction* other) const; |
| 2323 | 2370 |
| 2371 virtual bool MayThrow() const { return false; } | |
| 2372 | |
| 2324 private: | 2373 private: |
| 2325 const Object& value_; | 2374 const Object& value_; |
| 2326 | 2375 |
| 2327 DISALLOW_COPY_AND_ASSIGN(ConstantInstr); | 2376 DISALLOW_COPY_AND_ASSIGN(ConstantInstr); |
| 2328 }; | 2377 }; |
| 2329 | 2378 |
| 2330 | 2379 |
| 2331 class AssertAssignableInstr : public TemplateDefinition<3> { | 2380 class AssertAssignableInstr : public TemplateDefinition<3> { |
| 2332 public: | 2381 public: |
| 2333 AssertAssignableInstr(intptr_t token_pos, | 2382 AssertAssignableInstr(intptr_t token_pos, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2365 | 2414 |
| 2366 virtual bool CanDeoptimize() const { return true; } | 2415 virtual bool CanDeoptimize() const { return true; } |
| 2367 | 2416 |
| 2368 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); | 2417 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); |
| 2369 | 2418 |
| 2370 virtual bool AllowsCSE() const { return true; } | 2419 virtual bool AllowsCSE() const { return true; } |
| 2371 virtual EffectSet Effects() const { return EffectSet::None(); } | 2420 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2372 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2421 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 2373 virtual bool AttributesEqual(Instruction* other) const; | 2422 virtual bool AttributesEqual(Instruction* other) const; |
| 2374 | 2423 |
| 2424 virtual bool MayThrow() const { return true; } | |
| 2425 | |
| 2375 private: | 2426 private: |
| 2376 const intptr_t token_pos_; | 2427 const intptr_t token_pos_; |
| 2377 AbstractType& dst_type_; | 2428 AbstractType& dst_type_; |
| 2378 const String& dst_name_; | 2429 const String& dst_name_; |
| 2379 | 2430 |
| 2380 DISALLOW_COPY_AND_ASSIGN(AssertAssignableInstr); | 2431 DISALLOW_COPY_AND_ASSIGN(AssertAssignableInstr); |
| 2381 }; | 2432 }; |
| 2382 | 2433 |
| 2383 | 2434 |
| 2384 class AssertBooleanInstr : public TemplateDefinition<1> { | 2435 class AssertBooleanInstr : public TemplateDefinition<1> { |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 2398 | 2449 |
| 2399 virtual bool CanDeoptimize() const { return true; } | 2450 virtual bool CanDeoptimize() const { return true; } |
| 2400 | 2451 |
| 2401 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); | 2452 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); |
| 2402 | 2453 |
| 2403 virtual bool AllowsCSE() const { return true; } | 2454 virtual bool AllowsCSE() const { return true; } |
| 2404 virtual EffectSet Effects() const { return EffectSet::None(); } | 2455 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2405 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2456 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 2406 virtual bool AttributesEqual(Instruction* other) const { return true; } | 2457 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 2407 | 2458 |
| 2459 virtual bool MayThrow() const { return true; } | |
| 2460 | |
| 2408 private: | 2461 private: |
| 2409 const intptr_t token_pos_; | 2462 const intptr_t token_pos_; |
| 2410 | 2463 |
| 2411 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr); | 2464 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr); |
| 2412 }; | 2465 }; |
| 2413 | 2466 |
| 2414 | 2467 |
| 2415 class ArgumentDefinitionTestInstr : public TemplateDefinition<1> { | 2468 class ArgumentDefinitionTestInstr : public TemplateDefinition<1> { |
| 2416 public: | 2469 public: |
| 2417 ArgumentDefinitionTestInstr(ArgumentDefinitionTestNode* node, | 2470 ArgumentDefinitionTestInstr(ArgumentDefinitionTestNode* node, |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 2432 } | 2485 } |
| 2433 | 2486 |
| 2434 Value* saved_arguments_descriptor() const { return inputs_[0]; } | 2487 Value* saved_arguments_descriptor() const { return inputs_[0]; } |
| 2435 | 2488 |
| 2436 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2489 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2437 | 2490 |
| 2438 virtual bool CanDeoptimize() const { return true; } | 2491 virtual bool CanDeoptimize() const { return true; } |
| 2439 | 2492 |
| 2440 virtual EffectSet Effects() const { return EffectSet::None(); } | 2493 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2441 | 2494 |
| 2495 virtual bool MayThrow() const { return true; } | |
| 2496 | |
| 2442 private: | 2497 private: |
| 2443 const ArgumentDefinitionTestNode& ast_node_; | 2498 const ArgumentDefinitionTestNode& ast_node_; |
| 2444 | 2499 |
| 2445 DISALLOW_COPY_AND_ASSIGN(ArgumentDefinitionTestInstr); | 2500 DISALLOW_COPY_AND_ASSIGN(ArgumentDefinitionTestInstr); |
| 2446 }; | 2501 }; |
| 2447 | 2502 |
| 2448 | 2503 |
| 2449 // Denotes the current context, normally held in a register. This is | 2504 // Denotes the current context, normally held in a register. This is |
| 2450 // a computation, not a value, because it's mutable. | 2505 // a computation, not a value, because it's mutable. |
| 2451 class CurrentContextInstr : public TemplateDefinition<0> { | 2506 class CurrentContextInstr : public TemplateDefinition<0> { |
| 2452 public: | 2507 public: |
| 2453 CurrentContextInstr() { } | 2508 CurrentContextInstr() { } |
| 2454 | 2509 |
| 2455 DECLARE_INSTRUCTION(CurrentContext) | 2510 DECLARE_INSTRUCTION(CurrentContext) |
| 2456 virtual CompileType ComputeType() const; | 2511 virtual CompileType ComputeType() const; |
| 2457 | 2512 |
| 2458 virtual bool CanDeoptimize() const { return false; } | 2513 virtual bool CanDeoptimize() const { return false; } |
| 2459 | 2514 |
| 2460 virtual EffectSet Effects() const { return EffectSet::None(); } | 2515 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2461 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2516 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 2462 virtual bool AttributesEqual(Instruction* other) const { return true; } | 2517 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 2463 | 2518 |
| 2519 virtual bool MayThrow() const { return false; } | |
| 2520 | |
| 2464 private: | 2521 private: |
| 2465 DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr); | 2522 DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr); |
| 2466 }; | 2523 }; |
| 2467 | 2524 |
| 2468 | 2525 |
| 2469 class ClosureCallInstr : public TemplateDefinition<0> { | 2526 class ClosureCallInstr : public TemplateDefinition<0> { |
| 2470 public: | 2527 public: |
| 2471 ClosureCallInstr(ClosureCallNode* node, | 2528 ClosureCallInstr(ClosureCallNode* node, |
| 2472 ZoneGrowableArray<PushArgumentInstr*>* arguments) | 2529 ZoneGrowableArray<PushArgumentInstr*>* arguments) |
| 2473 : ast_node_(*node), | 2530 : ast_node_(*node), |
| 2474 arguments_(arguments) { } | 2531 arguments_(arguments) { } |
| 2475 | 2532 |
| 2476 DECLARE_INSTRUCTION(ClosureCall) | 2533 DECLARE_INSTRUCTION(ClosureCall) |
| 2477 | 2534 |
| 2478 const Array& argument_names() const { return ast_node_.arguments()->names(); } | 2535 const Array& argument_names() const { return ast_node_.arguments()->names(); } |
| 2479 intptr_t token_pos() const { return ast_node_.token_pos(); } | 2536 intptr_t token_pos() const { return ast_node_.token_pos(); } |
| 2480 | 2537 |
| 2481 virtual intptr_t ArgumentCount() const { return arguments_->length(); } | 2538 virtual intptr_t ArgumentCount() const { return arguments_->length(); } |
| 2482 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { | 2539 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { |
| 2483 return (*arguments_)[index]; | 2540 return (*arguments_)[index]; |
| 2484 } | 2541 } |
| 2485 | 2542 |
| 2486 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2543 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2487 | 2544 |
| 2488 virtual bool CanDeoptimize() const { return true; } | 2545 virtual bool CanDeoptimize() const { return true; } |
| 2489 | 2546 |
| 2490 virtual EffectSet Effects() const { return EffectSet::All(); } | 2547 virtual EffectSet Effects() const { return EffectSet::All(); } |
| 2491 | 2548 |
| 2549 virtual bool MayThrow() const { return true; } | |
| 2550 | |
| 2492 private: | 2551 private: |
| 2493 const ClosureCallNode& ast_node_; | 2552 const ClosureCallNode& ast_node_; |
| 2494 ZoneGrowableArray<PushArgumentInstr*>* arguments_; | 2553 ZoneGrowableArray<PushArgumentInstr*>* arguments_; |
| 2495 | 2554 |
| 2496 DISALLOW_COPY_AND_ASSIGN(ClosureCallInstr); | 2555 DISALLOW_COPY_AND_ASSIGN(ClosureCallInstr); |
| 2497 }; | 2556 }; |
| 2498 | 2557 |
| 2499 | 2558 |
| 2500 class InstanceCallInstr : public TemplateDefinition<0> { | 2559 class InstanceCallInstr : public TemplateDefinition<0> { |
| 2501 public: | 2560 public: |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2544 } | 2603 } |
| 2545 const Array& argument_names() const { return argument_names_; } | 2604 const Array& argument_names() const { return argument_names_; } |
| 2546 intptr_t checked_argument_count() const { return checked_argument_count_; } | 2605 intptr_t checked_argument_count() const { return checked_argument_count_; } |
| 2547 | 2606 |
| 2548 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2607 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2549 | 2608 |
| 2550 virtual bool CanDeoptimize() const { return true; } | 2609 virtual bool CanDeoptimize() const { return true; } |
| 2551 | 2610 |
| 2552 virtual EffectSet Effects() const { return EffectSet::All(); } | 2611 virtual EffectSet Effects() const { return EffectSet::All(); } |
| 2553 | 2612 |
| 2613 virtual bool MayThrow() const { return true; } | |
| 2614 | |
| 2554 protected: | 2615 protected: |
| 2555 friend class FlowGraphOptimizer; | 2616 friend class FlowGraphOptimizer; |
| 2556 void set_ic_data(ICData* value) { ic_data_ = value; } | 2617 void set_ic_data(ICData* value) { ic_data_ = value; } |
| 2557 | 2618 |
| 2558 private: | 2619 private: |
| 2559 const ICData* ic_data_; | 2620 const ICData* ic_data_; |
| 2560 const intptr_t token_pos_; | 2621 const intptr_t token_pos_; |
| 2561 const String& function_name_; | 2622 const String& function_name_; |
| 2562 const Token::Kind token_kind_; // Binary op, unary op, kGET or kILLEGAL. | 2623 const Token::Kind token_kind_; // Binary op, unary op, kGET or kILLEGAL. |
| 2563 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; | 2624 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 2593 DECLARE_INSTRUCTION(PolymorphicInstanceCall) | 2654 DECLARE_INSTRUCTION(PolymorphicInstanceCall) |
| 2594 | 2655 |
| 2595 const ICData& ic_data() const { return ic_data_; } | 2656 const ICData& ic_data() const { return ic_data_; } |
| 2596 | 2657 |
| 2597 virtual bool CanDeoptimize() const { return true; } | 2658 virtual bool CanDeoptimize() const { return true; } |
| 2598 | 2659 |
| 2599 virtual EffectSet Effects() const { return EffectSet::All(); } | 2660 virtual EffectSet Effects() const { return EffectSet::All(); } |
| 2600 | 2661 |
| 2601 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2662 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2602 | 2663 |
| 2664 virtual bool MayThrow() const { return true; } | |
| 2665 | |
| 2603 private: | 2666 private: |
| 2604 InstanceCallInstr* instance_call_; | 2667 InstanceCallInstr* instance_call_; |
| 2605 const ICData& ic_data_; | 2668 const ICData& ic_data_; |
| 2606 const bool with_checks_; | 2669 const bool with_checks_; |
| 2607 | 2670 |
| 2608 DISALLOW_COPY_AND_ASSIGN(PolymorphicInstanceCallInstr); | 2671 DISALLOW_COPY_AND_ASSIGN(PolymorphicInstanceCallInstr); |
| 2609 }; | 2672 }; |
| 2610 | 2673 |
| 2611 | 2674 |
| 2612 class ComparisonInstr : public TemplateDefinition<2> { | 2675 class ComparisonInstr : public TemplateDefinition<2> { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2684 return comparison()->DeoptimizationTarget(); | 2747 return comparison()->DeoptimizationTarget(); |
| 2685 } | 2748 } |
| 2686 | 2749 |
| 2687 | 2750 |
| 2688 inline Representation BranchInstr::RequiredInputRepresentation( | 2751 inline Representation BranchInstr::RequiredInputRepresentation( |
| 2689 intptr_t i) const { | 2752 intptr_t i) const { |
| 2690 return comparison()->RequiredInputRepresentation(i); | 2753 return comparison()->RequiredInputRepresentation(i); |
| 2691 } | 2754 } |
| 2692 | 2755 |
| 2693 | 2756 |
| 2757 inline bool BranchInstr::MayThrow() const { | |
| 2758 return comparison()->MayThrow(); | |
| 2759 } | |
| 2760 | |
| 2761 | |
| 2694 class StrictCompareInstr : public ComparisonInstr { | 2762 class StrictCompareInstr : public ComparisonInstr { |
| 2695 public: | 2763 public: |
| 2696 StrictCompareInstr(Token::Kind kind, Value* left, Value* right); | 2764 StrictCompareInstr(Token::Kind kind, Value* left, Value* right); |
| 2697 | 2765 |
| 2698 DECLARE_INSTRUCTION(StrictCompare) | 2766 DECLARE_INSTRUCTION(StrictCompare) |
| 2699 virtual CompileType ComputeType() const; | 2767 virtual CompileType ComputeType() const; |
| 2700 | 2768 |
| 2701 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2769 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2702 | 2770 |
| 2703 virtual bool CanBeDeoptimizationTarget() const { | 2771 virtual bool CanBeDeoptimizationTarget() const { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 2714 | 2782 |
| 2715 bool needs_number_check() const { return needs_number_check_; } | 2783 bool needs_number_check() const { return needs_number_check_; } |
| 2716 void set_needs_number_check(bool value) { needs_number_check_ = value; } | 2784 void set_needs_number_check(bool value) { needs_number_check_ = value; } |
| 2717 void set_kind(Token::Kind value) { kind_ = value; } | 2785 void set_kind(Token::Kind value) { kind_ = value; } |
| 2718 | 2786 |
| 2719 virtual bool AllowsCSE() const { return true; } | 2787 virtual bool AllowsCSE() const { return true; } |
| 2720 virtual EffectSet Effects() const { return EffectSet::None(); } | 2788 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2721 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2789 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 2722 virtual bool AttributesEqual(Instruction* other) const; | 2790 virtual bool AttributesEqual(Instruction* other) const; |
| 2723 | 2791 |
| 2792 virtual bool MayThrow() const { return false; } | |
| 2793 | |
| 2724 private: | 2794 private: |
| 2725 // True if the comparison must check for double, Mint or Bigint and | 2795 // True if the comparison must check for double, Mint or Bigint and |
| 2726 // use value comparison instead. | 2796 // use value comparison instead. |
| 2727 bool needs_number_check_; | 2797 bool needs_number_check_; |
| 2728 | 2798 |
| 2729 DISALLOW_COPY_AND_ASSIGN(StrictCompareInstr); | 2799 DISALLOW_COPY_AND_ASSIGN(StrictCompareInstr); |
| 2730 }; | 2800 }; |
| 2731 | 2801 |
| 2732 | 2802 |
| 2733 class EqualityCompareInstr : public ComparisonInstr { | 2803 class EqualityCompareInstr : public ComparisonInstr { |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 2759 // Receiver class id is computed from collected ICData. | 2829 // Receiver class id is computed from collected ICData. |
| 2760 void set_receiver_class_id(intptr_t value) { receiver_class_id_ = value; } | 2830 void set_receiver_class_id(intptr_t value) { receiver_class_id_ = value; } |
| 2761 intptr_t receiver_class_id() const { return receiver_class_id_; } | 2831 intptr_t receiver_class_id() const { return receiver_class_id_; } |
| 2762 | 2832 |
| 2763 bool IsInlinedNumericComparison() const { | 2833 bool IsInlinedNumericComparison() const { |
| 2764 return (receiver_class_id() == kDoubleCid) | 2834 return (receiver_class_id() == kDoubleCid) |
| 2765 || (receiver_class_id() == kMintCid) | 2835 || (receiver_class_id() == kMintCid) |
| 2766 || (receiver_class_id() == kSmiCid); | 2836 || (receiver_class_id() == kSmiCid); |
| 2767 } | 2837 } |
| 2768 | 2838 |
| 2839 bool is_checked_strict_equal() const { | |
| 2840 return HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid); | |
| 2841 } | |
| 2842 | |
| 2769 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2843 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2770 | 2844 |
| 2771 virtual bool CanDeoptimize() const { | 2845 virtual bool CanDeoptimize() const { |
| 2772 return !IsInlinedNumericComparison(); | 2846 return !IsInlinedNumericComparison(); |
| 2773 } | 2847 } |
| 2774 | 2848 |
| 2775 virtual void EmitBranchCode(FlowGraphCompiler* compiler, | 2849 virtual void EmitBranchCode(FlowGraphCompiler* compiler, |
| 2776 BranchInstr* branch); | 2850 BranchInstr* branch); |
| 2777 | 2851 |
| 2778 virtual intptr_t DeoptimizationTarget() const { | 2852 virtual intptr_t DeoptimizationTarget() const { |
| 2779 return GetDeoptId(); | 2853 return GetDeoptId(); |
| 2780 } | 2854 } |
| 2781 | 2855 |
| 2782 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 2856 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 2783 ASSERT((idx == 0) || (idx == 1)); | 2857 ASSERT((idx == 0) || (idx == 1)); |
| 2784 if (receiver_class_id() == kDoubleCid) return kUnboxedDouble; | 2858 if (receiver_class_id() == kDoubleCid) return kUnboxedDouble; |
| 2785 if (receiver_class_id() == kMintCid) return kUnboxedMint; | 2859 if (receiver_class_id() == kMintCid) return kUnboxedMint; |
| 2786 return kTagged; | 2860 return kTagged; |
| 2787 } | 2861 } |
| 2788 | 2862 |
| 2789 bool IsPolymorphic() const; | 2863 bool IsPolymorphic() const; |
| 2790 | 2864 |
| 2791 virtual EffectSet Effects() const { | 2865 virtual EffectSet Effects() const { |
| 2792 return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All(); | 2866 return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All(); |
| 2793 } | 2867 } |
| 2794 | 2868 |
| 2869 virtual bool MayThrow() const { | |
| 2870 return !IsInlinedNumericComparison() && !is_checked_strict_equal(); | |
| 2871 } | |
| 2872 | |
| 2795 private: | 2873 private: |
| 2796 const ICData* ic_data_; | 2874 const ICData* ic_data_; |
| 2797 const intptr_t token_pos_; | 2875 const intptr_t token_pos_; |
| 2798 intptr_t receiver_class_id_; // Set by optimizer. | 2876 intptr_t receiver_class_id_; // Set by optimizer. |
| 2799 | 2877 |
| 2800 DISALLOW_COPY_AND_ASSIGN(EqualityCompareInstr); | 2878 DISALLOW_COPY_AND_ASSIGN(EqualityCompareInstr); |
| 2801 }; | 2879 }; |
| 2802 | 2880 |
| 2803 | 2881 |
| 2804 class RelationalOpInstr : public ComparisonInstr { | 2882 class RelationalOpInstr : public ComparisonInstr { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2859 ASSERT((idx == 0) || (idx == 1)); | 2937 ASSERT((idx == 0) || (idx == 1)); |
| 2860 if (operands_class_id() == kDoubleCid) return kUnboxedDouble; | 2938 if (operands_class_id() == kDoubleCid) return kUnboxedDouble; |
| 2861 if (operands_class_id() == kMintCid) return kUnboxedMint; | 2939 if (operands_class_id() == kMintCid) return kUnboxedMint; |
| 2862 return kTagged; | 2940 return kTagged; |
| 2863 } | 2941 } |
| 2864 | 2942 |
| 2865 virtual EffectSet Effects() const { | 2943 virtual EffectSet Effects() const { |
| 2866 return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All(); | 2944 return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All(); |
| 2867 } | 2945 } |
| 2868 | 2946 |
| 2947 virtual bool MayThrow() const { return !IsInlinedNumericComparison(); } | |
| 2948 | |
| 2869 private: | 2949 private: |
| 2870 const ICData* ic_data_; | 2950 const ICData* ic_data_; |
| 2871 const intptr_t token_pos_; | 2951 const intptr_t token_pos_; |
| 2872 intptr_t operands_class_id_; // class id of both operands. | 2952 intptr_t operands_class_id_; // class id of both operands. |
| 2873 | 2953 |
| 2874 DISALLOW_COPY_AND_ASSIGN(RelationalOpInstr); | 2954 DISALLOW_COPY_AND_ASSIGN(RelationalOpInstr); |
| 2875 }; | 2955 }; |
| 2876 | 2956 |
| 2877 | 2957 |
| 2878 // TODO(vegorov): ComparisonInstr should be switched to use IfTheElseInstr for | 2958 // TODO(vegorov): ComparisonInstr should be switched to use IfTheElseInstr for |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2919 virtual bool AllowsCSE() const { return true; } | 2999 virtual bool AllowsCSE() const { return true; } |
| 2920 virtual EffectSet Effects() const { return EffectSet::None(); } | 3000 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2921 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 3001 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 2922 virtual bool AttributesEqual(Instruction* other) const { | 3002 virtual bool AttributesEqual(Instruction* other) const { |
| 2923 IfThenElseInstr* other_if_then_else = other->AsIfThenElse(); | 3003 IfThenElseInstr* other_if_then_else = other->AsIfThenElse(); |
| 2924 return (kind_ == other_if_then_else->kind_) && | 3004 return (kind_ == other_if_then_else->kind_) && |
| 2925 (if_true_ == other_if_then_else->if_true_) && | 3005 (if_true_ == other_if_then_else->if_true_) && |
| 2926 (if_false_ == other_if_then_else->if_false_); | 3006 (if_false_ == other_if_then_else->if_false_); |
| 2927 } | 3007 } |
| 2928 | 3008 |
| 3009 virtual bool MayThrow() const { return false; } | |
| 3010 | |
| 2929 private: | 3011 private: |
| 2930 const Token::Kind kind_; | 3012 const Token::Kind kind_; |
| 2931 const intptr_t if_true_; | 3013 const intptr_t if_true_; |
| 2932 const intptr_t if_false_; | 3014 const intptr_t if_false_; |
| 2933 | 3015 |
| 2934 DISALLOW_COPY_AND_ASSIGN(IfThenElseInstr); | 3016 DISALLOW_COPY_AND_ASSIGN(IfThenElseInstr); |
| 2935 }; | 3017 }; |
| 2936 | 3018 |
| 2937 | 3019 |
| 2938 class StaticCallInstr : public TemplateDefinition<0> { | 3020 class StaticCallInstr : public TemplateDefinition<0> { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2970 | 3052 |
| 2971 virtual EffectSet Effects() const { return EffectSet::All(); } | 3053 virtual EffectSet Effects() const { return EffectSet::All(); } |
| 2972 | 3054 |
| 2973 void set_result_cid(intptr_t value) { result_cid_ = value; } | 3055 void set_result_cid(intptr_t value) { result_cid_ = value; } |
| 2974 | 3056 |
| 2975 bool is_known_list_constructor() const { return is_known_list_constructor_; } | 3057 bool is_known_list_constructor() const { return is_known_list_constructor_; } |
| 2976 void set_is_known_list_constructor(bool value) { | 3058 void set_is_known_list_constructor(bool value) { |
| 2977 is_known_list_constructor_ = value; | 3059 is_known_list_constructor_ = value; |
| 2978 } | 3060 } |
| 2979 | 3061 |
| 3062 virtual bool MayThrow() const { return true; } | |
| 3063 | |
| 2980 private: | 3064 private: |
| 2981 const intptr_t token_pos_; | 3065 const intptr_t token_pos_; |
| 2982 const Function& function_; | 3066 const Function& function_; |
| 2983 const Array& argument_names_; | 3067 const Array& argument_names_; |
| 2984 ZoneGrowableArray<PushArgumentInstr*>* arguments_; | 3068 ZoneGrowableArray<PushArgumentInstr*>* arguments_; |
| 2985 intptr_t result_cid_; // For some library functions we know the result. | 3069 intptr_t result_cid_; // For some library functions we know the result. |
| 2986 | 3070 |
| 2987 // 'True' for recognized list constructors. | 3071 // 'True' for recognized list constructors. |
| 2988 bool is_known_list_constructor_; | 3072 bool is_known_list_constructor_; |
| 2989 | 3073 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 3006 virtual bool CanDeoptimize() const { return false; } | 3090 virtual bool CanDeoptimize() const { return false; } |
| 3007 | 3091 |
| 3008 virtual EffectSet Effects() const { | 3092 virtual EffectSet Effects() const { |
| 3009 UNREACHABLE(); // Eliminated by SSA construction. | 3093 UNREACHABLE(); // Eliminated by SSA construction. |
| 3010 return EffectSet::None(); | 3094 return EffectSet::None(); |
| 3011 } | 3095 } |
| 3012 | 3096 |
| 3013 void mark_last() { is_last_ = true; } | 3097 void mark_last() { is_last_ = true; } |
| 3014 bool is_last() const { return is_last_; } | 3098 bool is_last() const { return is_last_; } |
| 3015 | 3099 |
| 3100 virtual bool MayThrow() const { | |
| 3101 UNREACHABLE(); | |
| 3102 return false; | |
| 3103 } | |
| 3104 | |
| 3016 private: | 3105 private: |
| 3017 const LocalVariable& local_; | 3106 const LocalVariable& local_; |
| 3018 bool is_last_; | 3107 bool is_last_; |
| 3019 | 3108 |
| 3020 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr); | 3109 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr); |
| 3021 }; | 3110 }; |
| 3022 | 3111 |
| 3023 | 3112 |
| 3024 class StoreLocalInstr : public TemplateDefinition<1> { | 3113 class StoreLocalInstr : public TemplateDefinition<1> { |
| 3025 public: | 3114 public: |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 3042 bool is_dead() const { return is_dead_; } | 3131 bool is_dead() const { return is_dead_; } |
| 3043 | 3132 |
| 3044 void mark_last() { is_last_ = true; } | 3133 void mark_last() { is_last_ = true; } |
| 3045 bool is_last() const { return is_last_; } | 3134 bool is_last() const { return is_last_; } |
| 3046 | 3135 |
| 3047 virtual EffectSet Effects() const { | 3136 virtual EffectSet Effects() const { |
| 3048 UNREACHABLE(); // Eliminated by SSA construction. | 3137 UNREACHABLE(); // Eliminated by SSA construction. |
| 3049 return EffectSet::None(); | 3138 return EffectSet::None(); |
| 3050 } | 3139 } |
| 3051 | 3140 |
| 3141 virtual bool MayThrow() const { | |
| 3142 UNREACHABLE(); | |
| 3143 return false; | |
| 3144 } | |
| 3145 | |
| 3052 private: | 3146 private: |
| 3053 const LocalVariable& local_; | 3147 const LocalVariable& local_; |
| 3054 bool is_dead_; | 3148 bool is_dead_; |
| 3055 bool is_last_; | 3149 bool is_last_; |
| 3056 | 3150 |
| 3057 DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr); | 3151 DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr); |
| 3058 }; | 3152 }; |
| 3059 | 3153 |
| 3060 | 3154 |
| 3061 class NativeCallInstr : public TemplateDefinition<0> { | 3155 class NativeCallInstr : public TemplateDefinition<0> { |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 3076 NativeFunction native_c_function() const { | 3170 NativeFunction native_c_function() const { |
| 3077 return ast_node_.native_c_function(); | 3171 return ast_node_.native_c_function(); |
| 3078 } | 3172 } |
| 3079 | 3173 |
| 3080 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3174 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3081 | 3175 |
| 3082 virtual bool CanDeoptimize() const { return false; } | 3176 virtual bool CanDeoptimize() const { return false; } |
| 3083 | 3177 |
| 3084 virtual EffectSet Effects() const { return EffectSet::All(); } | 3178 virtual EffectSet Effects() const { return EffectSet::All(); } |
| 3085 | 3179 |
| 3180 virtual bool MayThrow() const { | |
| 3181 UNREACHABLE(); | |
| 3182 return true; | |
| 3183 } | |
| 3184 | |
| 3086 private: | 3185 private: |
| 3087 const NativeBodyNode& ast_node_; | 3186 const NativeBodyNode& ast_node_; |
| 3088 | 3187 |
| 3089 DISALLOW_COPY_AND_ASSIGN(NativeCallInstr); | 3188 DISALLOW_COPY_AND_ASSIGN(NativeCallInstr); |
| 3090 }; | 3189 }; |
| 3091 | 3190 |
| 3092 | 3191 |
| 3093 enum StoreBarrierType { | 3192 enum StoreBarrierType { |
| 3094 kNoStoreBarrier, | 3193 kNoStoreBarrier, |
| 3095 kEmitStoreBarrier | 3194 kEmitStoreBarrier |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 3122 | 3221 |
| 3123 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3222 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3124 | 3223 |
| 3125 virtual bool CanDeoptimize() const { return false; } | 3224 virtual bool CanDeoptimize() const { return false; } |
| 3126 | 3225 |
| 3127 // Currently CSE/LICM don't operate on any instructions that can be affected | 3226 // Currently CSE/LICM don't operate on any instructions that can be affected |
| 3128 // by stores/loads. LoadOptimizer handles loads separately. Hence stores | 3227 // by stores/loads. LoadOptimizer handles loads separately. Hence stores |
| 3129 // are marked as having no side-effects. | 3228 // are marked as having no side-effects. |
| 3130 virtual EffectSet Effects() const { return EffectSet::None(); } | 3229 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3131 | 3230 |
| 3231 virtual bool MayThrow() const { return false; } | |
| 3232 | |
| 3132 private: | 3233 private: |
| 3133 bool CanValueBeSmi() const { | 3234 bool CanValueBeSmi() const { |
| 3134 const intptr_t cid = value()->Type()->ToNullableCid(); | 3235 const intptr_t cid = value()->Type()->ToNullableCid(); |
| 3135 // Write barrier is skipped for nullable and non-nullable smis. | 3236 // Write barrier is skipped for nullable and non-nullable smis. |
| 3136 ASSERT(cid != kSmiCid); | 3237 ASSERT(cid != kSmiCid); |
| 3137 return (cid == kDynamicCid); | 3238 return (cid == kDynamicCid); |
| 3138 } | 3239 } |
| 3139 | 3240 |
| 3140 const Field& field_; | 3241 const Field& field_; |
| 3141 const StoreBarrierType emit_store_barrier_; | 3242 const StoreBarrierType emit_store_barrier_; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 3166 | 3267 |
| 3167 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); | 3268 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); |
| 3168 | 3269 |
| 3169 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3270 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3170 | 3271 |
| 3171 virtual bool AllowsCSE() const { return true; } | 3272 virtual bool AllowsCSE() const { return true; } |
| 3172 virtual EffectSet Effects() const { return EffectSet::None(); } | 3273 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3173 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 3274 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 3174 virtual bool AttributesEqual(Instruction* other) const; | 3275 virtual bool AttributesEqual(Instruction* other) const; |
| 3175 | 3276 |
| 3277 virtual bool MayThrow() const { return false; } | |
| 3278 | |
| 3176 private: | 3279 private: |
| 3177 const Field& field_; | 3280 const Field& field_; |
| 3178 | 3281 |
| 3179 DISALLOW_COPY_AND_ASSIGN(GuardFieldInstr); | 3282 DISALLOW_COPY_AND_ASSIGN(GuardFieldInstr); |
| 3180 }; | 3283 }; |
| 3181 | 3284 |
| 3182 | 3285 |
| 3183 class LoadStaticFieldInstr : public TemplateDefinition<0> { | 3286 class LoadStaticFieldInstr : public TemplateDefinition<0> { |
| 3184 public: | 3287 public: |
| 3185 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {} | 3288 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {} |
| 3186 | 3289 |
| 3187 DECLARE_INSTRUCTION(LoadStaticField) | 3290 DECLARE_INSTRUCTION(LoadStaticField) |
| 3188 virtual CompileType ComputeType() const; | 3291 virtual CompileType ComputeType() const; |
| 3189 | 3292 |
| 3190 const Field& field() const { return field_; } | 3293 const Field& field() const { return field_; } |
| 3191 | 3294 |
| 3192 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3295 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3193 | 3296 |
| 3194 virtual bool CanDeoptimize() const { return false; } | 3297 virtual bool CanDeoptimize() const { return false; } |
| 3195 | 3298 |
| 3196 virtual bool AllowsCSE() const { return field_.is_final(); } | 3299 virtual bool AllowsCSE() const { return field_.is_final(); } |
| 3197 virtual EffectSet Effects() const { return EffectSet::None(); } | 3300 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3198 virtual EffectSet Dependencies() const; | 3301 virtual EffectSet Dependencies() const; |
| 3199 virtual bool AttributesEqual(Instruction* other) const; | 3302 virtual bool AttributesEqual(Instruction* other) const; |
| 3200 | 3303 |
| 3304 virtual bool MayThrow() const { return false; } | |
| 3201 private: | 3305 private: |
| 3202 const Field& field_; | 3306 const Field& field_; |
| 3203 | 3307 |
| 3204 DISALLOW_COPY_AND_ASSIGN(LoadStaticFieldInstr); | 3308 DISALLOW_COPY_AND_ASSIGN(LoadStaticFieldInstr); |
| 3205 }; | 3309 }; |
| 3206 | 3310 |
| 3207 | 3311 |
| 3208 class StoreStaticFieldInstr : public TemplateDefinition<1> { | 3312 class StoreStaticFieldInstr : public TemplateDefinition<1> { |
| 3209 public: | 3313 public: |
| 3210 StoreStaticFieldInstr(const Field& field, Value* value) | 3314 StoreStaticFieldInstr(const Field& field, Value* value) |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 3221 | 3325 |
| 3222 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3326 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3223 | 3327 |
| 3224 virtual bool CanDeoptimize() const { return false; } | 3328 virtual bool CanDeoptimize() const { return false; } |
| 3225 | 3329 |
| 3226 // Currently CSE/LICM don't operate on any instructions that can be affected | 3330 // Currently CSE/LICM don't operate on any instructions that can be affected |
| 3227 // by stores/loads. LoadOptimizer handles loads separately. Hence stores | 3331 // by stores/loads. LoadOptimizer handles loads separately. Hence stores |
| 3228 // are marked as having no side-effects. | 3332 // are marked as having no side-effects. |
| 3229 virtual EffectSet Effects() const { return EffectSet::None(); } | 3333 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3230 | 3334 |
| 3335 virtual bool MayThrow() const { return false; } | |
| 3336 | |
| 3231 private: | 3337 private: |
| 3232 bool CanValueBeSmi() const { | 3338 bool CanValueBeSmi() const { |
| 3233 const intptr_t cid = value()->Type()->ToNullableCid(); | 3339 const intptr_t cid = value()->Type()->ToNullableCid(); |
| 3234 // Write barrier is skipped for nullable and non-nullable smis. | 3340 // Write barrier is skipped for nullable and non-nullable smis. |
| 3235 ASSERT(cid != kSmiCid); | 3341 ASSERT(cid != kSmiCid); |
| 3236 return (cid == kDynamicCid); | 3342 return (cid == kDynamicCid); |
| 3237 } | 3343 } |
| 3238 | 3344 |
| 3239 const Field& field_; | 3345 const Field& field_; |
| 3240 | 3346 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3280 | 3386 |
| 3281 | 3387 |
| 3282 virtual Representation representation() const; | 3388 virtual Representation representation() const; |
| 3283 virtual void InferRange(); | 3389 virtual void InferRange(); |
| 3284 | 3390 |
| 3285 virtual bool AllowsCSE() const { return false; } | 3391 virtual bool AllowsCSE() const { return false; } |
| 3286 virtual EffectSet Effects() const { return EffectSet::None(); } | 3392 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3287 virtual EffectSet Dependencies() const; | 3393 virtual EffectSet Dependencies() const; |
| 3288 virtual bool AttributesEqual(Instruction* other) const; | 3394 virtual bool AttributesEqual(Instruction* other) const; |
| 3289 | 3395 |
| 3396 virtual bool MayThrow() const { return false; } | |
| 3397 | |
| 3290 private: | 3398 private: |
| 3291 const intptr_t index_scale_; | 3399 const intptr_t index_scale_; |
| 3292 const intptr_t class_id_; | 3400 const intptr_t class_id_; |
| 3293 | 3401 |
| 3294 DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr); | 3402 DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr); |
| 3295 }; | 3403 }; |
| 3296 | 3404 |
| 3297 | 3405 |
| 3298 class StringFromCharCodeInstr : public TemplateDefinition<1> { | 3406 class StringFromCharCodeInstr : public TemplateDefinition<1> { |
| 3299 public: | 3407 public: |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 3312 | 3420 |
| 3313 virtual bool CanDeoptimize() const { return false; } | 3421 virtual bool CanDeoptimize() const { return false; } |
| 3314 | 3422 |
| 3315 virtual bool AllowsCSE() const { return true; } | 3423 virtual bool AllowsCSE() const { return true; } |
| 3316 virtual EffectSet Effects() const { return EffectSet::None(); } | 3424 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3317 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 3425 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 3318 virtual bool AttributesEqual(Instruction* other) const { | 3426 virtual bool AttributesEqual(Instruction* other) const { |
| 3319 return other->AsStringFromCharCode()->cid_ == cid_; | 3427 return other->AsStringFromCharCode()->cid_ == cid_; |
| 3320 } | 3428 } |
| 3321 | 3429 |
| 3430 virtual bool MayThrow() const { return false; } | |
| 3431 | |
| 3322 private: | 3432 private: |
| 3323 const intptr_t cid_; | 3433 const intptr_t cid_; |
| 3324 | 3434 |
| 3325 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr); | 3435 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr); |
| 3326 }; | 3436 }; |
| 3327 | 3437 |
| 3328 | 3438 |
| 3329 class StoreIndexedInstr : public TemplateDefinition<3> { | 3439 class StoreIndexedInstr : public TemplateDefinition<3> { |
| 3330 public: | 3440 public: |
| 3331 StoreIndexedInstr(Value* array, | 3441 StoreIndexedInstr(Value* array, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3366 } | 3476 } |
| 3367 | 3477 |
| 3368 virtual intptr_t DeoptimizationTarget() const { | 3478 virtual intptr_t DeoptimizationTarget() const { |
| 3369 // Direct access since this instruction cannot deoptimize, and the deopt-id | 3479 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 3370 // was inherited from another instruction that could deoptimize. | 3480 // was inherited from another instruction that could deoptimize. |
| 3371 return deopt_id_; | 3481 return deopt_id_; |
| 3372 } | 3482 } |
| 3373 | 3483 |
| 3374 virtual EffectSet Effects() const { return EffectSet::None(); } | 3484 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3375 | 3485 |
| 3486 virtual bool MayThrow() const { return false; } | |
| 3487 | |
| 3376 private: | 3488 private: |
| 3377 const StoreBarrierType emit_store_barrier_; | 3489 const StoreBarrierType emit_store_barrier_; |
| 3378 const intptr_t index_scale_; | 3490 const intptr_t index_scale_; |
| 3379 const intptr_t class_id_; | 3491 const intptr_t class_id_; |
| 3380 | 3492 |
| 3381 DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr); | 3493 DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr); |
| 3382 }; | 3494 }; |
| 3383 | 3495 |
| 3384 | 3496 |
| 3385 // Note overrideable, built-in: value? false : true. | 3497 // Note overrideable, built-in: value? false : true. |
| 3386 class BooleanNegateInstr : public TemplateDefinition<1> { | 3498 class BooleanNegateInstr : public TemplateDefinition<1> { |
| 3387 public: | 3499 public: |
| 3388 explicit BooleanNegateInstr(Value* value) { | 3500 explicit BooleanNegateInstr(Value* value) { |
| 3389 SetInputAt(0, value); | 3501 SetInputAt(0, value); |
| 3390 } | 3502 } |
| 3391 | 3503 |
| 3392 DECLARE_INSTRUCTION(BooleanNegate) | 3504 DECLARE_INSTRUCTION(BooleanNegate) |
| 3393 virtual CompileType ComputeType() const; | 3505 virtual CompileType ComputeType() const; |
| 3394 | 3506 |
| 3395 Value* value() const { return inputs_[0]; } | 3507 Value* value() const { return inputs_[0]; } |
| 3396 | 3508 |
| 3397 virtual bool CanDeoptimize() const { return false; } | 3509 virtual bool CanDeoptimize() const { return false; } |
| 3398 | 3510 |
| 3399 virtual EffectSet Effects() const { return EffectSet::None(); } | 3511 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3400 | 3512 |
| 3513 virtual bool MayThrow() const { return false; } | |
| 3514 | |
| 3401 private: | 3515 private: |
| 3402 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr); | 3516 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr); |
| 3403 }; | 3517 }; |
| 3404 | 3518 |
| 3405 | 3519 |
| 3406 class InstanceOfInstr : public TemplateDefinition<3> { | 3520 class InstanceOfInstr : public TemplateDefinition<3> { |
| 3407 public: | 3521 public: |
| 3408 InstanceOfInstr(intptr_t token_pos, | 3522 InstanceOfInstr(intptr_t token_pos, |
| 3409 Value* value, | 3523 Value* value, |
| 3410 Value* instantiator, | 3524 Value* instantiator, |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 3432 bool negate_result() const { return negate_result_; } | 3546 bool negate_result() const { return negate_result_; } |
| 3433 const AbstractType& type() const { return type_; } | 3547 const AbstractType& type() const { return type_; } |
| 3434 intptr_t token_pos() const { return token_pos_; } | 3548 intptr_t token_pos() const { return token_pos_; } |
| 3435 | 3549 |
| 3436 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3550 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3437 | 3551 |
| 3438 virtual bool CanDeoptimize() const { return true; } | 3552 virtual bool CanDeoptimize() const { return true; } |
| 3439 | 3553 |
| 3440 virtual EffectSet Effects() const { return EffectSet::None(); } | 3554 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3441 | 3555 |
| 3556 virtual bool MayThrow() const { return true; } | |
| 3557 | |
| 3442 private: | 3558 private: |
| 3443 const intptr_t token_pos_; | 3559 const intptr_t token_pos_; |
| 3444 Value* value_; | 3560 Value* value_; |
| 3445 Value* instantiator_; | 3561 Value* instantiator_; |
| 3446 Value* type_arguments_; | 3562 Value* type_arguments_; |
| 3447 const AbstractType& type_; | 3563 const AbstractType& type_; |
| 3448 const bool negate_result_; | 3564 const bool negate_result_; |
| 3449 | 3565 |
| 3450 DISALLOW_COPY_AND_ASSIGN(InstanceOfInstr); | 3566 DISALLOW_COPY_AND_ASSIGN(InstanceOfInstr); |
| 3451 }; | 3567 }; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 3473 | 3589 |
| 3474 const Function& constructor() const { return ast_node_.constructor(); } | 3590 const Function& constructor() const { return ast_node_.constructor(); } |
| 3475 intptr_t token_pos() const { return ast_node_.token_pos(); } | 3591 intptr_t token_pos() const { return ast_node_.token_pos(); } |
| 3476 | 3592 |
| 3477 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3593 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3478 | 3594 |
| 3479 virtual bool CanDeoptimize() const { return false; } | 3595 virtual bool CanDeoptimize() const { return false; } |
| 3480 | 3596 |
| 3481 virtual EffectSet Effects() const { return EffectSet::None(); } | 3597 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3482 | 3598 |
| 3599 virtual bool MayThrow() const { return false; } | |
| 3600 | |
| 3483 // If the result of the allocation is not stored into any field, passed | 3601 // If the result of the allocation is not stored into any field, passed |
| 3484 // as an argument or used in a phi then it can't alias with any other | 3602 // as an argument or used in a phi then it can't alias with any other |
| 3485 // SSA value. | 3603 // SSA value. |
| 3486 enum Identity { | 3604 enum Identity { |
| 3487 kUnknown, | 3605 kUnknown, |
| 3488 kAliased, | 3606 kAliased, |
| 3489 kNotAliased | 3607 kNotAliased |
| 3490 }; | 3608 }; |
| 3491 | 3609 |
| 3492 Identity identity() const { return identity_; } | 3610 Identity identity() const { return identity_; } |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 3516 | 3634 |
| 3517 const Function& constructor() const { return ast_node_.constructor(); } | 3635 const Function& constructor() const { return ast_node_.constructor(); } |
| 3518 intptr_t token_pos() const { return ast_node_.token_pos(); } | 3636 intptr_t token_pos() const { return ast_node_.token_pos(); } |
| 3519 | 3637 |
| 3520 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3638 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3521 | 3639 |
| 3522 virtual bool CanDeoptimize() const { return true; } | 3640 virtual bool CanDeoptimize() const { return true; } |
| 3523 | 3641 |
| 3524 virtual EffectSet Effects() const { return EffectSet::None(); } | 3642 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3525 | 3643 |
| 3644 virtual bool MayThrow() const { return false; } | |
| 3645 | |
| 3526 private: | 3646 private: |
| 3527 const ConstructorCallNode& ast_node_; | 3647 const ConstructorCallNode& ast_node_; |
| 3528 | 3648 |
| 3529 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckInstr); | 3649 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckInstr); |
| 3530 }; | 3650 }; |
| 3531 | 3651 |
| 3532 | 3652 |
| 3533 class CreateArrayInstr : public TemplateDefinition<1> { | 3653 class CreateArrayInstr : public TemplateDefinition<1> { |
| 3534 public: | 3654 public: |
| 3535 CreateArrayInstr(intptr_t token_pos, | 3655 CreateArrayInstr(intptr_t token_pos, |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 3553 intptr_t token_pos() const { return token_pos_; } | 3673 intptr_t token_pos() const { return token_pos_; } |
| 3554 const AbstractType& type() const { return type_; } | 3674 const AbstractType& type() const { return type_; } |
| 3555 Value* element_type() const { return inputs_[0]; } | 3675 Value* element_type() const { return inputs_[0]; } |
| 3556 | 3676 |
| 3557 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3677 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3558 | 3678 |
| 3559 virtual bool CanDeoptimize() const { return false; } | 3679 virtual bool CanDeoptimize() const { return false; } |
| 3560 | 3680 |
| 3561 virtual EffectSet Effects() const { return EffectSet::None(); } | 3681 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3562 | 3682 |
| 3683 virtual bool MayThrow() const { return false; } | |
| 3684 | |
| 3563 private: | 3685 private: |
| 3564 const intptr_t token_pos_; | 3686 const intptr_t token_pos_; |
| 3565 const intptr_t num_elements_; | 3687 const intptr_t num_elements_; |
| 3566 const AbstractType& type_; | 3688 const AbstractType& type_; |
| 3567 | 3689 |
| 3568 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); | 3690 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); |
| 3569 }; | 3691 }; |
| 3570 | 3692 |
| 3571 | 3693 |
| 3572 class CreateClosureInstr : public TemplateDefinition<0> { | 3694 class CreateClosureInstr : public TemplateDefinition<0> { |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 3588 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { | 3710 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { |
| 3589 return (*arguments_)[index]; | 3711 return (*arguments_)[index]; |
| 3590 } | 3712 } |
| 3591 | 3713 |
| 3592 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3714 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3593 | 3715 |
| 3594 virtual bool CanDeoptimize() const { return false; } | 3716 virtual bool CanDeoptimize() const { return false; } |
| 3595 | 3717 |
| 3596 virtual EffectSet Effects() const { return EffectSet::None(); } | 3718 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3597 | 3719 |
| 3720 virtual bool MayThrow() const { return false; } | |
| 3721 | |
| 3598 private: | 3722 private: |
| 3599 const Function& function_; | 3723 const Function& function_; |
| 3600 ZoneGrowableArray<PushArgumentInstr*>* arguments_; | 3724 ZoneGrowableArray<PushArgumentInstr*>* arguments_; |
| 3601 intptr_t token_pos_; | 3725 intptr_t token_pos_; |
| 3602 | 3726 |
| 3603 DISALLOW_COPY_AND_ASSIGN(CreateClosureInstr); | 3727 DISALLOW_COPY_AND_ASSIGN(CreateClosureInstr); |
| 3604 }; | 3728 }; |
| 3605 | 3729 |
| 3606 | 3730 |
| 3607 class LoadUntaggedInstr : public TemplateDefinition<1> { | 3731 class LoadUntaggedInstr : public TemplateDefinition<1> { |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 3622 virtual bool CanDeoptimize() const { return false; } | 3746 virtual bool CanDeoptimize() const { return false; } |
| 3623 | 3747 |
| 3624 // This instruction must not be moved without the indexed access that | 3748 // This instruction must not be moved without the indexed access that |
| 3625 // depends on it (e.g. out of loops). GC may cause collect | 3749 // depends on it (e.g. out of loops). GC may cause collect |
| 3626 // the array while the external data-array is still accessed. | 3750 // the array while the external data-array is still accessed. |
| 3627 virtual bool AllowsCSE() const { return false; } | 3751 virtual bool AllowsCSE() const { return false; } |
| 3628 virtual EffectSet Effects() const { return EffectSet::None(); } | 3752 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3629 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 3753 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 3630 virtual bool AttributesEqual(Instruction* other) const { return true; } | 3754 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 3631 | 3755 |
| 3756 virtual bool MayThrow() const { return false; } | |
| 3757 | |
| 3632 private: | 3758 private: |
| 3633 intptr_t offset_; | 3759 intptr_t offset_; |
| 3634 | 3760 |
| 3635 DISALLOW_COPY_AND_ASSIGN(LoadUntaggedInstr); | 3761 DISALLOW_COPY_AND_ASSIGN(LoadUntaggedInstr); |
| 3636 }; | 3762 }; |
| 3637 | 3763 |
| 3638 | 3764 |
| 3639 class LoadClassIdInstr : public TemplateDefinition<1> { | 3765 class LoadClassIdInstr : public TemplateDefinition<1> { |
| 3640 public: | 3766 public: |
| 3641 explicit LoadClassIdInstr(Value* object) { | 3767 explicit LoadClassIdInstr(Value* object) { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 3652 | 3778 |
| 3653 virtual bool CanDeoptimize() const { return false; } | 3779 virtual bool CanDeoptimize() const { return false; } |
| 3654 | 3780 |
| 3655 virtual bool AllowsCSE() const { return true; } | 3781 virtual bool AllowsCSE() const { return true; } |
| 3656 virtual EffectSet Effects() const { return EffectSet::None(); } | 3782 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3657 virtual EffectSet Dependencies() const { | 3783 virtual EffectSet Dependencies() const { |
| 3658 return EffectSet::Externalization(); | 3784 return EffectSet::Externalization(); |
| 3659 } | 3785 } |
| 3660 virtual bool AttributesEqual(Instruction* other) const { return true; } | 3786 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 3661 | 3787 |
| 3788 virtual bool MayThrow() const { return false; } | |
| 3789 | |
| 3662 private: | 3790 private: |
| 3663 DISALLOW_COPY_AND_ASSIGN(LoadClassIdInstr); | 3791 DISALLOW_COPY_AND_ASSIGN(LoadClassIdInstr); |
| 3664 }; | 3792 }; |
| 3665 | 3793 |
| 3666 | 3794 |
| 3667 class LoadFieldInstr : public TemplateDefinition<1> { | 3795 class LoadFieldInstr : public TemplateDefinition<1> { |
| 3668 public: | 3796 public: |
| 3669 LoadFieldInstr(Value* instance, | 3797 LoadFieldInstr(Value* instance, |
| 3670 intptr_t offset_in_bytes, | 3798 intptr_t offset_in_bytes, |
| 3671 const AbstractType& type, | 3799 const AbstractType& type, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3716 | 3844 |
| 3717 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); | 3845 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); |
| 3718 | 3846 |
| 3719 static bool IsFixedLengthArrayCid(intptr_t cid); | 3847 static bool IsFixedLengthArrayCid(intptr_t cid); |
| 3720 | 3848 |
| 3721 virtual bool AllowsCSE() const { return immutable_; } | 3849 virtual bool AllowsCSE() const { return immutable_; } |
| 3722 virtual EffectSet Effects() const { return EffectSet::None(); } | 3850 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3723 virtual EffectSet Dependencies() const; | 3851 virtual EffectSet Dependencies() const; |
| 3724 virtual bool AttributesEqual(Instruction* other) const; | 3852 virtual bool AttributesEqual(Instruction* other) const; |
| 3725 | 3853 |
| 3854 virtual bool MayThrow() const { return false; } | |
| 3855 | |
| 3726 private: | 3856 private: |
| 3727 const intptr_t offset_in_bytes_; | 3857 const intptr_t offset_in_bytes_; |
| 3728 const AbstractType& type_; | 3858 const AbstractType& type_; |
| 3729 intptr_t result_cid_; | 3859 intptr_t result_cid_; |
| 3730 const bool immutable_; | 3860 const bool immutable_; |
| 3731 | 3861 |
| 3732 MethodRecognizer::Kind recognized_kind_; | 3862 MethodRecognizer::Kind recognized_kind_; |
| 3733 | 3863 |
| 3734 const char* field_name_; | 3864 const char* field_name_; |
| 3735 const Field* field_; | 3865 const Field* field_; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 3757 Value* dest() const { return inputs_[1]; } | 3887 Value* dest() const { return inputs_[1]; } |
| 3758 intptr_t offset_in_bytes() const { return offset_in_bytes_; } | 3888 intptr_t offset_in_bytes() const { return offset_in_bytes_; } |
| 3759 const AbstractType& type() const { return type_; } | 3889 const AbstractType& type() const { return type_; } |
| 3760 | 3890 |
| 3761 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3891 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3762 | 3892 |
| 3763 virtual bool CanDeoptimize() const { return false; } | 3893 virtual bool CanDeoptimize() const { return false; } |
| 3764 | 3894 |
| 3765 virtual EffectSet Effects() const { return EffectSet::None(); } | 3895 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3766 | 3896 |
| 3897 virtual bool MayThrow() const { return false; } | |
| 3898 | |
| 3767 private: | 3899 private: |
| 3768 const intptr_t offset_in_bytes_; | 3900 const intptr_t offset_in_bytes_; |
| 3769 const AbstractType& type_; | 3901 const AbstractType& type_; |
| 3770 | 3902 |
| 3771 DISALLOW_COPY_AND_ASSIGN(StoreVMFieldInstr); | 3903 DISALLOW_COPY_AND_ASSIGN(StoreVMFieldInstr); |
| 3772 }; | 3904 }; |
| 3773 | 3905 |
| 3774 | 3906 |
| 3775 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1> { | 3907 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1> { |
| 3776 public: | 3908 public: |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 3793 } | 3925 } |
| 3794 const Class& instantiator_class() const { return instantiator_class_; } | 3926 const Class& instantiator_class() const { return instantiator_class_; } |
| 3795 intptr_t token_pos() const { return token_pos_; } | 3927 intptr_t token_pos() const { return token_pos_; } |
| 3796 | 3928 |
| 3797 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3929 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3798 | 3930 |
| 3799 virtual bool CanDeoptimize() const { return true; } | 3931 virtual bool CanDeoptimize() const { return true; } |
| 3800 | 3932 |
| 3801 virtual EffectSet Effects() const { return EffectSet::None(); } | 3933 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3802 | 3934 |
| 3935 virtual bool MayThrow() const { return true; } | |
| 3936 | |
| 3803 private: | 3937 private: |
| 3804 const intptr_t token_pos_; | 3938 const intptr_t token_pos_; |
| 3805 const AbstractTypeArguments& type_arguments_; | 3939 const AbstractTypeArguments& type_arguments_; |
| 3806 const Class& instantiator_class_; | 3940 const Class& instantiator_class_; |
| 3807 | 3941 |
| 3808 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr); | 3942 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr); |
| 3809 }; | 3943 }; |
| 3810 | 3944 |
| 3811 | 3945 |
| 3812 class ExtractConstructorTypeArgumentsInstr : public TemplateDefinition<1> { | 3946 class ExtractConstructorTypeArgumentsInstr : public TemplateDefinition<1> { |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 3830 } | 3964 } |
| 3831 const Class& instantiator_class() const { return instantiator_class_; } | 3965 const Class& instantiator_class() const { return instantiator_class_; } |
| 3832 intptr_t token_pos() const { return token_pos_; } | 3966 intptr_t token_pos() const { return token_pos_; } |
| 3833 | 3967 |
| 3834 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3968 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3835 | 3969 |
| 3836 virtual bool CanDeoptimize() const { return false; } | 3970 virtual bool CanDeoptimize() const { return false; } |
| 3837 | 3971 |
| 3838 virtual EffectSet Effects() const { return EffectSet::None(); } | 3972 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3839 | 3973 |
| 3974 virtual bool MayThrow() const { return false; } | |
| 3975 | |
| 3840 private: | 3976 private: |
| 3841 const intptr_t token_pos_; | 3977 const intptr_t token_pos_; |
| 3842 const AbstractTypeArguments& type_arguments_; | 3978 const AbstractTypeArguments& type_arguments_; |
| 3843 const Class& instantiator_class_; | 3979 const Class& instantiator_class_; |
| 3844 | 3980 |
| 3845 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorTypeArgumentsInstr); | 3981 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorTypeArgumentsInstr); |
| 3846 }; | 3982 }; |
| 3847 | 3983 |
| 3848 | 3984 |
| 3849 class ExtractConstructorInstantiatorInstr : public TemplateDefinition<1> { | 3985 class ExtractConstructorInstantiatorInstr : public TemplateDefinition<1> { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 3862 return ast_node_.type_arguments(); | 3998 return ast_node_.type_arguments(); |
| 3863 } | 3999 } |
| 3864 const Function& constructor() const { return ast_node_.constructor(); } | 4000 const Function& constructor() const { return ast_node_.constructor(); } |
| 3865 const Class& instantiator_class() const { return instantiator_class_; } | 4001 const Class& instantiator_class() const { return instantiator_class_; } |
| 3866 intptr_t token_pos() const { return ast_node_.token_pos(); } | 4002 intptr_t token_pos() const { return ast_node_.token_pos(); } |
| 3867 | 4003 |
| 3868 virtual bool CanDeoptimize() const { return false; } | 4004 virtual bool CanDeoptimize() const { return false; } |
| 3869 | 4005 |
| 3870 virtual EffectSet Effects() const { return EffectSet::None(); } | 4006 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3871 | 4007 |
| 4008 virtual bool MayThrow() const { return false; } | |
| 4009 | |
| 3872 private: | 4010 private: |
| 3873 const ConstructorCallNode& ast_node_; | 4011 const ConstructorCallNode& ast_node_; |
| 3874 const Class& instantiator_class_; | 4012 const Class& instantiator_class_; |
| 3875 | 4013 |
| 3876 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorInstantiatorInstr); | 4014 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorInstantiatorInstr); |
| 3877 }; | 4015 }; |
| 3878 | 4016 |
| 3879 | 4017 |
| 3880 class AllocateContextInstr : public TemplateDefinition<0> { | 4018 class AllocateContextInstr : public TemplateDefinition<0> { |
| 3881 public: | 4019 public: |
| 3882 AllocateContextInstr(intptr_t token_pos, | 4020 AllocateContextInstr(intptr_t token_pos, |
| 3883 intptr_t num_context_variables) | 4021 intptr_t num_context_variables) |
| 3884 : token_pos_(token_pos), | 4022 : token_pos_(token_pos), |
| 3885 num_context_variables_(num_context_variables) {} | 4023 num_context_variables_(num_context_variables) {} |
| 3886 | 4024 |
| 3887 DECLARE_INSTRUCTION(AllocateContext) | 4025 DECLARE_INSTRUCTION(AllocateContext) |
| 3888 virtual CompileType ComputeType() const; | 4026 virtual CompileType ComputeType() const; |
| 3889 | 4027 |
| 3890 intptr_t token_pos() const { return token_pos_; } | 4028 intptr_t token_pos() const { return token_pos_; } |
| 3891 intptr_t num_context_variables() const { return num_context_variables_; } | 4029 intptr_t num_context_variables() const { return num_context_variables_; } |
| 3892 | 4030 |
| 3893 virtual void PrintOperandsTo(BufferFormatter* f) const; | 4031 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3894 | 4032 |
| 3895 virtual bool CanDeoptimize() const { return false; } | 4033 virtual bool CanDeoptimize() const { return false; } |
| 3896 | 4034 |
| 3897 virtual EffectSet Effects() const { return EffectSet::None(); } | 4035 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3898 | 4036 |
| 4037 virtual bool MayThrow() const { return false; } | |
| 4038 | |
| 3899 private: | 4039 private: |
| 3900 const intptr_t token_pos_; | 4040 const intptr_t token_pos_; |
| 3901 const intptr_t num_context_variables_; | 4041 const intptr_t num_context_variables_; |
| 3902 | 4042 |
| 3903 DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr); | 4043 DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr); |
| 3904 }; | 4044 }; |
| 3905 | 4045 |
| 3906 | 4046 |
| 3907 class ChainContextInstr : public TemplateInstruction<1> { | 4047 class ChainContextInstr : public TemplateInstruction<1> { |
| 3908 public: | 4048 public: |
| 3909 explicit ChainContextInstr(Value* context_value) { | 4049 explicit ChainContextInstr(Value* context_value) { |
| 3910 SetInputAt(0, context_value); | 4050 SetInputAt(0, context_value); |
| 3911 } | 4051 } |
| 3912 | 4052 |
| 3913 DECLARE_INSTRUCTION(ChainContext) | 4053 DECLARE_INSTRUCTION(ChainContext) |
| 3914 | 4054 |
| 3915 virtual intptr_t ArgumentCount() const { return 0; } | 4055 virtual intptr_t ArgumentCount() const { return 0; } |
| 3916 | 4056 |
| 3917 Value* context_value() const { return inputs_[0]; } | 4057 Value* context_value() const { return inputs_[0]; } |
| 3918 | 4058 |
| 3919 virtual bool CanDeoptimize() const { return false; } | 4059 virtual bool CanDeoptimize() const { return false; } |
| 3920 | 4060 |
| 3921 virtual EffectSet Effects() const { return EffectSet::None(); } | 4061 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3922 | 4062 |
| 4063 virtual bool MayThrow() const { return false; } | |
| 4064 | |
| 3923 private: | 4065 private: |
| 3924 DISALLOW_COPY_AND_ASSIGN(ChainContextInstr); | 4066 DISALLOW_COPY_AND_ASSIGN(ChainContextInstr); |
| 3925 }; | 4067 }; |
| 3926 | 4068 |
| 3927 | 4069 |
| 3928 class CloneContextInstr : public TemplateDefinition<1> { | 4070 class CloneContextInstr : public TemplateDefinition<1> { |
| 3929 public: | 4071 public: |
| 3930 CloneContextInstr(intptr_t token_pos, Value* context_value) | 4072 CloneContextInstr(intptr_t token_pos, Value* context_value) |
| 3931 : token_pos_(token_pos) { | 4073 : token_pos_(token_pos) { |
| 3932 SetInputAt(0, context_value); | 4074 SetInputAt(0, context_value); |
| 3933 } | 4075 } |
| 3934 | 4076 |
| 3935 intptr_t token_pos() const { return token_pos_; } | 4077 intptr_t token_pos() const { return token_pos_; } |
| 3936 Value* context_value() const { return inputs_[0]; } | 4078 Value* context_value() const { return inputs_[0]; } |
| 3937 | 4079 |
| 3938 DECLARE_INSTRUCTION(CloneContext) | 4080 DECLARE_INSTRUCTION(CloneContext) |
| 3939 virtual CompileType ComputeType() const; | 4081 virtual CompileType ComputeType() const; |
| 3940 | 4082 |
| 3941 virtual bool CanDeoptimize() const { return true; } | 4083 virtual bool CanDeoptimize() const { return true; } |
| 3942 | 4084 |
| 3943 virtual EffectSet Effects() const { return EffectSet::None(); } | 4085 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3944 | 4086 |
| 4087 virtual bool MayThrow() const { return false; } | |
| 4088 | |
| 3945 private: | 4089 private: |
| 3946 const intptr_t token_pos_; | 4090 const intptr_t token_pos_; |
| 3947 | 4091 |
| 3948 DISALLOW_COPY_AND_ASSIGN(CloneContextInstr); | 4092 DISALLOW_COPY_AND_ASSIGN(CloneContextInstr); |
| 3949 }; | 4093 }; |
| 3950 | 4094 |
| 3951 | 4095 |
| 3952 class CatchEntryInstr : public TemplateInstruction<0> { | 4096 class CatchEntryInstr : public TemplateInstruction<0> { |
| 3953 public: | 4097 public: |
| 3954 CatchEntryInstr(const LocalVariable& exception_var, | 4098 CatchEntryInstr(const LocalVariable& exception_var, |
| 3955 const LocalVariable& stacktrace_var) | 4099 const LocalVariable& stacktrace_var) |
| 3956 : exception_var_(exception_var), stacktrace_var_(stacktrace_var) {} | 4100 : exception_var_(exception_var), stacktrace_var_(stacktrace_var) {} |
| 3957 | 4101 |
| 3958 const LocalVariable& exception_var() const { return exception_var_; } | 4102 const LocalVariable& exception_var() const { return exception_var_; } |
| 3959 const LocalVariable& stacktrace_var() const { return stacktrace_var_; } | 4103 const LocalVariable& stacktrace_var() const { return stacktrace_var_; } |
| 3960 | 4104 |
| 3961 DECLARE_INSTRUCTION(CatchEntry) | 4105 DECLARE_INSTRUCTION(CatchEntry) |
| 3962 | 4106 |
| 3963 virtual intptr_t ArgumentCount() const { return 0; } | 4107 virtual intptr_t ArgumentCount() const { return 0; } |
| 3964 | 4108 |
| 3965 virtual void PrintOperandsTo(BufferFormatter* f) const; | 4109 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3966 | 4110 |
| 3967 virtual bool CanDeoptimize() const { return false; } | 4111 virtual bool CanDeoptimize() const { return false; } |
| 3968 | 4112 |
| 3969 virtual EffectSet Effects() const { return EffectSet::All(); } | 4113 virtual EffectSet Effects() const { return EffectSet::All(); } |
| 3970 | 4114 |
| 4115 virtual bool MayThrow() const { return false; } | |
| 4116 | |
| 3971 private: | 4117 private: |
| 3972 const LocalVariable& exception_var_; | 4118 const LocalVariable& exception_var_; |
| 3973 const LocalVariable& stacktrace_var_; | 4119 const LocalVariable& stacktrace_var_; |
| 3974 | 4120 |
| 3975 DISALLOW_COPY_AND_ASSIGN(CatchEntryInstr); | 4121 DISALLOW_COPY_AND_ASSIGN(CatchEntryInstr); |
| 3976 }; | 4122 }; |
| 3977 | 4123 |
| 3978 | 4124 |
| 3979 class CheckEitherNonSmiInstr : public TemplateInstruction<2> { | 4125 class CheckEitherNonSmiInstr : public TemplateInstruction<2> { |
| 3980 public: | 4126 public: |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 3995 | 4141 |
| 3996 virtual bool CanDeoptimize() const { return true; } | 4142 virtual bool CanDeoptimize() const { return true; } |
| 3997 | 4143 |
| 3998 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); | 4144 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); |
| 3999 | 4145 |
| 4000 virtual bool AllowsCSE() const { return true; } | 4146 virtual bool AllowsCSE() const { return true; } |
| 4001 virtual EffectSet Effects() const { return EffectSet::None(); } | 4147 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4002 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4148 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4003 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4149 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4004 | 4150 |
| 4151 virtual bool MayThrow() const { return false; } | |
| 4152 | |
| 4005 private: | 4153 private: |
| 4006 DISALLOW_COPY_AND_ASSIGN(CheckEitherNonSmiInstr); | 4154 DISALLOW_COPY_AND_ASSIGN(CheckEitherNonSmiInstr); |
| 4007 }; | 4155 }; |
| 4008 | 4156 |
| 4009 | 4157 |
| 4010 class BoxDoubleInstr : public TemplateDefinition<1> { | 4158 class BoxDoubleInstr : public TemplateDefinition<1> { |
| 4011 public: | 4159 public: |
| 4012 explicit BoxDoubleInstr(Value* value) { | 4160 explicit BoxDoubleInstr(Value* value) { |
| 4013 SetInputAt(0, value); | 4161 SetInputAt(0, value); |
| 4014 } | 4162 } |
| 4015 | 4163 |
| 4016 Value* value() const { return inputs_[0]; } | 4164 Value* value() const { return inputs_[0]; } |
| 4017 | 4165 |
| 4018 DECLARE_INSTRUCTION(BoxDouble) | 4166 DECLARE_INSTRUCTION(BoxDouble) |
| 4019 virtual CompileType ComputeType() const; | 4167 virtual CompileType ComputeType() const; |
| 4020 | 4168 |
| 4021 virtual bool CanDeoptimize() const { return false; } | 4169 virtual bool CanDeoptimize() const { return false; } |
| 4022 | 4170 |
| 4023 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 4171 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 4024 ASSERT(idx == 0); | 4172 ASSERT(idx == 0); |
| 4025 return kUnboxedDouble; | 4173 return kUnboxedDouble; |
| 4026 } | 4174 } |
| 4027 | 4175 |
| 4028 virtual bool AllowsCSE() const { return true; } | 4176 virtual bool AllowsCSE() const { return true; } |
| 4029 virtual EffectSet Effects() const { return EffectSet::None(); } | 4177 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4030 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4178 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4031 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4179 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4032 | 4180 |
| 4181 virtual bool MayThrow() const { return false; } | |
| 4182 | |
| 4033 Definition* Canonicalize(FlowGraphOptimizer* optimizer); | 4183 Definition* Canonicalize(FlowGraphOptimizer* optimizer); |
| 4034 | 4184 |
| 4035 private: | 4185 private: |
| 4036 DISALLOW_COPY_AND_ASSIGN(BoxDoubleInstr); | 4186 DISALLOW_COPY_AND_ASSIGN(BoxDoubleInstr); |
| 4037 }; | 4187 }; |
| 4038 | 4188 |
| 4039 | 4189 |
| 4040 class BoxFloat32x4Instr : public TemplateDefinition<1> { | 4190 class BoxFloat32x4Instr : public TemplateDefinition<1> { |
| 4041 public: | 4191 public: |
| 4042 explicit BoxFloat32x4Instr(Value* value) { | 4192 explicit BoxFloat32x4Instr(Value* value) { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 4053 } | 4203 } |
| 4054 | 4204 |
| 4055 DECLARE_INSTRUCTION(BoxFloat32x4) | 4205 DECLARE_INSTRUCTION(BoxFloat32x4) |
| 4056 virtual CompileType ComputeType() const; | 4206 virtual CompileType ComputeType() const; |
| 4057 | 4207 |
| 4058 virtual bool AllowsCSE() const { return true; } | 4208 virtual bool AllowsCSE() const { return true; } |
| 4059 virtual EffectSet Effects() const { return EffectSet::None(); } | 4209 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4060 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4210 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4061 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4211 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4062 | 4212 |
| 4213 virtual bool MayThrow() const { return false; } | |
| 4214 | |
| 4063 private: | 4215 private: |
| 4064 DISALLOW_COPY_AND_ASSIGN(BoxFloat32x4Instr); | 4216 DISALLOW_COPY_AND_ASSIGN(BoxFloat32x4Instr); |
| 4065 }; | 4217 }; |
| 4066 | 4218 |
| 4067 | 4219 |
| 4068 class BoxUint32x4Instr : public TemplateDefinition<1> { | 4220 class BoxUint32x4Instr : public TemplateDefinition<1> { |
| 4069 public: | 4221 public: |
| 4070 explicit BoxUint32x4Instr(Value* value) { | 4222 explicit BoxUint32x4Instr(Value* value) { |
| 4071 SetInputAt(0, value); | 4223 SetInputAt(0, value); |
| 4072 } | 4224 } |
| 4073 | 4225 |
| 4074 Value* value() const { return inputs_[0]; } | 4226 Value* value() const { return inputs_[0]; } |
| 4075 | 4227 |
| 4076 virtual bool CanDeoptimize() const { return false; } | 4228 virtual bool CanDeoptimize() const { return false; } |
| 4077 | 4229 |
| 4078 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 4230 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 4079 ASSERT(idx == 0); | 4231 ASSERT(idx == 0); |
| 4080 return kUnboxedUint32x4; | 4232 return kUnboxedUint32x4; |
| 4081 } | 4233 } |
| 4082 | 4234 |
| 4083 DECLARE_INSTRUCTION(BoxUint32x4) | 4235 DECLARE_INSTRUCTION(BoxUint32x4) |
| 4084 virtual CompileType ComputeType() const; | 4236 virtual CompileType ComputeType() const; |
| 4085 | 4237 |
| 4086 virtual bool AllowsCSE() const { return true; } | 4238 virtual bool AllowsCSE() const { return true; } |
| 4087 virtual EffectSet Effects() const { return EffectSet::None(); } | 4239 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4088 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4240 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4089 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4241 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4090 | 4242 |
| 4243 virtual bool MayThrow() const { return false; } | |
| 4244 | |
| 4091 private: | 4245 private: |
| 4092 DISALLOW_COPY_AND_ASSIGN(BoxUint32x4Instr); | 4246 DISALLOW_COPY_AND_ASSIGN(BoxUint32x4Instr); |
| 4093 }; | 4247 }; |
| 4094 | 4248 |
| 4095 | 4249 |
| 4096 class BoxIntegerInstr : public TemplateDefinition<1> { | 4250 class BoxIntegerInstr : public TemplateDefinition<1> { |
| 4097 public: | 4251 public: |
| 4098 explicit BoxIntegerInstr(Value* value) { | 4252 explicit BoxIntegerInstr(Value* value) { |
| 4099 SetInputAt(0, value); | 4253 SetInputAt(0, value); |
| 4100 } | 4254 } |
| 4101 | 4255 |
| 4102 Value* value() const { return inputs_[0]; } | 4256 Value* value() const { return inputs_[0]; } |
| 4103 | 4257 |
| 4104 virtual bool CanDeoptimize() const { return false; } | 4258 virtual bool CanDeoptimize() const { return false; } |
| 4105 | 4259 |
| 4106 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 4260 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 4107 ASSERT(idx == 0); | 4261 ASSERT(idx == 0); |
| 4108 return kUnboxedMint; | 4262 return kUnboxedMint; |
| 4109 } | 4263 } |
| 4110 | 4264 |
| 4111 DECLARE_INSTRUCTION(BoxInteger) | 4265 DECLARE_INSTRUCTION(BoxInteger) |
| 4112 virtual CompileType ComputeType() const; | 4266 virtual CompileType ComputeType() const; |
| 4113 | 4267 |
| 4114 virtual bool AllowsCSE() const { return true; } | 4268 virtual bool AllowsCSE() const { return true; } |
| 4115 virtual EffectSet Effects() const { return EffectSet::None(); } | 4269 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4116 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4270 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4117 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4271 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4118 | 4272 |
| 4273 virtual bool MayThrow() const { return false; } | |
| 4274 | |
| 4119 private: | 4275 private: |
| 4120 DISALLOW_COPY_AND_ASSIGN(BoxIntegerInstr); | 4276 DISALLOW_COPY_AND_ASSIGN(BoxIntegerInstr); |
| 4121 }; | 4277 }; |
| 4122 | 4278 |
| 4123 | 4279 |
| 4124 class UnboxDoubleInstr : public TemplateDefinition<1> { | 4280 class UnboxDoubleInstr : public TemplateDefinition<1> { |
| 4125 public: | 4281 public: |
| 4126 UnboxDoubleInstr(Value* value, intptr_t deopt_id) { | 4282 UnboxDoubleInstr(Value* value, intptr_t deopt_id) { |
| 4127 SetInputAt(0, value); | 4283 SetInputAt(0, value); |
| 4128 deopt_id_ = deopt_id; | 4284 deopt_id_ = deopt_id; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 4140 } | 4296 } |
| 4141 | 4297 |
| 4142 DECLARE_INSTRUCTION(UnboxDouble) | 4298 DECLARE_INSTRUCTION(UnboxDouble) |
| 4143 virtual CompileType ComputeType() const; | 4299 virtual CompileType ComputeType() const; |
| 4144 | 4300 |
| 4145 virtual bool AllowsCSE() const { return true; } | 4301 virtual bool AllowsCSE() const { return true; } |
| 4146 virtual EffectSet Effects() const { return EffectSet::None(); } | 4302 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4147 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4303 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4148 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4304 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4149 | 4305 |
| 4306 virtual bool MayThrow() const { return false; } | |
| 4307 | |
| 4150 Definition* Canonicalize(FlowGraphOptimizer* optimizer); | 4308 Definition* Canonicalize(FlowGraphOptimizer* optimizer); |
| 4151 | 4309 |
| 4152 private: | 4310 private: |
| 4153 DISALLOW_COPY_AND_ASSIGN(UnboxDoubleInstr); | 4311 DISALLOW_COPY_AND_ASSIGN(UnboxDoubleInstr); |
| 4154 }; | 4312 }; |
| 4155 | 4313 |
| 4156 | 4314 |
| 4157 class UnboxFloat32x4Instr : public TemplateDefinition<1> { | 4315 class UnboxFloat32x4Instr : public TemplateDefinition<1> { |
| 4158 public: | 4316 public: |
| 4159 UnboxFloat32x4Instr(Value* value, intptr_t deopt_id) { | 4317 UnboxFloat32x4Instr(Value* value, intptr_t deopt_id) { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 4172 } | 4330 } |
| 4173 | 4331 |
| 4174 DECLARE_INSTRUCTION(UnboxFloat32x4) | 4332 DECLARE_INSTRUCTION(UnboxFloat32x4) |
| 4175 virtual CompileType ComputeType() const; | 4333 virtual CompileType ComputeType() const; |
| 4176 | 4334 |
| 4177 virtual bool AllowsCSE() const { return true; } | 4335 virtual bool AllowsCSE() const { return true; } |
| 4178 virtual EffectSet Effects() const { return EffectSet::None(); } | 4336 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4179 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4337 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4180 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4338 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4181 | 4339 |
| 4340 virtual bool MayThrow() const { return false; } | |
| 4341 | |
| 4182 private: | 4342 private: |
| 4183 DISALLOW_COPY_AND_ASSIGN(UnboxFloat32x4Instr); | 4343 DISALLOW_COPY_AND_ASSIGN(UnboxFloat32x4Instr); |
| 4184 }; | 4344 }; |
| 4185 | 4345 |
| 4186 | 4346 |
| 4187 class UnboxUint32x4Instr : public TemplateDefinition<1> { | 4347 class UnboxUint32x4Instr : public TemplateDefinition<1> { |
| 4188 public: | 4348 public: |
| 4189 UnboxUint32x4Instr(Value* value, intptr_t deopt_id) { | 4349 UnboxUint32x4Instr(Value* value, intptr_t deopt_id) { |
| 4190 SetInputAt(0, value); | 4350 SetInputAt(0, value); |
| 4191 deopt_id_ = deopt_id; | 4351 deopt_id_ = deopt_id; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 4202 } | 4362 } |
| 4203 | 4363 |
| 4204 virtual bool AllowsCSE() const { return true; } | 4364 virtual bool AllowsCSE() const { return true; } |
| 4205 virtual EffectSet Effects() const { return EffectSet::None(); } | 4365 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4206 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4366 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4207 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4367 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4208 | 4368 |
| 4209 DECLARE_INSTRUCTION(UnboxUint32x4) | 4369 DECLARE_INSTRUCTION(UnboxUint32x4) |
| 4210 virtual CompileType ComputeType() const; | 4370 virtual CompileType ComputeType() const; |
| 4211 | 4371 |
| 4372 virtual bool MayThrow() const { return false; } | |
| 4373 | |
| 4212 private: | 4374 private: |
| 4213 DISALLOW_COPY_AND_ASSIGN(UnboxUint32x4Instr); | 4375 DISALLOW_COPY_AND_ASSIGN(UnboxUint32x4Instr); |
| 4214 }; | 4376 }; |
| 4215 | 4377 |
| 4216 | 4378 |
| 4217 class UnboxIntegerInstr : public TemplateDefinition<1> { | 4379 class UnboxIntegerInstr : public TemplateDefinition<1> { |
| 4218 public: | 4380 public: |
| 4219 UnboxIntegerInstr(Value* value, intptr_t deopt_id) { | 4381 UnboxIntegerInstr(Value* value, intptr_t deopt_id) { |
| 4220 SetInputAt(0, value); | 4382 SetInputAt(0, value); |
| 4221 deopt_id_ = deopt_id; | 4383 deopt_id_ = deopt_id; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 4234 | 4396 |
| 4235 | 4397 |
| 4236 DECLARE_INSTRUCTION(UnboxInteger) | 4398 DECLARE_INSTRUCTION(UnboxInteger) |
| 4237 virtual CompileType ComputeType() const; | 4399 virtual CompileType ComputeType() const; |
| 4238 | 4400 |
| 4239 virtual bool AllowsCSE() const { return true; } | 4401 virtual bool AllowsCSE() const { return true; } |
| 4240 virtual EffectSet Effects() const { return EffectSet::None(); } | 4402 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4241 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4403 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4242 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4404 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4243 | 4405 |
| 4406 virtual bool MayThrow() const { return false; } | |
| 4407 | |
| 4244 private: | 4408 private: |
| 4245 DISALLOW_COPY_AND_ASSIGN(UnboxIntegerInstr); | 4409 DISALLOW_COPY_AND_ASSIGN(UnboxIntegerInstr); |
| 4246 }; | 4410 }; |
| 4247 | 4411 |
| 4248 | 4412 |
| 4249 class MathSqrtInstr : public TemplateDefinition<1> { | 4413 class MathSqrtInstr : public TemplateDefinition<1> { |
| 4250 public: | 4414 public: |
| 4251 MathSqrtInstr(Value* value, StaticCallInstr* instance_call) { | 4415 MathSqrtInstr(Value* value, StaticCallInstr* instance_call) { |
| 4252 SetInputAt(0, value); | 4416 SetInputAt(0, value); |
| 4253 deopt_id_ = instance_call->deopt_id(); | 4417 deopt_id_ = instance_call->deopt_id(); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 4273 } | 4437 } |
| 4274 | 4438 |
| 4275 DECLARE_INSTRUCTION(MathSqrt) | 4439 DECLARE_INSTRUCTION(MathSqrt) |
| 4276 virtual CompileType ComputeType() const; | 4440 virtual CompileType ComputeType() const; |
| 4277 | 4441 |
| 4278 virtual bool AllowsCSE() const { return true; } | 4442 virtual bool AllowsCSE() const { return true; } |
| 4279 virtual EffectSet Effects() const { return EffectSet::None(); } | 4443 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4280 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4444 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4281 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4445 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4282 | 4446 |
| 4447 virtual bool MayThrow() const { return false; } | |
| 4448 | |
| 4283 private: | 4449 private: |
| 4284 DISALLOW_COPY_AND_ASSIGN(MathSqrtInstr); | 4450 DISALLOW_COPY_AND_ASSIGN(MathSqrtInstr); |
| 4285 }; | 4451 }; |
| 4286 | 4452 |
| 4287 | 4453 |
| 4288 class BinaryDoubleOpInstr : public TemplateDefinition<2> { | 4454 class BinaryDoubleOpInstr : public TemplateDefinition<2> { |
| 4289 public: | 4455 public: |
| 4290 BinaryDoubleOpInstr(Token::Kind op_kind, | 4456 BinaryDoubleOpInstr(Token::Kind op_kind, |
| 4291 Value* left, | 4457 Value* left, |
| 4292 Value* right, | 4458 Value* right, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4326 | 4492 |
| 4327 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); | 4493 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); |
| 4328 | 4494 |
| 4329 virtual bool AllowsCSE() const { return true; } | 4495 virtual bool AllowsCSE() const { return true; } |
| 4330 virtual EffectSet Effects() const { return EffectSet::None(); } | 4496 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4331 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4497 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4332 virtual bool AttributesEqual(Instruction* other) const { | 4498 virtual bool AttributesEqual(Instruction* other) const { |
| 4333 return op_kind() == other->AsBinaryDoubleOp()->op_kind(); | 4499 return op_kind() == other->AsBinaryDoubleOp()->op_kind(); |
| 4334 } | 4500 } |
| 4335 | 4501 |
| 4502 virtual bool MayThrow() const { return false; } | |
| 4503 | |
| 4336 private: | 4504 private: |
| 4337 const Token::Kind op_kind_; | 4505 const Token::Kind op_kind_; |
| 4338 | 4506 |
| 4339 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr); | 4507 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr); |
| 4340 }; | 4508 }; |
| 4341 | 4509 |
| 4342 | 4510 |
| 4343 class BinaryFloat32x4OpInstr : public TemplateDefinition<2> { | 4511 class BinaryFloat32x4OpInstr : public TemplateDefinition<2> { |
| 4344 public: | 4512 public: |
| 4345 BinaryFloat32x4OpInstr(Token::Kind op_kind, | 4513 BinaryFloat32x4OpInstr(Token::Kind op_kind, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4379 DECLARE_INSTRUCTION(BinaryFloat32x4Op) | 4547 DECLARE_INSTRUCTION(BinaryFloat32x4Op) |
| 4380 virtual CompileType ComputeType() const; | 4548 virtual CompileType ComputeType() const; |
| 4381 | 4549 |
| 4382 virtual bool AllowsCSE() const { return true; } | 4550 virtual bool AllowsCSE() const { return true; } |
| 4383 virtual EffectSet Effects() const { return EffectSet::None(); } | 4551 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4384 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4552 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4385 virtual bool AttributesEqual(Instruction* other) const { | 4553 virtual bool AttributesEqual(Instruction* other) const { |
| 4386 return op_kind() == other->AsBinaryFloat32x4Op()->op_kind(); | 4554 return op_kind() == other->AsBinaryFloat32x4Op()->op_kind(); |
| 4387 } | 4555 } |
| 4388 | 4556 |
| 4557 virtual bool MayThrow() const { return false; } | |
| 4558 | |
| 4389 private: | 4559 private: |
| 4390 const Token::Kind op_kind_; | 4560 const Token::Kind op_kind_; |
| 4391 | 4561 |
| 4392 DISALLOW_COPY_AND_ASSIGN(BinaryFloat32x4OpInstr); | 4562 DISALLOW_COPY_AND_ASSIGN(BinaryFloat32x4OpInstr); |
| 4393 }; | 4563 }; |
| 4394 | 4564 |
| 4395 | 4565 |
| 4396 class Float32x4ShuffleInstr : public TemplateDefinition<1> { | 4566 class Float32x4ShuffleInstr : public TemplateDefinition<1> { |
| 4397 public: | 4567 public: |
| 4398 Float32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value, | 4568 Float32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4434 DECLARE_INSTRUCTION(Float32x4Shuffle) | 4604 DECLARE_INSTRUCTION(Float32x4Shuffle) |
| 4435 virtual CompileType ComputeType() const; | 4605 virtual CompileType ComputeType() const; |
| 4436 | 4606 |
| 4437 virtual bool AllowsCSE() const { return true; } | 4607 virtual bool AllowsCSE() const { return true; } |
| 4438 virtual EffectSet Effects() const { return EffectSet::None(); } | 4608 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4439 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4609 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4440 virtual bool AttributesEqual(Instruction* other) const { | 4610 virtual bool AttributesEqual(Instruction* other) const { |
| 4441 return op_kind() == other->AsFloat32x4Shuffle()->op_kind(); | 4611 return op_kind() == other->AsFloat32x4Shuffle()->op_kind(); |
| 4442 } | 4612 } |
| 4443 | 4613 |
| 4614 virtual bool MayThrow() const { return false; } | |
| 4615 | |
| 4444 private: | 4616 private: |
| 4445 const MethodRecognizer::Kind op_kind_; | 4617 const MethodRecognizer::Kind op_kind_; |
| 4446 | 4618 |
| 4447 DISALLOW_COPY_AND_ASSIGN(Float32x4ShuffleInstr); | 4619 DISALLOW_COPY_AND_ASSIGN(Float32x4ShuffleInstr); |
| 4448 }; | 4620 }; |
| 4449 | 4621 |
| 4450 | 4622 |
| 4451 class Float32x4ConstructorInstr : public TemplateDefinition<4> { | 4623 class Float32x4ConstructorInstr : public TemplateDefinition<4> { |
| 4452 public: | 4624 public: |
| 4453 Float32x4ConstructorInstr(Value* value0, Value* value1, Value* value2, | 4625 Float32x4ConstructorInstr(Value* value0, Value* value1, Value* value2, |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 4484 } | 4656 } |
| 4485 | 4657 |
| 4486 DECLARE_INSTRUCTION(Float32x4Constructor) | 4658 DECLARE_INSTRUCTION(Float32x4Constructor) |
| 4487 virtual CompileType ComputeType() const; | 4659 virtual CompileType ComputeType() const; |
| 4488 | 4660 |
| 4489 virtual bool AllowsCSE() const { return true; } | 4661 virtual bool AllowsCSE() const { return true; } |
| 4490 virtual EffectSet Effects() const { return EffectSet::None(); } | 4662 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4491 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4663 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4492 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4664 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4493 | 4665 |
| 4666 virtual bool MayThrow() const { return false; } | |
| 4667 | |
| 4494 private: | 4668 private: |
| 4495 DISALLOW_COPY_AND_ASSIGN(Float32x4ConstructorInstr); | 4669 DISALLOW_COPY_AND_ASSIGN(Float32x4ConstructorInstr); |
| 4496 }; | 4670 }; |
| 4497 | 4671 |
| 4498 | 4672 |
| 4499 class Float32x4SplatInstr : public TemplateDefinition<1> { | 4673 class Float32x4SplatInstr : public TemplateDefinition<1> { |
| 4500 public: | 4674 public: |
| 4501 Float32x4SplatInstr(Value* value, StaticCallInstr* static_call) { | 4675 Float32x4SplatInstr(Value* value, StaticCallInstr* static_call) { |
| 4502 SetInputAt(0, value); | 4676 SetInputAt(0, value); |
| 4503 deopt_id_ = static_call->deopt_id(); | 4677 deopt_id_ = static_call->deopt_id(); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 4525 } | 4699 } |
| 4526 | 4700 |
| 4527 DECLARE_INSTRUCTION(Float32x4Splat) | 4701 DECLARE_INSTRUCTION(Float32x4Splat) |
| 4528 virtual CompileType ComputeType() const; | 4702 virtual CompileType ComputeType() const; |
| 4529 | 4703 |
| 4530 virtual bool AllowsCSE() const { return true; } | 4704 virtual bool AllowsCSE() const { return true; } |
| 4531 virtual EffectSet Effects() const { return EffectSet::None(); } | 4705 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4532 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4706 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4533 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4707 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4534 | 4708 |
| 4709 virtual bool MayThrow() const { return false; } | |
| 4710 | |
| 4535 private: | 4711 private: |
| 4536 DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr); | 4712 DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr); |
| 4537 }; | 4713 }; |
| 4538 | 4714 |
| 4539 | 4715 |
| 4540 class Float32x4ZeroInstr : public TemplateDefinition<0> { | 4716 class Float32x4ZeroInstr : public TemplateDefinition<0> { |
| 4541 public: | 4717 public: |
| 4542 explicit Float32x4ZeroInstr(StaticCallInstr* static_call) { | 4718 explicit Float32x4ZeroInstr(StaticCallInstr* static_call) { |
| 4543 deopt_id_ = static_call->deopt_id(); | 4719 deopt_id_ = static_call->deopt_id(); |
| 4544 } | 4720 } |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 4565 } | 4741 } |
| 4566 | 4742 |
| 4567 DECLARE_INSTRUCTION(Float32x4Zero) | 4743 DECLARE_INSTRUCTION(Float32x4Zero) |
| 4568 virtual CompileType ComputeType() const; | 4744 virtual CompileType ComputeType() const; |
| 4569 | 4745 |
| 4570 virtual bool AllowsCSE() const { return true; } | 4746 virtual bool AllowsCSE() const { return true; } |
| 4571 virtual EffectSet Effects() const { return EffectSet::None(); } | 4747 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4572 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4748 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4573 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4749 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4574 | 4750 |
| 4751 virtual bool MayThrow() const { return false; } | |
| 4752 | |
| 4575 private: | 4753 private: |
| 4576 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr); | 4754 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr); |
| 4577 }; | 4755 }; |
| 4578 | 4756 |
| 4579 | 4757 |
| 4580 class Float32x4ComparisonInstr : public TemplateDefinition<2> { | 4758 class Float32x4ComparisonInstr : public TemplateDefinition<2> { |
| 4581 public: | 4759 public: |
| 4582 Float32x4ComparisonInstr(MethodRecognizer::Kind op_kind, Value* left, | 4760 Float32x4ComparisonInstr(MethodRecognizer::Kind op_kind, Value* left, |
| 4583 Value* right, InstanceCallInstr* instance_call) | 4761 Value* right, InstanceCallInstr* instance_call) |
| 4584 : op_kind_(op_kind) { | 4762 : op_kind_(op_kind) { |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 4614 DECLARE_INSTRUCTION(Float32x4Comparison) | 4792 DECLARE_INSTRUCTION(Float32x4Comparison) |
| 4615 virtual CompileType ComputeType() const; | 4793 virtual CompileType ComputeType() const; |
| 4616 | 4794 |
| 4617 virtual bool AllowsCSE() const { return true; } | 4795 virtual bool AllowsCSE() const { return true; } |
| 4618 virtual EffectSet Effects() const { return EffectSet::None(); } | 4796 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4619 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4797 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4620 virtual bool AttributesEqual(Instruction* other) const { | 4798 virtual bool AttributesEqual(Instruction* other) const { |
| 4621 return op_kind() == other->AsFloat32x4Comparison()->op_kind(); | 4799 return op_kind() == other->AsFloat32x4Comparison()->op_kind(); |
| 4622 } | 4800 } |
| 4623 | 4801 |
| 4802 virtual bool MayThrow() const { return false; } | |
| 4803 | |
| 4624 private: | 4804 private: |
| 4625 const MethodRecognizer::Kind op_kind_; | 4805 const MethodRecognizer::Kind op_kind_; |
| 4626 | 4806 |
| 4627 DISALLOW_COPY_AND_ASSIGN(Float32x4ComparisonInstr); | 4807 DISALLOW_COPY_AND_ASSIGN(Float32x4ComparisonInstr); |
| 4628 }; | 4808 }; |
| 4629 | 4809 |
| 4630 | 4810 |
| 4631 class Float32x4MinMaxInstr : public TemplateDefinition<2> { | 4811 class Float32x4MinMaxInstr : public TemplateDefinition<2> { |
| 4632 public: | 4812 public: |
| 4633 Float32x4MinMaxInstr(MethodRecognizer::Kind op_kind, Value* left, | 4813 Float32x4MinMaxInstr(MethodRecognizer::Kind op_kind, Value* left, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4665 DECLARE_INSTRUCTION(Float32x4MinMax) | 4845 DECLARE_INSTRUCTION(Float32x4MinMax) |
| 4666 virtual CompileType ComputeType() const; | 4846 virtual CompileType ComputeType() const; |
| 4667 | 4847 |
| 4668 virtual bool AllowsCSE() const { return true; } | 4848 virtual bool AllowsCSE() const { return true; } |
| 4669 virtual EffectSet Effects() const { return EffectSet::None(); } | 4849 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4670 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4850 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4671 virtual bool AttributesEqual(Instruction* other) const { | 4851 virtual bool AttributesEqual(Instruction* other) const { |
| 4672 return op_kind() == other->AsFloat32x4MinMax()->op_kind(); | 4852 return op_kind() == other->AsFloat32x4MinMax()->op_kind(); |
| 4673 } | 4853 } |
| 4674 | 4854 |
| 4855 virtual bool MayThrow() const { return false; } | |
| 4856 | |
| 4675 private: | 4857 private: |
| 4676 const MethodRecognizer::Kind op_kind_; | 4858 const MethodRecognizer::Kind op_kind_; |
| 4677 | 4859 |
| 4678 DISALLOW_COPY_AND_ASSIGN(Float32x4MinMaxInstr); | 4860 DISALLOW_COPY_AND_ASSIGN(Float32x4MinMaxInstr); |
| 4679 }; | 4861 }; |
| 4680 | 4862 |
| 4681 | 4863 |
| 4682 class Float32x4ScaleInstr : public TemplateDefinition<2> { | 4864 class Float32x4ScaleInstr : public TemplateDefinition<2> { |
| 4683 public: | 4865 public: |
| 4684 Float32x4ScaleInstr(MethodRecognizer::Kind op_kind, Value* left, | 4866 Float32x4ScaleInstr(MethodRecognizer::Kind op_kind, Value* left, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4719 DECLARE_INSTRUCTION(Float32x4Scale) | 4901 DECLARE_INSTRUCTION(Float32x4Scale) |
| 4720 virtual CompileType ComputeType() const; | 4902 virtual CompileType ComputeType() const; |
| 4721 | 4903 |
| 4722 virtual bool AllowsCSE() const { return true; } | 4904 virtual bool AllowsCSE() const { return true; } |
| 4723 virtual EffectSet Effects() const { return EffectSet::None(); } | 4905 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4724 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4906 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4725 virtual bool AttributesEqual(Instruction* other) const { | 4907 virtual bool AttributesEqual(Instruction* other) const { |
| 4726 return op_kind() == other->AsFloat32x4Scale()->op_kind(); | 4908 return op_kind() == other->AsFloat32x4Scale()->op_kind(); |
| 4727 } | 4909 } |
| 4728 | 4910 |
| 4911 virtual bool MayThrow() const { return false; } | |
| 4912 | |
| 4729 private: | 4913 private: |
| 4730 const MethodRecognizer::Kind op_kind_; | 4914 const MethodRecognizer::Kind op_kind_; |
| 4731 | 4915 |
| 4732 DISALLOW_COPY_AND_ASSIGN(Float32x4ScaleInstr); | 4916 DISALLOW_COPY_AND_ASSIGN(Float32x4ScaleInstr); |
| 4733 }; | 4917 }; |
| 4734 | 4918 |
| 4735 | 4919 |
| 4736 class Float32x4SqrtInstr : public TemplateDefinition<1> { | 4920 class Float32x4SqrtInstr : public TemplateDefinition<1> { |
| 4737 public: | 4921 public: |
| 4738 Float32x4SqrtInstr(MethodRecognizer::Kind op_kind, Value* left, | 4922 Float32x4SqrtInstr(MethodRecognizer::Kind op_kind, Value* left, |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 4767 DECLARE_INSTRUCTION(Float32x4Sqrt) | 4951 DECLARE_INSTRUCTION(Float32x4Sqrt) |
| 4768 virtual CompileType ComputeType() const; | 4952 virtual CompileType ComputeType() const; |
| 4769 | 4953 |
| 4770 virtual bool AllowsCSE() const { return true; } | 4954 virtual bool AllowsCSE() const { return true; } |
| 4771 virtual EffectSet Effects() const { return EffectSet::None(); } | 4955 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4772 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4956 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4773 virtual bool AttributesEqual(Instruction* other) const { | 4957 virtual bool AttributesEqual(Instruction* other) const { |
| 4774 return op_kind() == other->AsFloat32x4Sqrt()->op_kind(); | 4958 return op_kind() == other->AsFloat32x4Sqrt()->op_kind(); |
| 4775 } | 4959 } |
| 4776 | 4960 |
| 4961 virtual bool MayThrow() const { return false; } | |
| 4962 | |
| 4777 private: | 4963 private: |
| 4778 const MethodRecognizer::Kind op_kind_; | 4964 const MethodRecognizer::Kind op_kind_; |
| 4779 | 4965 |
| 4780 DISALLOW_COPY_AND_ASSIGN(Float32x4SqrtInstr); | 4966 DISALLOW_COPY_AND_ASSIGN(Float32x4SqrtInstr); |
| 4781 }; | 4967 }; |
| 4782 | 4968 |
| 4783 | 4969 |
| 4784 class Float32x4ZeroArgInstr : public TemplateDefinition<1> { | 4970 class Float32x4ZeroArgInstr : public TemplateDefinition<1> { |
| 4785 public: | 4971 public: |
| 4786 Float32x4ZeroArgInstr(MethodRecognizer::Kind op_kind, Value* left, | 4972 Float32x4ZeroArgInstr(MethodRecognizer::Kind op_kind, Value* left, |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 4815 DECLARE_INSTRUCTION(Float32x4ZeroArg) | 5001 DECLARE_INSTRUCTION(Float32x4ZeroArg) |
| 4816 virtual CompileType ComputeType() const; | 5002 virtual CompileType ComputeType() const; |
| 4817 | 5003 |
| 4818 virtual bool AllowsCSE() const { return true; } | 5004 virtual bool AllowsCSE() const { return true; } |
| 4819 virtual EffectSet Effects() const { return EffectSet::None(); } | 5005 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4820 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5006 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4821 virtual bool AttributesEqual(Instruction* other) const { | 5007 virtual bool AttributesEqual(Instruction* other) const { |
| 4822 return op_kind() == other->AsFloat32x4ZeroArg()->op_kind(); | 5008 return op_kind() == other->AsFloat32x4ZeroArg()->op_kind(); |
| 4823 } | 5009 } |
| 4824 | 5010 |
| 5011 virtual bool MayThrow() const { return false; } | |
| 5012 | |
| 4825 private: | 5013 private: |
| 4826 const MethodRecognizer::Kind op_kind_; | 5014 const MethodRecognizer::Kind op_kind_; |
| 4827 | 5015 |
| 4828 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroArgInstr); | 5016 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroArgInstr); |
| 4829 }; | 5017 }; |
| 4830 | 5018 |
| 4831 | 5019 |
| 4832 class Float32x4ClampInstr : public TemplateDefinition<3> { | 5020 class Float32x4ClampInstr : public TemplateDefinition<3> { |
| 4833 public: | 5021 public: |
| 4834 Float32x4ClampInstr(Value* left, Value* lower, Value* upper, | 5022 Float32x4ClampInstr(Value* left, Value* lower, Value* upper, |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 4863 } | 5051 } |
| 4864 | 5052 |
| 4865 DECLARE_INSTRUCTION(Float32x4Clamp) | 5053 DECLARE_INSTRUCTION(Float32x4Clamp) |
| 4866 virtual CompileType ComputeType() const; | 5054 virtual CompileType ComputeType() const; |
| 4867 | 5055 |
| 4868 virtual bool AllowsCSE() const { return true; } | 5056 virtual bool AllowsCSE() const { return true; } |
| 4869 virtual EffectSet Effects() const { return EffectSet::None(); } | 5057 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4870 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5058 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4871 virtual bool AttributesEqual(Instruction* other) const { return true; } | 5059 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4872 | 5060 |
| 5061 virtual bool MayThrow() const { return false; } | |
| 5062 | |
| 4873 private: | 5063 private: |
| 4874 DISALLOW_COPY_AND_ASSIGN(Float32x4ClampInstr); | 5064 DISALLOW_COPY_AND_ASSIGN(Float32x4ClampInstr); |
| 4875 }; | 5065 }; |
| 4876 | 5066 |
| 4877 | 5067 |
| 4878 class Float32x4WithInstr : public TemplateDefinition<2> { | 5068 class Float32x4WithInstr : public TemplateDefinition<2> { |
| 4879 public: | 5069 public: |
| 4880 Float32x4WithInstr(MethodRecognizer::Kind op_kind, Value* left, | 5070 Float32x4WithInstr(MethodRecognizer::Kind op_kind, Value* left, |
| 4881 Value* replacement, InstanceCallInstr* instance_call) | 5071 Value* replacement, InstanceCallInstr* instance_call) |
| 4882 : op_kind_(op_kind) { | 5072 : op_kind_(op_kind) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4915 DECLARE_INSTRUCTION(Float32x4With) | 5105 DECLARE_INSTRUCTION(Float32x4With) |
| 4916 virtual CompileType ComputeType() const; | 5106 virtual CompileType ComputeType() const; |
| 4917 | 5107 |
| 4918 virtual bool AllowsCSE() const { return true; } | 5108 virtual bool AllowsCSE() const { return true; } |
| 4919 virtual EffectSet Effects() const { return EffectSet::None(); } | 5109 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4920 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5110 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4921 virtual bool AttributesEqual(Instruction* other) const { | 5111 virtual bool AttributesEqual(Instruction* other) const { |
| 4922 return op_kind() == other->AsFloat32x4With()->op_kind(); | 5112 return op_kind() == other->AsFloat32x4With()->op_kind(); |
| 4923 } | 5113 } |
| 4924 | 5114 |
| 5115 virtual bool MayThrow() const { return false; } | |
| 5116 | |
| 4925 private: | 5117 private: |
| 4926 const MethodRecognizer::Kind op_kind_; | 5118 const MethodRecognizer::Kind op_kind_; |
| 4927 | 5119 |
| 4928 DISALLOW_COPY_AND_ASSIGN(Float32x4WithInstr); | 5120 DISALLOW_COPY_AND_ASSIGN(Float32x4WithInstr); |
| 4929 }; | 5121 }; |
| 4930 | 5122 |
| 4931 | 5123 |
| 4932 class Float32x4ToUint32x4Instr : public TemplateDefinition<1> { | 5124 class Float32x4ToUint32x4Instr : public TemplateDefinition<1> { |
| 4933 public: | 5125 public: |
| 4934 Float32x4ToUint32x4Instr(Value* left, InstanceCallInstr* instance_call) { | 5126 Float32x4ToUint32x4Instr(Value* left, InstanceCallInstr* instance_call) { |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 4958 } | 5150 } |
| 4959 | 5151 |
| 4960 DECLARE_INSTRUCTION(Float32x4ToUint32x4) | 5152 DECLARE_INSTRUCTION(Float32x4ToUint32x4) |
| 4961 virtual CompileType ComputeType() const; | 5153 virtual CompileType ComputeType() const; |
| 4962 | 5154 |
| 4963 virtual bool AllowsCSE() const { return true; } | 5155 virtual bool AllowsCSE() const { return true; } |
| 4964 virtual EffectSet Effects() const { return EffectSet::None(); } | 5156 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4965 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5157 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4966 virtual bool AttributesEqual(Instruction* other) const { return true; } | 5158 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4967 | 5159 |
| 5160 virtual bool MayThrow() const { return false; } | |
| 5161 | |
| 4968 private: | 5162 private: |
| 4969 DISALLOW_COPY_AND_ASSIGN(Float32x4ToUint32x4Instr); | 5163 DISALLOW_COPY_AND_ASSIGN(Float32x4ToUint32x4Instr); |
| 4970 }; | 5164 }; |
| 4971 | 5165 |
| 4972 | 5166 |
| 4973 class BinaryMintOpInstr : public TemplateDefinition<2> { | 5167 class BinaryMintOpInstr : public TemplateDefinition<2> { |
| 4974 public: | 5168 public: |
| 4975 BinaryMintOpInstr(Token::Kind op_kind, | 5169 BinaryMintOpInstr(Token::Kind op_kind, |
| 4976 Value* left, | 5170 Value* left, |
| 4977 Value* right, | 5171 Value* right, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5017 virtual CompileType ComputeType() const; | 5211 virtual CompileType ComputeType() const; |
| 5018 | 5212 |
| 5019 virtual bool AllowsCSE() const { return true; } | 5213 virtual bool AllowsCSE() const { return true; } |
| 5020 virtual EffectSet Effects() const { return EffectSet::None(); } | 5214 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5021 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5215 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5022 virtual bool AttributesEqual(Instruction* other) const { | 5216 virtual bool AttributesEqual(Instruction* other) const { |
| 5023 ASSERT(other->IsBinaryMintOp()); | 5217 ASSERT(other->IsBinaryMintOp()); |
| 5024 return op_kind() == other->AsBinaryMintOp()->op_kind(); | 5218 return op_kind() == other->AsBinaryMintOp()->op_kind(); |
| 5025 } | 5219 } |
| 5026 | 5220 |
| 5221 virtual bool MayThrow() const { return false; } | |
| 5222 | |
| 5027 private: | 5223 private: |
| 5028 const Token::Kind op_kind_; | 5224 const Token::Kind op_kind_; |
| 5029 InstanceCallInstr* instance_call_; | 5225 InstanceCallInstr* instance_call_; |
| 5030 | 5226 |
| 5031 DISALLOW_COPY_AND_ASSIGN(BinaryMintOpInstr); | 5227 DISALLOW_COPY_AND_ASSIGN(BinaryMintOpInstr); |
| 5032 }; | 5228 }; |
| 5033 | 5229 |
| 5034 | 5230 |
| 5035 class ShiftMintOpInstr : public TemplateDefinition<2> { | 5231 class ShiftMintOpInstr : public TemplateDefinition<2> { |
| 5036 public: | 5232 public: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5073 | 5269 |
| 5074 DECLARE_INSTRUCTION(ShiftMintOp) | 5270 DECLARE_INSTRUCTION(ShiftMintOp) |
| 5075 | 5271 |
| 5076 virtual bool AllowsCSE() const { return true; } | 5272 virtual bool AllowsCSE() const { return true; } |
| 5077 virtual EffectSet Effects() const { return EffectSet::None(); } | 5273 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5078 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5274 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5079 virtual bool AttributesEqual(Instruction* other) const { | 5275 virtual bool AttributesEqual(Instruction* other) const { |
| 5080 return op_kind() == other->AsShiftMintOp()->op_kind(); | 5276 return op_kind() == other->AsShiftMintOp()->op_kind(); |
| 5081 } | 5277 } |
| 5082 | 5278 |
| 5279 virtual bool MayThrow() const { return false; } | |
| 5280 | |
| 5083 private: | 5281 private: |
| 5084 const Token::Kind op_kind_; | 5282 const Token::Kind op_kind_; |
| 5085 | 5283 |
| 5086 DISALLOW_COPY_AND_ASSIGN(ShiftMintOpInstr); | 5284 DISALLOW_COPY_AND_ASSIGN(ShiftMintOpInstr); |
| 5087 }; | 5285 }; |
| 5088 | 5286 |
| 5089 | 5287 |
| 5090 class UnaryMintOpInstr : public TemplateDefinition<1> { | 5288 class UnaryMintOpInstr : public TemplateDefinition<1> { |
| 5091 public: | 5289 public: |
| 5092 UnaryMintOpInstr(Token::Kind op_kind, | 5290 UnaryMintOpInstr(Token::Kind op_kind, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5124 DECLARE_INSTRUCTION(UnaryMintOp) | 5322 DECLARE_INSTRUCTION(UnaryMintOp) |
| 5125 virtual CompileType ComputeType() const; | 5323 virtual CompileType ComputeType() const; |
| 5126 | 5324 |
| 5127 virtual bool AllowsCSE() const { return true; } | 5325 virtual bool AllowsCSE() const { return true; } |
| 5128 virtual EffectSet Effects() const { return EffectSet::None(); } | 5326 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5129 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5327 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5130 virtual bool AttributesEqual(Instruction* other) const { | 5328 virtual bool AttributesEqual(Instruction* other) const { |
| 5131 return op_kind() == other->AsUnaryMintOp()->op_kind(); | 5329 return op_kind() == other->AsUnaryMintOp()->op_kind(); |
| 5132 } | 5330 } |
| 5133 | 5331 |
| 5332 virtual bool MayThrow() const { return false; } | |
| 5333 | |
| 5134 private: | 5334 private: |
| 5135 const Token::Kind op_kind_; | 5335 const Token::Kind op_kind_; |
| 5136 | 5336 |
| 5137 DISALLOW_COPY_AND_ASSIGN(UnaryMintOpInstr); | 5337 DISALLOW_COPY_AND_ASSIGN(UnaryMintOpInstr); |
| 5138 }; | 5338 }; |
| 5139 | 5339 |
| 5140 | 5340 |
| 5141 class BinarySmiOpInstr : public TemplateDefinition<2> { | 5341 class BinarySmiOpInstr : public TemplateDefinition<2> { |
| 5142 public: | 5342 public: |
| 5143 BinarySmiOpInstr(Token::Kind op_kind, | 5343 BinarySmiOpInstr(Token::Kind op_kind, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5182 void PrintTo(BufferFormatter* f) const; | 5382 void PrintTo(BufferFormatter* f) const; |
| 5183 | 5383 |
| 5184 virtual void InferRange(); | 5384 virtual void InferRange(); |
| 5185 | 5385 |
| 5186 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); | 5386 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); |
| 5187 | 5387 |
| 5188 // Returns true if right is a non-zero Smi constant which absolute value is | 5388 // Returns true if right is a non-zero Smi constant which absolute value is |
| 5189 // a power of two. | 5389 // a power of two. |
| 5190 bool RightIsPowerOfTwoConstant() const; | 5390 bool RightIsPowerOfTwoConstant() const; |
| 5191 | 5391 |
| 5392 virtual bool MayThrow() const { return false; } | |
| 5393 | |
| 5192 private: | 5394 private: |
| 5193 const Token::Kind op_kind_; | 5395 const Token::Kind op_kind_; |
| 5194 InstanceCallInstr* instance_call_; | 5396 InstanceCallInstr* instance_call_; |
| 5195 bool overflow_; | 5397 bool overflow_; |
| 5196 bool is_truncating_; | 5398 bool is_truncating_; |
| 5197 | 5399 |
| 5198 DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr); | 5400 DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr); |
| 5199 }; | 5401 }; |
| 5200 | 5402 |
| 5201 | 5403 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 5221 | 5423 |
| 5222 virtual bool CanDeoptimize() const { return op_kind() == Token::kNEGATE; } | 5424 virtual bool CanDeoptimize() const { return op_kind() == Token::kNEGATE; } |
| 5223 | 5425 |
| 5224 virtual bool AllowsCSE() const { return true; } | 5426 virtual bool AllowsCSE() const { return true; } |
| 5225 virtual EffectSet Effects() const { return EffectSet::None(); } | 5427 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5226 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5428 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5227 virtual bool AttributesEqual(Instruction* other) const { | 5429 virtual bool AttributesEqual(Instruction* other) const { |
| 5228 return other->AsUnarySmiOp()->op_kind() == op_kind(); | 5430 return other->AsUnarySmiOp()->op_kind() == op_kind(); |
| 5229 } | 5431 } |
| 5230 | 5432 |
| 5433 virtual bool MayThrow() const { return false; } | |
| 5434 | |
| 5231 private: | 5435 private: |
| 5232 const Token::Kind op_kind_; | 5436 const Token::Kind op_kind_; |
| 5233 | 5437 |
| 5234 DISALLOW_COPY_AND_ASSIGN(UnarySmiOpInstr); | 5438 DISALLOW_COPY_AND_ASSIGN(UnarySmiOpInstr); |
| 5235 }; | 5439 }; |
| 5236 | 5440 |
| 5237 | 5441 |
| 5238 class CheckStackOverflowInstr : public TemplateInstruction<0> { | 5442 class CheckStackOverflowInstr : public TemplateInstruction<0> { |
| 5239 public: | 5443 public: |
| 5240 explicit CheckStackOverflowInstr(intptr_t token_pos) | 5444 explicit CheckStackOverflowInstr(intptr_t token_pos) |
| 5241 : token_pos_(token_pos) {} | 5445 : token_pos_(token_pos) {} |
| 5242 | 5446 |
| 5243 intptr_t token_pos() const { return token_pos_; } | 5447 intptr_t token_pos() const { return token_pos_; } |
| 5244 | 5448 |
| 5245 DECLARE_INSTRUCTION(CheckStackOverflow) | 5449 DECLARE_INSTRUCTION(CheckStackOverflow) |
| 5246 | 5450 |
| 5247 virtual intptr_t ArgumentCount() const { return 0; } | 5451 virtual intptr_t ArgumentCount() const { return 0; } |
| 5248 | 5452 |
| 5249 virtual bool CanDeoptimize() const { return true; } | 5453 virtual bool CanDeoptimize() const { return true; } |
| 5250 | 5454 |
| 5251 virtual EffectSet Effects() const { return EffectSet::None(); } | 5455 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5252 | 5456 |
| 5457 virtual bool MayThrow() const { return false; } | |
| 5458 | |
| 5253 private: | 5459 private: |
| 5254 const intptr_t token_pos_; | 5460 const intptr_t token_pos_; |
| 5255 | 5461 |
| 5256 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr); | 5462 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr); |
| 5257 }; | 5463 }; |
| 5258 | 5464 |
| 5259 | 5465 |
| 5260 class SmiToDoubleInstr : public TemplateDefinition<1> { | 5466 class SmiToDoubleInstr : public TemplateDefinition<1> { |
| 5261 public: | 5467 public: |
| 5262 explicit SmiToDoubleInstr(Value* value) { | 5468 explicit SmiToDoubleInstr(Value* value) { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 5274 | 5480 |
| 5275 virtual intptr_t ArgumentCount() const { return 1; } | 5481 virtual intptr_t ArgumentCount() const { return 1; } |
| 5276 | 5482 |
| 5277 virtual bool CanDeoptimize() const { return false; } | 5483 virtual bool CanDeoptimize() const { return false; } |
| 5278 | 5484 |
| 5279 virtual bool AllowsCSE() const { return true; } | 5485 virtual bool AllowsCSE() const { return true; } |
| 5280 virtual EffectSet Effects() const { return EffectSet::None(); } | 5486 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5281 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5487 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5282 virtual bool AttributesEqual(Instruction* other) const { return true; } | 5488 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 5283 | 5489 |
| 5490 virtual bool MayThrow() const { return false; } | |
| 5491 | |
| 5284 private: | 5492 private: |
| 5285 DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr); | 5493 DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr); |
| 5286 }; | 5494 }; |
| 5287 | 5495 |
| 5288 | 5496 |
| 5289 class DoubleToIntegerInstr : public TemplateDefinition<1> { | 5497 class DoubleToIntegerInstr : public TemplateDefinition<1> { |
| 5290 public: | 5498 public: |
| 5291 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call) | 5499 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call) |
| 5292 : instance_call_(instance_call) { | 5500 : instance_call_(instance_call) { |
| 5293 SetInputAt(0, value); | 5501 SetInputAt(0, value); |
| 5294 deopt_id_ = instance_call->deopt_id(); | 5502 deopt_id_ = instance_call->deopt_id(); |
| 5295 } | 5503 } |
| 5296 | 5504 |
| 5297 Value* value() const { return inputs_[0]; } | 5505 Value* value() const { return inputs_[0]; } |
| 5298 InstanceCallInstr* instance_call() const { return instance_call_; } | 5506 InstanceCallInstr* instance_call() const { return instance_call_; } |
| 5299 | 5507 |
| 5300 DECLARE_INSTRUCTION(DoubleToInteger) | 5508 DECLARE_INSTRUCTION(DoubleToInteger) |
| 5301 virtual CompileType ComputeType() const; | 5509 virtual CompileType ComputeType() const; |
| 5302 | 5510 |
| 5303 virtual intptr_t ArgumentCount() const { return 1; } | 5511 virtual intptr_t ArgumentCount() const { return 1; } |
| 5304 | 5512 |
| 5305 virtual bool CanDeoptimize() const { return true; } | 5513 virtual bool CanDeoptimize() const { return true; } |
| 5306 | 5514 |
| 5307 virtual EffectSet Effects() const { return EffectSet::None(); } | 5515 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5308 | 5516 |
| 5517 virtual bool MayThrow() const { return true; } | |
| 5518 | |
| 5309 private: | 5519 private: |
| 5310 InstanceCallInstr* instance_call_; | 5520 InstanceCallInstr* instance_call_; |
| 5311 | 5521 |
| 5312 DISALLOW_COPY_AND_ASSIGN(DoubleToIntegerInstr); | 5522 DISALLOW_COPY_AND_ASSIGN(DoubleToIntegerInstr); |
| 5313 }; | 5523 }; |
| 5314 | 5524 |
| 5315 | 5525 |
| 5316 // Similar to 'DoubleToIntegerInstr' but expects unboxed double as input | 5526 // Similar to 'DoubleToIntegerInstr' but expects unboxed double as input |
| 5317 // and creates a Smi. | 5527 // and creates a Smi. |
| 5318 class DoubleToSmiInstr : public TemplateDefinition<1> { | 5528 class DoubleToSmiInstr : public TemplateDefinition<1> { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 5331 | 5541 |
| 5332 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5542 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 5333 ASSERT(idx == 0); | 5543 ASSERT(idx == 0); |
| 5334 return kUnboxedDouble; | 5544 return kUnboxedDouble; |
| 5335 } | 5545 } |
| 5336 | 5546 |
| 5337 virtual intptr_t DeoptimizationTarget() const { return deopt_id_; } | 5547 virtual intptr_t DeoptimizationTarget() const { return deopt_id_; } |
| 5338 | 5548 |
| 5339 virtual EffectSet Effects() const { return EffectSet::None(); } | 5549 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5340 | 5550 |
| 5551 virtual bool MayThrow() const { return false; } | |
| 5552 | |
| 5341 private: | 5553 private: |
| 5342 DISALLOW_COPY_AND_ASSIGN(DoubleToSmiInstr); | 5554 DISALLOW_COPY_AND_ASSIGN(DoubleToSmiInstr); |
| 5343 }; | 5555 }; |
| 5344 | 5556 |
| 5345 | 5557 |
| 5346 class DoubleToDoubleInstr : public TemplateDefinition<1> { | 5558 class DoubleToDoubleInstr : public TemplateDefinition<1> { |
| 5347 public: | 5559 public: |
| 5348 DoubleToDoubleInstr(Value* value, | 5560 DoubleToDoubleInstr(Value* value, |
| 5349 InstanceCallInstr* instance_call, | 5561 InstanceCallInstr* instance_call, |
| 5350 MethodRecognizer::Kind recognized_kind) | 5562 MethodRecognizer::Kind recognized_kind) |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 5373 | 5585 |
| 5374 virtual intptr_t DeoptimizationTarget() const { return deopt_id_; } | 5586 virtual intptr_t DeoptimizationTarget() const { return deopt_id_; } |
| 5375 | 5587 |
| 5376 virtual bool AllowsCSE() const { return true; } | 5588 virtual bool AllowsCSE() const { return true; } |
| 5377 virtual EffectSet Effects() const { return EffectSet::None(); } | 5589 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5378 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5590 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5379 virtual bool AttributesEqual(Instruction* other) const { | 5591 virtual bool AttributesEqual(Instruction* other) const { |
| 5380 return other->AsDoubleToDouble()->recognized_kind() == recognized_kind(); | 5592 return other->AsDoubleToDouble()->recognized_kind() == recognized_kind(); |
| 5381 } | 5593 } |
| 5382 | 5594 |
| 5595 virtual bool MayThrow() const { return false; } | |
| 5596 | |
| 5383 private: | 5597 private: |
| 5384 const MethodRecognizer::Kind recognized_kind_; | 5598 const MethodRecognizer::Kind recognized_kind_; |
| 5385 | 5599 |
| 5386 DISALLOW_COPY_AND_ASSIGN(DoubleToDoubleInstr); | 5600 DISALLOW_COPY_AND_ASSIGN(DoubleToDoubleInstr); |
| 5387 }; | 5601 }; |
| 5388 | 5602 |
| 5389 | 5603 |
| 5390 class InvokeMathCFunctionInstr : public Definition { | 5604 class InvokeMathCFunctionInstr : public Definition { |
| 5391 public: | 5605 public: |
| 5392 InvokeMathCFunctionInstr(ZoneGrowableArray<Value*>* inputs, | 5606 InvokeMathCFunctionInstr(ZoneGrowableArray<Value*>* inputs, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5434 } | 5648 } |
| 5435 | 5649 |
| 5436 virtual bool AllowsCSE() const { return true; } | 5650 virtual bool AllowsCSE() const { return true; } |
| 5437 virtual EffectSet Effects() const { return EffectSet::None(); } | 5651 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5438 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5652 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5439 virtual bool AttributesEqual(Instruction* other) const { | 5653 virtual bool AttributesEqual(Instruction* other) const { |
| 5440 InvokeMathCFunctionInstr* other_invoke = other->AsInvokeMathCFunction(); | 5654 InvokeMathCFunctionInstr* other_invoke = other->AsInvokeMathCFunction(); |
| 5441 return other_invoke->recognized_kind() == recognized_kind(); | 5655 return other_invoke->recognized_kind() == recognized_kind(); |
| 5442 } | 5656 } |
| 5443 | 5657 |
| 5658 virtual bool MayThrow() const { return false; } | |
| 5659 | |
| 5444 private: | 5660 private: |
| 5445 virtual void RawSetInputAt(intptr_t i, Value* value) { | 5661 virtual void RawSetInputAt(intptr_t i, Value* value) { |
| 5446 (*inputs_)[i] = value; | 5662 (*inputs_)[i] = value; |
| 5447 } | 5663 } |
| 5448 | 5664 |
| 5449 ZoneGrowableArray<Value*>* inputs_; | 5665 ZoneGrowableArray<Value*>* inputs_; |
| 5450 | 5666 |
| 5451 LocationSummary* locs_; | 5667 LocationSummary* locs_; |
| 5452 | 5668 |
| 5453 const MethodRecognizer::Kind recognized_kind_; | 5669 const MethodRecognizer::Kind recognized_kind_; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 5478 | 5694 |
| 5479 void set_null_check(bool flag) { null_check_ = flag; } | 5695 void set_null_check(bool flag) { null_check_ = flag; } |
| 5480 | 5696 |
| 5481 bool null_check() const { return null_check_; } | 5697 bool null_check() const { return null_check_; } |
| 5482 | 5698 |
| 5483 virtual bool AllowsCSE() const { return true; } | 5699 virtual bool AllowsCSE() const { return true; } |
| 5484 virtual EffectSet Effects() const { return EffectSet::None(); } | 5700 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5485 virtual EffectSet Dependencies() const; | 5701 virtual EffectSet Dependencies() const; |
| 5486 virtual bool AttributesEqual(Instruction* other) const; | 5702 virtual bool AttributesEqual(Instruction* other) const; |
| 5487 | 5703 |
| 5704 virtual bool MayThrow() const { return false; } | |
| 5705 | |
| 5488 private: | 5706 private: |
| 5489 const ICData& unary_checks_; | 5707 const ICData& unary_checks_; |
| 5490 | 5708 |
| 5491 bool null_check_; | 5709 bool null_check_; |
| 5492 | 5710 |
| 5493 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); | 5711 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); |
| 5494 }; | 5712 }; |
| 5495 | 5713 |
| 5496 | 5714 |
| 5497 class CheckSmiInstr : public TemplateInstruction<1> { | 5715 class CheckSmiInstr : public TemplateInstruction<1> { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 5510 | 5728 |
| 5511 virtual bool CanDeoptimize() const { return true; } | 5729 virtual bool CanDeoptimize() const { return true; } |
| 5512 | 5730 |
| 5513 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); | 5731 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); |
| 5514 | 5732 |
| 5515 virtual bool AllowsCSE() const { return true; } | 5733 virtual bool AllowsCSE() const { return true; } |
| 5516 virtual EffectSet Effects() const { return EffectSet::None(); } | 5734 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5517 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5735 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5518 virtual bool AttributesEqual(Instruction* other) const { return true; } | 5736 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 5519 | 5737 |
| 5738 virtual bool MayThrow() const { return false; } | |
| 5739 | |
| 5520 private: | 5740 private: |
| 5521 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); | 5741 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); |
| 5522 }; | 5742 }; |
| 5523 | 5743 |
| 5524 | 5744 |
| 5525 class CheckArrayBoundInstr : public TemplateInstruction<2> { | 5745 class CheckArrayBoundInstr : public TemplateInstruction<2> { |
| 5526 public: | 5746 public: |
| 5527 CheckArrayBoundInstr(Value* length, | 5747 CheckArrayBoundInstr(Value* length, |
| 5528 Value* index, | 5748 Value* index, |
| 5529 intptr_t array_type, | 5749 intptr_t array_type, |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 5550 // Returns the length offset for array and string types. | 5770 // Returns the length offset for array and string types. |
| 5551 static intptr_t LengthOffsetFor(intptr_t class_id); | 5771 static intptr_t LengthOffsetFor(intptr_t class_id); |
| 5552 | 5772 |
| 5553 static bool IsFixedLengthArrayType(intptr_t class_id); | 5773 static bool IsFixedLengthArrayType(intptr_t class_id); |
| 5554 | 5774 |
| 5555 virtual bool AllowsCSE() const { return true; } | 5775 virtual bool AllowsCSE() const { return true; } |
| 5556 virtual EffectSet Effects() const { return EffectSet::None(); } | 5776 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5557 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5777 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5558 virtual bool AttributesEqual(Instruction* other) const; | 5778 virtual bool AttributesEqual(Instruction* other) const; |
| 5559 | 5779 |
| 5780 virtual bool MayThrow() const { return false; } | |
| 5781 | |
| 5560 private: | 5782 private: |
| 5561 intptr_t array_type_; | 5783 intptr_t array_type_; |
| 5562 | 5784 |
| 5563 DISALLOW_COPY_AND_ASSIGN(CheckArrayBoundInstr); | 5785 DISALLOW_COPY_AND_ASSIGN(CheckArrayBoundInstr); |
| 5564 }; | 5786 }; |
| 5565 | 5787 |
| 5566 | 5788 |
| 5567 #undef DECLARE_INSTRUCTION | 5789 #undef DECLARE_INSTRUCTION |
| 5568 | 5790 |
| 5569 class Environment : public ZoneAllocated { | 5791 class Environment : public ZoneAllocated { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5781 ForwardInstructionIterator* current_iterator_; | 6003 ForwardInstructionIterator* current_iterator_; |
| 5782 | 6004 |
| 5783 private: | 6005 private: |
| 5784 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6006 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 5785 }; | 6007 }; |
| 5786 | 6008 |
| 5787 | 6009 |
| 5788 } // namespace dart | 6010 } // namespace dart |
| 5789 | 6011 |
| 5790 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6012 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |