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