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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 14682020: Optimize functions containing try-catch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 bool NeedsEnvironment() const { 820 bool NeedsEnvironment() const {
821 return CanDeoptimize() || CanBeDeoptimizationTarget(); 821 return CanDeoptimize() || CanBeDeoptimizationTarget();
822 } 822 }
823 823
824 virtual bool CanBeDeoptimizationTarget() const { 824 virtual bool CanBeDeoptimizationTarget() const {
825 return false; 825 return false;
826 } 826 }
827 827
828 void InheritDeoptTargetAfter(Instruction* other); 828 void InheritDeoptTargetAfter(Instruction* other);
829 829
830 virtual bool MayThrow() const = 0;
831
830 protected: 832 protected:
831 // Fetch deopt id without checking if this computation can deoptimize. 833 // Fetch deopt id without checking if this computation can deoptimize.
832 intptr_t GetDeoptId() const { 834 intptr_t GetDeoptId() const {
833 return deopt_id_; 835 return deopt_id_;
834 } 836 }
835 837
836 private: 838 private:
837 friend class Definition; // Needed for InsertBefore, InsertAfter. 839 friend class Definition; // Needed for InsertBefore, InsertAfter.
838 840
839 // Classes that set deopt_id_. 841 // Classes that set deopt_id_.
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 1012
1011 MoveOperands* MoveOperandsAt(intptr_t index) const { return moves_[index]; } 1013 MoveOperands* MoveOperandsAt(intptr_t index) const { return moves_[index]; }
1012 1014
1013 void SetSrcSlotAt(intptr_t index, const Location& loc); 1015 void SetSrcSlotAt(intptr_t index, const Location& loc);
1014 void SetDestSlotAt(intptr_t index, const Location& loc); 1016 void SetDestSlotAt(intptr_t index, const Location& loc);
1015 1017
1016 intptr_t NumMoves() const { return moves_.length(); } 1018 intptr_t NumMoves() const { return moves_.length(); }
1017 1019
1018 virtual void PrintTo(BufferFormatter* f) const; 1020 virtual void PrintTo(BufferFormatter* f) const;
1019 1021
1022 virtual bool MayThrow() const { return false; }
1023
1020 private: 1024 private:
1021 GrowableArray<MoveOperands*> moves_; // Elements cannot be null. 1025 GrowableArray<MoveOperands*> moves_; // Elements cannot be null.
1022 1026
1023 DISALLOW_COPY_AND_ASSIGN(ParallelMoveInstr); 1027 DISALLOW_COPY_AND_ASSIGN(ParallelMoveInstr);
1024 }; 1028 };
1025 1029
1026 1030
1027 // Basic block entries are administrative nodes. There is a distinguished 1031 // Basic block entries are administrative nodes. There is a distinguished
1028 // graph entry with no predecessor. Joins are the only nodes with multiple 1032 // graph entry with no predecessor. Joins are the only nodes with multiple
1029 // predecessors. Targets are all other basic block entries. The types 1033 // predecessors. Targets are all other basic block entries. The types
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 // BlockEntry environment is copied to Goto and Branch instructions 1119 // BlockEntry environment is copied to Goto and Branch instructions
1116 // when we insert new blocks targeting this block. 1120 // when we insert new blocks targeting this block.
1117 return true; 1121 return true;
1118 } 1122 }
1119 1123
1120 virtual bool CanDeoptimize() const { return false; } 1124 virtual bool CanDeoptimize() const { return false; }
1121 1125
1122 virtual EffectSet Effects() const { return EffectSet::None(); } 1126 virtual EffectSet Effects() const { return EffectSet::None(); }
1123 virtual EffectSet Dependencies() const { return EffectSet::None(); } 1127 virtual EffectSet Dependencies() const { return EffectSet::None(); }
1124 1128
1129 virtual bool MayThrow() const { return false; }
1130
1125 intptr_t try_index() const { return try_index_; } 1131 intptr_t try_index() const { return try_index_; }
1126 1132
1133 // True for blocks inside a try { } region.
1134 bool InsideTryBlock() const {
1135 return try_index_ != CatchClauseNode::kInvalidTryIndex;
1136 }
1137
1127 BitVector* loop_info() const { return loop_info_; } 1138 BitVector* loop_info() const { return loop_info_; }
1128 void set_loop_info(BitVector* loop_info) { 1139 void set_loop_info(BitVector* loop_info) {
1129 loop_info_ = loop_info; 1140 loop_info_ = loop_info;
1130 } 1141 }
1131 1142
1132 virtual BlockEntryInstr* GetBlock() const { 1143 virtual BlockEntryInstr* GetBlock() const {
1133 return const_cast<BlockEntryInstr*>(this); 1144 return const_cast<BlockEntryInstr*>(this);
1134 } 1145 }
1135 1146
1136 // Helper to mutate the graph during inlining. This block should be 1147 // Helper to mutate the graph during inlining. This block should be
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 virtual intptr_t PredecessorCount() const { return 0; } 1252 virtual intptr_t PredecessorCount() const { return 0; }
1242 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { 1253 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const {
1243 UNREACHABLE(); 1254 UNREACHABLE();
1244 return NULL; 1255 return NULL;
1245 } 1256 }
1246 virtual intptr_t SuccessorCount() const; 1257 virtual intptr_t SuccessorCount() const;
1247 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; 1258 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const;
1248 1259
1249 void AddCatchEntry(CatchBlockEntryInstr* entry) { catch_entries_.Add(entry); } 1260 void AddCatchEntry(CatchBlockEntryInstr* entry) { catch_entries_.Add(entry); }
1250 1261
1262 CatchBlockEntryInstr* GetCatchEntry(intptr_t index);
1263
1251 virtual void PrepareEntry(FlowGraphCompiler* compiler); 1264 virtual void PrepareEntry(FlowGraphCompiler* compiler);
1252 1265
1253 GrowableArray<Definition*>* initial_definitions() { 1266 GrowableArray<Definition*>* initial_definitions() {
1254 return &initial_definitions_; 1267 return &initial_definitions_;
1255 } 1268 }
1256 ConstantInstr* constant_null(); 1269 ConstantInstr* constant_null();
1257 1270
1258 intptr_t spill_slot_count() const { return spill_slot_count_; } 1271 intptr_t spill_slot_count() const { return spill_slot_count_; }
1259 void set_spill_slot_count(intptr_t count) { 1272 void set_spill_slot_count(intptr_t count) {
1260 ASSERT(count >= 0); 1273 ASSERT(count >= 0);
1261 spill_slot_count_ = count; 1274 spill_slot_count_ = count;
1262 } 1275 }
1263 1276
1277 // Number of stack slots reserved for compiling try-catch. For functions
1278 // without try-catch, this is 0. Otherwise, it is the number of local
1279 // variables.
1280 intptr_t fixed_slot_count() const { return fixed_slot_count_; }
1281 void set_fixed_slot_count(intptr_t count) {
1282 ASSERT(count >= 0);
1283 fixed_slot_count_ = count;
1284 }
1264 TargetEntryInstr* normal_entry() const { return normal_entry_; } 1285 TargetEntryInstr* normal_entry() const { return normal_entry_; }
1265 1286
1266 const ParsedFunction& parsed_function() const { 1287 const ParsedFunction& parsed_function() const {
1267 return parsed_function_; 1288 return parsed_function_;
1268 } 1289 }
1269 1290
1291 const GrowableArray<CatchBlockEntryInstr*>& catch_entries() const {
1292 return catch_entries_;
1293 }
1294
1270 virtual void PrintTo(BufferFormatter* f) const; 1295 virtual void PrintTo(BufferFormatter* f) const;
1271 1296
1272 private: 1297 private:
1273 virtual void ClearPredecessors() {} 1298 virtual void ClearPredecessors() {}
1274 virtual void AddPredecessor(BlockEntryInstr* predecessor) { UNREACHABLE(); } 1299 virtual void AddPredecessor(BlockEntryInstr* predecessor) { UNREACHABLE(); }
1275 1300
1276 const ParsedFunction& parsed_function_; 1301 const ParsedFunction& parsed_function_;
1277 TargetEntryInstr* normal_entry_; 1302 TargetEntryInstr* normal_entry_;
1278 GrowableArray<CatchBlockEntryInstr*> catch_entries_; 1303 GrowableArray<CatchBlockEntryInstr*> catch_entries_;
1279 GrowableArray<Definition*> initial_definitions_; 1304 GrowableArray<Definition*> initial_definitions_;
1280 intptr_t spill_slot_count_; 1305 intptr_t spill_slot_count_;
1306 intptr_t fixed_slot_count_; // For try-catch in optimized code.
1281 1307
1282 DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr); 1308 DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr);
1283 }; 1309 };
1284 1310
1285 1311
1286 class JoinEntryInstr : public BlockEntryInstr { 1312 class JoinEntryInstr : public BlockEntryInstr {
1287 public: 1313 public:
1288 JoinEntryInstr(intptr_t block_id, intptr_t try_index) 1314 JoinEntryInstr(intptr_t block_id, intptr_t try_index)
1289 : BlockEntryInstr(block_id, try_index), 1315 : BlockEntryInstr(block_id, try_index),
1290 predecessors_(2), // Two is the assumed to be the common case. 1316 predecessors_(2), // Two is the assumed to be the common case.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { 1436 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const {
1411 ASSERT((index == 0) && (predecessor_ != NULL)); 1437 ASSERT((index == 0) && (predecessor_ != NULL));
1412 return predecessor_; 1438 return predecessor_;
1413 } 1439 }
1414 1440
1415 // Returns try index for the try block to which this catch handler 1441 // Returns try index for the try block to which this catch handler
1416 // corresponds. 1442 // corresponds.
1417 intptr_t catch_try_index() const { 1443 intptr_t catch_try_index() const {
1418 return catch_try_index_; 1444 return catch_try_index_;
1419 } 1445 }
1446 GrowableArray<Definition*>* initial_definitions() {
1447 return &initial_definitions_;
1448 }
1420 1449
1421 virtual void PrepareEntry(FlowGraphCompiler* compiler); 1450 virtual void PrepareEntry(FlowGraphCompiler* compiler);
1422 1451
1423 virtual void PrintTo(BufferFormatter* f) const; 1452 virtual void PrintTo(BufferFormatter* f) const;
1424 1453
1425 private: 1454 private:
1426 friend class BlockEntryInstr; // Access to predecessor_ when inlining. 1455 friend class BlockEntryInstr; // Access to predecessor_ when inlining.
1427 1456
1428 virtual void ClearPredecessors() { predecessor_ = NULL; } 1457 virtual void ClearPredecessors() { predecessor_ = NULL; }
1429 virtual void AddPredecessor(BlockEntryInstr* predecessor) { 1458 virtual void AddPredecessor(BlockEntryInstr* predecessor) {
1430 ASSERT(predecessor_ == NULL); 1459 ASSERT(predecessor_ == NULL);
1431 predecessor_ = predecessor; 1460 predecessor_ = predecessor;
1432 } 1461 }
1433 1462
1434 BlockEntryInstr* predecessor_; 1463 BlockEntryInstr* predecessor_;
1435 const Array& catch_handler_types_; 1464 const Array& catch_handler_types_;
1436 const intptr_t catch_try_index_; 1465 const intptr_t catch_try_index_;
1466 GrowableArray<Definition*> initial_definitions_;
1437 1467
1438 DISALLOW_COPY_AND_ASSIGN(CatchBlockEntryInstr); 1468 DISALLOW_COPY_AND_ASSIGN(CatchBlockEntryInstr);
1439 }; 1469 };
1440 1470
1441 1471
1442 // Abstract super-class of all instructions that define a value (Bind, Phi). 1472 // Abstract super-class of all instructions that define a value (Bind, Phi).
1443 class Definition : public Instruction { 1473 class Definition : public Instruction {
1444 public: 1474 public:
1445 enum UseKind { kEffect, kValue }; 1475 enum UseKind { kEffect, kValue };
1446 1476
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 virtual void InferRange(); 1685 virtual void InferRange();
1656 1686
1657 BitVector* reaching_defs() const { 1687 BitVector* reaching_defs() const {
1658 return reaching_defs_; 1688 return reaching_defs_;
1659 } 1689 }
1660 1690
1661 void set_reaching_defs(BitVector* reaching_defs) { 1691 void set_reaching_defs(BitVector* reaching_defs) {
1662 reaching_defs_ = reaching_defs; 1692 reaching_defs_ = reaching_defs;
1663 } 1693 }
1664 1694
1695 virtual bool MayThrow() const { return false; }
1696
1665 private: 1697 private:
1666 // Direct access to inputs_ in order to resize it due to unreachable 1698 // Direct access to inputs_ in order to resize it due to unreachable
1667 // predecessors. 1699 // predecessors.
1668 friend class ConstantPropagator; 1700 friend class ConstantPropagator;
1669 1701
1670 void RawSetInputAt(intptr_t i, Value* value) { inputs_[i] = value; } 1702 void RawSetInputAt(intptr_t i, Value* value) { inputs_[i] = value; }
1671 1703
1672 JoinEntryInstr* block_; 1704 JoinEntryInstr* block_;
1673 GrowableArray<Value*> inputs_; 1705 GrowableArray<Value*> inputs_;
1674 bool is_alive_; 1706 bool is_alive_;
1675 Representation representation_; 1707 Representation representation_;
1676 1708
1677 BitVector* reaching_defs_; 1709 BitVector* reaching_defs_;
1678 1710
1679 DISALLOW_COPY_AND_ASSIGN(PhiInstr); 1711 DISALLOW_COPY_AND_ASSIGN(PhiInstr);
1680 }; 1712 };
1681 1713
1682 1714
1683 class ParameterInstr : public Definition { 1715 class ParameterInstr : public Definition {
1684 public: 1716 public:
1685 ParameterInstr(intptr_t index, GraphEntryInstr* block) 1717 ParameterInstr(intptr_t index, BlockEntryInstr* block)
1686 : index_(index), block_(block) { } 1718 : index_(index), block_(block) { }
1687 1719
1688 DECLARE_INSTRUCTION(Parameter) 1720 DECLARE_INSTRUCTION(Parameter)
1689 1721
1690 intptr_t index() const { return index_; } 1722 intptr_t index() const { return index_; }
1691 1723
1692 // Get the block entry for that instruction. 1724 // Get the block entry for that instruction.
1693 virtual BlockEntryInstr* GetBlock() const { return block_; } 1725 virtual BlockEntryInstr* GetBlock() const { return block_; }
1694 1726
1695 virtual intptr_t ArgumentCount() const { return 0; } 1727 virtual intptr_t ArgumentCount() const { return 0; }
(...skipping 11 matching lines...) Expand all
1707 1739
1708 virtual intptr_t Hashcode() const { 1740 virtual intptr_t Hashcode() const {
1709 UNREACHABLE(); 1741 UNREACHABLE();
1710 return 0; 1742 return 0;
1711 } 1743 }
1712 1744
1713 virtual void PrintOperandsTo(BufferFormatter* f) const; 1745 virtual void PrintOperandsTo(BufferFormatter* f) const;
1714 1746
1715 virtual CompileType ComputeType() const; 1747 virtual CompileType ComputeType() const;
1716 1748
1749 virtual bool MayThrow() const { return false; }
1750
1717 private: 1751 private:
1718 virtual void RawSetInputAt(intptr_t i, Value* value) { UNREACHABLE(); } 1752 virtual void RawSetInputAt(intptr_t i, Value* value) { UNREACHABLE(); }
1719 1753
1720 const intptr_t index_; 1754 const intptr_t index_;
1721 GraphEntryInstr* block_; 1755 BlockEntryInstr* block_;
1722 1756
1723 DISALLOW_COPY_AND_ASSIGN(ParameterInstr); 1757 DISALLOW_COPY_AND_ASSIGN(ParameterInstr);
1724 }; 1758 };
1725 1759
1726 1760
1727 class PushArgumentInstr : public Definition { 1761 class PushArgumentInstr : public Definition {
1728 public: 1762 public:
1729 explicit PushArgumentInstr(Value* value) : locs_(NULL) { 1763 explicit PushArgumentInstr(Value* value) : locs_(NULL) {
1730 SetInputAt(0, value); 1764 SetInputAt(0, value);
1731 set_use_kind(kEffect); // Override the default. 1765 set_use_kind(kEffect); // Override the default.
(...skipping 24 matching lines...) Expand all
1756 UNREACHABLE(); 1790 UNREACHABLE();
1757 return 0; 1791 return 0;
1758 } 1792 }
1759 1793
1760 virtual bool CanDeoptimize() const { return false; } 1794 virtual bool CanDeoptimize() const { return false; }
1761 1795
1762 virtual EffectSet Effects() const { return EffectSet::None(); } 1796 virtual EffectSet Effects() const { return EffectSet::None(); }
1763 1797
1764 virtual void PrintOperandsTo(BufferFormatter* f) const; 1798 virtual void PrintOperandsTo(BufferFormatter* f) const;
1765 1799
1800 virtual bool MayThrow() const { return false; }
1801
1766 private: 1802 private:
1767 virtual void RawSetInputAt(intptr_t i, Value* value) { 1803 virtual void RawSetInputAt(intptr_t i, Value* value) {
1768 ASSERT(i == 0); 1804 ASSERT(i == 0);
1769 value_ = value; 1805 value_ = value;
1770 } 1806 }
1771 1807
1772 Value* value_; 1808 Value* value_;
1773 LocationSummary* locs_; 1809 LocationSummary* locs_;
1774 1810
1775 DISALLOW_COPY_AND_ASSIGN(PushArgumentInstr); 1811 DISALLOW_COPY_AND_ASSIGN(PushArgumentInstr);
(...skipping 22 matching lines...) Expand all
1798 virtual bool CanBeDeoptimizationTarget() const { 1834 virtual bool CanBeDeoptimizationTarget() const {
1799 // Return instruction might turn into a Goto instruction after inlining. 1835 // Return instruction might turn into a Goto instruction after inlining.
1800 // Every Goto must have an environment. 1836 // Every Goto must have an environment.
1801 return true; 1837 return true;
1802 } 1838 }
1803 1839
1804 virtual bool CanDeoptimize() const { return false; } 1840 virtual bool CanDeoptimize() const { return false; }
1805 1841
1806 virtual EffectSet Effects() const { return EffectSet::None(); } 1842 virtual EffectSet Effects() const { return EffectSet::None(); }
1807 1843
1844 virtual bool MayThrow() const { return false; }
1845
1808 private: 1846 private:
1809 const intptr_t token_pos_; 1847 const intptr_t token_pos_;
1810 1848
1811 DISALLOW_COPY_AND_ASSIGN(ReturnInstr); 1849 DISALLOW_COPY_AND_ASSIGN(ReturnInstr);
1812 }; 1850 };
1813 1851
1814 1852
1815 class ThrowInstr : public TemplateInstruction<0> { 1853 class ThrowInstr : public TemplateInstruction<0> {
1816 public: 1854 public:
1817 explicit ThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { } 1855 explicit ThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { }
1818 1856
1819 DECLARE_INSTRUCTION(Throw) 1857 DECLARE_INSTRUCTION(Throw)
1820 1858
1821 virtual intptr_t ArgumentCount() const { return 1; } 1859 virtual intptr_t ArgumentCount() const { return 1; }
1822 1860
1823 intptr_t token_pos() const { return token_pos_; } 1861 intptr_t token_pos() const { return token_pos_; }
1824 1862
1825 virtual bool CanDeoptimize() const { return true; } 1863 virtual bool CanDeoptimize() const { return true; }
1826 1864
1827 virtual EffectSet Effects() const { return EffectSet::None(); } 1865 virtual EffectSet Effects() const { return EffectSet::None(); }
1828 1866
1867 virtual bool MayThrow() const { return true; }
1868
1829 private: 1869 private:
1830 const intptr_t token_pos_; 1870 const intptr_t token_pos_;
1831 1871
1832 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); 1872 DISALLOW_COPY_AND_ASSIGN(ThrowInstr);
1833 }; 1873 };
1834 1874
1835 1875
1836 class ReThrowInstr : public TemplateInstruction<0> { 1876 class ReThrowInstr : public TemplateInstruction<0> {
1837 public: 1877 public:
1838 explicit ReThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { } 1878 explicit ReThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { }
1839 1879
1840 DECLARE_INSTRUCTION(ReThrow) 1880 DECLARE_INSTRUCTION(ReThrow)
1841 1881
1842 virtual intptr_t ArgumentCount() const { return 2; } 1882 virtual intptr_t ArgumentCount() const { return 2; }
1843 1883
1844 intptr_t token_pos() const { return token_pos_; } 1884 intptr_t token_pos() const { return token_pos_; }
1845 1885
1846 virtual bool CanDeoptimize() const { return true; } 1886 virtual bool CanDeoptimize() const { return true; }
1847 1887
1848 virtual EffectSet Effects() const { return EffectSet::None(); } 1888 virtual EffectSet Effects() const { return EffectSet::None(); }
1849 1889
1890 virtual bool MayThrow() const { return true; }
1891
1850 private: 1892 private:
1851 const intptr_t token_pos_; 1893 const intptr_t token_pos_;
1852 1894
1853 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr); 1895 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr);
1854 }; 1896 };
1855 1897
1856 1898
1857 class GotoInstr : public TemplateInstruction<0> { 1899 class GotoInstr : public TemplateInstruction<0> {
1858 public: 1900 public:
1859 explicit GotoInstr(JoinEntryInstr* entry) 1901 explicit GotoInstr(JoinEntryInstr* entry)
(...skipping 29 matching lines...) Expand all
1889 1931
1890 ParallelMoveInstr* GetParallelMove() { 1932 ParallelMoveInstr* GetParallelMove() {
1891 if (parallel_move_ == NULL) { 1933 if (parallel_move_ == NULL) {
1892 parallel_move_ = new ParallelMoveInstr(); 1934 parallel_move_ = new ParallelMoveInstr();
1893 } 1935 }
1894 return parallel_move_; 1936 return parallel_move_;
1895 } 1937 }
1896 1938
1897 virtual void PrintTo(BufferFormatter* f) const; 1939 virtual void PrintTo(BufferFormatter* f) const;
1898 1940
1941 virtual bool MayThrow() const { return false; }
1942
1899 private: 1943 private:
1900 JoinEntryInstr* successor_; 1944 JoinEntryInstr* successor_;
1901 1945
1902 // Parallel move that will be used by linear scan register allocator to 1946 // Parallel move that will be used by linear scan register allocator to
1903 // connect live ranges at the end of the block and resolve phis. 1947 // connect live ranges at the end of the block and resolve phis.
1904 ParallelMoveInstr* parallel_move_; 1948 ParallelMoveInstr* parallel_move_;
1905 }; 1949 };
1906 1950
1907 1951
1908 class ControlInstruction : public Instruction { 1952 class ControlInstruction : public Instruction {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1983 void set_constant_target(TargetEntryInstr* target) { 2027 void set_constant_target(TargetEntryInstr* target) {
1984 ASSERT(target == true_successor() || target == false_successor()); 2028 ASSERT(target == true_successor() || target == false_successor());
1985 constant_target_ = target; 2029 constant_target_ = target;
1986 } 2030 }
1987 TargetEntryInstr* constant_target() const { 2031 TargetEntryInstr* constant_target() const {
1988 return constant_target_; 2032 return constant_target_;
1989 } 2033 }
1990 2034
1991 virtual void InheritDeoptTarget(Instruction* other); 2035 virtual void InheritDeoptTarget(Instruction* other);
1992 2036
2037 virtual bool MayThrow() const;
2038
1993 private: 2039 private:
1994 virtual void RawSetInputAt(intptr_t i, Value* value); 2040 virtual void RawSetInputAt(intptr_t i, Value* value);
1995 2041
1996 ComparisonInstr* comparison_; 2042 ComparisonInstr* comparison_;
1997 const bool is_checked_; 2043 const bool is_checked_;
1998 2044
1999 ConstrainedCompileType* constrained_type_; 2045 ConstrainedCompileType* constrained_type_;
2000 2046
2001 TargetEntryInstr* constant_target_; 2047 TargetEntryInstr* constant_target_;
2002 2048
(...skipping 10 matching lines...) Expand all
2013 DECLARE_INSTRUCTION(StoreContext) 2059 DECLARE_INSTRUCTION(StoreContext)
2014 2060
2015 virtual intptr_t ArgumentCount() const { return 0; } 2061 virtual intptr_t ArgumentCount() const { return 0; }
2016 2062
2017 Value* value() const { return inputs_[0]; } 2063 Value* value() const { return inputs_[0]; }
2018 2064
2019 virtual bool CanDeoptimize() const { return false; } 2065 virtual bool CanDeoptimize() const { return false; }
2020 2066
2021 virtual EffectSet Effects() const { return EffectSet::None(); } 2067 virtual EffectSet Effects() const { return EffectSet::None(); }
2022 2068
2069 virtual bool MayThrow() const { return false; }
2070
2023 private: 2071 private:
2024 DISALLOW_COPY_AND_ASSIGN(StoreContextInstr); 2072 DISALLOW_COPY_AND_ASSIGN(StoreContextInstr);
2025 }; 2073 };
2026 2074
2027 2075
2028 template<intptr_t N> 2076 template<intptr_t N>
2029 class TemplateDefinition : public Definition { 2077 class TemplateDefinition : public Definition {
2030 public: 2078 public:
2031 TemplateDefinition<N>() : locs_(NULL) { } 2079 TemplateDefinition<N>() : locs_(NULL) { }
2032 2080
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 2114
2067 Value* value() const { return inputs_[0]; } 2115 Value* value() const { return inputs_[0]; }
2068 2116
2069 virtual CompileType ComputeType() const; 2117 virtual CompileType ComputeType() const;
2070 virtual bool RecomputeType(); 2118 virtual bool RecomputeType();
2071 2119
2072 virtual bool CanDeoptimize() const { return false; } 2120 virtual bool CanDeoptimize() const { return false; }
2073 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2121 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2074 virtual EffectSet Effects() const { return EffectSet::None(); } 2122 virtual EffectSet Effects() const { return EffectSet::None(); }
2075 2123
2124 virtual bool MayThrow() const { return false; }
2125
2076 private: 2126 private:
2077 DISALLOW_COPY_AND_ASSIGN(RedefinitionInstr); 2127 DISALLOW_COPY_AND_ASSIGN(RedefinitionInstr);
2078 }; 2128 };
2079 2129
2080 2130
2081 class RangeBoundary : public ValueObject { 2131 class RangeBoundary : public ValueObject {
2082 public: 2132 public:
2083 enum Kind { kUnknown, kSymbol, kConstant }; 2133 enum Kind { kUnknown, kSymbol, kConstant };
2084 2134
2085 RangeBoundary() : kind_(kUnknown), value_(0), offset_(0) { } 2135 RangeBoundary() : kind_(kUnknown), value_(0), offset_(0) { }
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 2307
2258 virtual bool CanDeoptimize() const { return false; } 2308 virtual bool CanDeoptimize() const { return false; }
2259 2309
2260 virtual EffectSet Effects() const { return EffectSet::None(); } 2310 virtual EffectSet Effects() const { return EffectSet::None(); }
2261 2311
2262 virtual bool AttributesEqual(Instruction* other) const { 2312 virtual bool AttributesEqual(Instruction* other) const {
2263 UNREACHABLE(); 2313 UNREACHABLE();
2264 return false; 2314 return false;
2265 } 2315 }
2266 2316
2317 virtual bool MayThrow() const { return false; }
2318
2267 virtual void PrintOperandsTo(BufferFormatter* f) const; 2319 virtual void PrintOperandsTo(BufferFormatter* f) const;
2268 2320
2269 Value* value() const { return inputs_[0]; } 2321 Value* value() const { return inputs_[0]; }
2270 Range* constraint() const { return constraint_; } 2322 Range* constraint() const { return constraint_; }
2271 2323
2272 virtual void InferRange(); 2324 virtual void InferRange();
2273 2325
2274 void AddDependency(Definition* defn) { 2326 void AddDependency(Definition* defn) {
2275 Value* val = new Value(defn); 2327 Value* val = new Value(defn);
2276 defn->AddInputUse(val); 2328 defn->AddInputUse(val);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 2367
2316 virtual bool CanDeoptimize() const { return false; } 2368 virtual bool CanDeoptimize() const { return false; }
2317 2369
2318 virtual void InferRange(); 2370 virtual void InferRange();
2319 2371
2320 virtual bool AllowsCSE() const { return true; } 2372 virtual bool AllowsCSE() const { return true; }
2321 virtual EffectSet Effects() const { return EffectSet::None(); } 2373 virtual EffectSet Effects() const { return EffectSet::None(); }
2322 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2374 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2323 virtual bool AttributesEqual(Instruction* other) const; 2375 virtual bool AttributesEqual(Instruction* other) const;
2324 2376
2377 virtual bool MayThrow() const { return false; }
2378
2325 private: 2379 private:
2326 const Object& value_; 2380 const Object& value_;
2327 2381
2328 DISALLOW_COPY_AND_ASSIGN(ConstantInstr); 2382 DISALLOW_COPY_AND_ASSIGN(ConstantInstr);
2329 }; 2383 };
2330 2384
2331 2385
2332 class AssertAssignableInstr : public TemplateDefinition<3> { 2386 class AssertAssignableInstr : public TemplateDefinition<3> {
2333 public: 2387 public:
2334 AssertAssignableInstr(intptr_t token_pos, 2388 AssertAssignableInstr(intptr_t token_pos,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2366 2420
2367 virtual bool CanDeoptimize() const { return true; } 2421 virtual bool CanDeoptimize() const { return true; }
2368 2422
2369 virtual Definition* Canonicalize(FlowGraph* flow_graph); 2423 virtual Definition* Canonicalize(FlowGraph* flow_graph);
2370 2424
2371 virtual bool AllowsCSE() const { return true; } 2425 virtual bool AllowsCSE() const { return true; }
2372 virtual EffectSet Effects() const { return EffectSet::None(); } 2426 virtual EffectSet Effects() const { return EffectSet::None(); }
2373 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2427 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2374 virtual bool AttributesEqual(Instruction* other) const; 2428 virtual bool AttributesEqual(Instruction* other) const;
2375 2429
2430 virtual bool MayThrow() const { return true; }
2431
2376 private: 2432 private:
2377 const intptr_t token_pos_; 2433 const intptr_t token_pos_;
2378 AbstractType& dst_type_; 2434 AbstractType& dst_type_;
2379 const String& dst_name_; 2435 const String& dst_name_;
2380 2436
2381 DISALLOW_COPY_AND_ASSIGN(AssertAssignableInstr); 2437 DISALLOW_COPY_AND_ASSIGN(AssertAssignableInstr);
2382 }; 2438 };
2383 2439
2384 2440
2385 class AssertBooleanInstr : public TemplateDefinition<1> { 2441 class AssertBooleanInstr : public TemplateDefinition<1> {
(...skipping 13 matching lines...) Expand all
2399 2455
2400 virtual bool CanDeoptimize() const { return true; } 2456 virtual bool CanDeoptimize() const { return true; }
2401 2457
2402 virtual Definition* Canonicalize(FlowGraph* flow_graph); 2458 virtual Definition* Canonicalize(FlowGraph* flow_graph);
2403 2459
2404 virtual bool AllowsCSE() const { return true; } 2460 virtual bool AllowsCSE() const { return true; }
2405 virtual EffectSet Effects() const { return EffectSet::None(); } 2461 virtual EffectSet Effects() const { return EffectSet::None(); }
2406 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2462 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2407 virtual bool AttributesEqual(Instruction* other) const { return true; } 2463 virtual bool AttributesEqual(Instruction* other) const { return true; }
2408 2464
2465 virtual bool MayThrow() const { return true; }
2466
2409 private: 2467 private:
2410 const intptr_t token_pos_; 2468 const intptr_t token_pos_;
2411 2469
2412 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr); 2470 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr);
2413 }; 2471 };
2414 2472
2415 2473
2416 class ArgumentDefinitionTestInstr : public TemplateDefinition<1> { 2474 class ArgumentDefinitionTestInstr : public TemplateDefinition<1> {
2417 public: 2475 public:
2418 ArgumentDefinitionTestInstr(ArgumentDefinitionTestNode* node, 2476 ArgumentDefinitionTestInstr(ArgumentDefinitionTestNode* node,
(...skipping 14 matching lines...) Expand all
2433 } 2491 }
2434 2492
2435 Value* saved_arguments_descriptor() const { return inputs_[0]; } 2493 Value* saved_arguments_descriptor() const { return inputs_[0]; }
2436 2494
2437 virtual void PrintOperandsTo(BufferFormatter* f) const; 2495 virtual void PrintOperandsTo(BufferFormatter* f) const;
2438 2496
2439 virtual bool CanDeoptimize() const { return true; } 2497 virtual bool CanDeoptimize() const { return true; }
2440 2498
2441 virtual EffectSet Effects() const { return EffectSet::None(); } 2499 virtual EffectSet Effects() const { return EffectSet::None(); }
2442 2500
2501 virtual bool MayThrow() const { return true; }
2502
2443 private: 2503 private:
2444 const ArgumentDefinitionTestNode& ast_node_; 2504 const ArgumentDefinitionTestNode& ast_node_;
2445 2505
2446 DISALLOW_COPY_AND_ASSIGN(ArgumentDefinitionTestInstr); 2506 DISALLOW_COPY_AND_ASSIGN(ArgumentDefinitionTestInstr);
2447 }; 2507 };
2448 2508
2449 2509
2450 // Denotes the current context, normally held in a register. This is 2510 // Denotes the current context, normally held in a register. This is
2451 // a computation, not a value, because it's mutable. 2511 // a computation, not a value, because it's mutable.
2452 class CurrentContextInstr : public TemplateDefinition<0> { 2512 class CurrentContextInstr : public TemplateDefinition<0> {
2453 public: 2513 public:
2454 CurrentContextInstr() { } 2514 CurrentContextInstr() { }
2455 2515
2456 DECLARE_INSTRUCTION(CurrentContext) 2516 DECLARE_INSTRUCTION(CurrentContext)
2457 virtual CompileType ComputeType() const; 2517 virtual CompileType ComputeType() const;
2458 2518
2459 virtual bool CanDeoptimize() const { return false; } 2519 virtual bool CanDeoptimize() const { return false; }
2460 2520
2461 virtual EffectSet Effects() const { return EffectSet::None(); } 2521 virtual EffectSet Effects() const { return EffectSet::None(); }
2462 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2522 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2463 virtual bool AttributesEqual(Instruction* other) const { return true; } 2523 virtual bool AttributesEqual(Instruction* other) const { return true; }
2464 2524
2525 virtual bool MayThrow() const { return false; }
2526
2465 private: 2527 private:
2466 DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr); 2528 DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr);
2467 }; 2529 };
2468 2530
2469 2531
2470 class ClosureCallInstr : public TemplateDefinition<0> { 2532 class ClosureCallInstr : public TemplateDefinition<0> {
2471 public: 2533 public:
2472 ClosureCallInstr(ClosureCallNode* node, 2534 ClosureCallInstr(ClosureCallNode* node,
2473 ZoneGrowableArray<PushArgumentInstr*>* arguments) 2535 ZoneGrowableArray<PushArgumentInstr*>* arguments)
2474 : ast_node_(*node), 2536 : ast_node_(*node),
2475 arguments_(arguments) { } 2537 arguments_(arguments) { }
2476 2538
2477 DECLARE_INSTRUCTION(ClosureCall) 2539 DECLARE_INSTRUCTION(ClosureCall)
2478 2540
2479 const Array& argument_names() const { return ast_node_.arguments()->names(); } 2541 const Array& argument_names() const { return ast_node_.arguments()->names(); }
2480 intptr_t token_pos() const { return ast_node_.token_pos(); } 2542 intptr_t token_pos() const { return ast_node_.token_pos(); }
2481 2543
2482 virtual intptr_t ArgumentCount() const { return arguments_->length(); } 2544 virtual intptr_t ArgumentCount() const { return arguments_->length(); }
2483 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { 2545 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const {
2484 return (*arguments_)[index]; 2546 return (*arguments_)[index];
2485 } 2547 }
2486 2548
2487 virtual void PrintOperandsTo(BufferFormatter* f) const; 2549 virtual void PrintOperandsTo(BufferFormatter* f) const;
2488 2550
2489 virtual bool CanDeoptimize() const { return true; } 2551 virtual bool CanDeoptimize() const { return true; }
2490 2552
2491 virtual EffectSet Effects() const { return EffectSet::All(); } 2553 virtual EffectSet Effects() const { return EffectSet::All(); }
2492 2554
2555 virtual bool MayThrow() const { return true; }
2556
2493 private: 2557 private:
2494 const ClosureCallNode& ast_node_; 2558 const ClosureCallNode& ast_node_;
2495 ZoneGrowableArray<PushArgumentInstr*>* arguments_; 2559 ZoneGrowableArray<PushArgumentInstr*>* arguments_;
2496 2560
2497 DISALLOW_COPY_AND_ASSIGN(ClosureCallInstr); 2561 DISALLOW_COPY_AND_ASSIGN(ClosureCallInstr);
2498 }; 2562 };
2499 2563
2500 2564
2501 class InstanceCallInstr : public TemplateDefinition<0> { 2565 class InstanceCallInstr : public TemplateDefinition<0> {
2502 public: 2566 public:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2545 } 2609 }
2546 const Array& argument_names() const { return argument_names_; } 2610 const Array& argument_names() const { return argument_names_; }
2547 intptr_t checked_argument_count() const { return checked_argument_count_; } 2611 intptr_t checked_argument_count() const { return checked_argument_count_; }
2548 2612
2549 virtual void PrintOperandsTo(BufferFormatter* f) const; 2613 virtual void PrintOperandsTo(BufferFormatter* f) const;
2550 2614
2551 virtual bool CanDeoptimize() const { return true; } 2615 virtual bool CanDeoptimize() const { return true; }
2552 2616
2553 virtual EffectSet Effects() const { return EffectSet::All(); } 2617 virtual EffectSet Effects() const { return EffectSet::All(); }
2554 2618
2619 virtual bool MayThrow() const { return true; }
2620
2555 protected: 2621 protected:
2556 friend class FlowGraphOptimizer; 2622 friend class FlowGraphOptimizer;
2557 void set_ic_data(ICData* value) { ic_data_ = value; } 2623 void set_ic_data(ICData* value) { ic_data_ = value; }
2558 2624
2559 private: 2625 private:
2560 const ICData* ic_data_; 2626 const ICData* ic_data_;
2561 const intptr_t token_pos_; 2627 const intptr_t token_pos_;
2562 const String& function_name_; 2628 const String& function_name_;
2563 const Token::Kind token_kind_; // Binary op, unary op, kGET or kILLEGAL. 2629 const Token::Kind token_kind_; // Binary op, unary op, kGET or kILLEGAL.
2564 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; 2630 ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
(...skipping 29 matching lines...) Expand all
2594 DECLARE_INSTRUCTION(PolymorphicInstanceCall) 2660 DECLARE_INSTRUCTION(PolymorphicInstanceCall)
2595 2661
2596 const ICData& ic_data() const { return ic_data_; } 2662 const ICData& ic_data() const { return ic_data_; }
2597 2663
2598 virtual bool CanDeoptimize() const { return true; } 2664 virtual bool CanDeoptimize() const { return true; }
2599 2665
2600 virtual EffectSet Effects() const { return EffectSet::All(); } 2666 virtual EffectSet Effects() const { return EffectSet::All(); }
2601 2667
2602 virtual void PrintOperandsTo(BufferFormatter* f) const; 2668 virtual void PrintOperandsTo(BufferFormatter* f) const;
2603 2669
2670 virtual bool MayThrow() const { return true; }
2671
2604 private: 2672 private:
2605 InstanceCallInstr* instance_call_; 2673 InstanceCallInstr* instance_call_;
2606 const ICData& ic_data_; 2674 const ICData& ic_data_;
2607 const bool with_checks_; 2675 const bool with_checks_;
2608 2676
2609 DISALLOW_COPY_AND_ASSIGN(PolymorphicInstanceCallInstr); 2677 DISALLOW_COPY_AND_ASSIGN(PolymorphicInstanceCallInstr);
2610 }; 2678 };
2611 2679
2612 2680
2613 class ComparisonInstr : public TemplateDefinition<2> { 2681 class ComparisonInstr : public TemplateDefinition<2> {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
2685 return comparison()->DeoptimizationTarget(); 2753 return comparison()->DeoptimizationTarget();
2686 } 2754 }
2687 2755
2688 2756
2689 inline Representation BranchInstr::RequiredInputRepresentation( 2757 inline Representation BranchInstr::RequiredInputRepresentation(
2690 intptr_t i) const { 2758 intptr_t i) const {
2691 return comparison()->RequiredInputRepresentation(i); 2759 return comparison()->RequiredInputRepresentation(i);
2692 } 2760 }
2693 2761
2694 2762
2763 inline bool BranchInstr::MayThrow() const {
2764 return comparison()->MayThrow();
2765 }
2766
2767
2695 class StrictCompareInstr : public ComparisonInstr { 2768 class StrictCompareInstr : public ComparisonInstr {
2696 public: 2769 public:
2697 StrictCompareInstr(Token::Kind kind, Value* left, Value* right); 2770 StrictCompareInstr(Token::Kind kind, Value* left, Value* right);
2698 2771
2699 DECLARE_INSTRUCTION(StrictCompare) 2772 DECLARE_INSTRUCTION(StrictCompare)
2700 virtual CompileType ComputeType() const; 2773 virtual CompileType ComputeType() const;
2701 2774
2702 virtual void PrintOperandsTo(BufferFormatter* f) const; 2775 virtual void PrintOperandsTo(BufferFormatter* f) const;
2703 2776
2704 virtual bool CanBeDeoptimizationTarget() const { 2777 virtual bool CanBeDeoptimizationTarget() const {
(...skipping 10 matching lines...) Expand all
2715 2788
2716 bool needs_number_check() const { return needs_number_check_; } 2789 bool needs_number_check() const { return needs_number_check_; }
2717 void set_needs_number_check(bool value) { needs_number_check_ = value; } 2790 void set_needs_number_check(bool value) { needs_number_check_ = value; }
2718 void set_kind(Token::Kind value) { kind_ = value; } 2791 void set_kind(Token::Kind value) { kind_ = value; }
2719 2792
2720 virtual bool AllowsCSE() const { return true; } 2793 virtual bool AllowsCSE() const { return true; }
2721 virtual EffectSet Effects() const { return EffectSet::None(); } 2794 virtual EffectSet Effects() const { return EffectSet::None(); }
2722 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2795 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2723 virtual bool AttributesEqual(Instruction* other) const; 2796 virtual bool AttributesEqual(Instruction* other) const;
2724 2797
2798 virtual bool MayThrow() const { return false; }
2799
2725 private: 2800 private:
2726 // True if the comparison must check for double, Mint or Bigint and 2801 // True if the comparison must check for double, Mint or Bigint and
2727 // use value comparison instead. 2802 // use value comparison instead.
2728 bool needs_number_check_; 2803 bool needs_number_check_;
2729 2804
2730 DISALLOW_COPY_AND_ASSIGN(StrictCompareInstr); 2805 DISALLOW_COPY_AND_ASSIGN(StrictCompareInstr);
2731 }; 2806 };
2732 2807
2733 2808
2734 class EqualityCompareInstr : public ComparisonInstr { 2809 class EqualityCompareInstr : public ComparisonInstr {
(...skipping 25 matching lines...) Expand all
2760 // Receiver class id is computed from collected ICData. 2835 // Receiver class id is computed from collected ICData.
2761 void set_receiver_class_id(intptr_t value) { receiver_class_id_ = value; } 2836 void set_receiver_class_id(intptr_t value) { receiver_class_id_ = value; }
2762 intptr_t receiver_class_id() const { return receiver_class_id_; } 2837 intptr_t receiver_class_id() const { return receiver_class_id_; }
2763 2838
2764 bool IsInlinedNumericComparison() const { 2839 bool IsInlinedNumericComparison() const {
2765 return (receiver_class_id() == kDoubleCid) 2840 return (receiver_class_id() == kDoubleCid)
2766 || (receiver_class_id() == kMintCid) 2841 || (receiver_class_id() == kMintCid)
2767 || (receiver_class_id() == kSmiCid); 2842 || (receiver_class_id() == kSmiCid);
2768 } 2843 }
2769 2844
2845 bool is_checked_strict_equal() const {
2846 return HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid);
2847 }
2848
2770 virtual void PrintOperandsTo(BufferFormatter* f) const; 2849 virtual void PrintOperandsTo(BufferFormatter* f) const;
2771 2850
2772 virtual bool CanDeoptimize() const { 2851 virtual bool CanDeoptimize() const {
2773 return !IsInlinedNumericComparison(); 2852 return !IsInlinedNumericComparison();
2774 } 2853 }
2775 2854
2776 virtual void EmitBranchCode(FlowGraphCompiler* compiler, 2855 virtual void EmitBranchCode(FlowGraphCompiler* compiler,
2777 BranchInstr* branch); 2856 BranchInstr* branch);
2778 2857
2779 virtual intptr_t DeoptimizationTarget() const { 2858 virtual intptr_t DeoptimizationTarget() const {
2780 return GetDeoptId(); 2859 return GetDeoptId();
2781 } 2860 }
2782 2861
2783 virtual Representation RequiredInputRepresentation(intptr_t idx) const { 2862 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
2784 ASSERT((idx == 0) || (idx == 1)); 2863 ASSERT((idx == 0) || (idx == 1));
2785 if (receiver_class_id() == kDoubleCid) return kUnboxedDouble; 2864 if (receiver_class_id() == kDoubleCid) return kUnboxedDouble;
2786 if (receiver_class_id() == kMintCid) return kUnboxedMint; 2865 if (receiver_class_id() == kMintCid) return kUnboxedMint;
2787 return kTagged; 2866 return kTagged;
2788 } 2867 }
2789 2868
2790 bool IsPolymorphic() const; 2869 bool IsPolymorphic() const;
2791 2870
2792 virtual EffectSet Effects() const { 2871 virtual EffectSet Effects() const {
2793 return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All(); 2872 return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All();
2794 } 2873 }
2795 2874
2875 virtual bool MayThrow() const {
2876 return !IsInlinedNumericComparison() && !is_checked_strict_equal();
2877 }
2878
2796 private: 2879 private:
2797 const ICData* ic_data_; 2880 const ICData* ic_data_;
2798 const intptr_t token_pos_; 2881 const intptr_t token_pos_;
2799 intptr_t receiver_class_id_; // Set by optimizer. 2882 intptr_t receiver_class_id_; // Set by optimizer.
2800 2883
2801 DISALLOW_COPY_AND_ASSIGN(EqualityCompareInstr); 2884 DISALLOW_COPY_AND_ASSIGN(EqualityCompareInstr);
2802 }; 2885 };
2803 2886
2804 2887
2805 class RelationalOpInstr : public ComparisonInstr { 2888 class RelationalOpInstr : public ComparisonInstr {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2860 ASSERT((idx == 0) || (idx == 1)); 2943 ASSERT((idx == 0) || (idx == 1));
2861 if (operands_class_id() == kDoubleCid) return kUnboxedDouble; 2944 if (operands_class_id() == kDoubleCid) return kUnboxedDouble;
2862 if (operands_class_id() == kMintCid) return kUnboxedMint; 2945 if (operands_class_id() == kMintCid) return kUnboxedMint;
2863 return kTagged; 2946 return kTagged;
2864 } 2947 }
2865 2948
2866 virtual EffectSet Effects() const { 2949 virtual EffectSet Effects() const {
2867 return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All(); 2950 return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All();
2868 } 2951 }
2869 2952
2953 virtual bool MayThrow() const { return !IsInlinedNumericComparison(); }
2954
2870 private: 2955 private:
2871 const ICData* ic_data_; 2956 const ICData* ic_data_;
2872 const intptr_t token_pos_; 2957 const intptr_t token_pos_;
2873 intptr_t operands_class_id_; // class id of both operands. 2958 intptr_t operands_class_id_; // class id of both operands.
2874 2959
2875 DISALLOW_COPY_AND_ASSIGN(RelationalOpInstr); 2960 DISALLOW_COPY_AND_ASSIGN(RelationalOpInstr);
2876 }; 2961 };
2877 2962
2878 2963
2879 // TODO(vegorov): ComparisonInstr should be switched to use IfTheElseInstr for 2964 // TODO(vegorov): ComparisonInstr should be switched to use IfTheElseInstr for
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2920 virtual bool AllowsCSE() const { return true; } 3005 virtual bool AllowsCSE() const { return true; }
2921 virtual EffectSet Effects() const { return EffectSet::None(); } 3006 virtual EffectSet Effects() const { return EffectSet::None(); }
2922 virtual EffectSet Dependencies() const { return EffectSet::None(); } 3007 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2923 virtual bool AttributesEqual(Instruction* other) const { 3008 virtual bool AttributesEqual(Instruction* other) const {
2924 IfThenElseInstr* other_if_then_else = other->AsIfThenElse(); 3009 IfThenElseInstr* other_if_then_else = other->AsIfThenElse();
2925 return (kind_ == other_if_then_else->kind_) && 3010 return (kind_ == other_if_then_else->kind_) &&
2926 (if_true_ == other_if_then_else->if_true_) && 3011 (if_true_ == other_if_then_else->if_true_) &&
2927 (if_false_ == other_if_then_else->if_false_); 3012 (if_false_ == other_if_then_else->if_false_);
2928 } 3013 }
2929 3014
3015 virtual bool MayThrow() const { return false; }
3016
2930 private: 3017 private:
2931 const Token::Kind kind_; 3018 const Token::Kind kind_;
2932 const intptr_t if_true_; 3019 const intptr_t if_true_;
2933 const intptr_t if_false_; 3020 const intptr_t if_false_;
2934 3021
2935 DISALLOW_COPY_AND_ASSIGN(IfThenElseInstr); 3022 DISALLOW_COPY_AND_ASSIGN(IfThenElseInstr);
2936 }; 3023 };
2937 3024
2938 3025
2939 class StaticCallInstr : public TemplateDefinition<0> { 3026 class StaticCallInstr : public TemplateDefinition<0> {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2971 3058
2972 virtual EffectSet Effects() const { return EffectSet::All(); } 3059 virtual EffectSet Effects() const { return EffectSet::All(); }
2973 3060
2974 void set_result_cid(intptr_t value) { result_cid_ = value; } 3061 void set_result_cid(intptr_t value) { result_cid_ = value; }
2975 3062
2976 bool is_known_list_constructor() const { return is_known_list_constructor_; } 3063 bool is_known_list_constructor() const { return is_known_list_constructor_; }
2977 void set_is_known_list_constructor(bool value) { 3064 void set_is_known_list_constructor(bool value) {
2978 is_known_list_constructor_ = value; 3065 is_known_list_constructor_ = value;
2979 } 3066 }
2980 3067
3068 virtual bool MayThrow() const { return true; }
3069
2981 private: 3070 private:
2982 const intptr_t token_pos_; 3071 const intptr_t token_pos_;
2983 const Function& function_; 3072 const Function& function_;
2984 const Array& argument_names_; 3073 const Array& argument_names_;
2985 ZoneGrowableArray<PushArgumentInstr*>* arguments_; 3074 ZoneGrowableArray<PushArgumentInstr*>* arguments_;
2986 intptr_t result_cid_; // For some library functions we know the result. 3075 intptr_t result_cid_; // For some library functions we know the result.
2987 3076
2988 // 'True' for recognized list constructors. 3077 // 'True' for recognized list constructors.
2989 bool is_known_list_constructor_; 3078 bool is_known_list_constructor_;
2990 3079
(...skipping 16 matching lines...) Expand all
3007 virtual bool CanDeoptimize() const { return false; } 3096 virtual bool CanDeoptimize() const { return false; }
3008 3097
3009 virtual EffectSet Effects() const { 3098 virtual EffectSet Effects() const {
3010 UNREACHABLE(); // Eliminated by SSA construction. 3099 UNREACHABLE(); // Eliminated by SSA construction.
3011 return EffectSet::None(); 3100 return EffectSet::None();
3012 } 3101 }
3013 3102
3014 void mark_last() { is_last_ = true; } 3103 void mark_last() { is_last_ = true; }
3015 bool is_last() const { return is_last_; } 3104 bool is_last() const { return is_last_; }
3016 3105
3106 virtual bool MayThrow() const {
3107 UNREACHABLE();
3108 return false;
3109 }
3110
3017 private: 3111 private:
3018 const LocalVariable& local_; 3112 const LocalVariable& local_;
3019 bool is_last_; 3113 bool is_last_;
3020 3114
3021 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr); 3115 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr);
3022 }; 3116 };
3023 3117
3024 3118
3025 class StoreLocalInstr : public TemplateDefinition<1> { 3119 class StoreLocalInstr : public TemplateDefinition<1> {
3026 public: 3120 public:
(...skipping 16 matching lines...) Expand all
3043 bool is_dead() const { return is_dead_; } 3137 bool is_dead() const { return is_dead_; }
3044 3138
3045 void mark_last() { is_last_ = true; } 3139 void mark_last() { is_last_ = true; }
3046 bool is_last() const { return is_last_; } 3140 bool is_last() const { return is_last_; }
3047 3141
3048 virtual EffectSet Effects() const { 3142 virtual EffectSet Effects() const {
3049 UNREACHABLE(); // Eliminated by SSA construction. 3143 UNREACHABLE(); // Eliminated by SSA construction.
3050 return EffectSet::None(); 3144 return EffectSet::None();
3051 } 3145 }
3052 3146
3147 virtual bool MayThrow() const {
3148 UNREACHABLE();
3149 return false;
3150 }
3151
3053 private: 3152 private:
3054 const LocalVariable& local_; 3153 const LocalVariable& local_;
3055 bool is_dead_; 3154 bool is_dead_;
3056 bool is_last_; 3155 bool is_last_;
3057 3156
3058 DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr); 3157 DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr);
3059 }; 3158 };
3060 3159
3061 3160
3062 class NativeCallInstr : public TemplateDefinition<0> { 3161 class NativeCallInstr : public TemplateDefinition<0> {
(...skipping 14 matching lines...) Expand all
3077 NativeFunction native_c_function() const { 3176 NativeFunction native_c_function() const {
3078 return ast_node_.native_c_function(); 3177 return ast_node_.native_c_function();
3079 } 3178 }
3080 3179
3081 virtual void PrintOperandsTo(BufferFormatter* f) const; 3180 virtual void PrintOperandsTo(BufferFormatter* f) const;
3082 3181
3083 virtual bool CanDeoptimize() const { return false; } 3182 virtual bool CanDeoptimize() const { return false; }
3084 3183
3085 virtual EffectSet Effects() const { return EffectSet::All(); } 3184 virtual EffectSet Effects() const { return EffectSet::All(); }
3086 3185
3186 virtual bool MayThrow() const {
3187 UNREACHABLE();
3188 return true;
3189 }
3190
3087 private: 3191 private:
3088 const NativeBodyNode& ast_node_; 3192 const NativeBodyNode& ast_node_;
3089 3193
3090 DISALLOW_COPY_AND_ASSIGN(NativeCallInstr); 3194 DISALLOW_COPY_AND_ASSIGN(NativeCallInstr);
3091 }; 3195 };
3092 3196
3093 3197
3094 enum StoreBarrierType { 3198 enum StoreBarrierType {
3095 kNoStoreBarrier, 3199 kNoStoreBarrier,
3096 kEmitStoreBarrier 3200 kEmitStoreBarrier
(...skipping 26 matching lines...) Expand all
3123 3227
3124 virtual void PrintOperandsTo(BufferFormatter* f) const; 3228 virtual void PrintOperandsTo(BufferFormatter* f) const;
3125 3229
3126 virtual bool CanDeoptimize() const { return false; } 3230 virtual bool CanDeoptimize() const { return false; }
3127 3231
3128 // Currently CSE/LICM don't operate on any instructions that can be affected 3232 // Currently CSE/LICM don't operate on any instructions that can be affected
3129 // by stores/loads. LoadOptimizer handles loads separately. Hence stores 3233 // by stores/loads. LoadOptimizer handles loads separately. Hence stores
3130 // are marked as having no side-effects. 3234 // are marked as having no side-effects.
3131 virtual EffectSet Effects() const { return EffectSet::None(); } 3235 virtual EffectSet Effects() const { return EffectSet::None(); }
3132 3236
3237 virtual bool MayThrow() const { return false; }
3238
3133 private: 3239 private:
3134 bool CanValueBeSmi() const { 3240 bool CanValueBeSmi() const {
3135 const intptr_t cid = value()->Type()->ToNullableCid(); 3241 const intptr_t cid = value()->Type()->ToNullableCid();
3136 // Write barrier is skipped for nullable and non-nullable smis. 3242 // Write barrier is skipped for nullable and non-nullable smis.
3137 ASSERT(cid != kSmiCid); 3243 ASSERT(cid != kSmiCid);
3138 return (cid == kDynamicCid); 3244 return (cid == kDynamicCid);
3139 } 3245 }
3140 3246
3141 const Field& field_; 3247 const Field& field_;
3142 const StoreBarrierType emit_store_barrier_; 3248 const StoreBarrierType emit_store_barrier_;
(...skipping 24 matching lines...) Expand all
3167 3273
3168 virtual Instruction* Canonicalize(FlowGraph* flow_graph); 3274 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
3169 3275
3170 virtual void PrintOperandsTo(BufferFormatter* f) const; 3276 virtual void PrintOperandsTo(BufferFormatter* f) const;
3171 3277
3172 virtual bool AllowsCSE() const { return true; } 3278 virtual bool AllowsCSE() const { return true; }
3173 virtual EffectSet Effects() const { return EffectSet::None(); } 3279 virtual EffectSet Effects() const { return EffectSet::None(); }
3174 virtual EffectSet Dependencies() const { return EffectSet::None(); } 3280 virtual EffectSet Dependencies() const { return EffectSet::None(); }
3175 virtual bool AttributesEqual(Instruction* other) const; 3281 virtual bool AttributesEqual(Instruction* other) const;
3176 3282
3283 virtual bool MayThrow() const { return false; }
3284
3177 private: 3285 private:
3178 const Field& field_; 3286 const Field& field_;
3179 3287
3180 DISALLOW_COPY_AND_ASSIGN(GuardFieldInstr); 3288 DISALLOW_COPY_AND_ASSIGN(GuardFieldInstr);
3181 }; 3289 };
3182 3290
3183 3291
3184 class LoadStaticFieldInstr : public TemplateDefinition<0> { 3292 class LoadStaticFieldInstr : public TemplateDefinition<0> {
3185 public: 3293 public:
3186 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {} 3294 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {}
3187 3295
3188 DECLARE_INSTRUCTION(LoadStaticField) 3296 DECLARE_INSTRUCTION(LoadStaticField)
3189 virtual CompileType ComputeType() const; 3297 virtual CompileType ComputeType() const;
3190 3298
3191 const Field& field() const { return field_; } 3299 const Field& field() const { return field_; }
3192 3300
3193 virtual void PrintOperandsTo(BufferFormatter* f) const; 3301 virtual void PrintOperandsTo(BufferFormatter* f) const;
3194 3302
3195 virtual bool CanDeoptimize() const { return false; } 3303 virtual bool CanDeoptimize() const { return false; }
3196 3304
3197 virtual bool AllowsCSE() const { return field_.is_final(); } 3305 virtual bool AllowsCSE() const { return field_.is_final(); }
3198 virtual EffectSet Effects() const { return EffectSet::None(); } 3306 virtual EffectSet Effects() const { return EffectSet::None(); }
3199 virtual EffectSet Dependencies() const; 3307 virtual EffectSet Dependencies() const;
3200 virtual bool AttributesEqual(Instruction* other) const; 3308 virtual bool AttributesEqual(Instruction* other) const;
3201 3309
3310 virtual bool MayThrow() const { return false; }
3202 private: 3311 private:
3203 const Field& field_; 3312 const Field& field_;
3204 3313
3205 DISALLOW_COPY_AND_ASSIGN(LoadStaticFieldInstr); 3314 DISALLOW_COPY_AND_ASSIGN(LoadStaticFieldInstr);
3206 }; 3315 };
3207 3316
3208 3317
3209 class StoreStaticFieldInstr : public TemplateDefinition<1> { 3318 class StoreStaticFieldInstr : public TemplateDefinition<1> {
3210 public: 3319 public:
3211 StoreStaticFieldInstr(const Field& field, Value* value) 3320 StoreStaticFieldInstr(const Field& field, Value* value)
(...skipping 10 matching lines...) Expand all
3222 3331
3223 virtual void PrintOperandsTo(BufferFormatter* f) const; 3332 virtual void PrintOperandsTo(BufferFormatter* f) const;
3224 3333
3225 virtual bool CanDeoptimize() const { return false; } 3334 virtual bool CanDeoptimize() const { return false; }
3226 3335
3227 // Currently CSE/LICM don't operate on any instructions that can be affected 3336 // Currently CSE/LICM don't operate on any instructions that can be affected
3228 // by stores/loads. LoadOptimizer handles loads separately. Hence stores 3337 // by stores/loads. LoadOptimizer handles loads separately. Hence stores
3229 // are marked as having no side-effects. 3338 // are marked as having no side-effects.
3230 virtual EffectSet Effects() const { return EffectSet::None(); } 3339 virtual EffectSet Effects() const { return EffectSet::None(); }
3231 3340
3341 virtual bool MayThrow() const { return false; }
3342
3232 private: 3343 private:
3233 bool CanValueBeSmi() const { 3344 bool CanValueBeSmi() const {
3234 const intptr_t cid = value()->Type()->ToNullableCid(); 3345 const intptr_t cid = value()->Type()->ToNullableCid();
3235 // Write barrier is skipped for nullable and non-nullable smis. 3346 // Write barrier is skipped for nullable and non-nullable smis.
3236 ASSERT(cid != kSmiCid); 3347 ASSERT(cid != kSmiCid);
3237 return (cid == kDynamicCid); 3348 return (cid == kDynamicCid);
3238 } 3349 }
3239 3350
3240 const Field& field_; 3351 const Field& field_;
3241 3352
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
3281 3392
3282 3393
3283 virtual Representation representation() const; 3394 virtual Representation representation() const;
3284 virtual void InferRange(); 3395 virtual void InferRange();
3285 3396
3286 virtual bool AllowsCSE() const { return false; } 3397 virtual bool AllowsCSE() const { return false; }
3287 virtual EffectSet Effects() const { return EffectSet::None(); } 3398 virtual EffectSet Effects() const { return EffectSet::None(); }
3288 virtual EffectSet Dependencies() const; 3399 virtual EffectSet Dependencies() const;
3289 virtual bool AttributesEqual(Instruction* other) const; 3400 virtual bool AttributesEqual(Instruction* other) const;
3290 3401
3402 virtual bool MayThrow() const { return false; }
3403
3291 private: 3404 private:
3292 const intptr_t index_scale_; 3405 const intptr_t index_scale_;
3293 const intptr_t class_id_; 3406 const intptr_t class_id_;
3294 3407
3295 DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr); 3408 DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr);
3296 }; 3409 };
3297 3410
3298 3411
3299 class StringFromCharCodeInstr : public TemplateDefinition<1> { 3412 class StringFromCharCodeInstr : public TemplateDefinition<1> {
3300 public: 3413 public:
(...skipping 12 matching lines...) Expand all
3313 3426
3314 virtual bool CanDeoptimize() const { return false; } 3427 virtual bool CanDeoptimize() const { return false; }
3315 3428
3316 virtual bool AllowsCSE() const { return true; } 3429 virtual bool AllowsCSE() const { return true; }
3317 virtual EffectSet Effects() const { return EffectSet::None(); } 3430 virtual EffectSet Effects() const { return EffectSet::None(); }
3318 virtual EffectSet Dependencies() const { return EffectSet::None(); } 3431 virtual EffectSet Dependencies() const { return EffectSet::None(); }
3319 virtual bool AttributesEqual(Instruction* other) const { 3432 virtual bool AttributesEqual(Instruction* other) const {
3320 return other->AsStringFromCharCode()->cid_ == cid_; 3433 return other->AsStringFromCharCode()->cid_ == cid_;
3321 } 3434 }
3322 3435
3436 virtual bool MayThrow() const { return false; }
3437
3323 private: 3438 private:
3324 const intptr_t cid_; 3439 const intptr_t cid_;
3325 3440
3326 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr); 3441 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr);
3327 }; 3442 };
3328 3443
3329 3444
3330 class StoreIndexedInstr : public TemplateDefinition<3> { 3445 class StoreIndexedInstr : public TemplateDefinition<3> {
3331 public: 3446 public:
3332 StoreIndexedInstr(Value* array, 3447 StoreIndexedInstr(Value* array,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
3367 } 3482 }
3368 3483
3369 virtual intptr_t DeoptimizationTarget() const { 3484 virtual intptr_t DeoptimizationTarget() const {
3370 // Direct access since this instruction cannot deoptimize, and the deopt-id 3485 // Direct access since this instruction cannot deoptimize, and the deopt-id
3371 // was inherited from another instruction that could deoptimize. 3486 // was inherited from another instruction that could deoptimize.
3372 return deopt_id_; 3487 return deopt_id_;
3373 } 3488 }
3374 3489
3375 virtual EffectSet Effects() const { return EffectSet::None(); } 3490 virtual EffectSet Effects() const { return EffectSet::None(); }
3376 3491
3492 virtual bool MayThrow() const { return false; }
3493
3377 private: 3494 private:
3378 const StoreBarrierType emit_store_barrier_; 3495 const StoreBarrierType emit_store_barrier_;
3379 const intptr_t index_scale_; 3496 const intptr_t index_scale_;
3380 const intptr_t class_id_; 3497 const intptr_t class_id_;
3381 3498
3382 DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr); 3499 DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr);
3383 }; 3500 };
3384 3501
3385 3502
3386 // Note overrideable, built-in: value? false : true. 3503 // Note overrideable, built-in: value? false : true.
3387 class BooleanNegateInstr : public TemplateDefinition<1> { 3504 class BooleanNegateInstr : public TemplateDefinition<1> {
3388 public: 3505 public:
3389 explicit BooleanNegateInstr(Value* value) { 3506 explicit BooleanNegateInstr(Value* value) {
3390 SetInputAt(0, value); 3507 SetInputAt(0, value);
3391 } 3508 }
3392 3509
3393 DECLARE_INSTRUCTION(BooleanNegate) 3510 DECLARE_INSTRUCTION(BooleanNegate)
3394 virtual CompileType ComputeType() const; 3511 virtual CompileType ComputeType() const;
3395 3512
3396 Value* value() const { return inputs_[0]; } 3513 Value* value() const { return inputs_[0]; }
3397 3514
3398 virtual bool CanDeoptimize() const { return false; } 3515 virtual bool CanDeoptimize() const { return false; }
3399 3516
3400 virtual EffectSet Effects() const { return EffectSet::None(); } 3517 virtual EffectSet Effects() const { return EffectSet::None(); }
3401 3518
3519 virtual bool MayThrow() const { return false; }
3520
3402 private: 3521 private:
3403 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr); 3522 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr);
3404 }; 3523 };
3405 3524
3406 3525
3407 class InstanceOfInstr : public TemplateDefinition<3> { 3526 class InstanceOfInstr : public TemplateDefinition<3> {
3408 public: 3527 public:
3409 InstanceOfInstr(intptr_t token_pos, 3528 InstanceOfInstr(intptr_t token_pos,
3410 Value* value, 3529 Value* value,
3411 Value* instantiator, 3530 Value* instantiator,
(...skipping 21 matching lines...) Expand all
3433 bool negate_result() const { return negate_result_; } 3552 bool negate_result() const { return negate_result_; }
3434 const AbstractType& type() const { return type_; } 3553 const AbstractType& type() const { return type_; }
3435 intptr_t token_pos() const { return token_pos_; } 3554 intptr_t token_pos() const { return token_pos_; }
3436 3555
3437 virtual void PrintOperandsTo(BufferFormatter* f) const; 3556 virtual void PrintOperandsTo(BufferFormatter* f) const;
3438 3557
3439 virtual bool CanDeoptimize() const { return true; } 3558 virtual bool CanDeoptimize() const { return true; }
3440 3559
3441 virtual EffectSet Effects() const { return EffectSet::None(); } 3560 virtual EffectSet Effects() const { return EffectSet::None(); }
3442 3561
3562 virtual bool MayThrow() const { return true; }
3563
3443 private: 3564 private:
3444 const intptr_t token_pos_; 3565 const intptr_t token_pos_;
3445 Value* value_; 3566 Value* value_;
3446 Value* instantiator_; 3567 Value* instantiator_;
3447 Value* type_arguments_; 3568 Value* type_arguments_;
3448 const AbstractType& type_; 3569 const AbstractType& type_;
3449 const bool negate_result_; 3570 const bool negate_result_;
3450 3571
3451 DISALLOW_COPY_AND_ASSIGN(InstanceOfInstr); 3572 DISALLOW_COPY_AND_ASSIGN(InstanceOfInstr);
3452 }; 3573 };
(...skipping 21 matching lines...) Expand all
3474 3595
3475 const Function& constructor() const { return ast_node_.constructor(); } 3596 const Function& constructor() const { return ast_node_.constructor(); }
3476 intptr_t token_pos() const { return ast_node_.token_pos(); } 3597 intptr_t token_pos() const { return ast_node_.token_pos(); }
3477 3598
3478 virtual void PrintOperandsTo(BufferFormatter* f) const; 3599 virtual void PrintOperandsTo(BufferFormatter* f) const;
3479 3600
3480 virtual bool CanDeoptimize() const { return false; } 3601 virtual bool CanDeoptimize() const { return false; }
3481 3602
3482 virtual EffectSet Effects() const { return EffectSet::None(); } 3603 virtual EffectSet Effects() const { return EffectSet::None(); }
3483 3604
3605 virtual bool MayThrow() const { return false; }
3606
3484 // If the result of the allocation is not stored into any field, passed 3607 // If the result of the allocation is not stored into any field, passed
3485 // as an argument or used in a phi then it can't alias with any other 3608 // as an argument or used in a phi then it can't alias with any other
3486 // SSA value. 3609 // SSA value.
3487 enum Identity { 3610 enum Identity {
3488 kUnknown, 3611 kUnknown,
3489 kAliased, 3612 kAliased,
3490 kNotAliased 3613 kNotAliased
3491 }; 3614 };
3492 3615
3493 Identity identity() const { return identity_; } 3616 Identity identity() const { return identity_; }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
3542 virtual EffectSet Effects() const { return EffectSet::None(); } 3665 virtual EffectSet Effects() const { return EffectSet::None(); }
3543 3666
3544 LocationSummary* locs() { 3667 LocationSummary* locs() {
3545 UNREACHABLE(); 3668 UNREACHABLE();
3546 return NULL; 3669 return NULL;
3547 } 3670 }
3548 3671
3549 Location* locations() { return locations_; } 3672 Location* locations() { return locations_; }
3550 void set_locations(Location* locations) { locations_ = locations; } 3673 void set_locations(Location* locations) { locations_ = locations; }
3551 3674
3675 virtual bool MayThrow() const { return false; }
3676
3552 private: 3677 private:
3553 virtual void RawSetInputAt(intptr_t i, Value* value) { 3678 virtual void RawSetInputAt(intptr_t i, Value* value) {
3554 (*values_)[i] = value; 3679 (*values_)[i] = value;
3555 } 3680 }
3556 3681
3557 const Class& cls_; 3682 const Class& cls_;
3558 const ZoneGrowableArray<const Field*>& fields_; 3683 const ZoneGrowableArray<const Field*>& fields_;
3559 ZoneGrowableArray<Value*>* values_; 3684 ZoneGrowableArray<Value*>* values_;
3560 Location* locations_; 3685 Location* locations_;
3561 3686
(...skipping 15 matching lines...) Expand all
3577 3702
3578 const Function& constructor() const { return ast_node_.constructor(); } 3703 const Function& constructor() const { return ast_node_.constructor(); }
3579 intptr_t token_pos() const { return ast_node_.token_pos(); } 3704 intptr_t token_pos() const { return ast_node_.token_pos(); }
3580 3705
3581 virtual void PrintOperandsTo(BufferFormatter* f) const; 3706 virtual void PrintOperandsTo(BufferFormatter* f) const;
3582 3707
3583 virtual bool CanDeoptimize() const { return true; } 3708 virtual bool CanDeoptimize() const { return true; }
3584 3709
3585 virtual EffectSet Effects() const { return EffectSet::None(); } 3710 virtual EffectSet Effects() const { return EffectSet::None(); }
3586 3711
3712 virtual bool MayThrow() const { return false; }
3713
3587 private: 3714 private:
3588 const ConstructorCallNode& ast_node_; 3715 const ConstructorCallNode& ast_node_;
3589 3716
3590 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckInstr); 3717 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckInstr);
3591 }; 3718 };
3592 3719
3593 3720
3594 class CreateArrayInstr : public TemplateDefinition<1> { 3721 class CreateArrayInstr : public TemplateDefinition<1> {
3595 public: 3722 public:
3596 CreateArrayInstr(intptr_t token_pos, 3723 CreateArrayInstr(intptr_t token_pos,
(...skipping 17 matching lines...) Expand all
3614 intptr_t token_pos() const { return token_pos_; } 3741 intptr_t token_pos() const { return token_pos_; }
3615 const AbstractType& type() const { return type_; } 3742 const AbstractType& type() const { return type_; }
3616 Value* element_type() const { return inputs_[0]; } 3743 Value* element_type() const { return inputs_[0]; }
3617 3744
3618 virtual void PrintOperandsTo(BufferFormatter* f) const; 3745 virtual void PrintOperandsTo(BufferFormatter* f) const;
3619 3746
3620 virtual bool CanDeoptimize() const { return false; } 3747 virtual bool CanDeoptimize() const { return false; }
3621 3748
3622 virtual EffectSet Effects() const { return EffectSet::None(); } 3749 virtual EffectSet Effects() const { return EffectSet::None(); }
3623 3750
3751 virtual bool MayThrow() const { return false; }
3752
3624 private: 3753 private:
3625 const intptr_t token_pos_; 3754 const intptr_t token_pos_;
3626 const intptr_t num_elements_; 3755 const intptr_t num_elements_;
3627 const AbstractType& type_; 3756 const AbstractType& type_;
3628 3757
3629 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); 3758 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr);
3630 }; 3759 };
3631 3760
3632 3761
3633 class CreateClosureInstr : public TemplateDefinition<0> { 3762 class CreateClosureInstr : public TemplateDefinition<0> {
(...skipping 15 matching lines...) Expand all
3649 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { 3778 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const {
3650 return (*arguments_)[index]; 3779 return (*arguments_)[index];
3651 } 3780 }
3652 3781
3653 virtual void PrintOperandsTo(BufferFormatter* f) const; 3782 virtual void PrintOperandsTo(BufferFormatter* f) const;
3654 3783
3655 virtual bool CanDeoptimize() const { return false; } 3784 virtual bool CanDeoptimize() const { return false; }
3656 3785
3657 virtual EffectSet Effects() const { return EffectSet::None(); } 3786 virtual EffectSet Effects() const { return EffectSet::None(); }
3658 3787
3788 virtual bool MayThrow() const { return false; }
3789
3659 private: 3790 private:
3660 const Function& function_; 3791 const Function& function_;
3661 ZoneGrowableArray<PushArgumentInstr*>* arguments_; 3792 ZoneGrowableArray<PushArgumentInstr*>* arguments_;
3662 intptr_t token_pos_; 3793 intptr_t token_pos_;
3663 3794
3664 DISALLOW_COPY_AND_ASSIGN(CreateClosureInstr); 3795 DISALLOW_COPY_AND_ASSIGN(CreateClosureInstr);
3665 }; 3796 };
3666 3797
3667 3798
3668 class LoadUntaggedInstr : public TemplateDefinition<1> { 3799 class LoadUntaggedInstr : public TemplateDefinition<1> {
(...skipping 14 matching lines...) Expand all
3683 virtual bool CanDeoptimize() const { return false; } 3814 virtual bool CanDeoptimize() const { return false; }
3684 3815
3685 // This instruction must not be moved without the indexed access that 3816 // This instruction must not be moved without the indexed access that
3686 // depends on it (e.g. out of loops). GC may cause collect 3817 // depends on it (e.g. out of loops). GC may cause collect
3687 // the array while the external data-array is still accessed. 3818 // the array while the external data-array is still accessed.
3688 virtual bool AllowsCSE() const { return false; } 3819 virtual bool AllowsCSE() const { return false; }
3689 virtual EffectSet Effects() const { return EffectSet::None(); } 3820 virtual EffectSet Effects() const { return EffectSet::None(); }
3690 virtual EffectSet Dependencies() const { return EffectSet::None(); } 3821 virtual EffectSet Dependencies() const { return EffectSet::None(); }
3691 virtual bool AttributesEqual(Instruction* other) const { return true; } 3822 virtual bool AttributesEqual(Instruction* other) const { return true; }
3692 3823
3824 virtual bool MayThrow() const { return false; }
3825
3693 private: 3826 private:
3694 intptr_t offset_; 3827 intptr_t offset_;
3695 3828
3696 DISALLOW_COPY_AND_ASSIGN(LoadUntaggedInstr); 3829 DISALLOW_COPY_AND_ASSIGN(LoadUntaggedInstr);
3697 }; 3830 };
3698 3831
3699 3832
3700 class LoadClassIdInstr : public TemplateDefinition<1> { 3833 class LoadClassIdInstr : public TemplateDefinition<1> {
3701 public: 3834 public:
3702 explicit LoadClassIdInstr(Value* object) { 3835 explicit LoadClassIdInstr(Value* object) {
(...skipping 10 matching lines...) Expand all
3713 3846
3714 virtual bool CanDeoptimize() const { return false; } 3847 virtual bool CanDeoptimize() const { return false; }
3715 3848
3716 virtual bool AllowsCSE() const { return true; } 3849 virtual bool AllowsCSE() const { return true; }
3717 virtual EffectSet Effects() const { return EffectSet::None(); } 3850 virtual EffectSet Effects() const { return EffectSet::None(); }
3718 virtual EffectSet Dependencies() const { 3851 virtual EffectSet Dependencies() const {
3719 return EffectSet::Externalization(); 3852 return EffectSet::Externalization();
3720 } 3853 }
3721 virtual bool AttributesEqual(Instruction* other) const { return true; } 3854 virtual bool AttributesEqual(Instruction* other) const { return true; }
3722 3855
3856 virtual bool MayThrow() const { return false; }
3857
3723 private: 3858 private:
3724 DISALLOW_COPY_AND_ASSIGN(LoadClassIdInstr); 3859 DISALLOW_COPY_AND_ASSIGN(LoadClassIdInstr);
3725 }; 3860 };
3726 3861
3727 3862
3728 class LoadFieldInstr : public TemplateDefinition<1> { 3863 class LoadFieldInstr : public TemplateDefinition<1> {
3729 public: 3864 public:
3730 LoadFieldInstr(Value* instance, 3865 LoadFieldInstr(Value* instance,
3731 intptr_t offset_in_bytes, 3866 intptr_t offset_in_bytes,
3732 const AbstractType& type, 3867 const AbstractType& type,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
3777 3912
3778 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); 3913 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid);
3779 3914
3780 static bool IsFixedLengthArrayCid(intptr_t cid); 3915 static bool IsFixedLengthArrayCid(intptr_t cid);
3781 3916
3782 virtual bool AllowsCSE() const { return immutable_; } 3917 virtual bool AllowsCSE() const { return immutable_; }
3783 virtual EffectSet Effects() const { return EffectSet::None(); } 3918 virtual EffectSet Effects() const { return EffectSet::None(); }
3784 virtual EffectSet Dependencies() const; 3919 virtual EffectSet Dependencies() const;
3785 virtual bool AttributesEqual(Instruction* other) const; 3920 virtual bool AttributesEqual(Instruction* other) const;
3786 3921
3922 virtual bool MayThrow() const { return false; }
3923
3787 private: 3924 private:
3788 const intptr_t offset_in_bytes_; 3925 const intptr_t offset_in_bytes_;
3789 const AbstractType& type_; 3926 const AbstractType& type_;
3790 intptr_t result_cid_; 3927 intptr_t result_cid_;
3791 const bool immutable_; 3928 const bool immutable_;
3792 3929
3793 MethodRecognizer::Kind recognized_kind_; 3930 MethodRecognizer::Kind recognized_kind_;
3794 3931
3795 const char* field_name_; 3932 const char* field_name_;
3796 const Field* field_; 3933 const Field* field_;
(...skipping 21 matching lines...) Expand all
3818 Value* dest() const { return inputs_[1]; } 3955 Value* dest() const { return inputs_[1]; }
3819 intptr_t offset_in_bytes() const { return offset_in_bytes_; } 3956 intptr_t offset_in_bytes() const { return offset_in_bytes_; }
3820 const AbstractType& type() const { return type_; } 3957 const AbstractType& type() const { return type_; }
3821 3958
3822 virtual void PrintOperandsTo(BufferFormatter* f) const; 3959 virtual void PrintOperandsTo(BufferFormatter* f) const;
3823 3960
3824 virtual bool CanDeoptimize() const { return false; } 3961 virtual bool CanDeoptimize() const { return false; }
3825 3962
3826 virtual EffectSet Effects() const { return EffectSet::None(); } 3963 virtual EffectSet Effects() const { return EffectSet::None(); }
3827 3964
3965 virtual bool MayThrow() const { return false; }
3966
3828 private: 3967 private:
3829 const intptr_t offset_in_bytes_; 3968 const intptr_t offset_in_bytes_;
3830 const AbstractType& type_; 3969 const AbstractType& type_;
3831 3970
3832 DISALLOW_COPY_AND_ASSIGN(StoreVMFieldInstr); 3971 DISALLOW_COPY_AND_ASSIGN(StoreVMFieldInstr);
3833 }; 3972 };
3834 3973
3835 3974
3836 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1> { 3975 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1> {
3837 public: 3976 public:
(...skipping 16 matching lines...) Expand all
3854 } 3993 }
3855 const Class& instantiator_class() const { return instantiator_class_; } 3994 const Class& instantiator_class() const { return instantiator_class_; }
3856 intptr_t token_pos() const { return token_pos_; } 3995 intptr_t token_pos() const { return token_pos_; }
3857 3996
3858 virtual void PrintOperandsTo(BufferFormatter* f) const; 3997 virtual void PrintOperandsTo(BufferFormatter* f) const;
3859 3998
3860 virtual bool CanDeoptimize() const { return true; } 3999 virtual bool CanDeoptimize() const { return true; }
3861 4000
3862 virtual EffectSet Effects() const { return EffectSet::None(); } 4001 virtual EffectSet Effects() const { return EffectSet::None(); }
3863 4002
4003 virtual bool MayThrow() const { return true; }
4004
3864 private: 4005 private:
3865 const intptr_t token_pos_; 4006 const intptr_t token_pos_;
3866 const AbstractTypeArguments& type_arguments_; 4007 const AbstractTypeArguments& type_arguments_;
3867 const Class& instantiator_class_; 4008 const Class& instantiator_class_;
3868 4009
3869 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr); 4010 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr);
3870 }; 4011 };
3871 4012
3872 4013
3873 class ExtractConstructorTypeArgumentsInstr : public TemplateDefinition<1> { 4014 class ExtractConstructorTypeArgumentsInstr : public TemplateDefinition<1> {
(...skipping 17 matching lines...) Expand all
3891 } 4032 }
3892 const Class& instantiator_class() const { return instantiator_class_; } 4033 const Class& instantiator_class() const { return instantiator_class_; }
3893 intptr_t token_pos() const { return token_pos_; } 4034 intptr_t token_pos() const { return token_pos_; }
3894 4035
3895 virtual void PrintOperandsTo(BufferFormatter* f) const; 4036 virtual void PrintOperandsTo(BufferFormatter* f) const;
3896 4037
3897 virtual bool CanDeoptimize() const { return false; } 4038 virtual bool CanDeoptimize() const { return false; }
3898 4039
3899 virtual EffectSet Effects() const { return EffectSet::None(); } 4040 virtual EffectSet Effects() const { return EffectSet::None(); }
3900 4041
4042 virtual bool MayThrow() const { return false; }
4043
3901 private: 4044 private:
3902 const intptr_t token_pos_; 4045 const intptr_t token_pos_;
3903 const AbstractTypeArguments& type_arguments_; 4046 const AbstractTypeArguments& type_arguments_;
3904 const Class& instantiator_class_; 4047 const Class& instantiator_class_;
3905 4048
3906 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorTypeArgumentsInstr); 4049 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorTypeArgumentsInstr);
3907 }; 4050 };
3908 4051
3909 4052
3910 class ExtractConstructorInstantiatorInstr : public TemplateDefinition<1> { 4053 class ExtractConstructorInstantiatorInstr : public TemplateDefinition<1> {
(...skipping 12 matching lines...) Expand all
3923 return ast_node_.type_arguments(); 4066 return ast_node_.type_arguments();
3924 } 4067 }
3925 const Function& constructor() const { return ast_node_.constructor(); } 4068 const Function& constructor() const { return ast_node_.constructor(); }
3926 const Class& instantiator_class() const { return instantiator_class_; } 4069 const Class& instantiator_class() const { return instantiator_class_; }
3927 intptr_t token_pos() const { return ast_node_.token_pos(); } 4070 intptr_t token_pos() const { return ast_node_.token_pos(); }
3928 4071
3929 virtual bool CanDeoptimize() const { return false; } 4072 virtual bool CanDeoptimize() const { return false; }
3930 4073
3931 virtual EffectSet Effects() const { return EffectSet::None(); } 4074 virtual EffectSet Effects() const { return EffectSet::None(); }
3932 4075
4076 virtual bool MayThrow() const { return false; }
4077
3933 private: 4078 private:
3934 const ConstructorCallNode& ast_node_; 4079 const ConstructorCallNode& ast_node_;
3935 const Class& instantiator_class_; 4080 const Class& instantiator_class_;
3936 4081
3937 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorInstantiatorInstr); 4082 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorInstantiatorInstr);
3938 }; 4083 };
3939 4084
3940 4085
3941 class AllocateContextInstr : public TemplateDefinition<0> { 4086 class AllocateContextInstr : public TemplateDefinition<0> {
3942 public: 4087 public:
3943 AllocateContextInstr(intptr_t token_pos, 4088 AllocateContextInstr(intptr_t token_pos,
3944 intptr_t num_context_variables) 4089 intptr_t num_context_variables)
3945 : token_pos_(token_pos), 4090 : token_pos_(token_pos),
3946 num_context_variables_(num_context_variables) {} 4091 num_context_variables_(num_context_variables) {}
3947 4092
3948 DECLARE_INSTRUCTION(AllocateContext) 4093 DECLARE_INSTRUCTION(AllocateContext)
3949 virtual CompileType ComputeType() const; 4094 virtual CompileType ComputeType() const;
3950 4095
3951 intptr_t token_pos() const { return token_pos_; } 4096 intptr_t token_pos() const { return token_pos_; }
3952 intptr_t num_context_variables() const { return num_context_variables_; } 4097 intptr_t num_context_variables() const { return num_context_variables_; }
3953 4098
3954 virtual void PrintOperandsTo(BufferFormatter* f) const; 4099 virtual void PrintOperandsTo(BufferFormatter* f) const;
3955 4100
3956 virtual bool CanDeoptimize() const { return false; } 4101 virtual bool CanDeoptimize() const { return false; }
3957 4102
3958 virtual EffectSet Effects() const { return EffectSet::None(); } 4103 virtual EffectSet Effects() const { return EffectSet::None(); }
3959 4104
4105 virtual bool MayThrow() const { return false; }
4106
3960 private: 4107 private:
3961 const intptr_t token_pos_; 4108 const intptr_t token_pos_;
3962 const intptr_t num_context_variables_; 4109 const intptr_t num_context_variables_;
3963 4110
3964 DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr); 4111 DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr);
3965 }; 4112 };
3966 4113
3967 4114
3968 class ChainContextInstr : public TemplateInstruction<1> { 4115 class ChainContextInstr : public TemplateInstruction<1> {
3969 public: 4116 public:
3970 explicit ChainContextInstr(Value* context_value) { 4117 explicit ChainContextInstr(Value* context_value) {
3971 SetInputAt(0, context_value); 4118 SetInputAt(0, context_value);
3972 } 4119 }
3973 4120
3974 DECLARE_INSTRUCTION(ChainContext) 4121 DECLARE_INSTRUCTION(ChainContext)
3975 4122
3976 virtual intptr_t ArgumentCount() const { return 0; } 4123 virtual intptr_t ArgumentCount() const { return 0; }
3977 4124
3978 Value* context_value() const { return inputs_[0]; } 4125 Value* context_value() const { return inputs_[0]; }
3979 4126
3980 virtual bool CanDeoptimize() const { return false; } 4127 virtual bool CanDeoptimize() const { return false; }
3981 4128
3982 virtual EffectSet Effects() const { return EffectSet::None(); } 4129 virtual EffectSet Effects() const { return EffectSet::None(); }
3983 4130
4131 virtual bool MayThrow() const { return false; }
4132
3984 private: 4133 private:
3985 DISALLOW_COPY_AND_ASSIGN(ChainContextInstr); 4134 DISALLOW_COPY_AND_ASSIGN(ChainContextInstr);
3986 }; 4135 };
3987 4136
3988 4137
3989 class CloneContextInstr : public TemplateDefinition<1> { 4138 class CloneContextInstr : public TemplateDefinition<1> {
3990 public: 4139 public:
3991 CloneContextInstr(intptr_t token_pos, Value* context_value) 4140 CloneContextInstr(intptr_t token_pos, Value* context_value)
3992 : token_pos_(token_pos) { 4141 : token_pos_(token_pos) {
3993 SetInputAt(0, context_value); 4142 SetInputAt(0, context_value);
3994 } 4143 }
3995 4144
3996 intptr_t token_pos() const { return token_pos_; } 4145 intptr_t token_pos() const { return token_pos_; }
3997 Value* context_value() const { return inputs_[0]; } 4146 Value* context_value() const { return inputs_[0]; }
3998 4147
3999 DECLARE_INSTRUCTION(CloneContext) 4148 DECLARE_INSTRUCTION(CloneContext)
4000 virtual CompileType ComputeType() const; 4149 virtual CompileType ComputeType() const;
4001 4150
4002 virtual bool CanDeoptimize() const { return true; } 4151 virtual bool CanDeoptimize() const { return true; }
4003 4152
4004 virtual EffectSet Effects() const { return EffectSet::None(); } 4153 virtual EffectSet Effects() const { return EffectSet::None(); }
4005 4154
4155 virtual bool MayThrow() const { return false; }
4156
4006 private: 4157 private:
4007 const intptr_t token_pos_; 4158 const intptr_t token_pos_;
4008 4159
4009 DISALLOW_COPY_AND_ASSIGN(CloneContextInstr); 4160 DISALLOW_COPY_AND_ASSIGN(CloneContextInstr);
4010 }; 4161 };
4011 4162
4012 4163
4013 class CatchEntryInstr : public TemplateInstruction<0> { 4164 class CatchEntryInstr : public TemplateInstruction<0> {
4014 public: 4165 public:
4015 CatchEntryInstr(const LocalVariable& exception_var, 4166 CatchEntryInstr(const LocalVariable& exception_var,
4016 const LocalVariable& stacktrace_var) 4167 const LocalVariable& stacktrace_var)
4017 : exception_var_(exception_var), stacktrace_var_(stacktrace_var) {} 4168 : exception_var_(exception_var), stacktrace_var_(stacktrace_var) {}
4018 4169
4019 const LocalVariable& exception_var() const { return exception_var_; } 4170 const LocalVariable& exception_var() const { return exception_var_; }
4020 const LocalVariable& stacktrace_var() const { return stacktrace_var_; } 4171 const LocalVariable& stacktrace_var() const { return stacktrace_var_; }
4021 4172
4022 DECLARE_INSTRUCTION(CatchEntry) 4173 DECLARE_INSTRUCTION(CatchEntry)
4023 4174
4024 virtual intptr_t ArgumentCount() const { return 0; } 4175 virtual intptr_t ArgumentCount() const { return 0; }
4025 4176
4026 virtual void PrintOperandsTo(BufferFormatter* f) const; 4177 virtual void PrintOperandsTo(BufferFormatter* f) const;
4027 4178
4028 virtual bool CanDeoptimize() const { return false; } 4179 virtual bool CanDeoptimize() const { return false; }
4029 4180
4030 virtual EffectSet Effects() const { return EffectSet::All(); } 4181 virtual EffectSet Effects() const { return EffectSet::All(); }
4031 4182
4183 virtual bool MayThrow() const { return false; }
4184
4032 private: 4185 private:
4033 const LocalVariable& exception_var_; 4186 const LocalVariable& exception_var_;
4034 const LocalVariable& stacktrace_var_; 4187 const LocalVariable& stacktrace_var_;
4035 4188
4036 DISALLOW_COPY_AND_ASSIGN(CatchEntryInstr); 4189 DISALLOW_COPY_AND_ASSIGN(CatchEntryInstr);
4037 }; 4190 };
4038 4191
4039 4192
4040 class CheckEitherNonSmiInstr : public TemplateInstruction<2> { 4193 class CheckEitherNonSmiInstr : public TemplateInstruction<2> {
4041 public: 4194 public:
(...skipping 14 matching lines...) Expand all
4056 4209
4057 virtual bool CanDeoptimize() const { return true; } 4210 virtual bool CanDeoptimize() const { return true; }
4058 4211
4059 virtual Instruction* Canonicalize(FlowGraph* flow_graph); 4212 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
4060 4213
4061 virtual bool AllowsCSE() const { return true; } 4214 virtual bool AllowsCSE() const { return true; }
4062 virtual EffectSet Effects() const { return EffectSet::None(); } 4215 virtual EffectSet Effects() const { return EffectSet::None(); }
4063 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4216 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4064 virtual bool AttributesEqual(Instruction* other) const { return true; } 4217 virtual bool AttributesEqual(Instruction* other) const { return true; }
4065 4218
4219 virtual bool MayThrow() const { return false; }
4220
4066 private: 4221 private:
4067 DISALLOW_COPY_AND_ASSIGN(CheckEitherNonSmiInstr); 4222 DISALLOW_COPY_AND_ASSIGN(CheckEitherNonSmiInstr);
4068 }; 4223 };
4069 4224
4070 4225
4071 class BoxDoubleInstr : public TemplateDefinition<1> { 4226 class BoxDoubleInstr : public TemplateDefinition<1> {
4072 public: 4227 public:
4073 explicit BoxDoubleInstr(Value* value) { 4228 explicit BoxDoubleInstr(Value* value) {
4074 SetInputAt(0, value); 4229 SetInputAt(0, value);
4075 } 4230 }
4076 4231
4077 Value* value() const { return inputs_[0]; } 4232 Value* value() const { return inputs_[0]; }
4078 4233
4079 DECLARE_INSTRUCTION(BoxDouble) 4234 DECLARE_INSTRUCTION(BoxDouble)
4080 virtual CompileType ComputeType() const; 4235 virtual CompileType ComputeType() const;
4081 4236
4082 virtual bool CanDeoptimize() const { return false; } 4237 virtual bool CanDeoptimize() const { return false; }
4083 4238
4084 virtual Representation RequiredInputRepresentation(intptr_t idx) const { 4239 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
4085 ASSERT(idx == 0); 4240 ASSERT(idx == 0);
4086 return kUnboxedDouble; 4241 return kUnboxedDouble;
4087 } 4242 }
4088 4243
4089 virtual bool AllowsCSE() const { return true; } 4244 virtual bool AllowsCSE() const { return true; }
4090 virtual EffectSet Effects() const { return EffectSet::None(); } 4245 virtual EffectSet Effects() const { return EffectSet::None(); }
4091 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4246 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4092 virtual bool AttributesEqual(Instruction* other) const { return true; } 4247 virtual bool AttributesEqual(Instruction* other) const { return true; }
4093 4248
4249 virtual bool MayThrow() const { return false; }
4250
4094 Definition* Canonicalize(FlowGraph* flow_graph); 4251 Definition* Canonicalize(FlowGraph* flow_graph);
4095 4252
4096 private: 4253 private:
4097 DISALLOW_COPY_AND_ASSIGN(BoxDoubleInstr); 4254 DISALLOW_COPY_AND_ASSIGN(BoxDoubleInstr);
4098 }; 4255 };
4099 4256
4100 4257
4101 class BoxFloat32x4Instr : public TemplateDefinition<1> { 4258 class BoxFloat32x4Instr : public TemplateDefinition<1> {
4102 public: 4259 public:
4103 explicit BoxFloat32x4Instr(Value* value) { 4260 explicit BoxFloat32x4Instr(Value* value) {
(...skipping 10 matching lines...) Expand all
4114 } 4271 }
4115 4272
4116 DECLARE_INSTRUCTION(BoxFloat32x4) 4273 DECLARE_INSTRUCTION(BoxFloat32x4)
4117 virtual CompileType ComputeType() const; 4274 virtual CompileType ComputeType() const;
4118 4275
4119 virtual bool AllowsCSE() const { return true; } 4276 virtual bool AllowsCSE() const { return true; }
4120 virtual EffectSet Effects() const { return EffectSet::None(); } 4277 virtual EffectSet Effects() const { return EffectSet::None(); }
4121 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4278 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4122 virtual bool AttributesEqual(Instruction* other) const { return true; } 4279 virtual bool AttributesEqual(Instruction* other) const { return true; }
4123 4280
4281 virtual bool MayThrow() const { return false; }
4282
4124 private: 4283 private:
4125 DISALLOW_COPY_AND_ASSIGN(BoxFloat32x4Instr); 4284 DISALLOW_COPY_AND_ASSIGN(BoxFloat32x4Instr);
4126 }; 4285 };
4127 4286
4128 4287
4129 class BoxUint32x4Instr : public TemplateDefinition<1> { 4288 class BoxUint32x4Instr : public TemplateDefinition<1> {
4130 public: 4289 public:
4131 explicit BoxUint32x4Instr(Value* value) { 4290 explicit BoxUint32x4Instr(Value* value) {
4132 SetInputAt(0, value); 4291 SetInputAt(0, value);
4133 } 4292 }
4134 4293
4135 Value* value() const { return inputs_[0]; } 4294 Value* value() const { return inputs_[0]; }
4136 4295
4137 virtual bool CanDeoptimize() const { return false; } 4296 virtual bool CanDeoptimize() const { return false; }
4138 4297
4139 virtual Representation RequiredInputRepresentation(intptr_t idx) const { 4298 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
4140 ASSERT(idx == 0); 4299 ASSERT(idx == 0);
4141 return kUnboxedUint32x4; 4300 return kUnboxedUint32x4;
4142 } 4301 }
4143 4302
4144 DECLARE_INSTRUCTION(BoxUint32x4) 4303 DECLARE_INSTRUCTION(BoxUint32x4)
4145 virtual CompileType ComputeType() const; 4304 virtual CompileType ComputeType() const;
4146 4305
4147 virtual bool AllowsCSE() const { return true; } 4306 virtual bool AllowsCSE() const { return true; }
4148 virtual EffectSet Effects() const { return EffectSet::None(); } 4307 virtual EffectSet Effects() const { return EffectSet::None(); }
4149 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4308 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4150 virtual bool AttributesEqual(Instruction* other) const { return true; } 4309 virtual bool AttributesEqual(Instruction* other) const { return true; }
4151 4310
4311 virtual bool MayThrow() const { return false; }
4312
4152 private: 4313 private:
4153 DISALLOW_COPY_AND_ASSIGN(BoxUint32x4Instr); 4314 DISALLOW_COPY_AND_ASSIGN(BoxUint32x4Instr);
4154 }; 4315 };
4155 4316
4156 4317
4157 class BoxIntegerInstr : public TemplateDefinition<1> { 4318 class BoxIntegerInstr : public TemplateDefinition<1> {
4158 public: 4319 public:
4159 explicit BoxIntegerInstr(Value* value) { 4320 explicit BoxIntegerInstr(Value* value) {
4160 SetInputAt(0, value); 4321 SetInputAt(0, value);
4161 } 4322 }
4162 4323
4163 Value* value() const { return inputs_[0]; } 4324 Value* value() const { return inputs_[0]; }
4164 4325
4165 virtual bool CanDeoptimize() const { return false; } 4326 virtual bool CanDeoptimize() const { return false; }
4166 4327
4167 virtual Representation RequiredInputRepresentation(intptr_t idx) const { 4328 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
4168 ASSERT(idx == 0); 4329 ASSERT(idx == 0);
4169 return kUnboxedMint; 4330 return kUnboxedMint;
4170 } 4331 }
4171 4332
4172 DECLARE_INSTRUCTION(BoxInteger) 4333 DECLARE_INSTRUCTION(BoxInteger)
4173 virtual CompileType ComputeType() const; 4334 virtual CompileType ComputeType() const;
4174 4335
4175 virtual bool AllowsCSE() const { return true; } 4336 virtual bool AllowsCSE() const { return true; }
4176 virtual EffectSet Effects() const { return EffectSet::None(); } 4337 virtual EffectSet Effects() const { return EffectSet::None(); }
4177 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4338 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4178 virtual bool AttributesEqual(Instruction* other) const { return true; } 4339 virtual bool AttributesEqual(Instruction* other) const { return true; }
4179 4340
4341 virtual bool MayThrow() const { return false; }
4342
4180 private: 4343 private:
4181 DISALLOW_COPY_AND_ASSIGN(BoxIntegerInstr); 4344 DISALLOW_COPY_AND_ASSIGN(BoxIntegerInstr);
4182 }; 4345 };
4183 4346
4184 4347
4185 class UnboxDoubleInstr : public TemplateDefinition<1> { 4348 class UnboxDoubleInstr : public TemplateDefinition<1> {
4186 public: 4349 public:
4187 UnboxDoubleInstr(Value* value, intptr_t deopt_id) { 4350 UnboxDoubleInstr(Value* value, intptr_t deopt_id) {
4188 SetInputAt(0, value); 4351 SetInputAt(0, value);
4189 deopt_id_ = deopt_id; 4352 deopt_id_ = deopt_id;
(...skipping 11 matching lines...) Expand all
4201 } 4364 }
4202 4365
4203 DECLARE_INSTRUCTION(UnboxDouble) 4366 DECLARE_INSTRUCTION(UnboxDouble)
4204 virtual CompileType ComputeType() const; 4367 virtual CompileType ComputeType() const;
4205 4368
4206 virtual bool AllowsCSE() const { return true; } 4369 virtual bool AllowsCSE() const { return true; }
4207 virtual EffectSet Effects() const { return EffectSet::None(); } 4370 virtual EffectSet Effects() const { return EffectSet::None(); }
4208 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4371 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4209 virtual bool AttributesEqual(Instruction* other) const { return true; } 4372 virtual bool AttributesEqual(Instruction* other) const { return true; }
4210 4373
4374 virtual bool MayThrow() const { return false; }
4375
4211 Definition* Canonicalize(FlowGraph* flow_graph); 4376 Definition* Canonicalize(FlowGraph* flow_graph);
4212 4377
4213 private: 4378 private:
4214 DISALLOW_COPY_AND_ASSIGN(UnboxDoubleInstr); 4379 DISALLOW_COPY_AND_ASSIGN(UnboxDoubleInstr);
4215 }; 4380 };
4216 4381
4217 4382
4218 class UnboxFloat32x4Instr : public TemplateDefinition<1> { 4383 class UnboxFloat32x4Instr : public TemplateDefinition<1> {
4219 public: 4384 public:
4220 UnboxFloat32x4Instr(Value* value, intptr_t deopt_id) { 4385 UnboxFloat32x4Instr(Value* value, intptr_t deopt_id) {
(...skipping 12 matching lines...) Expand all
4233 } 4398 }
4234 4399
4235 DECLARE_INSTRUCTION(UnboxFloat32x4) 4400 DECLARE_INSTRUCTION(UnboxFloat32x4)
4236 virtual CompileType ComputeType() const; 4401 virtual CompileType ComputeType() const;
4237 4402
4238 virtual bool AllowsCSE() const { return true; } 4403 virtual bool AllowsCSE() const { return true; }
4239 virtual EffectSet Effects() const { return EffectSet::None(); } 4404 virtual EffectSet Effects() const { return EffectSet::None(); }
4240 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4405 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4241 virtual bool AttributesEqual(Instruction* other) const { return true; } 4406 virtual bool AttributesEqual(Instruction* other) const { return true; }
4242 4407
4408 virtual bool MayThrow() const { return false; }
4409
4243 private: 4410 private:
4244 DISALLOW_COPY_AND_ASSIGN(UnboxFloat32x4Instr); 4411 DISALLOW_COPY_AND_ASSIGN(UnboxFloat32x4Instr);
4245 }; 4412 };
4246 4413
4247 4414
4248 class UnboxUint32x4Instr : public TemplateDefinition<1> { 4415 class UnboxUint32x4Instr : public TemplateDefinition<1> {
4249 public: 4416 public:
4250 UnboxUint32x4Instr(Value* value, intptr_t deopt_id) { 4417 UnboxUint32x4Instr(Value* value, intptr_t deopt_id) {
4251 SetInputAt(0, value); 4418 SetInputAt(0, value);
4252 deopt_id_ = deopt_id; 4419 deopt_id_ = deopt_id;
(...skipping 10 matching lines...) Expand all
4263 } 4430 }
4264 4431
4265 virtual bool AllowsCSE() const { return true; } 4432 virtual bool AllowsCSE() const { return true; }
4266 virtual EffectSet Effects() const { return EffectSet::None(); } 4433 virtual EffectSet Effects() const { return EffectSet::None(); }
4267 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4434 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4268 virtual bool AttributesEqual(Instruction* other) const { return true; } 4435 virtual bool AttributesEqual(Instruction* other) const { return true; }
4269 4436
4270 DECLARE_INSTRUCTION(UnboxUint32x4) 4437 DECLARE_INSTRUCTION(UnboxUint32x4)
4271 virtual CompileType ComputeType() const; 4438 virtual CompileType ComputeType() const;
4272 4439
4440 virtual bool MayThrow() const { return false; }
4441
4273 private: 4442 private:
4274 DISALLOW_COPY_AND_ASSIGN(UnboxUint32x4Instr); 4443 DISALLOW_COPY_AND_ASSIGN(UnboxUint32x4Instr);
4275 }; 4444 };
4276 4445
4277 4446
4278 class UnboxIntegerInstr : public TemplateDefinition<1> { 4447 class UnboxIntegerInstr : public TemplateDefinition<1> {
4279 public: 4448 public:
4280 UnboxIntegerInstr(Value* value, intptr_t deopt_id) { 4449 UnboxIntegerInstr(Value* value, intptr_t deopt_id) {
4281 SetInputAt(0, value); 4450 SetInputAt(0, value);
4282 deopt_id_ = deopt_id; 4451 deopt_id_ = deopt_id;
(...skipping 12 matching lines...) Expand all
4295 4464
4296 4465
4297 DECLARE_INSTRUCTION(UnboxInteger) 4466 DECLARE_INSTRUCTION(UnboxInteger)
4298 virtual CompileType ComputeType() const; 4467 virtual CompileType ComputeType() const;
4299 4468
4300 virtual bool AllowsCSE() const { return true; } 4469 virtual bool AllowsCSE() const { return true; }
4301 virtual EffectSet Effects() const { return EffectSet::None(); } 4470 virtual EffectSet Effects() const { return EffectSet::None(); }
4302 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4471 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4303 virtual bool AttributesEqual(Instruction* other) const { return true; } 4472 virtual bool AttributesEqual(Instruction* other) const { return true; }
4304 4473
4474 virtual bool MayThrow() const { return false; }
4475
4305 private: 4476 private:
4306 DISALLOW_COPY_AND_ASSIGN(UnboxIntegerInstr); 4477 DISALLOW_COPY_AND_ASSIGN(UnboxIntegerInstr);
4307 }; 4478 };
4308 4479
4309 4480
4310 class MathSqrtInstr : public TemplateDefinition<1> { 4481 class MathSqrtInstr : public TemplateDefinition<1> {
4311 public: 4482 public:
4312 MathSqrtInstr(Value* value, StaticCallInstr* instance_call) { 4483 MathSqrtInstr(Value* value, StaticCallInstr* instance_call) {
4313 SetInputAt(0, value); 4484 SetInputAt(0, value);
4314 deopt_id_ = instance_call->deopt_id(); 4485 deopt_id_ = instance_call->deopt_id();
(...skipping 19 matching lines...) Expand all
4334 } 4505 }
4335 4506
4336 DECLARE_INSTRUCTION(MathSqrt) 4507 DECLARE_INSTRUCTION(MathSqrt)
4337 virtual CompileType ComputeType() const; 4508 virtual CompileType ComputeType() const;
4338 4509
4339 virtual bool AllowsCSE() const { return true; } 4510 virtual bool AllowsCSE() const { return true; }
4340 virtual EffectSet Effects() const { return EffectSet::None(); } 4511 virtual EffectSet Effects() const { return EffectSet::None(); }
4341 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4512 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4342 virtual bool AttributesEqual(Instruction* other) const { return true; } 4513 virtual bool AttributesEqual(Instruction* other) const { return true; }
4343 4514
4515 virtual bool MayThrow() const { return false; }
4516
4344 private: 4517 private:
4345 DISALLOW_COPY_AND_ASSIGN(MathSqrtInstr); 4518 DISALLOW_COPY_AND_ASSIGN(MathSqrtInstr);
4346 }; 4519 };
4347 4520
4348 4521
4349 class BinaryDoubleOpInstr : public TemplateDefinition<2> { 4522 class BinaryDoubleOpInstr : public TemplateDefinition<2> {
4350 public: 4523 public:
4351 BinaryDoubleOpInstr(Token::Kind op_kind, 4524 BinaryDoubleOpInstr(Token::Kind op_kind,
4352 Value* left, 4525 Value* left,
4353 Value* right, 4526 Value* right,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
4387 4560
4388 virtual Definition* Canonicalize(FlowGraph* flow_graph); 4561 virtual Definition* Canonicalize(FlowGraph* flow_graph);
4389 4562
4390 virtual bool AllowsCSE() const { return true; } 4563 virtual bool AllowsCSE() const { return true; }
4391 virtual EffectSet Effects() const { return EffectSet::None(); } 4564 virtual EffectSet Effects() const { return EffectSet::None(); }
4392 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4565 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4393 virtual bool AttributesEqual(Instruction* other) const { 4566 virtual bool AttributesEqual(Instruction* other) const {
4394 return op_kind() == other->AsBinaryDoubleOp()->op_kind(); 4567 return op_kind() == other->AsBinaryDoubleOp()->op_kind();
4395 } 4568 }
4396 4569
4570 virtual bool MayThrow() const { return false; }
4571
4397 private: 4572 private:
4398 const Token::Kind op_kind_; 4573 const Token::Kind op_kind_;
4399 4574
4400 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr); 4575 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr);
4401 }; 4576 };
4402 4577
4403 4578
4404 class BinaryFloat32x4OpInstr : public TemplateDefinition<2> { 4579 class BinaryFloat32x4OpInstr : public TemplateDefinition<2> {
4405 public: 4580 public:
4406 BinaryFloat32x4OpInstr(Token::Kind op_kind, 4581 BinaryFloat32x4OpInstr(Token::Kind op_kind,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
4440 DECLARE_INSTRUCTION(BinaryFloat32x4Op) 4615 DECLARE_INSTRUCTION(BinaryFloat32x4Op)
4441 virtual CompileType ComputeType() const; 4616 virtual CompileType ComputeType() const;
4442 4617
4443 virtual bool AllowsCSE() const { return true; } 4618 virtual bool AllowsCSE() const { return true; }
4444 virtual EffectSet Effects() const { return EffectSet::None(); } 4619 virtual EffectSet Effects() const { return EffectSet::None(); }
4445 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4620 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4446 virtual bool AttributesEqual(Instruction* other) const { 4621 virtual bool AttributesEqual(Instruction* other) const {
4447 return op_kind() == other->AsBinaryFloat32x4Op()->op_kind(); 4622 return op_kind() == other->AsBinaryFloat32x4Op()->op_kind();
4448 } 4623 }
4449 4624
4625 virtual bool MayThrow() const { return false; }
4626
4450 private: 4627 private:
4451 const Token::Kind op_kind_; 4628 const Token::Kind op_kind_;
4452 4629
4453 DISALLOW_COPY_AND_ASSIGN(BinaryFloat32x4OpInstr); 4630 DISALLOW_COPY_AND_ASSIGN(BinaryFloat32x4OpInstr);
4454 }; 4631 };
4455 4632
4456 4633
4457 class Float32x4ShuffleInstr : public TemplateDefinition<1> { 4634 class Float32x4ShuffleInstr : public TemplateDefinition<1> {
4458 public: 4635 public:
4459 Float32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value, 4636 Float32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
4495 DECLARE_INSTRUCTION(Float32x4Shuffle) 4672 DECLARE_INSTRUCTION(Float32x4Shuffle)
4496 virtual CompileType ComputeType() const; 4673 virtual CompileType ComputeType() const;
4497 4674
4498 virtual bool AllowsCSE() const { return true; } 4675 virtual bool AllowsCSE() const { return true; }
4499 virtual EffectSet Effects() const { return EffectSet::None(); } 4676 virtual EffectSet Effects() const { return EffectSet::None(); }
4500 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4677 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4501 virtual bool AttributesEqual(Instruction* other) const { 4678 virtual bool AttributesEqual(Instruction* other) const {
4502 return op_kind() == other->AsFloat32x4Shuffle()->op_kind(); 4679 return op_kind() == other->AsFloat32x4Shuffle()->op_kind();
4503 } 4680 }
4504 4681
4682 virtual bool MayThrow() const { return false; }
4683
4505 private: 4684 private:
4506 const MethodRecognizer::Kind op_kind_; 4685 const MethodRecognizer::Kind op_kind_;
4507 4686
4508 DISALLOW_COPY_AND_ASSIGN(Float32x4ShuffleInstr); 4687 DISALLOW_COPY_AND_ASSIGN(Float32x4ShuffleInstr);
4509 }; 4688 };
4510 4689
4511 4690
4512 class Float32x4ConstructorInstr : public TemplateDefinition<4> { 4691 class Float32x4ConstructorInstr : public TemplateDefinition<4> {
4513 public: 4692 public:
4514 Float32x4ConstructorInstr(Value* value0, Value* value1, Value* value2, 4693 Float32x4ConstructorInstr(Value* value0, Value* value1, Value* value2,
(...skipping 30 matching lines...) Expand all
4545 } 4724 }
4546 4725
4547 DECLARE_INSTRUCTION(Float32x4Constructor) 4726 DECLARE_INSTRUCTION(Float32x4Constructor)
4548 virtual CompileType ComputeType() const; 4727 virtual CompileType ComputeType() const;
4549 4728
4550 virtual bool AllowsCSE() const { return true; } 4729 virtual bool AllowsCSE() const { return true; }
4551 virtual EffectSet Effects() const { return EffectSet::None(); } 4730 virtual EffectSet Effects() const { return EffectSet::None(); }
4552 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4731 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4553 virtual bool AttributesEqual(Instruction* other) const { return true; } 4732 virtual bool AttributesEqual(Instruction* other) const { return true; }
4554 4733
4734 virtual bool MayThrow() const { return false; }
4735
4555 private: 4736 private:
4556 DISALLOW_COPY_AND_ASSIGN(Float32x4ConstructorInstr); 4737 DISALLOW_COPY_AND_ASSIGN(Float32x4ConstructorInstr);
4557 }; 4738 };
4558 4739
4559 4740
4560 class Float32x4SplatInstr : public TemplateDefinition<1> { 4741 class Float32x4SplatInstr : public TemplateDefinition<1> {
4561 public: 4742 public:
4562 Float32x4SplatInstr(Value* value, StaticCallInstr* static_call) { 4743 Float32x4SplatInstr(Value* value, StaticCallInstr* static_call) {
4563 SetInputAt(0, value); 4744 SetInputAt(0, value);
4564 deopt_id_ = static_call->deopt_id(); 4745 deopt_id_ = static_call->deopt_id();
(...skipping 21 matching lines...) Expand all
4586 } 4767 }
4587 4768
4588 DECLARE_INSTRUCTION(Float32x4Splat) 4769 DECLARE_INSTRUCTION(Float32x4Splat)
4589 virtual CompileType ComputeType() const; 4770 virtual CompileType ComputeType() const;
4590 4771
4591 virtual bool AllowsCSE() const { return true; } 4772 virtual bool AllowsCSE() const { return true; }
4592 virtual EffectSet Effects() const { return EffectSet::None(); } 4773 virtual EffectSet Effects() const { return EffectSet::None(); }
4593 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4774 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4594 virtual bool AttributesEqual(Instruction* other) const { return true; } 4775 virtual bool AttributesEqual(Instruction* other) const { return true; }
4595 4776
4777 virtual bool MayThrow() const { return false; }
4778
4596 private: 4779 private:
4597 DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr); 4780 DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr);
4598 }; 4781 };
4599 4782
4600 4783
4601 class Float32x4ZeroInstr : public TemplateDefinition<0> { 4784 class Float32x4ZeroInstr : public TemplateDefinition<0> {
4602 public: 4785 public:
4603 explicit Float32x4ZeroInstr(StaticCallInstr* static_call) { 4786 explicit Float32x4ZeroInstr(StaticCallInstr* static_call) {
4604 deopt_id_ = static_call->deopt_id(); 4787 deopt_id_ = static_call->deopt_id();
4605 } 4788 }
(...skipping 20 matching lines...) Expand all
4626 } 4809 }
4627 4810
4628 DECLARE_INSTRUCTION(Float32x4Zero) 4811 DECLARE_INSTRUCTION(Float32x4Zero)
4629 virtual CompileType ComputeType() const; 4812 virtual CompileType ComputeType() const;
4630 4813
4631 virtual bool AllowsCSE() const { return true; } 4814 virtual bool AllowsCSE() const { return true; }
4632 virtual EffectSet Effects() const { return EffectSet::None(); } 4815 virtual EffectSet Effects() const { return EffectSet::None(); }
4633 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4816 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4634 virtual bool AttributesEqual(Instruction* other) const { return true; } 4817 virtual bool AttributesEqual(Instruction* other) const { return true; }
4635 4818
4819 virtual bool MayThrow() const { return false; }
4820
4636 private: 4821 private:
4637 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr); 4822 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr);
4638 }; 4823 };
4639 4824
4640 4825
4641 class Float32x4ComparisonInstr : public TemplateDefinition<2> { 4826 class Float32x4ComparisonInstr : public TemplateDefinition<2> {
4642 public: 4827 public:
4643 Float32x4ComparisonInstr(MethodRecognizer::Kind op_kind, Value* left, 4828 Float32x4ComparisonInstr(MethodRecognizer::Kind op_kind, Value* left,
4644 Value* right, InstanceCallInstr* instance_call) 4829 Value* right, InstanceCallInstr* instance_call)
4645 : op_kind_(op_kind) { 4830 : op_kind_(op_kind) {
(...skipping 29 matching lines...) Expand all
4675 DECLARE_INSTRUCTION(Float32x4Comparison) 4860 DECLARE_INSTRUCTION(Float32x4Comparison)
4676 virtual CompileType ComputeType() const; 4861 virtual CompileType ComputeType() const;
4677 4862
4678 virtual bool AllowsCSE() const { return true; } 4863 virtual bool AllowsCSE() const { return true; }
4679 virtual EffectSet Effects() const { return EffectSet::None(); } 4864 virtual EffectSet Effects() const { return EffectSet::None(); }
4680 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4865 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4681 virtual bool AttributesEqual(Instruction* other) const { 4866 virtual bool AttributesEqual(Instruction* other) const {
4682 return op_kind() == other->AsFloat32x4Comparison()->op_kind(); 4867 return op_kind() == other->AsFloat32x4Comparison()->op_kind();
4683 } 4868 }
4684 4869
4870 virtual bool MayThrow() const { return false; }
4871
4685 private: 4872 private:
4686 const MethodRecognizer::Kind op_kind_; 4873 const MethodRecognizer::Kind op_kind_;
4687 4874
4688 DISALLOW_COPY_AND_ASSIGN(Float32x4ComparisonInstr); 4875 DISALLOW_COPY_AND_ASSIGN(Float32x4ComparisonInstr);
4689 }; 4876 };
4690 4877
4691 4878
4692 class Float32x4MinMaxInstr : public TemplateDefinition<2> { 4879 class Float32x4MinMaxInstr : public TemplateDefinition<2> {
4693 public: 4880 public:
4694 Float32x4MinMaxInstr(MethodRecognizer::Kind op_kind, Value* left, 4881 Float32x4MinMaxInstr(MethodRecognizer::Kind op_kind, Value* left,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
4726 DECLARE_INSTRUCTION(Float32x4MinMax) 4913 DECLARE_INSTRUCTION(Float32x4MinMax)
4727 virtual CompileType ComputeType() const; 4914 virtual CompileType ComputeType() const;
4728 4915
4729 virtual bool AllowsCSE() const { return true; } 4916 virtual bool AllowsCSE() const { return true; }
4730 virtual EffectSet Effects() const { return EffectSet::None(); } 4917 virtual EffectSet Effects() const { return EffectSet::None(); }
4731 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4918 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4732 virtual bool AttributesEqual(Instruction* other) const { 4919 virtual bool AttributesEqual(Instruction* other) const {
4733 return op_kind() == other->AsFloat32x4MinMax()->op_kind(); 4920 return op_kind() == other->AsFloat32x4MinMax()->op_kind();
4734 } 4921 }
4735 4922
4923 virtual bool MayThrow() const { return false; }
4924
4736 private: 4925 private:
4737 const MethodRecognizer::Kind op_kind_; 4926 const MethodRecognizer::Kind op_kind_;
4738 4927
4739 DISALLOW_COPY_AND_ASSIGN(Float32x4MinMaxInstr); 4928 DISALLOW_COPY_AND_ASSIGN(Float32x4MinMaxInstr);
4740 }; 4929 };
4741 4930
4742 4931
4743 class Float32x4ScaleInstr : public TemplateDefinition<2> { 4932 class Float32x4ScaleInstr : public TemplateDefinition<2> {
4744 public: 4933 public:
4745 Float32x4ScaleInstr(MethodRecognizer::Kind op_kind, Value* left, 4934 Float32x4ScaleInstr(MethodRecognizer::Kind op_kind, Value* left,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
4780 DECLARE_INSTRUCTION(Float32x4Scale) 4969 DECLARE_INSTRUCTION(Float32x4Scale)
4781 virtual CompileType ComputeType() const; 4970 virtual CompileType ComputeType() const;
4782 4971
4783 virtual bool AllowsCSE() const { return true; } 4972 virtual bool AllowsCSE() const { return true; }
4784 virtual EffectSet Effects() const { return EffectSet::None(); } 4973 virtual EffectSet Effects() const { return EffectSet::None(); }
4785 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4974 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4786 virtual bool AttributesEqual(Instruction* other) const { 4975 virtual bool AttributesEqual(Instruction* other) const {
4787 return op_kind() == other->AsFloat32x4Scale()->op_kind(); 4976 return op_kind() == other->AsFloat32x4Scale()->op_kind();
4788 } 4977 }
4789 4978
4979 virtual bool MayThrow() const { return false; }
4980
4790 private: 4981 private:
4791 const MethodRecognizer::Kind op_kind_; 4982 const MethodRecognizer::Kind op_kind_;
4792 4983
4793 DISALLOW_COPY_AND_ASSIGN(Float32x4ScaleInstr); 4984 DISALLOW_COPY_AND_ASSIGN(Float32x4ScaleInstr);
4794 }; 4985 };
4795 4986
4796 4987
4797 class Float32x4SqrtInstr : public TemplateDefinition<1> { 4988 class Float32x4SqrtInstr : public TemplateDefinition<1> {
4798 public: 4989 public:
4799 Float32x4SqrtInstr(MethodRecognizer::Kind op_kind, Value* left, 4990 Float32x4SqrtInstr(MethodRecognizer::Kind op_kind, Value* left,
(...skipping 28 matching lines...) Expand all
4828 DECLARE_INSTRUCTION(Float32x4Sqrt) 5019 DECLARE_INSTRUCTION(Float32x4Sqrt)
4829 virtual CompileType ComputeType() const; 5020 virtual CompileType ComputeType() const;
4830 5021
4831 virtual bool AllowsCSE() const { return true; } 5022 virtual bool AllowsCSE() const { return true; }
4832 virtual EffectSet Effects() const { return EffectSet::None(); } 5023 virtual EffectSet Effects() const { return EffectSet::None(); }
4833 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5024 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4834 virtual bool AttributesEqual(Instruction* other) const { 5025 virtual bool AttributesEqual(Instruction* other) const {
4835 return op_kind() == other->AsFloat32x4Sqrt()->op_kind(); 5026 return op_kind() == other->AsFloat32x4Sqrt()->op_kind();
4836 } 5027 }
4837 5028
5029 virtual bool MayThrow() const { return false; }
5030
4838 private: 5031 private:
4839 const MethodRecognizer::Kind op_kind_; 5032 const MethodRecognizer::Kind op_kind_;
4840 5033
4841 DISALLOW_COPY_AND_ASSIGN(Float32x4SqrtInstr); 5034 DISALLOW_COPY_AND_ASSIGN(Float32x4SqrtInstr);
4842 }; 5035 };
4843 5036
4844 5037
4845 class Float32x4ZeroArgInstr : public TemplateDefinition<1> { 5038 class Float32x4ZeroArgInstr : public TemplateDefinition<1> {
4846 public: 5039 public:
4847 Float32x4ZeroArgInstr(MethodRecognizer::Kind op_kind, Value* left, 5040 Float32x4ZeroArgInstr(MethodRecognizer::Kind op_kind, Value* left,
(...skipping 28 matching lines...) Expand all
4876 DECLARE_INSTRUCTION(Float32x4ZeroArg) 5069 DECLARE_INSTRUCTION(Float32x4ZeroArg)
4877 virtual CompileType ComputeType() const; 5070 virtual CompileType ComputeType() const;
4878 5071
4879 virtual bool AllowsCSE() const { return true; } 5072 virtual bool AllowsCSE() const { return true; }
4880 virtual EffectSet Effects() const { return EffectSet::None(); } 5073 virtual EffectSet Effects() const { return EffectSet::None(); }
4881 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5074 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4882 virtual bool AttributesEqual(Instruction* other) const { 5075 virtual bool AttributesEqual(Instruction* other) const {
4883 return op_kind() == other->AsFloat32x4ZeroArg()->op_kind(); 5076 return op_kind() == other->AsFloat32x4ZeroArg()->op_kind();
4884 } 5077 }
4885 5078
5079 virtual bool MayThrow() const { return false; }
5080
4886 private: 5081 private:
4887 const MethodRecognizer::Kind op_kind_; 5082 const MethodRecognizer::Kind op_kind_;
4888 5083
4889 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroArgInstr); 5084 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroArgInstr);
4890 }; 5085 };
4891 5086
4892 5087
4893 class Float32x4ClampInstr : public TemplateDefinition<3> { 5088 class Float32x4ClampInstr : public TemplateDefinition<3> {
4894 public: 5089 public:
4895 Float32x4ClampInstr(Value* left, Value* lower, Value* upper, 5090 Float32x4ClampInstr(Value* left, Value* lower, Value* upper,
(...skipping 28 matching lines...) Expand all
4924 } 5119 }
4925 5120
4926 DECLARE_INSTRUCTION(Float32x4Clamp) 5121 DECLARE_INSTRUCTION(Float32x4Clamp)
4927 virtual CompileType ComputeType() const; 5122 virtual CompileType ComputeType() const;
4928 5123
4929 virtual bool AllowsCSE() const { return true; } 5124 virtual bool AllowsCSE() const { return true; }
4930 virtual EffectSet Effects() const { return EffectSet::None(); } 5125 virtual EffectSet Effects() const { return EffectSet::None(); }
4931 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5126 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4932 virtual bool AttributesEqual(Instruction* other) const { return true; } 5127 virtual bool AttributesEqual(Instruction* other) const { return true; }
4933 5128
5129 virtual bool MayThrow() const { return false; }
5130
4934 private: 5131 private:
4935 DISALLOW_COPY_AND_ASSIGN(Float32x4ClampInstr); 5132 DISALLOW_COPY_AND_ASSIGN(Float32x4ClampInstr);
4936 }; 5133 };
4937 5134
4938 5135
4939 class Float32x4WithInstr : public TemplateDefinition<2> { 5136 class Float32x4WithInstr : public TemplateDefinition<2> {
4940 public: 5137 public:
4941 Float32x4WithInstr(MethodRecognizer::Kind op_kind, Value* left, 5138 Float32x4WithInstr(MethodRecognizer::Kind op_kind, Value* left,
4942 Value* replacement, InstanceCallInstr* instance_call) 5139 Value* replacement, InstanceCallInstr* instance_call)
4943 : op_kind_(op_kind) { 5140 : op_kind_(op_kind) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4976 DECLARE_INSTRUCTION(Float32x4With) 5173 DECLARE_INSTRUCTION(Float32x4With)
4977 virtual CompileType ComputeType() const; 5174 virtual CompileType ComputeType() const;
4978 5175
4979 virtual bool AllowsCSE() const { return true; } 5176 virtual bool AllowsCSE() const { return true; }
4980 virtual EffectSet Effects() const { return EffectSet::None(); } 5177 virtual EffectSet Effects() const { return EffectSet::None(); }
4981 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5178 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4982 virtual bool AttributesEqual(Instruction* other) const { 5179 virtual bool AttributesEqual(Instruction* other) const {
4983 return op_kind() == other->AsFloat32x4With()->op_kind(); 5180 return op_kind() == other->AsFloat32x4With()->op_kind();
4984 } 5181 }
4985 5182
5183 virtual bool MayThrow() const { return false; }
5184
4986 private: 5185 private:
4987 const MethodRecognizer::Kind op_kind_; 5186 const MethodRecognizer::Kind op_kind_;
4988 5187
4989 DISALLOW_COPY_AND_ASSIGN(Float32x4WithInstr); 5188 DISALLOW_COPY_AND_ASSIGN(Float32x4WithInstr);
4990 }; 5189 };
4991 5190
4992 5191
4993 class Float32x4ToUint32x4Instr : public TemplateDefinition<1> { 5192 class Float32x4ToUint32x4Instr : public TemplateDefinition<1> {
4994 public: 5193 public:
4995 Float32x4ToUint32x4Instr(Value* left, InstanceCallInstr* instance_call) { 5194 Float32x4ToUint32x4Instr(Value* left, InstanceCallInstr* instance_call) {
(...skipping 23 matching lines...) Expand all
5019 } 5218 }
5020 5219
5021 DECLARE_INSTRUCTION(Float32x4ToUint32x4) 5220 DECLARE_INSTRUCTION(Float32x4ToUint32x4)
5022 virtual CompileType ComputeType() const; 5221 virtual CompileType ComputeType() const;
5023 5222
5024 virtual bool AllowsCSE() const { return true; } 5223 virtual bool AllowsCSE() const { return true; }
5025 virtual EffectSet Effects() const { return EffectSet::None(); } 5224 virtual EffectSet Effects() const { return EffectSet::None(); }
5026 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5225 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5027 virtual bool AttributesEqual(Instruction* other) const { return true; } 5226 virtual bool AttributesEqual(Instruction* other) const { return true; }
5028 5227
5228 virtual bool MayThrow() const { return false; }
5229
5029 private: 5230 private:
5030 DISALLOW_COPY_AND_ASSIGN(Float32x4ToUint32x4Instr); 5231 DISALLOW_COPY_AND_ASSIGN(Float32x4ToUint32x4Instr);
5031 }; 5232 };
5032 5233
5033 5234
5034 class BinaryMintOpInstr : public TemplateDefinition<2> { 5235 class BinaryMintOpInstr : public TemplateDefinition<2> {
5035 public: 5236 public:
5036 BinaryMintOpInstr(Token::Kind op_kind, 5237 BinaryMintOpInstr(Token::Kind op_kind,
5037 Value* left, 5238 Value* left,
5038 Value* right, 5239 Value* right,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
5078 virtual CompileType ComputeType() const; 5279 virtual CompileType ComputeType() const;
5079 5280
5080 virtual bool AllowsCSE() const { return true; } 5281 virtual bool AllowsCSE() const { return true; }
5081 virtual EffectSet Effects() const { return EffectSet::None(); } 5282 virtual EffectSet Effects() const { return EffectSet::None(); }
5082 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5283 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5083 virtual bool AttributesEqual(Instruction* other) const { 5284 virtual bool AttributesEqual(Instruction* other) const {
5084 ASSERT(other->IsBinaryMintOp()); 5285 ASSERT(other->IsBinaryMintOp());
5085 return op_kind() == other->AsBinaryMintOp()->op_kind(); 5286 return op_kind() == other->AsBinaryMintOp()->op_kind();
5086 } 5287 }
5087 5288
5289 virtual bool MayThrow() const { return false; }
5290
5088 private: 5291 private:
5089 const Token::Kind op_kind_; 5292 const Token::Kind op_kind_;
5090 InstanceCallInstr* instance_call_; 5293 InstanceCallInstr* instance_call_;
5091 5294
5092 DISALLOW_COPY_AND_ASSIGN(BinaryMintOpInstr); 5295 DISALLOW_COPY_AND_ASSIGN(BinaryMintOpInstr);
5093 }; 5296 };
5094 5297
5095 5298
5096 class ShiftMintOpInstr : public TemplateDefinition<2> { 5299 class ShiftMintOpInstr : public TemplateDefinition<2> {
5097 public: 5300 public:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
5134 5337
5135 DECLARE_INSTRUCTION(ShiftMintOp) 5338 DECLARE_INSTRUCTION(ShiftMintOp)
5136 5339
5137 virtual bool AllowsCSE() const { return true; } 5340 virtual bool AllowsCSE() const { return true; }
5138 virtual EffectSet Effects() const { return EffectSet::None(); } 5341 virtual EffectSet Effects() const { return EffectSet::None(); }
5139 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5342 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5140 virtual bool AttributesEqual(Instruction* other) const { 5343 virtual bool AttributesEqual(Instruction* other) const {
5141 return op_kind() == other->AsShiftMintOp()->op_kind(); 5344 return op_kind() == other->AsShiftMintOp()->op_kind();
5142 } 5345 }
5143 5346
5347 virtual bool MayThrow() const { return false; }
5348
5144 private: 5349 private:
5145 const Token::Kind op_kind_; 5350 const Token::Kind op_kind_;
5146 5351
5147 DISALLOW_COPY_AND_ASSIGN(ShiftMintOpInstr); 5352 DISALLOW_COPY_AND_ASSIGN(ShiftMintOpInstr);
5148 }; 5353 };
5149 5354
5150 5355
5151 class UnaryMintOpInstr : public TemplateDefinition<1> { 5356 class UnaryMintOpInstr : public TemplateDefinition<1> {
5152 public: 5357 public:
5153 UnaryMintOpInstr(Token::Kind op_kind, 5358 UnaryMintOpInstr(Token::Kind op_kind,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
5185 DECLARE_INSTRUCTION(UnaryMintOp) 5390 DECLARE_INSTRUCTION(UnaryMintOp)
5186 virtual CompileType ComputeType() const; 5391 virtual CompileType ComputeType() const;
5187 5392
5188 virtual bool AllowsCSE() const { return true; } 5393 virtual bool AllowsCSE() const { return true; }
5189 virtual EffectSet Effects() const { return EffectSet::None(); } 5394 virtual EffectSet Effects() const { return EffectSet::None(); }
5190 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5395 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5191 virtual bool AttributesEqual(Instruction* other) const { 5396 virtual bool AttributesEqual(Instruction* other) const {
5192 return op_kind() == other->AsUnaryMintOp()->op_kind(); 5397 return op_kind() == other->AsUnaryMintOp()->op_kind();
5193 } 5398 }
5194 5399
5400 virtual bool MayThrow() const { return false; }
5401
5195 private: 5402 private:
5196 const Token::Kind op_kind_; 5403 const Token::Kind op_kind_;
5197 5404
5198 DISALLOW_COPY_AND_ASSIGN(UnaryMintOpInstr); 5405 DISALLOW_COPY_AND_ASSIGN(UnaryMintOpInstr);
5199 }; 5406 };
5200 5407
5201 5408
5202 class BinarySmiOpInstr : public TemplateDefinition<2> { 5409 class BinarySmiOpInstr : public TemplateDefinition<2> {
5203 public: 5410 public:
5204 BinarySmiOpInstr(Token::Kind op_kind, 5411 BinarySmiOpInstr(Token::Kind op_kind,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
5243 void PrintTo(BufferFormatter* f) const; 5450 void PrintTo(BufferFormatter* f) const;
5244 5451
5245 virtual void InferRange(); 5452 virtual void InferRange();
5246 5453
5247 virtual Definition* Canonicalize(FlowGraph* flow_graph); 5454 virtual Definition* Canonicalize(FlowGraph* flow_graph);
5248 5455
5249 // Returns true if right is a non-zero Smi constant which absolute value is 5456 // Returns true if right is a non-zero Smi constant which absolute value is
5250 // a power of two. 5457 // a power of two.
5251 bool RightIsPowerOfTwoConstant() const; 5458 bool RightIsPowerOfTwoConstant() const;
5252 5459
5460 virtual bool MayThrow() const { return false; }
5461
5253 private: 5462 private:
5254 const Token::Kind op_kind_; 5463 const Token::Kind op_kind_;
5255 InstanceCallInstr* instance_call_; 5464 InstanceCallInstr* instance_call_;
5256 bool overflow_; 5465 bool overflow_;
5257 bool is_truncating_; 5466 bool is_truncating_;
5258 5467
5259 DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr); 5468 DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr);
5260 }; 5469 };
5261 5470
5262 5471
(...skipping 19 matching lines...) Expand all
5282 5491
5283 virtual bool CanDeoptimize() const { return op_kind() == Token::kNEGATE; } 5492 virtual bool CanDeoptimize() const { return op_kind() == Token::kNEGATE; }
5284 5493
5285 virtual bool AllowsCSE() const { return true; } 5494 virtual bool AllowsCSE() const { return true; }
5286 virtual EffectSet Effects() const { return EffectSet::None(); } 5495 virtual EffectSet Effects() const { return EffectSet::None(); }
5287 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5496 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5288 virtual bool AttributesEqual(Instruction* other) const { 5497 virtual bool AttributesEqual(Instruction* other) const {
5289 return other->AsUnarySmiOp()->op_kind() == op_kind(); 5498 return other->AsUnarySmiOp()->op_kind() == op_kind();
5290 } 5499 }
5291 5500
5501 virtual bool MayThrow() const { return false; }
5502
5292 private: 5503 private:
5293 const Token::Kind op_kind_; 5504 const Token::Kind op_kind_;
5294 5505
5295 DISALLOW_COPY_AND_ASSIGN(UnarySmiOpInstr); 5506 DISALLOW_COPY_AND_ASSIGN(UnarySmiOpInstr);
5296 }; 5507 };
5297 5508
5298 5509
5299 class CheckStackOverflowInstr : public TemplateInstruction<0> { 5510 class CheckStackOverflowInstr : public TemplateInstruction<0> {
5300 public: 5511 public:
5301 explicit CheckStackOverflowInstr(intptr_t token_pos) 5512 explicit CheckStackOverflowInstr(intptr_t token_pos)
5302 : token_pos_(token_pos) {} 5513 : token_pos_(token_pos) {}
5303 5514
5304 intptr_t token_pos() const { return token_pos_; } 5515 intptr_t token_pos() const { return token_pos_; }
5305 5516
5306 DECLARE_INSTRUCTION(CheckStackOverflow) 5517 DECLARE_INSTRUCTION(CheckStackOverflow)
5307 5518
5308 virtual intptr_t ArgumentCount() const { return 0; } 5519 virtual intptr_t ArgumentCount() const { return 0; }
5309 5520
5310 virtual bool CanDeoptimize() const { return true; } 5521 virtual bool CanDeoptimize() const { return true; }
5311 5522
5312 virtual EffectSet Effects() const { return EffectSet::None(); } 5523 virtual EffectSet Effects() const { return EffectSet::None(); }
5313 5524
5525 virtual bool MayThrow() const { return false; }
5526
5314 private: 5527 private:
5315 const intptr_t token_pos_; 5528 const intptr_t token_pos_;
5316 5529
5317 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr); 5530 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr);
5318 }; 5531 };
5319 5532
5320 5533
5321 class SmiToDoubleInstr : public TemplateDefinition<1> { 5534 class SmiToDoubleInstr : public TemplateDefinition<1> {
5322 public: 5535 public:
5323 explicit SmiToDoubleInstr(Value* value) { 5536 explicit SmiToDoubleInstr(Value* value) {
(...skipping 11 matching lines...) Expand all
5335 5548
5336 virtual intptr_t ArgumentCount() const { return 1; } 5549 virtual intptr_t ArgumentCount() const { return 1; }
5337 5550
5338 virtual bool CanDeoptimize() const { return false; } 5551 virtual bool CanDeoptimize() const { return false; }
5339 5552
5340 virtual bool AllowsCSE() const { return true; } 5553 virtual bool AllowsCSE() const { return true; }
5341 virtual EffectSet Effects() const { return EffectSet::None(); } 5554 virtual EffectSet Effects() const { return EffectSet::None(); }
5342 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5555 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5343 virtual bool AttributesEqual(Instruction* other) const { return true; } 5556 virtual bool AttributesEqual(Instruction* other) const { return true; }
5344 5557
5558 virtual bool MayThrow() const { return false; }
5559
5345 private: 5560 private:
5346 DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr); 5561 DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr);
5347 }; 5562 };
5348 5563
5349 5564
5350 class DoubleToIntegerInstr : public TemplateDefinition<1> { 5565 class DoubleToIntegerInstr : public TemplateDefinition<1> {
5351 public: 5566 public:
5352 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call) 5567 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call)
5353 : instance_call_(instance_call) { 5568 : instance_call_(instance_call) {
5354 SetInputAt(0, value); 5569 SetInputAt(0, value);
5355 deopt_id_ = instance_call->deopt_id(); 5570 deopt_id_ = instance_call->deopt_id();
5356 } 5571 }
5357 5572
5358 Value* value() const { return inputs_[0]; } 5573 Value* value() const { return inputs_[0]; }
5359 InstanceCallInstr* instance_call() const { return instance_call_; } 5574 InstanceCallInstr* instance_call() const { return instance_call_; }
5360 5575
5361 DECLARE_INSTRUCTION(DoubleToInteger) 5576 DECLARE_INSTRUCTION(DoubleToInteger)
5362 virtual CompileType ComputeType() const; 5577 virtual CompileType ComputeType() const;
5363 5578
5364 virtual intptr_t ArgumentCount() const { return 1; } 5579 virtual intptr_t ArgumentCount() const { return 1; }
5365 5580
5366 virtual bool CanDeoptimize() const { return true; } 5581 virtual bool CanDeoptimize() const { return true; }
5367 5582
5368 virtual EffectSet Effects() const { return EffectSet::None(); } 5583 virtual EffectSet Effects() const { return EffectSet::None(); }
5369 5584
5585 virtual bool MayThrow() const { return true; }
5586
5370 private: 5587 private:
5371 InstanceCallInstr* instance_call_; 5588 InstanceCallInstr* instance_call_;
5372 5589
5373 DISALLOW_COPY_AND_ASSIGN(DoubleToIntegerInstr); 5590 DISALLOW_COPY_AND_ASSIGN(DoubleToIntegerInstr);
5374 }; 5591 };
5375 5592
5376 5593
5377 // Similar to 'DoubleToIntegerInstr' but expects unboxed double as input 5594 // Similar to 'DoubleToIntegerInstr' but expects unboxed double as input
5378 // and creates a Smi. 5595 // and creates a Smi.
5379 class DoubleToSmiInstr : public TemplateDefinition<1> { 5596 class DoubleToSmiInstr : public TemplateDefinition<1> {
(...skipping 12 matching lines...) Expand all
5392 5609
5393 virtual Representation RequiredInputRepresentation(intptr_t idx) const { 5610 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5394 ASSERT(idx == 0); 5611 ASSERT(idx == 0);
5395 return kUnboxedDouble; 5612 return kUnboxedDouble;
5396 } 5613 }
5397 5614
5398 virtual intptr_t DeoptimizationTarget() const { return deopt_id_; } 5615 virtual intptr_t DeoptimizationTarget() const { return deopt_id_; }
5399 5616
5400 virtual EffectSet Effects() const { return EffectSet::None(); } 5617 virtual EffectSet Effects() const { return EffectSet::None(); }
5401 5618
5619 virtual bool MayThrow() const { return false; }
5620
5402 private: 5621 private:
5403 DISALLOW_COPY_AND_ASSIGN(DoubleToSmiInstr); 5622 DISALLOW_COPY_AND_ASSIGN(DoubleToSmiInstr);
5404 }; 5623 };
5405 5624
5406 5625
5407 class DoubleToDoubleInstr : public TemplateDefinition<1> { 5626 class DoubleToDoubleInstr : public TemplateDefinition<1> {
5408 public: 5627 public:
5409 DoubleToDoubleInstr(Value* value, 5628 DoubleToDoubleInstr(Value* value,
5410 InstanceCallInstr* instance_call, 5629 InstanceCallInstr* instance_call,
5411 MethodRecognizer::Kind recognized_kind) 5630 MethodRecognizer::Kind recognized_kind)
(...skipping 22 matching lines...) Expand all
5434 5653
5435 virtual intptr_t DeoptimizationTarget() const { return deopt_id_; } 5654 virtual intptr_t DeoptimizationTarget() const { return deopt_id_; }
5436 5655
5437 virtual bool AllowsCSE() const { return true; } 5656 virtual bool AllowsCSE() const { return true; }
5438 virtual EffectSet Effects() const { return EffectSet::None(); } 5657 virtual EffectSet Effects() const { return EffectSet::None(); }
5439 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5658 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5440 virtual bool AttributesEqual(Instruction* other) const { 5659 virtual bool AttributesEqual(Instruction* other) const {
5441 return other->AsDoubleToDouble()->recognized_kind() == recognized_kind(); 5660 return other->AsDoubleToDouble()->recognized_kind() == recognized_kind();
5442 } 5661 }
5443 5662
5663 virtual bool MayThrow() const { return false; }
5664
5444 private: 5665 private:
5445 const MethodRecognizer::Kind recognized_kind_; 5666 const MethodRecognizer::Kind recognized_kind_;
5446 5667
5447 DISALLOW_COPY_AND_ASSIGN(DoubleToDoubleInstr); 5668 DISALLOW_COPY_AND_ASSIGN(DoubleToDoubleInstr);
5448 }; 5669 };
5449 5670
5450 5671
5451 class InvokeMathCFunctionInstr : public Definition { 5672 class InvokeMathCFunctionInstr : public Definition {
5452 public: 5673 public:
5453 InvokeMathCFunctionInstr(ZoneGrowableArray<Value*>* inputs, 5674 InvokeMathCFunctionInstr(ZoneGrowableArray<Value*>* inputs,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
5495 } 5716 }
5496 5717
5497 virtual bool AllowsCSE() const { return true; } 5718 virtual bool AllowsCSE() const { return true; }
5498 virtual EffectSet Effects() const { return EffectSet::None(); } 5719 virtual EffectSet Effects() const { return EffectSet::None(); }
5499 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5720 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5500 virtual bool AttributesEqual(Instruction* other) const { 5721 virtual bool AttributesEqual(Instruction* other) const {
5501 InvokeMathCFunctionInstr* other_invoke = other->AsInvokeMathCFunction(); 5722 InvokeMathCFunctionInstr* other_invoke = other->AsInvokeMathCFunction();
5502 return other_invoke->recognized_kind() == recognized_kind(); 5723 return other_invoke->recognized_kind() == recognized_kind();
5503 } 5724 }
5504 5725
5726 virtual bool MayThrow() const { return false; }
5727
5505 private: 5728 private:
5506 virtual void RawSetInputAt(intptr_t i, Value* value) { 5729 virtual void RawSetInputAt(intptr_t i, Value* value) {
5507 (*inputs_)[i] = value; 5730 (*inputs_)[i] = value;
5508 } 5731 }
5509 5732
5510 ZoneGrowableArray<Value*>* inputs_; 5733 ZoneGrowableArray<Value*>* inputs_;
5511 5734
5512 LocationSummary* locs_; 5735 LocationSummary* locs_;
5513 5736
5514 const MethodRecognizer::Kind recognized_kind_; 5737 const MethodRecognizer::Kind recognized_kind_;
(...skipping 24 matching lines...) Expand all
5539 5762
5540 void set_null_check(bool flag) { null_check_ = flag; } 5763 void set_null_check(bool flag) { null_check_ = flag; }
5541 5764
5542 bool null_check() const { return null_check_; } 5765 bool null_check() const { return null_check_; }
5543 5766
5544 virtual bool AllowsCSE() const { return true; } 5767 virtual bool AllowsCSE() const { return true; }
5545 virtual EffectSet Effects() const { return EffectSet::None(); } 5768 virtual EffectSet Effects() const { return EffectSet::None(); }
5546 virtual EffectSet Dependencies() const; 5769 virtual EffectSet Dependencies() const;
5547 virtual bool AttributesEqual(Instruction* other) const; 5770 virtual bool AttributesEqual(Instruction* other) const;
5548 5771
5772 virtual bool MayThrow() const { return false; }
5773
5549 private: 5774 private:
5550 const ICData& unary_checks_; 5775 const ICData& unary_checks_;
5551 5776
5552 bool null_check_; 5777 bool null_check_;
5553 5778
5554 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); 5779 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr);
5555 }; 5780 };
5556 5781
5557 5782
5558 class CheckSmiInstr : public TemplateInstruction<1> { 5783 class CheckSmiInstr : public TemplateInstruction<1> {
(...skipping 12 matching lines...) Expand all
5571 5796
5572 virtual bool CanDeoptimize() const { return true; } 5797 virtual bool CanDeoptimize() const { return true; }
5573 5798
5574 virtual Instruction* Canonicalize(FlowGraph* flow_graph); 5799 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
5575 5800
5576 virtual bool AllowsCSE() const { return true; } 5801 virtual bool AllowsCSE() const { return true; }
5577 virtual EffectSet Effects() const { return EffectSet::None(); } 5802 virtual EffectSet Effects() const { return EffectSet::None(); }
5578 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5803 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5579 virtual bool AttributesEqual(Instruction* other) const { return true; } 5804 virtual bool AttributesEqual(Instruction* other) const { return true; }
5580 5805
5806 virtual bool MayThrow() const { return false; }
5807
5581 private: 5808 private:
5582 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); 5809 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr);
5583 }; 5810 };
5584 5811
5585 5812
5586 class CheckArrayBoundInstr : public TemplateInstruction<2> { 5813 class CheckArrayBoundInstr : public TemplateInstruction<2> {
5587 public: 5814 public:
5588 CheckArrayBoundInstr(Value* length, 5815 CheckArrayBoundInstr(Value* length,
5589 Value* index, 5816 Value* index,
5590 intptr_t array_type, 5817 intptr_t array_type,
(...skipping 20 matching lines...) Expand all
5611 // Returns the length offset for array and string types. 5838 // Returns the length offset for array and string types.
5612 static intptr_t LengthOffsetFor(intptr_t class_id); 5839 static intptr_t LengthOffsetFor(intptr_t class_id);
5613 5840
5614 static bool IsFixedLengthArrayType(intptr_t class_id); 5841 static bool IsFixedLengthArrayType(intptr_t class_id);
5615 5842
5616 virtual bool AllowsCSE() const { return true; } 5843 virtual bool AllowsCSE() const { return true; }
5617 virtual EffectSet Effects() const { return EffectSet::None(); } 5844 virtual EffectSet Effects() const { return EffectSet::None(); }
5618 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5845 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5619 virtual bool AttributesEqual(Instruction* other) const; 5846 virtual bool AttributesEqual(Instruction* other) const;
5620 5847
5848 virtual bool MayThrow() const { return false; }
5849
5621 private: 5850 private:
5622 intptr_t array_type_; 5851 intptr_t array_type_;
5623 5852
5624 DISALLOW_COPY_AND_ASSIGN(CheckArrayBoundInstr); 5853 DISALLOW_COPY_AND_ASSIGN(CheckArrayBoundInstr);
5625 }; 5854 };
5626 5855
5627 5856
5628 #undef DECLARE_INSTRUCTION 5857 #undef DECLARE_INSTRUCTION
5629 5858
5630 class Environment : public ZoneAllocated { 5859 class Environment : public ZoneAllocated {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
5842 ForwardInstructionIterator* current_iterator_; 6071 ForwardInstructionIterator* current_iterator_;
5843 6072
5844 private: 6073 private:
5845 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 6074 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
5846 }; 6075 };
5847 6076
5848 6077
5849 } // namespace dart 6078 } // namespace dart
5850 6079
5851 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 6080 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698