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

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

Issue 3003593002: [vm] Cleanup Instruction::Effects(), prepare to cleanup Dependencies() (Closed)
Patch Set: Address review comment Created 3 years, 3 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
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.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 RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 6 #define RUNTIME_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/flags.h" 10 #include "vm/flags.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 private: 171 private:
172 bool CanComputeIsInstanceOf(const AbstractType& type, 172 bool CanComputeIsInstanceOf(const AbstractType& type,
173 bool is_nullable, 173 bool is_nullable,
174 bool* is_instance); 174 bool* is_instance);
175 175
176 bool is_nullable_; 176 bool is_nullable_;
177 intptr_t cid_; 177 intptr_t cid_;
178 const AbstractType* type_; 178 const AbstractType* type_;
179 }; 179 };
180 180
181 // TODO(alexmarkov): remove EffectSet as there are no tracked effects anymore 181 // TODO(dartbug.com/30474): remove EffectSet as there are no tracked effects
182 // anymore.
182 class EffectSet : public ValueObject { 183 class EffectSet : public ValueObject {
183 public: 184 public:
184 enum Effects { 185 enum Effects {
185 kNoEffects = 0, 186 kNoEffects = 0,
186 kUnusedEffect = 1, // Currently unused. 187 kUnusedEffect = 1, // Currently unused.
187 kLastEffect = kUnusedEffect 188 kLastEffect = kUnusedEffect
188 }; 189 };
189 190
190 EffectSet(const EffectSet& other) : ValueObject(), effects_(other.effects_) {} 191 EffectSet(const EffectSet& other) : ValueObject(), effects_(other.effects_) {}
191 192
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 void InsertAfter(Instruction* prev); 866 void InsertAfter(Instruction* prev);
866 867
867 // Append an instruction to the current one and return the tail. 868 // Append an instruction to the current one and return the tail.
868 // This function updated def-use chains of the newly appended 869 // This function updated def-use chains of the newly appended
869 // instruction. 870 // instruction.
870 Instruction* AppendInstruction(Instruction* tail); 871 Instruction* AppendInstruction(Instruction* tail);
871 872
872 // Returns true if CSE and LICM are allowed for this instruction. 873 // Returns true if CSE and LICM are allowed for this instruction.
873 virtual bool AllowsCSE() const { return false; } 874 virtual bool AllowsCSE() const { return false; }
874 875
875 // Returns set of effects created by this instruction. 876 // Returns true if this instruction has any side-effects besides storing.
876 virtual EffectSet Effects() const = 0; 877 // See StoreInstanceFieldInstr::HasUnknownSideEffects() for rationale.
878 virtual bool HasUnknownSideEffects() const = 0;
877 879
878 // Returns set of effects that affect this instruction. 880 // Returns set of effects that affect this instruction.
879 virtual EffectSet Dependencies() const { 881 virtual EffectSet Dependencies() const {
880 UNREACHABLE(); 882 UNREACHABLE();
881 return EffectSet::All(); 883 return EffectSet::All();
882 } 884 }
883 885
884 // Get the block entry for this instruction. 886 // Get the block entry for this instruction.
885 virtual BlockEntryInstr* GetBlock(); 887 virtual BlockEntryInstr* GetBlock();
886 888
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 Label* fall_through; 981 Label* fall_through;
980 }; 982 };
981 983
982 class PureInstruction : public Instruction { 984 class PureInstruction : public Instruction {
983 public: 985 public:
984 explicit PureInstruction(intptr_t deopt_id) : Instruction(deopt_id) {} 986 explicit PureInstruction(intptr_t deopt_id) : Instruction(deopt_id) {}
985 987
986 virtual bool AllowsCSE() const { return true; } 988 virtual bool AllowsCSE() const { return true; }
987 virtual EffectSet Dependencies() const { return EffectSet::None(); } 989 virtual EffectSet Dependencies() const { return EffectSet::None(); }
988 990
989 virtual EffectSet Effects() const { return EffectSet::None(); } 991 virtual bool HasUnknownSideEffects() const { return false; }
990 }; 992 };
991 993
992 // Types to be used as ThrowsTrait for TemplateInstruction/TemplateDefinition. 994 // Types to be used as ThrowsTrait for TemplateInstruction/TemplateDefinition.
993 struct Throws { 995 struct Throws {
994 static const bool kCanThrow = true; 996 static const bool kCanThrow = true;
995 }; 997 };
996 998
997 struct NoThrow { 999 struct NoThrow {
998 static const bool kCanThrow = false; 1000 static const bool kCanThrow = false;
999 }; 1001 };
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 class ParallelMoveInstr : public TemplateInstruction<0, NoThrow> { 1094 class ParallelMoveInstr : public TemplateInstruction<0, NoThrow> {
1093 public: 1095 public:
1094 ParallelMoveInstr() : moves_(4) {} 1096 ParallelMoveInstr() : moves_(4) {}
1095 1097
1096 DECLARE_INSTRUCTION(ParallelMove) 1098 DECLARE_INSTRUCTION(ParallelMove)
1097 1099
1098 virtual intptr_t ArgumentCount() const { return 0; } 1100 virtual intptr_t ArgumentCount() const { return 0; }
1099 1101
1100 virtual bool ComputeCanDeoptimize() const { return false; } 1102 virtual bool ComputeCanDeoptimize() const { return false; }
1101 1103
1102 virtual EffectSet Effects() const { 1104 virtual bool HasUnknownSideEffects() const {
1103 UNREACHABLE(); // This instruction never visited by optimization passes. 1105 UNREACHABLE(); // This instruction never visited by optimization passes.
1104 return EffectSet::None(); 1106 return false;
1105 } 1107 }
1106 1108
1107 virtual EffectSet Dependencies() const { 1109 virtual EffectSet Dependencies() const {
1108 UNREACHABLE(); // This instruction never visited by optimization passes. 1110 UNREACHABLE(); // This instruction never visited by optimization passes.
1109 return EffectSet::None(); 1111 return EffectSet::None();
1110 } 1112 }
1111 1113
1112 MoveOperands* AddMove(Location dest, Location src) { 1114 MoveOperands* AddMove(Location dest, Location src) {
1113 MoveOperands* move = new MoveOperands(dest, src); 1115 MoveOperands* move = new MoveOperands(dest, src);
1114 moves_.Add(move); 1116 moves_.Add(move);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 virtual intptr_t ArgumentCount() const { return 0; } 1218 virtual intptr_t ArgumentCount() const { return 0; }
1217 1219
1218 virtual bool CanBecomeDeoptimizationTarget() const { 1220 virtual bool CanBecomeDeoptimizationTarget() const {
1219 // BlockEntry environment is copied to Goto and Branch instructions 1221 // BlockEntry environment is copied to Goto and Branch instructions
1220 // when we insert new blocks targeting this block. 1222 // when we insert new blocks targeting this block.
1221 return true; 1223 return true;
1222 } 1224 }
1223 1225
1224 virtual bool ComputeCanDeoptimize() const { return false; } 1226 virtual bool ComputeCanDeoptimize() const { return false; }
1225 1227
1226 virtual EffectSet Effects() const { return EffectSet::None(); } 1228 virtual bool HasUnknownSideEffects() const { return false; }
1227 virtual EffectSet Dependencies() const { return EffectSet::None(); } 1229 virtual EffectSet Dependencies() const { return EffectSet::None(); }
1228 1230
1229 virtual bool MayThrow() const { return false; } 1231 virtual bool MayThrow() const { return false; }
1230 1232
1231 intptr_t try_index() const { return try_index_; } 1233 intptr_t try_index() const { return try_index_; }
1232 void set_try_index(intptr_t index) { try_index_ = index; } 1234 void set_try_index(intptr_t index) { try_index_ = index; }
1233 1235
1234 // True for blocks inside a try { } region. 1236 // True for blocks inside a try { } region.
1235 bool InsideTryBlock() const { 1237 bool InsideTryBlock() const {
1236 return try_index_ != CatchClauseNode::kInvalidTryIndex; 1238 return try_index_ != CatchClauseNode::kInvalidTryIndex;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 intptr_t IndexOfPredecessor(BlockEntryInstr* pred) const; 1464 intptr_t IndexOfPredecessor(BlockEntryInstr* pred) const;
1463 1465
1464 ZoneGrowableArray<PhiInstr*>* phis() const { return phis_; } 1466 ZoneGrowableArray<PhiInstr*>* phis() const { return phis_; }
1465 1467
1466 PhiInstr* InsertPhi(intptr_t var_index, intptr_t var_count); 1468 PhiInstr* InsertPhi(intptr_t var_index, intptr_t var_count);
1467 void RemoveDeadPhis(Definition* replacement); 1469 void RemoveDeadPhis(Definition* replacement);
1468 1470
1469 void InsertPhi(PhiInstr* phi); 1471 void InsertPhi(PhiInstr* phi);
1470 void RemovePhi(PhiInstr* phi); 1472 void RemovePhi(PhiInstr* phi);
1471 1473
1472 virtual EffectSet Effects() const { return EffectSet::None(); } 1474 virtual bool HasUnknownSideEffects() const { return false; }
1473 virtual EffectSet Dependencies() const { return EffectSet::None(); } 1475 virtual EffectSet Dependencies() const { return EffectSet::None(); }
1474 1476
1475 PRINT_TO_SUPPORT 1477 PRINT_TO_SUPPORT
1476 1478
1477 private: 1479 private:
1478 // Classes that have access to predecessors_ when inlining. 1480 // Classes that have access to predecessors_ when inlining.
1479 friend class BlockEntryInstr; 1481 friend class BlockEntryInstr;
1480 friend class InlineExitCollector; 1482 friend class InlineExitCollector;
1481 friend class PolymorphicInliner; 1483 friend class PolymorphicInliner;
1482 friend class IndirectEntryInstr; // Access in il_printer.cc. 1484 friend class IndirectEntryInstr; // Access in il_printer.cc.
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 def->AddEnvUse(this); 1879 def->AddEnvUse(this);
1878 } 1880 }
1879 1881
1880 class PureDefinition : public Definition { 1882 class PureDefinition : public Definition {
1881 public: 1883 public:
1882 explicit PureDefinition(intptr_t deopt_id) : Definition(deopt_id) {} 1884 explicit PureDefinition(intptr_t deopt_id) : Definition(deopt_id) {}
1883 1885
1884 virtual bool AllowsCSE() const { return true; } 1886 virtual bool AllowsCSE() const { return true; }
1885 virtual EffectSet Dependencies() const { return EffectSet::None(); } 1887 virtual EffectSet Dependencies() const { return EffectSet::None(); }
1886 1888
1887 virtual EffectSet Effects() const { return EffectSet::None(); } 1889 virtual bool HasUnknownSideEffects() const { return false; }
1888 }; 1890 };
1889 1891
1890 template <intptr_t N, 1892 template <intptr_t N,
1891 typename ThrowsTrait, 1893 typename ThrowsTrait,
1892 template <typename Impure, typename Pure> class CSETrait = NoCSE> 1894 template <typename Impure, typename Pure> class CSETrait = NoCSE>
1893 class TemplateDefinition : public CSETrait<Definition, PureDefinition>::Base { 1895 class TemplateDefinition : public CSETrait<Definition, PureDefinition>::Base {
1894 public: 1896 public:
1895 explicit TemplateDefinition(intptr_t deopt_id = Thread::kNoDeoptId) 1897 explicit TemplateDefinition(intptr_t deopt_id = Thread::kNoDeoptId)
1896 : CSETrait<Definition, PureDefinition>::Base(deopt_id), inputs_() {} 1898 : CSETrait<Definition, PureDefinition>::Base(deopt_id), inputs_() {}
1897 1899
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 1935
1934 virtual CompileType ComputeType() const; 1936 virtual CompileType ComputeType() const;
1935 virtual bool RecomputeType(); 1937 virtual bool RecomputeType();
1936 1938
1937 intptr_t InputCount() const { return inputs_.length(); } 1939 intptr_t InputCount() const { return inputs_.length(); }
1938 1940
1939 Value* InputAt(intptr_t i) const { return inputs_[i]; } 1941 Value* InputAt(intptr_t i) const { return inputs_[i]; }
1940 1942
1941 virtual bool ComputeCanDeoptimize() const { return false; } 1943 virtual bool ComputeCanDeoptimize() const { return false; }
1942 1944
1943 virtual EffectSet Effects() const { return EffectSet::None(); } 1945 virtual bool HasUnknownSideEffects() const { return false; }
1944 1946
1945 // Phi is alive if it reaches a non-environment use. 1947 // Phi is alive if it reaches a non-environment use.
1946 bool is_alive() const { return is_alive_; } 1948 bool is_alive() const { return is_alive_; }
1947 void mark_alive() { is_alive_ = true; } 1949 void mark_alive() { is_alive_ = true; }
1948 void mark_dead() { is_alive_ = false; } 1950 void mark_dead() { is_alive_ = false; }
1949 1951
1950 virtual Representation RequiredInputRepresentation(intptr_t i) const { 1952 virtual Representation RequiredInputRepresentation(intptr_t i) const {
1951 return representation_; 1953 return representation_;
1952 } 1954 }
1953 1955
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 virtual BlockEntryInstr* GetBlock() { return block_; } 2029 virtual BlockEntryInstr* GetBlock() { return block_; }
2028 2030
2029 intptr_t InputCount() const { return 0; } 2031 intptr_t InputCount() const { return 0; }
2030 Value* InputAt(intptr_t i) const { 2032 Value* InputAt(intptr_t i) const {
2031 UNREACHABLE(); 2033 UNREACHABLE();
2032 return NULL; 2034 return NULL;
2033 } 2035 }
2034 2036
2035 virtual bool ComputeCanDeoptimize() const { return false; } 2037 virtual bool ComputeCanDeoptimize() const { return false; }
2036 2038
2037 virtual EffectSet Effects() const { return EffectSet::None(); } 2039 virtual bool HasUnknownSideEffects() const { return false; }
2038 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2040 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2039 2041
2040 virtual intptr_t Hashcode() const { 2042 virtual intptr_t Hashcode() const {
2041 UNREACHABLE(); 2043 UNREACHABLE();
2042 return 0; 2044 return 0;
2043 } 2045 }
2044 2046
2045 virtual CompileType ComputeType() const; 2047 virtual CompileType ComputeType() const;
2046 2048
2047 virtual bool MayThrow() const { return false; } 2049 virtual bool MayThrow() const { return false; }
(...skipping 15 matching lines...) Expand all
2063 explicit PushArgumentInstr(Value* value) { SetInputAt(0, value); } 2065 explicit PushArgumentInstr(Value* value) { SetInputAt(0, value); }
2064 2066
2065 DECLARE_INSTRUCTION(PushArgument) 2067 DECLARE_INSTRUCTION(PushArgument)
2066 2068
2067 virtual CompileType ComputeType() const; 2069 virtual CompileType ComputeType() const;
2068 2070
2069 Value* value() const { return InputAt(0); } 2071 Value* value() const { return InputAt(0); }
2070 2072
2071 virtual bool ComputeCanDeoptimize() const { return false; } 2073 virtual bool ComputeCanDeoptimize() const { return false; }
2072 2074
2073 virtual EffectSet Effects() const { return EffectSet::None(); } 2075 virtual bool HasUnknownSideEffects() const { return false; }
2074 2076
2075 virtual TokenPosition token_pos() const { 2077 virtual TokenPosition token_pos() const {
2076 return TokenPosition::kPushArgument; 2078 return TokenPosition::kPushArgument;
2077 } 2079 }
2078 2080
2079 PRINT_OPERANDS_TO_SUPPORT 2081 PRINT_OPERANDS_TO_SUPPORT
2080 2082
2081 private: 2083 private:
2082 DISALLOW_COPY_AND_ASSIGN(PushArgumentInstr); 2084 DISALLOW_COPY_AND_ASSIGN(PushArgumentInstr);
2083 }; 2085 };
(...skipping 15 matching lines...) Expand all
2099 Value* value() const { return inputs_[0]; } 2101 Value* value() const { return inputs_[0]; }
2100 2102
2101 virtual bool CanBecomeDeoptimizationTarget() const { 2103 virtual bool CanBecomeDeoptimizationTarget() const {
2102 // Return instruction might turn into a Goto instruction after inlining. 2104 // Return instruction might turn into a Goto instruction after inlining.
2103 // Every Goto must have an environment. 2105 // Every Goto must have an environment.
2104 return true; 2106 return true;
2105 } 2107 }
2106 2108
2107 virtual bool ComputeCanDeoptimize() const { return false; } 2109 virtual bool ComputeCanDeoptimize() const { return false; }
2108 2110
2109 virtual EffectSet Effects() const { return EffectSet::None(); } 2111 virtual bool HasUnknownSideEffects() const { return false; }
2110 2112
2111 private: 2113 private:
2112 const TokenPosition token_pos_; 2114 const TokenPosition token_pos_;
2113 2115
2114 DISALLOW_COPY_AND_ASSIGN(ReturnInstr); 2116 DISALLOW_COPY_AND_ASSIGN(ReturnInstr);
2115 }; 2117 };
2116 2118
2117 class ThrowInstr : public TemplateInstruction<0, Throws> { 2119 class ThrowInstr : public TemplateInstruction<0, Throws> {
2118 public: 2120 public:
2119 explicit ThrowInstr(TokenPosition token_pos, intptr_t deopt_id) 2121 explicit ThrowInstr(TokenPosition token_pos, intptr_t deopt_id)
2120 : TemplateInstruction(deopt_id), token_pos_(token_pos) {} 2122 : TemplateInstruction(deopt_id), token_pos_(token_pos) {}
2121 2123
2122 DECLARE_INSTRUCTION(Throw) 2124 DECLARE_INSTRUCTION(Throw)
2123 2125
2124 virtual intptr_t ArgumentCount() const { return 1; } 2126 virtual intptr_t ArgumentCount() const { return 1; }
2125 2127
2126 virtual TokenPosition token_pos() const { return token_pos_; } 2128 virtual TokenPosition token_pos() const { return token_pos_; }
2127 2129
2128 virtual bool ComputeCanDeoptimize() const { return true; } 2130 virtual bool ComputeCanDeoptimize() const { return true; }
2129 2131
2130 virtual EffectSet Effects() const { return EffectSet::None(); } 2132 virtual bool HasUnknownSideEffects() const { return false; }
2131 2133
2132 private: 2134 private:
2133 const TokenPosition token_pos_; 2135 const TokenPosition token_pos_;
2134 2136
2135 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); 2137 DISALLOW_COPY_AND_ASSIGN(ThrowInstr);
2136 }; 2138 };
2137 2139
2138 class ReThrowInstr : public TemplateInstruction<0, Throws> { 2140 class ReThrowInstr : public TemplateInstruction<0, Throws> {
2139 public: 2141 public:
2140 // 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the 2142 // 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the
2141 // rethrow has been artificially generated by the parser. 2143 // rethrow has been artificially generated by the parser.
2142 ReThrowInstr(TokenPosition token_pos, 2144 ReThrowInstr(TokenPosition token_pos,
2143 intptr_t catch_try_index, 2145 intptr_t catch_try_index,
2144 intptr_t deopt_id) 2146 intptr_t deopt_id)
2145 : TemplateInstruction(deopt_id), 2147 : TemplateInstruction(deopt_id),
2146 token_pos_(token_pos), 2148 token_pos_(token_pos),
2147 catch_try_index_(catch_try_index) {} 2149 catch_try_index_(catch_try_index) {}
2148 2150
2149 DECLARE_INSTRUCTION(ReThrow) 2151 DECLARE_INSTRUCTION(ReThrow)
2150 2152
2151 virtual intptr_t ArgumentCount() const { return 2; } 2153 virtual intptr_t ArgumentCount() const { return 2; }
2152 2154
2153 virtual TokenPosition token_pos() const { return token_pos_; } 2155 virtual TokenPosition token_pos() const { return token_pos_; }
2154 intptr_t catch_try_index() const { return catch_try_index_; } 2156 intptr_t catch_try_index() const { return catch_try_index_; }
2155 2157
2156 virtual bool ComputeCanDeoptimize() const { return true; } 2158 virtual bool ComputeCanDeoptimize() const { return true; }
2157 2159
2158 virtual EffectSet Effects() const { return EffectSet::None(); } 2160 virtual bool HasUnknownSideEffects() const { return false; }
2159 2161
2160 private: 2162 private:
2161 const TokenPosition token_pos_; 2163 const TokenPosition token_pos_;
2162 const intptr_t catch_try_index_; 2164 const intptr_t catch_try_index_;
2163 2165
2164 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr); 2166 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr);
2165 }; 2167 };
2166 2168
2167 class StopInstr : public TemplateInstruction<0, NoThrow> { 2169 class StopInstr : public TemplateInstruction<0, NoThrow> {
2168 public: 2170 public:
2169 explicit StopInstr(const char* message) : message_(message) { 2171 explicit StopInstr(const char* message) : message_(message) {
2170 ASSERT(message != NULL); 2172 ASSERT(message != NULL);
2171 } 2173 }
2172 2174
2173 const char* message() const { return message_; } 2175 const char* message() const { return message_; }
2174 2176
2175 DECLARE_INSTRUCTION(Stop); 2177 DECLARE_INSTRUCTION(Stop);
2176 2178
2177 virtual intptr_t ArgumentCount() const { return 0; } 2179 virtual intptr_t ArgumentCount() const { return 0; }
2178 2180
2179 virtual bool ComputeCanDeoptimize() const { return false; } 2181 virtual bool ComputeCanDeoptimize() const { return false; }
2180 2182
2181 virtual EffectSet Effects() const { return EffectSet::None(); } 2183 virtual bool HasUnknownSideEffects() const { return false; }
2182 2184
2183 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2185 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2184 2186
2185 private: 2187 private:
2186 const char* message_; 2188 const char* message_;
2187 2189
2188 DISALLOW_COPY_AND_ASSIGN(StopInstr); 2190 DISALLOW_COPY_AND_ASSIGN(StopInstr);
2189 }; 2191 };
2190 2192
2191 class GotoInstr : public TemplateInstruction<0, NoThrow> { 2193 class GotoInstr : public TemplateInstruction<0, NoThrow> {
(...skipping 20 matching lines...) Expand all
2212 void adjust_edge_weight(double scale_factor) { edge_weight_ *= scale_factor; } 2214 void adjust_edge_weight(double scale_factor) { edge_weight_ *= scale_factor; }
2213 2215
2214 virtual bool CanBecomeDeoptimizationTarget() const { 2216 virtual bool CanBecomeDeoptimizationTarget() const {
2215 // Goto instruction can be used as a deoptimization target when LICM 2217 // Goto instruction can be used as a deoptimization target when LICM
2216 // hoists instructions out of the loop. 2218 // hoists instructions out of the loop.
2217 return true; 2219 return true;
2218 } 2220 }
2219 2221
2220 virtual bool ComputeCanDeoptimize() const { return false; } 2222 virtual bool ComputeCanDeoptimize() const { return false; }
2221 2223
2222 virtual EffectSet Effects() const { return EffectSet::None(); } 2224 virtual bool HasUnknownSideEffects() const { return false; }
2223 2225
2224 ParallelMoveInstr* parallel_move() const { return parallel_move_; } 2226 ParallelMoveInstr* parallel_move() const { return parallel_move_; }
2225 2227
2226 bool HasParallelMove() const { return parallel_move_ != NULL; } 2228 bool HasParallelMove() const { return parallel_move_ != NULL; }
2227 2229
2228 bool HasNonRedundantParallelMove() const { 2230 bool HasNonRedundantParallelMove() const {
2229 return HasParallelMove() && !parallel_move()->IsRedundant(); 2231 return HasParallelMove() && !parallel_move()->IsRedundant();
2230 } 2232 }
2231 2233
2232 ParallelMoveInstr* GetParallelMove() { 2234 ParallelMoveInstr* GetParallelMove() {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
2288 2290
2289 virtual intptr_t SuccessorCount() const { return successors_.length(); } 2291 virtual intptr_t SuccessorCount() const { return successors_.length(); }
2290 virtual TargetEntryInstr* SuccessorAt(intptr_t index) const { 2292 virtual TargetEntryInstr* SuccessorAt(intptr_t index) const {
2291 ASSERT(index < SuccessorCount()); 2293 ASSERT(index < SuccessorCount());
2292 return successors_[index]; 2294 return successors_[index];
2293 } 2295 }
2294 2296
2295 virtual bool ComputeCanDeoptimize() const { return false; } 2297 virtual bool ComputeCanDeoptimize() const { return false; }
2296 virtual bool CanBecomeDeoptimizationTarget() const { return false; } 2298 virtual bool CanBecomeDeoptimizationTarget() const { return false; }
2297 2299
2298 virtual EffectSet Effects() const { return EffectSet::None(); } 2300 virtual bool HasUnknownSideEffects() const { return false; }
2299 2301
2300 Value* offset() const { return inputs_[0]; } 2302 Value* offset() const { return inputs_[0]; }
2301 void ComputeOffsetTable(); 2303 void ComputeOffsetTable();
2302 2304
2303 PRINT_TO_SUPPORT 2305 PRINT_TO_SUPPORT
2304 2306
2305 private: 2307 private:
2306 GrowableArray<TargetEntryInstr*> successors_; 2308 GrowableArray<TargetEntryInstr*> successors_;
2307 TypedData& offsets_; 2309 TypedData& offsets_;
2308 }; 2310 };
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
2379 intptr_t operation_cid_; // Set by optimizer. 2381 intptr_t operation_cid_; // Set by optimizer.
2380 2382
2381 DISALLOW_COPY_AND_ASSIGN(ComparisonInstr); 2383 DISALLOW_COPY_AND_ASSIGN(ComparisonInstr);
2382 }; 2384 };
2383 2385
2384 class PureComparison : public ComparisonInstr { 2386 class PureComparison : public ComparisonInstr {
2385 public: 2387 public:
2386 virtual bool AllowsCSE() const { return true; } 2388 virtual bool AllowsCSE() const { return true; }
2387 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2389 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2388 2390
2389 virtual EffectSet Effects() const { return EffectSet::None(); } 2391 virtual bool HasUnknownSideEffects() const { return false; }
2390 2392
2391 protected: 2393 protected:
2392 PureComparison(TokenPosition token_pos, Token::Kind kind, intptr_t deopt_id) 2394 PureComparison(TokenPosition token_pos, Token::Kind kind, intptr_t deopt_id)
2393 : ComparisonInstr(token_pos, kind, deopt_id) {} 2395 : ComparisonInstr(token_pos, kind, deopt_id) {}
2394 }; 2396 };
2395 2397
2396 template <intptr_t N, 2398 template <intptr_t N,
2397 typename ThrowsTrait, 2399 typename ThrowsTrait,
2398 template <typename Impure, typename Pure> class CSETrait = NoCSE> 2400 template <typename Impure, typename Pure> class CSETrait = NoCSE>
2399 class TemplateComparison 2401 class TemplateComparison
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2442 virtual TokenPosition token_pos() const { return comparison_->token_pos(); } 2444 virtual TokenPosition token_pos() const { return comparison_->token_pos(); }
2443 2445
2444 virtual bool ComputeCanDeoptimize() const { 2446 virtual bool ComputeCanDeoptimize() const {
2445 return comparison()->ComputeCanDeoptimize(); 2447 return comparison()->ComputeCanDeoptimize();
2446 } 2448 }
2447 2449
2448 virtual bool CanBecomeDeoptimizationTarget() const { 2450 virtual bool CanBecomeDeoptimizationTarget() const {
2449 return comparison()->CanBecomeDeoptimizationTarget(); 2451 return comparison()->CanBecomeDeoptimizationTarget();
2450 } 2452 }
2451 2453
2452 virtual EffectSet Effects() const { return comparison()->Effects(); } 2454 virtual bool HasUnknownSideEffects() const {
2455 return comparison()->HasUnknownSideEffects();
2456 }
2453 2457
2454 ComparisonInstr* comparison() const { return comparison_; } 2458 ComparisonInstr* comparison() const { return comparison_; }
2455 void SetComparison(ComparisonInstr* comp); 2459 void SetComparison(ComparisonInstr* comp);
2456 2460
2457 virtual intptr_t DeoptimizationTarget() const { 2461 virtual intptr_t DeoptimizationTarget() const {
2458 return comparison()->DeoptimizationTarget(); 2462 return comparison()->DeoptimizationTarget();
2459 } 2463 }
2460 2464
2461 virtual Representation RequiredInputRepresentation(intptr_t i) const { 2465 virtual Representation RequiredInputRepresentation(intptr_t i) const {
2462 return comparison()->RequiredInputRepresentation(i); 2466 return comparison()->RequiredInputRepresentation(i);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2528 virtual CompileType ComputeType() const; 2532 virtual CompileType ComputeType() const;
2529 virtual bool RecomputeType(); 2533 virtual bool RecomputeType();
2530 2534
2531 virtual Definition* Canonicalize(FlowGraph* flow_graph); 2535 virtual Definition* Canonicalize(FlowGraph* flow_graph);
2532 2536
2533 void set_constrained_type(CompileType* type) { constrained_type_ = type; } 2537 void set_constrained_type(CompileType* type) { constrained_type_ = type; }
2534 CompileType* constrained_type() const { return constrained_type_; } 2538 CompileType* constrained_type() const { return constrained_type_; }
2535 2539
2536 virtual bool ComputeCanDeoptimize() const { return false; } 2540 virtual bool ComputeCanDeoptimize() const { return false; }
2537 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2541 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2538 virtual EffectSet Effects() const { return EffectSet::None(); } 2542 virtual bool HasUnknownSideEffects() const { return false; }
2539 2543
2540 private: 2544 private:
2541 CompileType* constrained_type_; 2545 CompileType* constrained_type_;
2542 DISALLOW_COPY_AND_ASSIGN(RedefinitionInstr); 2546 DISALLOW_COPY_AND_ASSIGN(RedefinitionInstr);
2543 }; 2547 };
2544 2548
2545 class ConstraintInstr : public TemplateDefinition<1, NoThrow> { 2549 class ConstraintInstr : public TemplateDefinition<1, NoThrow> {
2546 public: 2550 public:
2547 ConstraintInstr(Value* value, Range* constraint) 2551 ConstraintInstr(Value* value, Range* constraint)
2548 : constraint_(constraint), target_(NULL) { 2552 : constraint_(constraint), target_(NULL) {
2549 SetInputAt(0, value); 2553 SetInputAt(0, value);
2550 } 2554 }
2551 2555
2552 DECLARE_INSTRUCTION(Constraint) 2556 DECLARE_INSTRUCTION(Constraint)
2553 2557
2554 virtual CompileType ComputeType() const; 2558 virtual CompileType ComputeType() const;
2555 2559
2556 virtual bool ComputeCanDeoptimize() const { return false; } 2560 virtual bool ComputeCanDeoptimize() const { return false; }
2557 2561
2558 virtual EffectSet Effects() const { return EffectSet::None(); } 2562 virtual bool HasUnknownSideEffects() const { return false; }
2559 2563
2560 virtual bool AttributesEqual(Instruction* other) const { 2564 virtual bool AttributesEqual(Instruction* other) const {
2561 UNREACHABLE(); 2565 UNREACHABLE();
2562 return false; 2566 return false;
2563 } 2567 }
2564 2568
2565 Value* value() const { return inputs_[0]; } 2569 Value* value() const { return inputs_[0]; }
2566 Range* constraint() const { return constraint_; } 2570 Range* constraint() const { return constraint_; }
2567 2571
2568 virtual void InferRange(RangeAnalysis* analysis, Range* range); 2572 virtual void InferRange(RangeAnalysis* analysis, Range* range);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 public: 2729 public:
2726 enum SpecialParameterKind { kContext, kTypeArgs }; 2730 enum SpecialParameterKind { kContext, kTypeArgs };
2727 SpecialParameterInstr(SpecialParameterKind kind, intptr_t deopt_id) 2731 SpecialParameterInstr(SpecialParameterKind kind, intptr_t deopt_id)
2728 : TemplateDefinition(deopt_id), kind_(kind) {} 2732 : TemplateDefinition(deopt_id), kind_(kind) {}
2729 2733
2730 DECLARE_INSTRUCTION(SpecialParameter) 2734 DECLARE_INSTRUCTION(SpecialParameter)
2731 virtual CompileType ComputeType() const; 2735 virtual CompileType ComputeType() const;
2732 2736
2733 virtual bool ComputeCanDeoptimize() const { return false; } 2737 virtual bool ComputeCanDeoptimize() const { return false; }
2734 2738
2735 virtual EffectSet Effects() const { return EffectSet::None(); } 2739 virtual bool HasUnknownSideEffects() const { return false; }
2736 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2740 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2737 virtual bool AttributesEqual(Instruction* other) const { 2741 virtual bool AttributesEqual(Instruction* other) const {
2738 return kind() == other->AsSpecialParameter()->kind(); 2742 return kind() == other->AsSpecialParameter()->kind();
2739 } 2743 }
2740 SpecialParameterKind kind() const { return kind_; } 2744 SpecialParameterKind kind() const { return kind_; }
2741 2745
2742 private: 2746 private:
2743 const SpecialParameterKind kind_; 2747 const SpecialParameterKind kind_;
2744 DISALLOW_COPY_AND_ASSIGN(SpecialParameterInstr); 2748 DISALLOW_COPY_AND_ASSIGN(SpecialParameterInstr);
2745 }; 2749 };
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
2835 SetInputAt(0, function); 2839 SetInputAt(0, function);
2836 } 2840 }
2837 2841
2838 DECLARE_INSTRUCTION(ClosureCall) 2842 DECLARE_INSTRUCTION(ClosureCall)
2839 2843
2840 // TODO(kmillikin): implement exact call counts for closure calls. 2844 // TODO(kmillikin): implement exact call counts for closure calls.
2841 virtual intptr_t CallCount() const { return 1; } 2845 virtual intptr_t CallCount() const { return 1; }
2842 2846
2843 virtual bool ComputeCanDeoptimize() const { return true; } 2847 virtual bool ComputeCanDeoptimize() const { return true; }
2844 2848
2845 virtual EffectSet Effects() const { return EffectSet::All(); } 2849 virtual bool HasUnknownSideEffects() const { return true; }
2846 2850
2847 PRINT_OPERANDS_TO_SUPPORT 2851 PRINT_OPERANDS_TO_SUPPORT
2848 2852
2849 private: 2853 private:
2850 DISALLOW_COPY_AND_ASSIGN(ClosureCallInstr); 2854 DISALLOW_COPY_AND_ASSIGN(ClosureCallInstr);
2851 }; 2855 };
2852 2856
2853 class InstanceCallInstr : public TemplateDartCall<0> { 2857 class InstanceCallInstr : public TemplateDartCall<0> {
2854 public: 2858 public:
2855 InstanceCallInstr( 2859 InstanceCallInstr(
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
2911 virtual bool ComputeCanDeoptimize() const { return true; } 2915 virtual bool ComputeCanDeoptimize() const { return true; }
2912 2916
2913 virtual Definition* Canonicalize(FlowGraph* flow_graph); 2917 virtual Definition* Canonicalize(FlowGraph* flow_graph);
2914 2918
2915 virtual bool CanBecomeDeoptimizationTarget() const { 2919 virtual bool CanBecomeDeoptimizationTarget() const {
2916 // Instance calls that are specialized by the optimizer need a 2920 // Instance calls that are specialized by the optimizer need a
2917 // deoptimization descriptor before the call. 2921 // deoptimization descriptor before the call.
2918 return true; 2922 return true;
2919 } 2923 }
2920 2924
2921 virtual EffectSet Effects() const { return EffectSet::All(); } 2925 virtual bool HasUnknownSideEffects() const { return true; }
2922 2926
2923 PRINT_OPERANDS_TO_SUPPORT 2927 PRINT_OPERANDS_TO_SUPPORT
2924 2928
2925 bool MatchesCoreName(const String& name); 2929 bool MatchesCoreName(const String& name);
2926 2930
2927 RawFunction* ResolveForReceiverClass(const Class& cls); 2931 RawFunction* ResolveForReceiverClass(const Class& cls);
2928 2932
2929 protected: 2933 protected:
2930 friend class JitOptimizer; 2934 friend class JitOptimizer;
2931 void set_ic_data(ICData* value) { ic_data_ = value; } 2935 void set_ic_data(ICData* value) { ic_data_ = value; }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2991 // 10 calls in the CallCount above, but the heuristics need to know that the 2995 // 10 calls in the CallCount above, but the heuristics need to know that the
2992 // last two cids cover 7% and 3% of the calls, not 70% and 30%. 2996 // last two cids cover 7% and 3% of the calls, not 70% and 30%.
2993 intptr_t total_call_count() { return total_call_count_; } 2997 intptr_t total_call_count() { return total_call_count_; }
2994 2998
2995 void set_total_call_count(intptr_t count) { total_call_count_ = count; } 2999 void set_total_call_count(intptr_t count) { total_call_count_ = count; }
2996 3000
2997 DECLARE_INSTRUCTION(PolymorphicInstanceCall) 3001 DECLARE_INSTRUCTION(PolymorphicInstanceCall)
2998 3002
2999 virtual bool ComputeCanDeoptimize() const { return true; } 3003 virtual bool ComputeCanDeoptimize() const { return true; }
3000 3004
3001 virtual EffectSet Effects() const { return EffectSet::All(); } 3005 virtual bool HasUnknownSideEffects() const { return true; }
3002 3006
3003 virtual Definition* Canonicalize(FlowGraph* graph); 3007 virtual Definition* Canonicalize(FlowGraph* graph);
3004 3008
3005 static RawType* ComputeRuntimeType(const CallTargets& targets); 3009 static RawType* ComputeRuntimeType(const CallTargets& targets);
3006 3010
3007 PRINT_OPERANDS_TO_SUPPORT 3011 PRINT_OPERANDS_TO_SUPPORT
3008 3012
3009 private: 3013 private:
3010 InstanceCallInstr* instance_call_; 3014 InstanceCallInstr* instance_call_;
3011 const CallTargets& targets_; 3015 const CallTargets& targets_;
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
3247 3251
3248 virtual CompileType ComputeType() const; 3252 virtual CompileType ComputeType() const;
3249 3253
3250 virtual void InferRange(RangeAnalysis* analysis, Range* range); 3254 virtual void InferRange(RangeAnalysis* analysis, Range* range);
3251 3255
3252 ComparisonInstr* comparison() const { return comparison_; } 3256 ComparisonInstr* comparison() const { return comparison_; }
3253 intptr_t if_true() const { return if_true_; } 3257 intptr_t if_true() const { return if_true_; }
3254 intptr_t if_false() const { return if_false_; } 3258 intptr_t if_false() const { return if_false_; }
3255 3259
3256 virtual bool AllowsCSE() const { return comparison()->AllowsCSE(); } 3260 virtual bool AllowsCSE() const { return comparison()->AllowsCSE(); }
3257 virtual EffectSet Effects() const { return comparison()->Effects(); } 3261 virtual bool HasUnknownSideEffects() const {
3262 return comparison()->HasUnknownSideEffects();
3263 }
3258 virtual EffectSet Dependencies() const { 3264 virtual EffectSet Dependencies() const {
3259 return comparison()->Dependencies(); 3265 return comparison()->Dependencies();
3260 } 3266 }
3261 virtual bool AttributesEqual(Instruction* other) const { 3267 virtual bool AttributesEqual(Instruction* other) const {
3262 IfThenElseInstr* other_if_then_else = other->AsIfThenElse(); 3268 IfThenElseInstr* other_if_then_else = other->AsIfThenElse();
3263 return (comparison()->tag() == other_if_then_else->comparison()->tag()) && 3269 return (comparison()->tag() == other_if_then_else->comparison()->tag()) &&
3264 comparison()->AttributesEqual(other_if_then_else->comparison()) && 3270 comparison()->AttributesEqual(other_if_then_else->comparison()) &&
3265 (if_true_ == other_if_then_else->if_true_) && 3271 (if_true_ == other_if_then_else->if_true_) &&
3266 (if_false_ == other_if_then_else->if_false_); 3272 (if_false_ == other_if_then_else->if_false_);
3267 } 3273 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
3363 } 3369 }
3364 3370
3365 virtual bool ComputeCanDeoptimize() const { return true; } 3371 virtual bool ComputeCanDeoptimize() const { return true; }
3366 3372
3367 virtual bool CanBecomeDeoptimizationTarget() const { 3373 virtual bool CanBecomeDeoptimizationTarget() const {
3368 // Static calls that are specialized by the optimizer (e.g. sqrt) need a 3374 // Static calls that are specialized by the optimizer (e.g. sqrt) need a
3369 // deoptimization descriptor before the call. 3375 // deoptimization descriptor before the call.
3370 return true; 3376 return true;
3371 } 3377 }
3372 3378
3373 virtual EffectSet Effects() const { return EffectSet::All(); } 3379 virtual bool HasUnknownSideEffects() const { return true; }
3374 3380
3375 void set_result_cid(intptr_t value) { result_cid_ = value; } 3381 void set_result_cid(intptr_t value) { result_cid_ = value; }
3376 3382
3377 bool is_known_list_constructor() const { return is_known_list_constructor_; } 3383 bool is_known_list_constructor() const { return is_known_list_constructor_; }
3378 void set_is_known_list_constructor(bool value) { 3384 void set_is_known_list_constructor(bool value) {
3379 is_known_list_constructor_ = value; 3385 is_known_list_constructor_ = value;
3380 } 3386 }
3381 3387
3382 bool IsRecognizedFactory() const { return is_known_list_constructor(); } 3388 bool IsRecognizedFactory() const { return is_known_list_constructor(); }
3383 3389
(...skipping 21 matching lines...) Expand all
3405 LoadLocalInstr(const LocalVariable& local, TokenPosition token_pos) 3411 LoadLocalInstr(const LocalVariable& local, TokenPosition token_pos)
3406 : local_(local), is_last_(false), token_pos_(token_pos) {} 3412 : local_(local), is_last_(false), token_pos_(token_pos) {}
3407 3413
3408 DECLARE_INSTRUCTION(LoadLocal) 3414 DECLARE_INSTRUCTION(LoadLocal)
3409 virtual CompileType ComputeType() const; 3415 virtual CompileType ComputeType() const;
3410 3416
3411 const LocalVariable& local() const { return local_; } 3417 const LocalVariable& local() const { return local_; }
3412 3418
3413 virtual bool ComputeCanDeoptimize() const { return false; } 3419 virtual bool ComputeCanDeoptimize() const { return false; }
3414 3420
3415 virtual EffectSet Effects() const { 3421 virtual bool HasUnknownSideEffects() const {
3416 UNREACHABLE(); // Eliminated by SSA construction. 3422 UNREACHABLE(); // Eliminated by SSA construction.
3417 return EffectSet::None(); 3423 return false;
3418 } 3424 }
3419 3425
3420 void mark_last() { is_last_ = true; } 3426 void mark_last() { is_last_ = true; }
3421 bool is_last() const { return is_last_; } 3427 bool is_last() const { return is_last_; }
3422 3428
3423 virtual TokenPosition token_pos() const { return token_pos_; } 3429 virtual TokenPosition token_pos() const { return token_pos_; }
3424 3430
3425 PRINT_OPERANDS_TO_SUPPORT 3431 PRINT_OPERANDS_TO_SUPPORT
3426 3432
3427 private: 3433 private:
(...skipping 22 matching lines...) Expand all
3450 } 3456 }
3451 3457
3452 Value* value() const { return value_; } 3458 Value* value() const { return value_; }
3453 3459
3454 intptr_t num_temps() const { return num_temps_; } 3460 intptr_t num_temps() const { return num_temps_; }
3455 3461
3456 virtual CompileType ComputeType() const; 3462 virtual CompileType ComputeType() const;
3457 3463
3458 virtual bool ComputeCanDeoptimize() const { return false; } 3464 virtual bool ComputeCanDeoptimize() const { return false; }
3459 3465
3460 virtual EffectSet Effects() const { 3466 virtual bool HasUnknownSideEffects() const {
3461 UNREACHABLE(); // Eliminated by SSA construction. 3467 UNREACHABLE(); // Eliminated by SSA construction.
3462 return EffectSet::None(); 3468 return false;
3463 } 3469 }
3464 3470
3465 virtual bool MayThrow() const { 3471 virtual bool MayThrow() const {
3466 UNREACHABLE(); 3472 UNREACHABLE();
3467 return false; 3473 return false;
3468 } 3474 }
3469 3475
3470 virtual TokenPosition token_pos() const { return TokenPosition::kTempMove; } 3476 virtual TokenPosition token_pos() const { return TokenPosition::kTempMove; }
3471 3477
3472 PRINT_OPERANDS_TO_SUPPORT 3478 PRINT_OPERANDS_TO_SUPPORT
(...skipping 23 matching lines...) Expand all
3496 Value* value() const { return inputs_[0]; } 3502 Value* value() const { return inputs_[0]; }
3497 3503
3498 virtual bool ComputeCanDeoptimize() const { return false; } 3504 virtual bool ComputeCanDeoptimize() const { return false; }
3499 3505
3500 void mark_dead() { is_dead_ = true; } 3506 void mark_dead() { is_dead_ = true; }
3501 bool is_dead() const { return is_dead_; } 3507 bool is_dead() const { return is_dead_; }
3502 3508
3503 void mark_last() { is_last_ = true; } 3509 void mark_last() { is_last_ = true; }
3504 bool is_last() const { return is_last_; } 3510 bool is_last() const { return is_last_; }
3505 3511
3506 virtual EffectSet Effects() const { 3512 virtual bool HasUnknownSideEffects() const {
3507 UNREACHABLE(); // Eliminated by SSA construction. 3513 UNREACHABLE(); // Eliminated by SSA construction.
3508 return EffectSet::None(); 3514 return false;
3509 } 3515 }
3510 3516
3511 virtual TokenPosition token_pos() const { return token_pos_; } 3517 virtual TokenPosition token_pos() const { return token_pos_; }
3512 3518
3513 PRINT_OPERANDS_TO_SUPPORT 3519 PRINT_OPERANDS_TO_SUPPORT
3514 3520
3515 private: 3521 private:
3516 const LocalVariable& local_; 3522 const LocalVariable& local_;
3517 bool is_dead_; 3523 bool is_dead_;
3518 bool is_last_; 3524 bool is_last_;
(...skipping 29 matching lines...) Expand all
3548 const String& native_name() const { return *native_name_; } 3554 const String& native_name() const { return *native_name_; }
3549 const Function& function() const { return *function_; } 3555 const Function& function() const { return *function_; }
3550 NativeFunction native_c_function() const { return native_c_function_; } 3556 NativeFunction native_c_function() const { return native_c_function_; }
3551 bool is_bootstrap_native() const { return is_bootstrap_native_; } 3557 bool is_bootstrap_native() const { return is_bootstrap_native_; }
3552 bool is_auto_scope() const { return is_auto_scope_; } 3558 bool is_auto_scope() const { return is_auto_scope_; }
3553 bool link_lazily() const { return link_lazily_; } 3559 bool link_lazily() const { return link_lazily_; }
3554 virtual TokenPosition token_pos() const { return token_pos_; } 3560 virtual TokenPosition token_pos() const { return token_pos_; }
3555 3561
3556 virtual bool ComputeCanDeoptimize() const { return false; } 3562 virtual bool ComputeCanDeoptimize() const { return false; }
3557 3563
3558 virtual EffectSet Effects() const { return EffectSet::All(); } 3564 virtual bool HasUnknownSideEffects() const { return true; }
3559 3565
3560 void SetupNative(); 3566 void SetupNative();
3561 3567
3562 PRINT_OPERANDS_TO_SUPPORT 3568 PRINT_OPERANDS_TO_SUPPORT
3563 3569
3564 private: 3570 private:
3565 void set_native_c_function(NativeFunction value) { 3571 void set_native_c_function(NativeFunction value) {
3566 native_c_function_ = value; 3572 native_c_function_ = value;
3567 } 3573 }
3568 3574
(...skipping 17 matching lines...) Expand all
3586 RawPcDescriptors::Kind stub_kind, 3592 RawPcDescriptors::Kind stub_kind,
3587 intptr_t deopt_id) 3593 intptr_t deopt_id)
3588 : TemplateInstruction<0, NoThrow>(deopt_id), 3594 : TemplateInstruction<0, NoThrow>(deopt_id),
3589 token_pos_(token_pos), 3595 token_pos_(token_pos),
3590 stub_kind_(stub_kind) {} 3596 stub_kind_(stub_kind) {}
3591 3597
3592 DECLARE_INSTRUCTION(DebugStepCheck) 3598 DECLARE_INSTRUCTION(DebugStepCheck)
3593 3599
3594 virtual TokenPosition token_pos() const { return token_pos_; } 3600 virtual TokenPosition token_pos() const { return token_pos_; }
3595 virtual bool ComputeCanDeoptimize() const { return false; } 3601 virtual bool ComputeCanDeoptimize() const { return false; }
3596 virtual EffectSet Effects() const { return EffectSet::All(); } 3602 virtual bool HasUnknownSideEffects() const { return true; }
3597 virtual Instruction* Canonicalize(FlowGraph* flow_graph); 3603 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
3598 3604
3599 private: 3605 private:
3600 const TokenPosition token_pos_; 3606 const TokenPosition token_pos_;
3601 const RawPcDescriptors::Kind stub_kind_; 3607 const RawPcDescriptors::Kind stub_kind_;
3602 3608
3603 DISALLOW_COPY_AND_ASSIGN(DebugStepCheckInstr); 3609 DISALLOW_COPY_AND_ASSIGN(DebugStepCheckInstr);
3604 }; 3610 };
3605 3611
3606 enum StoreBarrierType { kNoStoreBarrier, kEmitStoreBarrier }; 3612 enum StoreBarrierType { kNoStoreBarrier, kEmitStoreBarrier };
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
3657 } 3663 }
3658 3664
3659 virtual bool ComputeCanDeoptimize() const { return false; } 3665 virtual bool ComputeCanDeoptimize() const { return false; }
3660 3666
3661 // May require a deoptimization target for input conversions. 3667 // May require a deoptimization target for input conversions.
3662 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } 3668 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
3663 3669
3664 // Currently CSE/LICM don't operate on any instructions that can be affected 3670 // Currently CSE/LICM don't operate on any instructions that can be affected
3665 // by stores/loads. LoadOptimizer handles loads separately. Hence stores 3671 // by stores/loads. LoadOptimizer handles loads separately. Hence stores
3666 // are marked as having no side-effects. 3672 // are marked as having no side-effects.
3667 virtual EffectSet Effects() const { return EffectSet::None(); } 3673 virtual bool HasUnknownSideEffects() const { return false; }
3668 3674
3669 bool IsUnboxedStore() const; 3675 bool IsUnboxedStore() const;
3670 3676
3671 bool IsPotentialUnboxedStore() const; 3677 bool IsPotentialUnboxedStore() const;
3672 3678
3673 virtual Representation RequiredInputRepresentation(intptr_t index) const; 3679 virtual Representation RequiredInputRepresentation(intptr_t index) const;
3674 3680
3675 PRINT_OPERANDS_TO_SUPPORT 3681 PRINT_OPERANDS_TO_SUPPORT
3676 3682
3677 private: 3683 private:
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
3764 3770
3765 DECLARE_INSTRUCTION(LoadStaticField) 3771 DECLARE_INSTRUCTION(LoadStaticField)
3766 virtual CompileType ComputeType() const; 3772 virtual CompileType ComputeType() const;
3767 3773
3768 const Field& StaticField() const; 3774 const Field& StaticField() const;
3769 3775
3770 Value* field_value() const { return inputs_[0]; } 3776 Value* field_value() const { return inputs_[0]; }
3771 3777
3772 virtual bool ComputeCanDeoptimize() const { return false; } 3778 virtual bool ComputeCanDeoptimize() const { return false; }
3773 3779
3774 virtual bool AllowsCSE() const { return StaticField().is_final(); } 3780 virtual bool AllowsCSE() const {
3775 virtual EffectSet Effects() const { return EffectSet::None(); } 3781 return StaticField().is_final() && !FLAG_fields_may_be_reset;
3782 }
3783 virtual bool HasUnknownSideEffects() const { return false; }
3776 virtual EffectSet Dependencies() const; 3784 virtual EffectSet Dependencies() const;
3777 virtual bool AttributesEqual(Instruction* other) const; 3785 virtual bool AttributesEqual(Instruction* other) const;
3778 3786
3779 virtual TokenPosition token_pos() const { return token_pos_; } 3787 virtual TokenPosition token_pos() const { return token_pos_; }
3780 3788
3781 PRINT_OPERANDS_TO_SUPPORT 3789 PRINT_OPERANDS_TO_SUPPORT
3782 3790
3783 private: 3791 private:
3784 const TokenPosition token_pos_; 3792 const TokenPosition token_pos_;
3785 3793
(...skipping 16 matching lines...) Expand all
3802 DECLARE_INSTRUCTION(StoreStaticField) 3810 DECLARE_INSTRUCTION(StoreStaticField)
3803 3811
3804 const Field& field() const { return field_; } 3812 const Field& field() const { return field_; }
3805 Value* value() const { return inputs_[kValuePos]; } 3813 Value* value() const { return inputs_[kValuePos]; }
3806 3814
3807 virtual bool ComputeCanDeoptimize() const { return false; } 3815 virtual bool ComputeCanDeoptimize() const { return false; }
3808 3816
3809 // Currently CSE/LICM don't operate on any instructions that can be affected 3817 // Currently CSE/LICM don't operate on any instructions that can be affected
3810 // by stores/loads. LoadOptimizer handles loads separately. Hence stores 3818 // by stores/loads. LoadOptimizer handles loads separately. Hence stores
3811 // are marked as having no side-effects. 3819 // are marked as having no side-effects.
3812 virtual EffectSet Effects() const { return EffectSet::None(); } 3820 virtual bool HasUnknownSideEffects() const { return false; }
3813 3821
3814 virtual TokenPosition token_pos() const { return token_pos_; } 3822 virtual TokenPosition token_pos() const { return token_pos_; }
3815 3823
3816 PRINT_OPERANDS_TO_SUPPORT 3824 PRINT_OPERANDS_TO_SUPPORT
3817 3825
3818 private: 3826 private:
3819 bool CanValueBeSmi() const { 3827 bool CanValueBeSmi() const {
3820 const intptr_t cid = value()->Type()->ToNullableCid(); 3828 const intptr_t cid = value()->Type()->ToNullableCid();
3821 // Write barrier is skipped for nullable and non-nullable smis. 3829 // Write barrier is skipped for nullable and non-nullable smis.
3822 ASSERT(cid != kSmiCid); 3830 ASSERT(cid != kSmiCid);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
3866 intptr_t class_id() const { return class_id_; } 3874 intptr_t class_id() const { return class_id_; }
3867 bool aligned() const { return alignment_ == kAlignedAccess; } 3875 bool aligned() const { return alignment_ == kAlignedAccess; }
3868 3876
3869 virtual bool ComputeCanDeoptimize() const { 3877 virtual bool ComputeCanDeoptimize() const {
3870 return GetDeoptId() != Thread::kNoDeoptId; 3878 return GetDeoptId() != Thread::kNoDeoptId;
3871 } 3879 }
3872 3880
3873 virtual Representation representation() const; 3881 virtual Representation representation() const;
3874 virtual void InferRange(RangeAnalysis* analysis, Range* range); 3882 virtual void InferRange(RangeAnalysis* analysis, Range* range);
3875 3883
3876 virtual EffectSet Effects() const { return EffectSet::None(); } 3884 virtual bool HasUnknownSideEffects() const { return false; }
3877 3885
3878 private: 3886 private:
3879 const intptr_t index_scale_; 3887 const intptr_t index_scale_;
3880 const intptr_t class_id_; 3888 const intptr_t class_id_;
3881 const AlignmentType alignment_; 3889 const AlignmentType alignment_;
3882 const TokenPosition token_pos_; 3890 const TokenPosition token_pos_;
3883 3891
3884 DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr); 3892 DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr);
3885 }; 3893 };
3886 3894
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
3935 bool can_pack_into_smi() const { 3943 bool can_pack_into_smi() const {
3936 return element_count() <= kSmiBits / (index_scale() * kBitsPerByte); 3944 return element_count() <= kSmiBits / (index_scale() * kBitsPerByte);
3937 } 3945 }
3938 3946
3939 virtual bool ComputeCanDeoptimize() const { return false; } 3947 virtual bool ComputeCanDeoptimize() const { return false; }
3940 3948
3941 virtual Representation representation() const { return representation_; } 3949 virtual Representation representation() const { return representation_; }
3942 void set_representation(Representation repr) { representation_ = repr; } 3950 void set_representation(Representation repr) { representation_ = repr; }
3943 virtual void InferRange(RangeAnalysis* analysis, Range* range); 3951 virtual void InferRange(RangeAnalysis* analysis, Range* range);
3944 3952
3945 virtual EffectSet Effects() const { return EffectSet::None(); } 3953 virtual bool HasUnknownSideEffects() const { return false; }
3946 3954
3947 private: 3955 private:
3948 const intptr_t class_id_; 3956 const intptr_t class_id_;
3949 const TokenPosition token_pos_; 3957 const TokenPosition token_pos_;
3950 const intptr_t element_count_; 3958 const intptr_t element_count_;
3951 Representation representation_; 3959 Representation representation_;
3952 3960
3953 DISALLOW_COPY_AND_ASSIGN(LoadCodeUnitsInstr); 3961 DISALLOW_COPY_AND_ASSIGN(LoadCodeUnitsInstr);
3954 }; 3962 };
3955 3963
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
4006 token_pos_(token_pos), 4014 token_pos_(token_pos),
4007 function_(Function::ZoneHandle()) { 4015 function_(Function::ZoneHandle()) {
4008 SetInputAt(0, value); 4016 SetInputAt(0, value);
4009 } 4017 }
4010 4018
4011 Value* value() const { return inputs_[0]; } 4019 Value* value() const { return inputs_[0]; }
4012 virtual TokenPosition token_pos() const { return token_pos_; } 4020 virtual TokenPosition token_pos() const { return token_pos_; }
4013 4021
4014 virtual CompileType ComputeType() const; 4022 virtual CompileType ComputeType() const;
4015 // Issues a static call to Dart code which calls toString on objects. 4023 // Issues a static call to Dart code which calls toString on objects.
4016 virtual EffectSet Effects() const { return EffectSet::All(); } 4024 virtual bool HasUnknownSideEffects() const { return true; }
4017 virtual bool ComputeCanDeoptimize() const { return true; } 4025 virtual bool ComputeCanDeoptimize() const { return true; }
4018 4026
4019 const Function& CallFunction() const; 4027 const Function& CallFunction() const;
4020 4028
4021 virtual Definition* Canonicalize(FlowGraph* flow_graph); 4029 virtual Definition* Canonicalize(FlowGraph* flow_graph);
4022 4030
4023 DECLARE_INSTRUCTION(StringInterpolate) 4031 DECLARE_INSTRUCTION(StringInterpolate)
4024 4032
4025 private: 4033 private:
4026 const TokenPosition token_pos_; 4034 const TokenPosition token_pos_;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
4064 bool IsExternal() const { 4072 bool IsExternal() const {
4065 return array()->definition()->representation() == kUntagged; 4073 return array()->definition()->representation() == kUntagged;
4066 } 4074 }
4067 4075
4068 virtual intptr_t DeoptimizationTarget() const { 4076 virtual intptr_t DeoptimizationTarget() const {
4069 // Direct access since this instruction cannot deoptimize, and the deopt-id 4077 // Direct access since this instruction cannot deoptimize, and the deopt-id
4070 // was inherited from another instruction that could deoptimize. 4078 // was inherited from another instruction that could deoptimize.
4071 return GetDeoptId(); 4079 return GetDeoptId();
4072 } 4080 }
4073 4081
4074 virtual EffectSet Effects() const { return EffectSet::None(); } 4082 virtual bool HasUnknownSideEffects() const { return false; }
4075 4083
4076 private: 4084 private:
4077 const StoreBarrierType emit_store_barrier_; 4085 const StoreBarrierType emit_store_barrier_;
4078 const intptr_t index_scale_; 4086 const intptr_t index_scale_;
4079 const intptr_t class_id_; 4087 const intptr_t class_id_;
4080 const AlignmentType alignment_; 4088 const AlignmentType alignment_;
4081 const TokenPosition token_pos_; 4089 const TokenPosition token_pos_;
4082 4090
4083 DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr); 4091 DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr);
4084 }; 4092 };
4085 4093
4086 // Note overrideable, built-in: value ? false : true. 4094 // Note overrideable, built-in: value ? false : true.
4087 class BooleanNegateInstr : public TemplateDefinition<1, NoThrow> { 4095 class BooleanNegateInstr : public TemplateDefinition<1, NoThrow> {
4088 public: 4096 public:
4089 explicit BooleanNegateInstr(Value* value) { SetInputAt(0, value); } 4097 explicit BooleanNegateInstr(Value* value) { SetInputAt(0, value); }
4090 4098
4091 DECLARE_INSTRUCTION(BooleanNegate) 4099 DECLARE_INSTRUCTION(BooleanNegate)
4092 virtual CompileType ComputeType() const; 4100 virtual CompileType ComputeType() const;
4093 4101
4094 Value* value() const { return inputs_[0]; } 4102 Value* value() const { return inputs_[0]; }
4095 4103
4096 virtual bool ComputeCanDeoptimize() const { return false; } 4104 virtual bool ComputeCanDeoptimize() const { return false; }
4097 4105
4098 virtual EffectSet Effects() const { return EffectSet::None(); } 4106 virtual bool HasUnknownSideEffects() const { return false; }
4099 4107
4100 virtual Definition* Canonicalize(FlowGraph* flow_graph); 4108 virtual Definition* Canonicalize(FlowGraph* flow_graph);
4101 4109
4102 private: 4110 private:
4103 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr); 4111 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr);
4104 }; 4112 };
4105 4113
4106 class InstanceOfInstr : public TemplateDefinition<3, Throws> { 4114 class InstanceOfInstr : public TemplateDefinition<3, Throws> {
4107 public: 4115 public:
4108 InstanceOfInstr(TokenPosition token_pos, 4116 InstanceOfInstr(TokenPosition token_pos,
(...skipping 14 matching lines...) Expand all
4123 4131
4124 Value* value() const { return inputs_[0]; } 4132 Value* value() const { return inputs_[0]; }
4125 Value* instantiator_type_arguments() const { return inputs_[1]; } 4133 Value* instantiator_type_arguments() const { return inputs_[1]; }
4126 Value* function_type_arguments() const { return inputs_[2]; } 4134 Value* function_type_arguments() const { return inputs_[2]; }
4127 4135
4128 const AbstractType& type() const { return type_; } 4136 const AbstractType& type() const { return type_; }
4129 virtual TokenPosition token_pos() const { return token_pos_; } 4137 virtual TokenPosition token_pos() const { return token_pos_; }
4130 4138
4131 virtual bool ComputeCanDeoptimize() const { return true; } 4139 virtual bool ComputeCanDeoptimize() const { return true; }
4132 4140
4133 virtual EffectSet Effects() const { return EffectSet::None(); } 4141 virtual bool HasUnknownSideEffects() const { return false; }
4134 4142
4135 PRINT_OPERANDS_TO_SUPPORT 4143 PRINT_OPERANDS_TO_SUPPORT
4136 4144
4137 private: 4145 private:
4138 const TokenPosition token_pos_; 4146 const TokenPosition token_pos_;
4139 Value* value_; 4147 Value* value_;
4140 Value* type_arguments_; 4148 Value* type_arguments_;
4141 const AbstractType& type_; 4149 const AbstractType& type_;
4142 4150
4143 DISALLOW_COPY_AND_ASSIGN(InstanceOfInstr); 4151 DISALLOW_COPY_AND_ASSIGN(InstanceOfInstr);
(...skipping 24 matching lines...) Expand all
4168 const Class& cls() const { return cls_; } 4176 const Class& cls() const { return cls_; }
4169 virtual TokenPosition token_pos() const { return token_pos_; } 4177 virtual TokenPosition token_pos() const { return token_pos_; }
4170 4178
4171 const Function& closure_function() const { return closure_function_; } 4179 const Function& closure_function() const { return closure_function_; }
4172 void set_closure_function(const Function& function) { 4180 void set_closure_function(const Function& function) {
4173 closure_function_ ^= function.raw(); 4181 closure_function_ ^= function.raw();
4174 } 4182 }
4175 4183
4176 virtual bool ComputeCanDeoptimize() const { return false; } 4184 virtual bool ComputeCanDeoptimize() const { return false; }
4177 4185
4178 virtual EffectSet Effects() const { return EffectSet::None(); } 4186 virtual bool HasUnknownSideEffects() const { return false; }
4179 4187
4180 virtual AliasIdentity Identity() const { return identity_; } 4188 virtual AliasIdentity Identity() const { return identity_; }
4181 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } 4189 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
4182 4190
4183 PRINT_OPERANDS_TO_SUPPORT 4191 PRINT_OPERANDS_TO_SUPPORT
4184 4192
4185 private: 4193 private:
4186 const TokenPosition token_pos_; 4194 const TokenPosition token_pos_;
4187 const Class& cls_; 4195 const Class& cls_;
4188 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; 4196 ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
(...skipping 13 matching lines...) Expand all
4202 identity_(AliasIdentity::Unknown()) {} 4210 identity_(AliasIdentity::Unknown()) {}
4203 4211
4204 DECLARE_INSTRUCTION(AllocateUninitializedContext) 4212 DECLARE_INSTRUCTION(AllocateUninitializedContext)
4205 virtual CompileType ComputeType() const; 4213 virtual CompileType ComputeType() const;
4206 4214
4207 virtual TokenPosition token_pos() const { return token_pos_; } 4215 virtual TokenPosition token_pos() const { return token_pos_; }
4208 intptr_t num_context_variables() const { return num_context_variables_; } 4216 intptr_t num_context_variables() const { return num_context_variables_; }
4209 4217
4210 virtual bool ComputeCanDeoptimize() const { return false; } 4218 virtual bool ComputeCanDeoptimize() const { return false; }
4211 4219
4212 virtual EffectSet Effects() const { return EffectSet::None(); } 4220 virtual bool HasUnknownSideEffects() const { return false; }
4213 4221
4214 virtual AliasIdentity Identity() const { return identity_; } 4222 virtual AliasIdentity Identity() const { return identity_; }
4215 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } 4223 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
4216 4224
4217 PRINT_OPERANDS_TO_SUPPORT 4225 PRINT_OPERANDS_TO_SUPPORT
4218 4226
4219 private: 4227 private:
4220 const TokenPosition token_pos_; 4228 const TokenPosition token_pos_;
4221 const intptr_t num_context_variables_; 4229 const intptr_t num_context_variables_;
4222 AliasIdentity identity_; 4230 AliasIdentity identity_;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
4287 // instructions are still in the graph. To avoid any redundant boxing 4295 // instructions are still in the graph. To avoid any redundant boxing
4288 // operations inserted by that pass we should indicate that this 4296 // operations inserted by that pass we should indicate that this
4289 // instruction can cope with any representation as it is essentially 4297 // instruction can cope with any representation as it is essentially
4290 // an environment use. 4298 // an environment use.
4291 virtual Representation RequiredInputRepresentation(intptr_t idx) const { 4299 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
4292 ASSERT(0 <= idx && idx < InputCount()); 4300 ASSERT(0 <= idx && idx < InputCount());
4293 return kNoRepresentation; 4301 return kNoRepresentation;
4294 } 4302 }
4295 4303
4296 virtual bool ComputeCanDeoptimize() const { return false; } 4304 virtual bool ComputeCanDeoptimize() const { return false; }
4297 virtual EffectSet Effects() const { return EffectSet::None(); } 4305 virtual bool HasUnknownSideEffects() const { return false; }
4298 4306
4299 Location* locations() { return locations_; } 4307 Location* locations() { return locations_; }
4300 void set_locations(Location* locations) { locations_ = locations; } 4308 void set_locations(Location* locations) { locations_ = locations; }
4301 4309
4302 virtual bool MayThrow() const { return false; } 4310 virtual bool MayThrow() const { return false; }
4303 4311
4304 void RemapRegisters(intptr_t* cpu_reg_slots, intptr_t* fpu_reg_slots); 4312 void RemapRegisters(intptr_t* cpu_reg_slots, intptr_t* fpu_reg_slots);
4305 4313
4306 bool was_visited_for_liveness() const { return visited_for_liveness_; } 4314 bool was_visited_for_liveness() const { return visited_for_liveness_; }
4307 void mark_visited_for_liveness() { visited_for_liveness_ = true; } 4315 void mark_visited_for_liveness() { visited_for_liveness_ = true; }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
4345 virtual CompileType ComputeType() const; 4353 virtual CompileType ComputeType() const;
4346 4354
4347 virtual TokenPosition token_pos() const { return token_pos_; } 4355 virtual TokenPosition token_pos() const { return token_pos_; }
4348 Value* element_type() const { return inputs_[kElementTypePos]; } 4356 Value* element_type() const { return inputs_[kElementTypePos]; }
4349 Value* num_elements() const { return inputs_[kLengthPos]; } 4357 Value* num_elements() const { return inputs_[kLengthPos]; }
4350 4358
4351 // Throw needs environment, which is created only if instruction can 4359 // Throw needs environment, which is created only if instruction can
4352 // deoptimize. 4360 // deoptimize.
4353 virtual bool ComputeCanDeoptimize() const { return MayThrow(); } 4361 virtual bool ComputeCanDeoptimize() const { return MayThrow(); }
4354 4362
4355 virtual EffectSet Effects() const { return EffectSet::None(); } 4363 virtual bool HasUnknownSideEffects() const { return false; }
4356 4364
4357 virtual AliasIdentity Identity() const { return identity_; } 4365 virtual AliasIdentity Identity() const { return identity_; }
4358 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } 4366 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
4359 4367
4360 private: 4368 private:
4361 const TokenPosition token_pos_; 4369 const TokenPosition token_pos_;
4362 AliasIdentity identity_; 4370 AliasIdentity identity_;
4363 4371
4364 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); 4372 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr);
4365 }; 4373 };
(...skipping 17 matching lines...) Expand all
4383 ASSERT(idx == 0); 4391 ASSERT(idx == 0);
4384 // The object may be tagged or untagged (for external objects). 4392 // The object may be tagged or untagged (for external objects).
4385 return kNoRepresentation; 4393 return kNoRepresentation;
4386 } 4394 }
4387 4395
4388 Value* object() const { return inputs_[0]; } 4396 Value* object() const { return inputs_[0]; }
4389 intptr_t offset() const { return offset_; } 4397 intptr_t offset() const { return offset_; }
4390 4398
4391 virtual bool ComputeCanDeoptimize() const { return false; } 4399 virtual bool ComputeCanDeoptimize() const { return false; }
4392 4400
4393 virtual EffectSet Effects() const { return EffectSet::None(); } 4401 virtual bool HasUnknownSideEffects() const { return false; }
4394 virtual bool AttributesEqual(Instruction* other) const { return true; } 4402 virtual bool AttributesEqual(Instruction* other) const { return true; }
4395 4403
4396 private: 4404 private:
4397 intptr_t offset_; 4405 intptr_t offset_;
4398 4406
4399 DISALLOW_COPY_AND_ASSIGN(LoadUntaggedInstr); 4407 DISALLOW_COPY_AND_ASSIGN(LoadUntaggedInstr);
4400 }; 4408 };
4401 4409
4402 class LoadClassIdInstr : public TemplateDefinition<1, NoThrow, Pure> { 4410 class LoadClassIdInstr : public TemplateDefinition<1, NoThrow, Pure> {
4403 public: 4411 public:
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
4500 // instance has the field. 4508 // instance has the field.
4501 bool Evaluate(const Object& instance_value, Object* result); 4509 bool Evaluate(const Object& instance_value, Object* result);
4502 4510
4503 virtual Definition* Canonicalize(FlowGraph* flow_graph); 4511 virtual Definition* Canonicalize(FlowGraph* flow_graph);
4504 4512
4505 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); 4513 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid);
4506 4514
4507 static bool IsFixedLengthArrayCid(intptr_t cid); 4515 static bool IsFixedLengthArrayCid(intptr_t cid);
4508 4516
4509 virtual bool AllowsCSE() const { return immutable_; } 4517 virtual bool AllowsCSE() const { return immutable_; }
4510 virtual EffectSet Effects() const { return EffectSet::None(); } 4518 virtual bool HasUnknownSideEffects() const { return false; }
4511 virtual EffectSet Dependencies() const; 4519 virtual EffectSet Dependencies() const;
4512 virtual bool AttributesEqual(Instruction* other) const; 4520 virtual bool AttributesEqual(Instruction* other) const;
4513 4521
4514 PRINT_OPERANDS_TO_SUPPORT 4522 PRINT_OPERANDS_TO_SUPPORT
4515 4523
4516 private: 4524 private:
4517 const intptr_t offset_in_bytes_; 4525 const intptr_t offset_in_bytes_;
4518 const AbstractType& type_; 4526 const AbstractType& type_;
4519 intptr_t result_cid_; 4527 intptr_t result_cid_;
4520 bool immutable_; 4528 bool immutable_;
(...skipping 20 matching lines...) Expand all
4541 4549
4542 DECLARE_INSTRUCTION(InstantiateType) 4550 DECLARE_INSTRUCTION(InstantiateType)
4543 4551
4544 Value* instantiator_type_arguments() const { return inputs_[0]; } 4552 Value* instantiator_type_arguments() const { return inputs_[0]; }
4545 Value* function_type_arguments() const { return inputs_[1]; } 4553 Value* function_type_arguments() const { return inputs_[1]; }
4546 const AbstractType& type() const { return type_; } 4554 const AbstractType& type() const { return type_; }
4547 virtual TokenPosition token_pos() const { return token_pos_; } 4555 virtual TokenPosition token_pos() const { return token_pos_; }
4548 4556
4549 virtual bool ComputeCanDeoptimize() const { return true; } 4557 virtual bool ComputeCanDeoptimize() const { return true; }
4550 4558
4551 virtual EffectSet Effects() const { return EffectSet::None(); } 4559 virtual bool HasUnknownSideEffects() const { return false; }
4552 4560
4553 PRINT_OPERANDS_TO_SUPPORT 4561 PRINT_OPERANDS_TO_SUPPORT
4554 4562
4555 private: 4563 private:
4556 const TokenPosition token_pos_; 4564 const TokenPosition token_pos_;
4557 const AbstractType& type_; 4565 const AbstractType& type_;
4558 4566
4559 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeInstr); 4567 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeInstr);
4560 }; 4568 };
4561 4569
(...skipping 17 matching lines...) Expand all
4579 DECLARE_INSTRUCTION(InstantiateTypeArguments) 4587 DECLARE_INSTRUCTION(InstantiateTypeArguments)
4580 4588
4581 Value* instantiator_type_arguments() const { return inputs_[0]; } 4589 Value* instantiator_type_arguments() const { return inputs_[0]; }
4582 Value* function_type_arguments() const { return inputs_[1]; } 4590 Value* function_type_arguments() const { return inputs_[1]; }
4583 const TypeArguments& type_arguments() const { return type_arguments_; } 4591 const TypeArguments& type_arguments() const { return type_arguments_; }
4584 const Class& instantiator_class() const { return instantiator_class_; } 4592 const Class& instantiator_class() const { return instantiator_class_; }
4585 virtual TokenPosition token_pos() const { return token_pos_; } 4593 virtual TokenPosition token_pos() const { return token_pos_; }
4586 4594
4587 virtual bool ComputeCanDeoptimize() const { return true; } 4595 virtual bool ComputeCanDeoptimize() const { return true; }
4588 4596
4589 virtual EffectSet Effects() const { return EffectSet::None(); } 4597 virtual bool HasUnknownSideEffects() const { return false; }
4590 4598
4591 virtual Definition* Canonicalize(FlowGraph* flow_graph); 4599 virtual Definition* Canonicalize(FlowGraph* flow_graph);
4592 4600
4593 PRINT_OPERANDS_TO_SUPPORT 4601 PRINT_OPERANDS_TO_SUPPORT
4594 4602
4595 private: 4603 private:
4596 const TokenPosition token_pos_; 4604 const TokenPosition token_pos_;
4597 const TypeArguments& type_arguments_; 4605 const TypeArguments& type_arguments_;
4598 const Class& instantiator_class_; 4606 const Class& instantiator_class_;
4599 4607
4600 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr); 4608 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr);
4601 }; 4609 };
4602 4610
4603 class AllocateContextInstr : public TemplateDefinition<0, NoThrow> { 4611 class AllocateContextInstr : public TemplateDefinition<0, NoThrow> {
4604 public: 4612 public:
4605 AllocateContextInstr(TokenPosition token_pos, intptr_t num_context_variables) 4613 AllocateContextInstr(TokenPosition token_pos, intptr_t num_context_variables)
4606 : token_pos_(token_pos), num_context_variables_(num_context_variables) {} 4614 : token_pos_(token_pos), num_context_variables_(num_context_variables) {}
4607 4615
4608 DECLARE_INSTRUCTION(AllocateContext) 4616 DECLARE_INSTRUCTION(AllocateContext)
4609 virtual CompileType ComputeType() const; 4617 virtual CompileType ComputeType() const;
4610 4618
4611 virtual TokenPosition token_pos() const { return token_pos_; } 4619 virtual TokenPosition token_pos() const { return token_pos_; }
4612 intptr_t num_context_variables() const { return num_context_variables_; } 4620 intptr_t num_context_variables() const { return num_context_variables_; }
4613 4621
4614 virtual bool ComputeCanDeoptimize() const { return false; } 4622 virtual bool ComputeCanDeoptimize() const { return false; }
4615 4623
4616 virtual EffectSet Effects() const { return EffectSet::None(); } 4624 virtual bool HasUnknownSideEffects() const { return false; }
4617 4625
4618 PRINT_OPERANDS_TO_SUPPORT 4626 PRINT_OPERANDS_TO_SUPPORT
4619 4627
4620 private: 4628 private:
4621 const TokenPosition token_pos_; 4629 const TokenPosition token_pos_;
4622 const intptr_t num_context_variables_; 4630 const intptr_t num_context_variables_;
4623 4631
4624 DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr); 4632 DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr);
4625 }; 4633 };
4626 4634
4627 class InitStaticFieldInstr : public TemplateInstruction<1, Throws> { 4635 class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
4628 public: 4636 public:
4629 InitStaticFieldInstr(Value* input, const Field& field, intptr_t deopt_id) 4637 InitStaticFieldInstr(Value* input, const Field& field, intptr_t deopt_id)
4630 : TemplateInstruction(deopt_id), field_(field) { 4638 : TemplateInstruction(deopt_id), field_(field) {
4631 SetInputAt(0, input); 4639 SetInputAt(0, input);
4632 CheckField(field); 4640 CheckField(field);
4633 } 4641 }
4634 4642
4635 virtual TokenPosition token_pos() const { return field_.token_pos(); } 4643 virtual TokenPosition token_pos() const { return field_.token_pos(); }
4636 const Field& field() const { return field_; } 4644 const Field& field() const { return field_; }
4637 4645
4638 DECLARE_INSTRUCTION(InitStaticField) 4646 DECLARE_INSTRUCTION(InitStaticField)
4639 4647
4640 virtual bool ComputeCanDeoptimize() const { return true; } 4648 virtual bool ComputeCanDeoptimize() const { return true; }
4641 virtual EffectSet Effects() const { return EffectSet::All(); } 4649 virtual bool HasUnknownSideEffects() const { return true; }
4642 virtual Instruction* Canonicalize(FlowGraph* flow_graph); 4650 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
4643 4651
4644 private: 4652 private:
4645 const Field& field_; 4653 const Field& field_;
4646 4654
4647 DISALLOW_COPY_AND_ASSIGN(InitStaticFieldInstr); 4655 DISALLOW_COPY_AND_ASSIGN(InitStaticFieldInstr);
4648 }; 4656 };
4649 4657
4650 class CloneContextInstr : public TemplateDefinition<1, NoThrow> { 4658 class CloneContextInstr : public TemplateDefinition<1, NoThrow> {
4651 public: 4659 public:
4652 CloneContextInstr(TokenPosition token_pos, 4660 CloneContextInstr(TokenPosition token_pos,
4653 Value* context_value, 4661 Value* context_value,
4654 intptr_t deopt_id) 4662 intptr_t deopt_id)
4655 : TemplateDefinition(deopt_id), token_pos_(token_pos) { 4663 : TemplateDefinition(deopt_id), token_pos_(token_pos) {
4656 SetInputAt(0, context_value); 4664 SetInputAt(0, context_value);
4657 } 4665 }
4658 4666
4659 virtual TokenPosition token_pos() const { return token_pos_; } 4667 virtual TokenPosition token_pos() const { return token_pos_; }
4660 Value* context_value() const { return inputs_[0]; } 4668 Value* context_value() const { return inputs_[0]; }
4661 4669
4662 DECLARE_INSTRUCTION(CloneContext) 4670 DECLARE_INSTRUCTION(CloneContext)
4663 virtual CompileType ComputeType() const; 4671 virtual CompileType ComputeType() const;
4664 4672
4665 virtual bool ComputeCanDeoptimize() const { return true; } 4673 virtual bool ComputeCanDeoptimize() const { return true; }
4666 4674
4667 virtual EffectSet Effects() const { return EffectSet::None(); } 4675 virtual bool HasUnknownSideEffects() const { return false; }
4668 4676
4669 private: 4677 private:
4670 const TokenPosition token_pos_; 4678 const TokenPosition token_pos_;
4671 4679
4672 DISALLOW_COPY_AND_ASSIGN(CloneContextInstr); 4680 DISALLOW_COPY_AND_ASSIGN(CloneContextInstr);
4673 }; 4681 };
4674 4682
4675 class CheckEitherNonSmiInstr : public TemplateInstruction<2, NoThrow, Pure> { 4683 class CheckEitherNonSmiInstr : public TemplateInstruction<2, NoThrow, Pure> {
4676 public: 4684 public:
4677 CheckEitherNonSmiInstr(Value* left, Value* right, intptr_t deopt_id) 4685 CheckEitherNonSmiInstr(Value* left, Value* right, intptr_t deopt_id)
(...skipping 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after
6736 SetInputAt(1, right); 6744 SetInputAt(1, right);
6737 } 6745 }
6738 6746
6739 InstanceCallInstr* call() const { return call_; } 6747 InstanceCallInstr* call() const { return call_; }
6740 Token::Kind op_kind() const { return op_kind_; } 6748 Token::Kind op_kind() const { return op_kind_; }
6741 Value* left() const { return inputs_[0]; } 6749 Value* left() const { return inputs_[0]; }
6742 Value* right() const { return inputs_[1]; } 6750 Value* right() const { return inputs_[1]; }
6743 6751
6744 virtual bool ComputeCanDeoptimize() const { return false; } 6752 virtual bool ComputeCanDeoptimize() const { return false; }
6745 6753
6746 virtual EffectSet Effects() const { return EffectSet::All(); } 6754 virtual bool HasUnknownSideEffects() const { return true; }
6747 6755
6748 virtual Definition* Canonicalize(FlowGraph* flow_graph); 6756 virtual Definition* Canonicalize(FlowGraph* flow_graph);
6749 6757
6750 PRINT_OPERANDS_TO_SUPPORT 6758 PRINT_OPERANDS_TO_SUPPORT
6751 6759
6752 DECLARE_INSTRUCTION(CheckedSmiOp) 6760 DECLARE_INSTRUCTION(CheckedSmiOp)
6753 6761
6754 private: 6762 private:
6755 InstanceCallInstr* call_; 6763 InstanceCallInstr* call_;
6756 const Token::Kind op_kind_; 6764 const Token::Kind op_kind_;
(...skipping 20 matching lines...) Expand all
6777 6785
6778 virtual Definition* Canonicalize(FlowGraph* flow_graph); 6786 virtual Definition* Canonicalize(FlowGraph* flow_graph);
6779 6787
6780 virtual void NegateComparison() { 6788 virtual void NegateComparison() {
6781 ComparisonInstr::NegateComparison(); 6789 ComparisonInstr::NegateComparison();
6782 is_negated_ = !is_negated_; 6790 is_negated_ = !is_negated_;
6783 } 6791 }
6784 6792
6785 bool is_negated() const { return is_negated_; } 6793 bool is_negated() const { return is_negated_; }
6786 6794
6787 virtual EffectSet Effects() const { return EffectSet::All(); } 6795 virtual bool HasUnknownSideEffects() const { return true; }
6788 6796
6789 PRINT_OPERANDS_TO_SUPPORT 6797 PRINT_OPERANDS_TO_SUPPORT
6790 6798
6791 DECLARE_INSTRUCTION(CheckedSmiComparison) 6799 DECLARE_INSTRUCTION(CheckedSmiComparison)
6792 6800
6793 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); 6801 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch);
6794 6802
6795 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, 6803 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
6796 BranchLabels labels); 6804 BranchLabels labels);
6797 6805
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
7173 virtual TokenPosition token_pos() const { return token_pos_; } 7181 virtual TokenPosition token_pos() const { return token_pos_; }
7174 bool in_loop() const { return loop_depth_ > 0; } 7182 bool in_loop() const { return loop_depth_ > 0; }
7175 intptr_t loop_depth() const { return loop_depth_; } 7183 intptr_t loop_depth() const { return loop_depth_; }
7176 7184
7177 DECLARE_INSTRUCTION(CheckStackOverflow) 7185 DECLARE_INSTRUCTION(CheckStackOverflow)
7178 7186
7179 virtual bool ComputeCanDeoptimize() const { return true; } 7187 virtual bool ComputeCanDeoptimize() const { return true; }
7180 7188
7181 virtual Instruction* Canonicalize(FlowGraph* flow_graph); 7189 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
7182 7190
7183 virtual EffectSet Effects() const { return EffectSet::None(); } 7191 virtual bool HasUnknownSideEffects() const { return false; }
7184 7192
7185 PRINT_OPERANDS_TO_SUPPORT 7193 PRINT_OPERANDS_TO_SUPPORT
7186 7194
7187 private: 7195 private:
7188 const TokenPosition token_pos_; 7196 const TokenPosition token_pos_;
7189 const intptr_t loop_depth_; 7197 const intptr_t loop_depth_;
7190 const Kind kind_; 7198 const Kind kind_;
7191 7199
7192 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr); 7200 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr);
7193 }; 7201 };
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
7285 Value* value() const { return inputs_[0]; } 7293 Value* value() const { return inputs_[0]; }
7286 InstanceCallInstr* instance_call() const { return instance_call_; } 7294 InstanceCallInstr* instance_call() const { return instance_call_; }
7287 7295
7288 DECLARE_INSTRUCTION(DoubleToInteger) 7296 DECLARE_INSTRUCTION(DoubleToInteger)
7289 virtual CompileType ComputeType() const; 7297 virtual CompileType ComputeType() const;
7290 7298
7291 virtual intptr_t ArgumentCount() const { return 1; } 7299 virtual intptr_t ArgumentCount() const { return 1; }
7292 7300
7293 virtual bool ComputeCanDeoptimize() const { return true; } 7301 virtual bool ComputeCanDeoptimize() const { return true; }
7294 7302
7295 virtual EffectSet Effects() const { return EffectSet::None(); } 7303 virtual bool HasUnknownSideEffects() const { return false; }
7296 7304
7297 private: 7305 private:
7298 InstanceCallInstr* instance_call_; 7306 InstanceCallInstr* instance_call_;
7299 7307
7300 DISALLOW_COPY_AND_ASSIGN(DoubleToIntegerInstr); 7308 DISALLOW_COPY_AND_ASSIGN(DoubleToIntegerInstr);
7301 }; 7309 };
7302 7310
7303 // Similar to 'DoubleToIntegerInstr' but expects unboxed double as input 7311 // Similar to 'DoubleToIntegerInstr' but expects unboxed double as input
7304 // and creates a Smi. 7312 // and creates a Smi.
7305 class DoubleToSmiInstr : public TemplateDefinition<1, NoThrow, Pure> { 7313 class DoubleToSmiInstr : public TemplateDefinition<1, NoThrow, Pure> {
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
7606 7614
7607 bool IsDeoptIfNull() const; 7615 bool IsDeoptIfNull() const;
7608 bool IsDeoptIfNotNull() const; 7616 bool IsDeoptIfNotNull() const;
7609 7617
7610 bool IsBitTest() const; 7618 bool IsBitTest() const;
7611 static bool IsCompactCidRange(const Cids& cids); 7619 static bool IsCompactCidRange(const Cids& cids);
7612 intptr_t ComputeCidMask() const; 7620 intptr_t ComputeCidMask() const;
7613 7621
7614 virtual bool AllowsCSE() const { return true; } 7622 virtual bool AllowsCSE() const { return true; }
7615 virtual EffectSet Dependencies() const { return EffectSet::None(); } 7623 virtual EffectSet Dependencies() const { return EffectSet::None(); }
7616 virtual EffectSet Effects() const { return EffectSet::None(); } 7624 virtual bool HasUnknownSideEffects() const { return false; }
7617 virtual bool AttributesEqual(Instruction* other) const; 7625 virtual bool AttributesEqual(Instruction* other) const;
7618 7626
7619 bool licm_hoisted() const { return licm_hoisted_; } 7627 bool licm_hoisted() const { return licm_hoisted_; }
7620 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } 7628 void set_licm_hoisted(bool value) { licm_hoisted_ = value; }
7621 7629
7622 PRINT_OPERANDS_TO_SUPPORT 7630 PRINT_OPERANDS_TO_SUPPORT
7623 7631
7624 private: 7632 private:
7625 const Cids& cids_; 7633 const Cids& cids_;
7626 bool licm_hoisted_; 7634 bool licm_hoisted_;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
7686 const CidRange& cids() const { return cids_; } 7694 const CidRange& cids() const { return cids_; }
7687 7695
7688 DECLARE_INSTRUCTION(CheckClassId) 7696 DECLARE_INSTRUCTION(CheckClassId)
7689 7697
7690 virtual bool ComputeCanDeoptimize() const { return true; } 7698 virtual bool ComputeCanDeoptimize() const { return true; }
7691 7699
7692 virtual Instruction* Canonicalize(FlowGraph* flow_graph); 7700 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
7693 7701
7694 virtual bool AllowsCSE() const { return true; } 7702 virtual bool AllowsCSE() const { return true; }
7695 virtual EffectSet Dependencies() const { return EffectSet::None(); } 7703 virtual EffectSet Dependencies() const { return EffectSet::None(); }
7696 virtual EffectSet Effects() const { return EffectSet::None(); } 7704 virtual bool HasUnknownSideEffects() const { return false; }
7697 virtual bool AttributesEqual(Instruction* other) const { return true; } 7705 virtual bool AttributesEqual(Instruction* other) const { return true; }
7698 7706
7699 PRINT_OPERANDS_TO_SUPPORT 7707 PRINT_OPERANDS_TO_SUPPORT
7700 7708
7701 private: 7709 private:
7702 bool Contains(intptr_t cid) const; 7710 bool Contains(intptr_t cid) const;
7703 7711
7704 CidRange cids_; 7712 CidRange cids_;
7705 7713
7706 DISALLOW_COPY_AND_ASSIGN(CheckClassIdInstr); 7714 DISALLOW_COPY_AND_ASSIGN(CheckClassIdInstr);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
7752 public: 7760 public:
7753 GenericCheckBoundInstr(Value* length, Value* index, intptr_t deopt_id) 7761 GenericCheckBoundInstr(Value* length, Value* index, intptr_t deopt_id)
7754 : TemplateInstruction(deopt_id) { 7762 : TemplateInstruction(deopt_id) {
7755 SetInputAt(kLengthPos, length); 7763 SetInputAt(kLengthPos, length);
7756 SetInputAt(kIndexPos, index); 7764 SetInputAt(kIndexPos, index);
7757 } 7765 }
7758 7766
7759 Value* length() const { return inputs_[kLengthPos]; } 7767 Value* length() const { return inputs_[kLengthPos]; }
7760 Value* index() const { return inputs_[kIndexPos]; } 7768 Value* index() const { return inputs_[kIndexPos]; }
7761 7769
7762 virtual EffectSet Effects() const { return EffectSet::None(); } 7770 virtual bool HasUnknownSideEffects() const { return false; }
7763 virtual EffectSet Dependencies() const { return EffectSet::None(); } 7771 virtual EffectSet Dependencies() const { return EffectSet::None(); }
7764 7772
7765 DECLARE_INSTRUCTION(GenericCheckBound) 7773 DECLARE_INSTRUCTION(GenericCheckBound)
7766 7774
7767 virtual bool ComputeCanDeoptimize() const { return true; } 7775 virtual bool ComputeCanDeoptimize() const { return true; }
7768 7776
7769 // Give a name to the location/input indices. 7777 // Give a name to the location/input indices.
7770 enum { kLengthPos = 0, kIndexPos = 1 }; 7778 enum { kLengthPos = 0, kIndexPos = 1 };
7771 7779
7772 private: 7780 private:
(...skipping 30 matching lines...) Expand all
7803 7811
7804 virtual bool ComputeCanDeoptimize() const; 7812 virtual bool ComputeCanDeoptimize() const;
7805 7813
7806 virtual Representation representation() const { return to(); } 7814 virtual Representation representation() const { return to(); }
7807 7815
7808 virtual Representation RequiredInputRepresentation(intptr_t idx) const { 7816 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
7809 ASSERT(idx == 0); 7817 ASSERT(idx == 0);
7810 return from(); 7818 return from();
7811 } 7819 }
7812 7820
7813 virtual EffectSet Effects() const { return EffectSet::None(); } 7821 virtual bool HasUnknownSideEffects() const { return false; }
7814 virtual EffectSet Dependencies() const { return EffectSet::None(); } 7822 virtual EffectSet Dependencies() const { return EffectSet::None(); }
7815 virtual bool AttributesEqual(Instruction* other) const { 7823 virtual bool AttributesEqual(Instruction* other) const {
7816 ASSERT(other->IsUnboxedIntConverter()); 7824 ASSERT(other->IsUnboxedIntConverter());
7817 UnboxedIntConverterInstr* converter = other->AsUnboxedIntConverter(); 7825 UnboxedIntConverterInstr* converter = other->AsUnboxedIntConverter();
7818 return (converter->from() == from()) && (converter->to() == to()) && 7826 return (converter->from() == from()) && (converter->to() == to()) &&
7819 (converter->is_truncating() == is_truncating()); 7827 (converter->is_truncating() == is_truncating());
7820 } 7828 }
7821 7829
7822 virtual void InferRange(RangeAnalysis* analysis, Range* range); 7830 virtual void InferRange(RangeAnalysis* analysis, Range* range);
7823 7831
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
8095 #define DEFINE_UNIMPLEMENTED_INSTRUCTION(Name) \ 8103 #define DEFINE_UNIMPLEMENTED_INSTRUCTION(Name) \
8096 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ 8104 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \
8097 UNIMPLEMENTED(); \ 8105 UNIMPLEMENTED(); \
8098 return NULL; \ 8106 return NULL; \
8099 } \ 8107 } \
8100 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8108 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8101 8109
8102 } // namespace dart 8110 } // namespace dart
8103 8111
8104 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 8112 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698