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

Unified Diff: runtime/vm/intermediate_language.h

Issue 642693005: Revert "IR refactoring: reduce duplication related to MayThrow/AllowsCSE." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 26733a585370b739daf8a4cdcadb6ebbfb860212..d312a8e171e51991a6ce3491c9fa3a284caee022 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -876,57 +876,15 @@ FOR_EACH_ABSTRACT_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
};
-class PureInstruction : public Instruction {
+template<intptr_t N>
+class TemplateInstruction: public Instruction {
public:
- explicit PureInstruction(intptr_t deopt_id)
- : Instruction(deopt_id) { }
-
- virtual bool AllowsCSE() const { return true; }
- virtual EffectSet Dependencies() const { return EffectSet::None(); }
-
- virtual EffectSet Effects() const { return EffectSet::None(); }
-};
-
-
-// Types to be used as ThrowsTrait for TemplateInstruction/TemplateDefinition.
-struct Throws {
- static const bool kCanThrow = true;
-};
-
-
-struct NoThrow {
- static const bool kCanThrow = false;
-};
-
-
-// Types to be used as CSETrait for TemplateInstruction/TemplateDefinition.
-// Pure instructions are those that allow CSE and have no effects and
-// no dependencies.
-template<typename DefaultBase, typename PureBase>
-struct Pure {
- typedef PureBase Base;
-};
-
-
-template<typename DefaultBase, typename PureBase>
-struct NoCSE {
- typedef DefaultBase Base;
-};
-
-
-template<intptr_t N,
- typename ThrowsTrait,
- template<typename Default, typename Pure> class CSETrait = NoCSE>
-class TemplateInstruction: public CSETrait<Instruction, PureInstruction>::Base {
- public:
- explicit TemplateInstruction(intptr_t deopt_id = Isolate::kNoDeoptId)
- : CSETrait<Instruction, PureInstruction>::Base(deopt_id), inputs_() { }
+ explicit TemplateInstruction<N>(intptr_t deopt_id = Isolate::kNoDeoptId)
+ : Instruction(deopt_id), inputs_() { }
virtual intptr_t InputCount() const { return N; }
virtual Value* InputAt(intptr_t i) const { return inputs_[i]; }
- virtual bool MayThrow() const { return ThrowsTrait::kCanThrow; }
-
protected:
EmbeddedArray<Value*, N> inputs_;
@@ -995,7 +953,7 @@ class MoveOperands : public ZoneAllocated {
};
-class ParallelMoveInstr : public TemplateInstruction<0, NoThrow> {
+class ParallelMoveInstr : public TemplateInstruction<0> {
public:
ParallelMoveInstr() : moves_(4) { }
@@ -1029,6 +987,8 @@ class ParallelMoveInstr : public TemplateInstruction<0, NoThrow> {
virtual void PrintTo(BufferFormatter* f) const;
+ virtual bool MayThrow() const { return false; }
+
private:
GrowableArray<MoveOperands*> moves_; // Elements cannot be null.
@@ -1782,31 +1742,15 @@ inline void Value::BindToEnvironment(Definition* def) {
}
-class PureDefinition : public Definition {
- public:
- explicit PureDefinition(intptr_t deopt_id)
- : Definition(deopt_id) { }
-
- virtual bool AllowsCSE() const { return true; }
- virtual EffectSet Dependencies() const { return EffectSet::None(); }
-
- virtual EffectSet Effects() const { return EffectSet::None(); }
-};
-
-
-template<intptr_t N,
- typename ThrowsTrait,
- template<typename Impure, typename Pure> class CSETrait = NoCSE>
-class TemplateDefinition : public CSETrait<Definition, PureDefinition>::Base {
+template<intptr_t N>
+class TemplateDefinition : public Definition {
public:
- explicit TemplateDefinition(intptr_t deopt_id = Isolate::kNoDeoptId)
- : CSETrait<Definition, PureDefinition>::Base(deopt_id), inputs_() { }
+ explicit TemplateDefinition<N>(intptr_t deopt_id = Isolate::kNoDeoptId)
+ : Definition(deopt_id), inputs_() { }
virtual intptr_t InputCount() const { return N; }
virtual Value* InputAt(intptr_t i) const { return inputs_[i]; }
- virtual bool MayThrow() const { return ThrowsTrait::kCanThrow; }
-
protected:
EmbeddedArray<Value*, N> inputs_;
@@ -1979,7 +1923,7 @@ class ParameterInstr : public Definition {
};
-class PushArgumentInstr : public TemplateDefinition<1, NoThrow> {
+class PushArgumentInstr : public TemplateDefinition<1> {
public:
explicit PushArgumentInstr(Value* value) {
SetInputAt(0, value);
@@ -1999,6 +1943,8 @@ class PushArgumentInstr : public TemplateDefinition<1, NoThrow> {
virtual void PrintOperandsTo(BufferFormatter* f) const;
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(PushArgumentInstr);
};
@@ -2009,10 +1955,10 @@ inline Definition* Instruction::ArgumentAt(intptr_t index) const {
}
-class ReturnInstr : public TemplateInstruction<1, NoThrow> {
+class ReturnInstr : public TemplateInstruction<1> {
public:
ReturnInstr(intptr_t token_pos, Value* value)
- : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+ : TemplateInstruction<1>(Isolate::Current()->GetNextDeoptId()),
token_pos_(token_pos) {
SetInputAt(0, value);
}
@@ -2034,6 +1980,8 @@ class ReturnInstr : public TemplateInstruction<1, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
private:
const intptr_t token_pos_;
@@ -2041,10 +1989,10 @@ class ReturnInstr : public TemplateInstruction<1, NoThrow> {
};
-class ThrowInstr : public TemplateInstruction<0, Throws> {
+class ThrowInstr : public TemplateInstruction<0> {
public:
explicit ThrowInstr(intptr_t token_pos)
- : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+ : TemplateInstruction<0>(Isolate::Current()->GetNextDeoptId()),
token_pos_(token_pos) {
}
@@ -2058,6 +2006,8 @@ class ThrowInstr : public TemplateInstruction<0, Throws> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return true; }
+
private:
const intptr_t token_pos_;
@@ -2065,12 +2015,12 @@ class ThrowInstr : public TemplateInstruction<0, Throws> {
};
-class ReThrowInstr : public TemplateInstruction<0, Throws> {
+class ReThrowInstr : public TemplateInstruction<0> {
public:
// 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the
// rethrow has been artifically generated by the parser.
ReThrowInstr(intptr_t token_pos, intptr_t catch_try_index)
- : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+ : TemplateInstruction<0>(Isolate::Current()->GetNextDeoptId()),
token_pos_(token_pos),
catch_try_index_(catch_try_index) {
}
@@ -2086,6 +2036,8 @@ class ReThrowInstr : public TemplateInstruction<0, Throws> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return true; }
+
private:
const intptr_t token_pos_;
const intptr_t catch_try_index_;
@@ -2094,10 +2046,10 @@ class ReThrowInstr : public TemplateInstruction<0, Throws> {
};
-class GotoInstr : public TemplateInstruction<0, NoThrow> {
+class GotoInstr : public TemplateInstruction<0> {
public:
explicit GotoInstr(JoinEntryInstr* entry)
- : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+ : TemplateInstruction<0>(Isolate::Current()->GetNextDeoptId()),
successor_(entry),
edge_weight_(0.0),
parallel_move_(NULL) {
@@ -2147,6 +2099,8 @@ class GotoInstr : public TemplateInstruction<0, NoThrow> {
virtual void PrintTo(BufferFormatter* f) const;
+ virtual bool MayThrow() const { return false; }
+
private:
JoinEntryInstr* successor_;
double edge_weight_;
@@ -2157,7 +2111,7 @@ class GotoInstr : public TemplateInstruction<0, NoThrow> {
};
-class ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class ComparisonInstr : public TemplateDefinition<2> {
public:
Value* left() const { return inputs_[0]; }
Value* right() const { return inputs_[1]; }
@@ -2188,12 +2142,6 @@ class ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
virtual bool CanBecomeDeoptimizationTarget() const { return true; }
virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
- virtual bool AttributesEqual(Instruction* other) const {
- ComparisonInstr* other_comparison = other->AsComparison();
- return kind() == other_comparison->kind() &&
- (operation_cid() == other_comparison->operation_cid());
- }
-
DEFINE_INSTRUCTION_TYPE_CHECK(Comparison)
protected:
@@ -2202,7 +2150,7 @@ class ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
Value* left,
Value* right,
intptr_t deopt_id = Isolate::kNoDeoptId)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<2>(deopt_id),
token_pos_(token_pos),
kind_(kind),
operation_cid_(kIllegalCid) {
@@ -2330,7 +2278,7 @@ class BranchInstr : public Instruction {
};
-class StoreContextInstr : public TemplateInstruction<1, NoThrow> {
+class StoreContextInstr : public TemplateInstruction<1> {
public:
explicit StoreContextInstr(Value* value) {
SetInputAt(kValuePos, value);
@@ -2350,15 +2298,17 @@ class StoreContextInstr : public TemplateInstruction<1, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(StoreContextInstr);
};
-class DeoptimizeInstr : public TemplateInstruction<0, NoThrow, Pure> {
+class DeoptimizeInstr : public TemplateInstruction<0> {
public:
DeoptimizeInstr(ICData::DeoptReasonId deopt_reason, intptr_t deopt_id)
- : TemplateInstruction(deopt_id),
+ : TemplateInstruction<0>(deopt_id),
deopt_reason_(deopt_reason) {
}
@@ -2366,10 +2316,15 @@ class DeoptimizeInstr : public TemplateInstruction<0, NoThrow, Pure> {
virtual bool CanDeoptimize() const { return true; }
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return true;
}
+ virtual bool MayThrow() const { return false; }
+
DECLARE_INSTRUCTION(Deoptimize)
private:
@@ -2379,7 +2334,7 @@ class DeoptimizeInstr : public TemplateInstruction<0, NoThrow, Pure> {
};
-class RedefinitionInstr : public TemplateDefinition<1, NoThrow> {
+class RedefinitionInstr : public TemplateDefinition<1> {
public:
explicit RedefinitionInstr(Value* value) {
SetInputAt(0, value);
@@ -2396,12 +2351,14 @@ class RedefinitionInstr : public TemplateDefinition<1, NoThrow> {
virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(RedefinitionInstr);
};
-class ConstraintInstr : public TemplateDefinition<1, NoThrow> {
+class ConstraintInstr : public TemplateDefinition<1> {
public:
ConstraintInstr(Value* value, Range* constraint)
: constraint_(constraint),
@@ -2422,6 +2379,8 @@ class ConstraintInstr : public TemplateDefinition<1, NoThrow> {
return false;
}
+ virtual bool MayThrow() const { return false; }
+
virtual void PrintOperandsTo(BufferFormatter* f) const;
Value* value() const { return inputs_[0]; }
@@ -2447,7 +2406,7 @@ class ConstraintInstr : public TemplateDefinition<1, NoThrow> {
};
-class ConstantInstr : public TemplateDefinition<0, NoThrow, Pure> {
+class ConstantInstr : public TemplateDefinition<0> {
public:
explicit ConstantInstr(const Object& value);
@@ -2464,8 +2423,13 @@ class ConstantInstr : public TemplateDefinition<0, NoThrow, Pure> {
virtual void InferRange(RangeAnalysis* analysis, Range* range);
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const;
+ virtual bool MayThrow() const { return false; }
+
private:
const Object& value_;
@@ -2498,7 +2462,7 @@ class UnboxedConstantInstr : public ConstantInstr {
};
-class AssertAssignableInstr : public TemplateDefinition<3, Throws, Pure> {
+class AssertAssignableInstr : public TemplateDefinition<3> {
public:
AssertAssignableInstr(intptr_t token_pos,
Value* value,
@@ -2507,7 +2471,7 @@ class AssertAssignableInstr : public TemplateDefinition<3, Throws, Pure> {
const AbstractType& dst_type,
const String& dst_name,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<3>(deopt_id),
token_pos_(token_pos),
dst_type_(AbstractType::ZoneHandle(dst_type.raw())),
dst_name_(dst_name) {
@@ -2545,8 +2509,13 @@ class AssertAssignableInstr : public TemplateDefinition<3, Throws, Pure> {
virtual Definition* Canonicalize(FlowGraph* flow_graph);
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const;
+ virtual bool MayThrow() const { return true; }
+
private:
const intptr_t token_pos_;
AbstractType& dst_type_;
@@ -2556,10 +2525,10 @@ class AssertAssignableInstr : public TemplateDefinition<3, Throws, Pure> {
};
-class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
+class AssertBooleanInstr : public TemplateDefinition<1> {
public:
AssertBooleanInstr(intptr_t token_pos, Value* value)
- : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+ : TemplateDefinition<1>(Isolate::Current()->GetNextDeoptId()),
token_pos_(token_pos) {
SetInputAt(0, value);
}
@@ -2576,8 +2545,13 @@ class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
virtual Definition* Canonicalize(FlowGraph* flow_graph);
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return true; }
+
private:
const intptr_t token_pos_;
@@ -2587,10 +2561,10 @@ class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
// Denotes the current context, normally held in a register. This is
// a computation, not a value, because it's mutable.
-class CurrentContextInstr : public TemplateDefinition<0, NoThrow> {
+class CurrentContextInstr : public TemplateDefinition<0> {
public:
CurrentContextInstr()
- : TemplateDefinition(Isolate::Current()->GetNextDeoptId()) {
+ : TemplateDefinition<0>(Isolate::Current()->GetNextDeoptId()) {
}
DECLARE_INSTRUCTION(CurrentContext)
@@ -2602,17 +2576,19 @@ class CurrentContextInstr : public TemplateDefinition<0, NoThrow> {
virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr);
};
-class ClosureCallInstr : public TemplateDefinition<1, Throws> {
+class ClosureCallInstr : public TemplateDefinition<1> {
public:
ClosureCallInstr(Value* function,
ClosureCallNode* node,
ZoneGrowableArray<PushArgumentInstr*>* arguments)
- : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+ : TemplateDefinition<1>(Isolate::Current()->GetNextDeoptId()),
ast_node_(*node),
arguments_(arguments) {
SetInputAt(0, function);
@@ -2637,6 +2613,8 @@ class ClosureCallInstr : public TemplateDefinition<1, Throws> {
virtual EffectSet Effects() const { return EffectSet::All(); }
+ virtual bool MayThrow() const { return true; }
+
private:
const ClosureCallNode& ast_node_;
ZoneGrowableArray<PushArgumentInstr*>* arguments_;
@@ -2645,7 +2623,7 @@ class ClosureCallInstr : public TemplateDefinition<1, Throws> {
};
-class InstanceCallInstr : public TemplateDefinition<0, Throws> {
+class InstanceCallInstr : public TemplateDefinition<0> {
public:
InstanceCallInstr(intptr_t token_pos,
const String& function_name,
@@ -2654,7 +2632,7 @@ class InstanceCallInstr : public TemplateDefinition<0, Throws> {
const Array& argument_names,
intptr_t checked_argument_count,
const ZoneGrowableArray<const ICData*>& ic_data_array)
- : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+ : TemplateDefinition<0>(Isolate::Current()->GetNextDeoptId()),
ic_data_(NULL),
token_pos_(token_pos),
function_name_(function_name),
@@ -2710,6 +2688,8 @@ class InstanceCallInstr : public TemplateDefinition<0, Throws> {
virtual EffectSet Effects() const { return EffectSet::All(); }
+ virtual bool MayThrow() const { return true; }
+
protected:
friend class FlowGraphOptimizer;
void set_ic_data(ICData* value) { ic_data_ = value; }
@@ -2727,12 +2707,12 @@ class InstanceCallInstr : public TemplateDefinition<0, Throws> {
};
-class PolymorphicInstanceCallInstr : public TemplateDefinition<0, Throws> {
+class PolymorphicInstanceCallInstr : public TemplateDefinition<0> {
public:
PolymorphicInstanceCallInstr(InstanceCallInstr* instance_call,
const ICData& ic_data,
bool with_checks)
- : TemplateDefinition(instance_call->deopt_id()),
+ : TemplateDefinition<0>(instance_call->deopt_id()),
instance_call_(instance_call),
ic_data_(ic_data),
with_checks_(with_checks) {
@@ -2767,6 +2747,8 @@ class PolymorphicInstanceCallInstr : public TemplateDefinition<0, Throws> {
virtual void PrintOperandsTo(BufferFormatter* f) const;
+ virtual bool MayThrow() const { return true; }
+
private:
InstanceCallInstr* instance_call_;
const ICData& ic_data_;
@@ -2805,7 +2787,12 @@ class StrictCompareInstr : public ComparisonInstr {
bool needs_number_check() const { return needs_number_check_; }
void set_needs_number_check(bool value) { needs_number_check_ = value; }
- bool AttributesEqual(Instruction* other) const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
+ virtual bool AttributesEqual(Instruction* other) const;
+
+ virtual bool MayThrow() const { return false; }
private:
// True if the comparison must check for double, Mint or Bigint and
@@ -2837,6 +2824,10 @@ class TestSmiInstr : public ComparisonInstr {
return kTagged;
}
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+
+ virtual bool MayThrow() const { return false; }
+
virtual void EmitBranchCode(FlowGraphCompiler* compiler,
BranchInstr* branch);
@@ -2885,6 +2876,12 @@ class TestCidsInstr : public ComparisonInstr {
return kTagged;
}
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
+
+ virtual bool MayThrow() const { return false; }
+
virtual bool AttributesEqual(Instruction* other) const;
virtual void EmitBranchCode(FlowGraphCompiler* compiler,
@@ -2937,6 +2934,10 @@ class EqualityCompareInstr : public ComparisonInstr {
return kTagged;
}
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(EqualityCompareInstr);
};
@@ -2978,6 +2979,12 @@ class RelationalOpInstr : public ComparisonInstr {
return kTagged;
}
+ virtual EffectSet Effects() const {
+ return EffectSet::None();
+ }
+
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(RelationalOpInstr);
};
@@ -3064,14 +3071,14 @@ class IfThenElseInstr : public Definition {
};
-class StaticCallInstr : public TemplateDefinition<0, Throws> {
+class StaticCallInstr : public TemplateDefinition<0> {
public:
StaticCallInstr(intptr_t token_pos,
const Function& function,
const Array& argument_names,
ZoneGrowableArray<PushArgumentInstr*>* arguments,
const ZoneGrowableArray<const ICData*>& ic_data_array)
- : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+ : TemplateDefinition<0>(Isolate::Current()->GetNextDeoptId()),
ic_data_(NULL),
token_pos_(token_pos),
function_(function),
@@ -3135,6 +3142,8 @@ class StaticCallInstr : public TemplateDefinition<0, Throws> {
return is_known_list_constructor() || is_native_list_factory();
}
+ virtual bool MayThrow() const { return true; }
+
virtual AliasIdentity Identity() const { return identity_; }
virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
@@ -3156,7 +3165,7 @@ class StaticCallInstr : public TemplateDefinition<0, Throws> {
};
-class LoadLocalInstr : public TemplateDefinition<0, NoThrow> {
+class LoadLocalInstr : public TemplateDefinition<0> {
public:
explicit LoadLocalInstr(const LocalVariable& local)
: local_(local), is_last_(false) { }
@@ -3178,6 +3187,11 @@ class LoadLocalInstr : public TemplateDefinition<0, NoThrow> {
void mark_last() { is_last_ = true; }
bool is_last() const { return is_last_; }
+ virtual bool MayThrow() const {
+ UNREACHABLE();
+ return false;
+ }
+
private:
const LocalVariable& local_;
bool is_last_;
@@ -3186,7 +3200,7 @@ class LoadLocalInstr : public TemplateDefinition<0, NoThrow> {
};
-class PushTempInstr : public TemplateDefinition<1, NoThrow> {
+class PushTempInstr : public TemplateDefinition<1> {
public:
explicit PushTempInstr(Value* value) {
SetInputAt(0, value);
@@ -3205,6 +3219,11 @@ class PushTempInstr : public TemplateDefinition<1, NoThrow> {
return EffectSet::None();
}
+ virtual bool MayThrow() const {
+ UNREACHABLE();
+ return false;
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(PushTempInstr);
};
@@ -3259,7 +3278,7 @@ class DropTempsInstr : public Definition {
};
-class StoreLocalInstr : public TemplateDefinition<1, NoThrow> {
+class StoreLocalInstr : public TemplateDefinition<1> {
public:
StoreLocalInstr(const LocalVariable& local, Value* value)
: local_(local), is_dead_(false), is_last_(false) {
@@ -3287,6 +3306,11 @@ class StoreLocalInstr : public TemplateDefinition<1, NoThrow> {
return EffectSet::None();
}
+ virtual bool MayThrow() const {
+ UNREACHABLE();
+ return false;
+ }
+
private:
const LocalVariable& local_;
bool is_dead_;
@@ -3296,7 +3320,7 @@ class StoreLocalInstr : public TemplateDefinition<1, NoThrow> {
};
-class NativeCallInstr : public TemplateDefinition<0, Throws> {
+class NativeCallInstr : public TemplateDefinition<0> {
public:
explicit NativeCallInstr(NativeBodyNode* node)
: ast_node_(*node) {}
@@ -3325,6 +3349,11 @@ class NativeCallInstr : public TemplateDefinition<0, Throws> {
virtual EffectSet Effects() const { return EffectSet::All(); }
+ virtual bool MayThrow() const {
+ UNREACHABLE();
+ return true;
+ }
+
private:
const NativeBodyNode& ast_node_;
@@ -3332,7 +3361,7 @@ class NativeCallInstr : public TemplateDefinition<0, Throws> {
};
-class DebugStepCheckInstr : public TemplateInstruction<0, NoThrow> {
+class DebugStepCheckInstr : public TemplateInstruction<0> {
public:
DebugStepCheckInstr(intptr_t token_pos,
RawPcDescriptors::Kind stub_kind)
@@ -3343,6 +3372,7 @@ class DebugStepCheckInstr : public TemplateInstruction<0, NoThrow> {
DECLARE_INSTRUCTION(DebugStepCheck)
virtual intptr_t token_pos() const { return token_pos_; }
+ virtual bool MayThrow() const { return false; }
virtual bool CanDeoptimize() const { return false; }
virtual EffectSet Effects() const { return EffectSet::All(); }
virtual intptr_t ArgumentCount() const { return 0; }
@@ -3362,7 +3392,7 @@ enum StoreBarrierType {
};
-class StoreInstanceFieldInstr : public TemplateDefinition<2, NoThrow> {
+class StoreInstanceFieldInstr : public TemplateDefinition<2> {
public:
StoreInstanceFieldInstr(const Field& field,
Value* instance,
@@ -3430,6 +3460,8 @@ class StoreInstanceFieldInstr : public TemplateDefinition<2, NoThrow> {
// are marked as having no side-effects.
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
bool IsUnboxedStore() const;
bool IsPotentialUnboxedStore() const;
@@ -3456,12 +3488,12 @@ class StoreInstanceFieldInstr : public TemplateDefinition<2, NoThrow> {
};
-class GuardFieldInstr : public TemplateInstruction<1, NoThrow, Pure> {
+class GuardFieldInstr : public TemplateInstruction<1> {
public:
GuardFieldInstr(Value* value,
const Field& field,
intptr_t deopt_id)
- : TemplateInstruction(deopt_id),
+ : TemplateInstruction<1>(deopt_id),
field_(field) {
SetInputAt(0, value);
}
@@ -3478,6 +3510,12 @@ class GuardFieldInstr : public TemplateInstruction<1, NoThrow, Pure> {
return true;
}
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
+
+ virtual bool MayThrow() const { return false; }
+
virtual void PrintOperandsTo(BufferFormatter* f) const;
private:
@@ -3523,7 +3561,7 @@ class GuardFieldLengthInstr : public GuardFieldInstr {
};
-class LoadStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
+class LoadStaticFieldInstr : public TemplateDefinition<1> {
public:
explicit LoadStaticFieldInstr(Value* field_value) {
ASSERT(field_value->BindsToConstant());
@@ -3546,12 +3584,14 @@ class LoadStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
virtual EffectSet Dependencies() const;
virtual bool AttributesEqual(Instruction* other) const;
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(LoadStaticFieldInstr);
};
-class StoreStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
+class StoreStaticFieldInstr : public TemplateDefinition<1> {
public:
StoreStaticFieldInstr(const Field& field, Value* value)
: field_(field) {
@@ -3578,6 +3618,8 @@ class StoreStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
// are marked as having no side-effects.
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
private:
bool CanValueBeSmi() const {
const intptr_t cid = value()->Type()->ToNullableCid();
@@ -3592,7 +3634,7 @@ class StoreStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
};
-class LoadIndexedInstr : public TemplateDefinition<2, NoThrow> {
+class LoadIndexedInstr : public TemplateDefinition<2> {
public:
LoadIndexedInstr(Value* array,
Value* index,
@@ -3600,7 +3642,7 @@ class LoadIndexedInstr : public TemplateDefinition<2, NoThrow> {
intptr_t class_id,
intptr_t deopt_id,
intptr_t token_pos)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<2>(deopt_id),
index_scale_(index_scale),
class_id_(class_id),
token_pos_(token_pos) {
@@ -3640,7 +3682,12 @@ class LoadIndexedInstr : public TemplateDefinition<2, NoThrow> {
virtual Representation representation() const;
virtual void InferRange(RangeAnalysis* analysis, Range* range);
+ virtual bool AllowsCSE() const { return false; }
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const;
+ virtual bool AttributesEqual(Instruction* other) const;
+
+ virtual bool MayThrow() const { return false; }
private:
const intptr_t index_scale_;
@@ -3651,7 +3698,7 @@ class LoadIndexedInstr : public TemplateDefinition<2, NoThrow> {
};
-class StringFromCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class StringFromCharCodeInstr : public TemplateDefinition<1> {
public:
StringFromCharCodeInstr(Value* char_code, intptr_t cid) : cid_(cid) {
ASSERT(char_code != NULL);
@@ -3668,10 +3715,15 @@ class StringFromCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
virtual bool CanDeoptimize() const { return false; }
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return other->AsStringFromCharCode()->cid_ == cid_;
}
+ virtual bool MayThrow() const { return false; }
+
private:
const intptr_t cid_;
@@ -3679,7 +3731,7 @@ class StringFromCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class StringToCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class StringToCharCodeInstr : public TemplateDefinition<1> {
public:
StringToCharCodeInstr(Value* str, intptr_t cid) : cid_(cid) {
ASSERT(str != NULL);
@@ -3693,10 +3745,15 @@ class StringToCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
virtual bool CanDeoptimize() const { return false; }
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return other->AsStringToCharCode()->cid_ == cid_;
}
+ virtual bool MayThrow() const { return false; }
+
private:
const intptr_t cid_;
@@ -3704,10 +3761,10 @@ class StringToCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class StringInterpolateInstr : public TemplateDefinition<1, Throws> {
+class StringInterpolateInstr : public TemplateDefinition<1> {
public:
StringInterpolateInstr(Value* value, intptr_t token_pos)
- : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+ : TemplateDefinition<1>(Isolate::Current()->GetNextDeoptId()),
token_pos_(token_pos),
function_(Function::Handle()) {
SetInputAt(0, value);
@@ -3720,6 +3777,7 @@ class StringInterpolateInstr : public TemplateDefinition<1, Throws> {
// Issues a static call to Dart code which calls toString on objects.
virtual EffectSet Effects() const { return EffectSet::All(); }
virtual bool CanDeoptimize() const { return true; }
+ virtual bool MayThrow() const { return true; }
const Function& CallFunction() const;
@@ -3735,7 +3793,7 @@ class StringInterpolateInstr : public TemplateDefinition<1, Throws> {
};
-class StoreIndexedInstr : public TemplateDefinition<3, NoThrow> {
+class StoreIndexedInstr : public TemplateDefinition<3> {
public:
StoreIndexedInstr(Value* array,
Value* index,
@@ -3745,7 +3803,7 @@ class StoreIndexedInstr : public TemplateDefinition<3, NoThrow> {
intptr_t class_id,
intptr_t deopt_id,
intptr_t token_pos)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<3>(deopt_id),
emit_store_barrier_(emit_store_barrier),
index_scale_(index_scale),
class_id_(class_id),
@@ -3791,6 +3849,8 @@ class StoreIndexedInstr : public TemplateDefinition<3, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
private:
const StoreBarrierType emit_store_barrier_;
const intptr_t index_scale_;
@@ -3802,7 +3862,7 @@ class StoreIndexedInstr : public TemplateDefinition<3, NoThrow> {
// Note overrideable, built-in: value ? false : true.
-class BooleanNegateInstr : public TemplateDefinition<1, NoThrow> {
+class BooleanNegateInstr : public TemplateDefinition<1> {
public:
explicit BooleanNegateInstr(Value* value) {
SetInputAt(0, value);
@@ -3817,6 +3877,8 @@ class BooleanNegateInstr : public TemplateDefinition<1, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
virtual Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -3824,7 +3886,7 @@ class BooleanNegateInstr : public TemplateDefinition<1, NoThrow> {
};
-class InstanceOfInstr : public TemplateDefinition<3, Throws> {
+class InstanceOfInstr : public TemplateDefinition<3> {
public:
InstanceOfInstr(intptr_t token_pos,
Value* value,
@@ -3833,7 +3895,7 @@ class InstanceOfInstr : public TemplateDefinition<3, Throws> {
const AbstractType& type,
bool negate_result,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<3>(deopt_id),
token_pos_(token_pos),
type_(type),
negate_result_(negate_result) {
@@ -3860,6 +3922,8 @@ class InstanceOfInstr : public TemplateDefinition<3, Throws> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return true; }
+
private:
const intptr_t token_pos_;
Value* value_;
@@ -3872,7 +3936,7 @@ class InstanceOfInstr : public TemplateDefinition<3, Throws> {
};
-class AllocateObjectInstr : public TemplateDefinition<0, NoThrow> {
+class AllocateObjectInstr : public TemplateDefinition<0> {
public:
AllocateObjectInstr(intptr_t token_pos,
const Class& cls,
@@ -3908,6 +3972,8 @@ class AllocateObjectInstr : public TemplateDefinition<0, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
virtual AliasIdentity Identity() const { return identity_; }
virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
@@ -4011,12 +4077,12 @@ class MaterializeObjectInstr : public Definition {
};
-class CreateArrayInstr : public TemplateDefinition<2, Throws> {
+class CreateArrayInstr : public TemplateDefinition<2> {
public:
CreateArrayInstr(intptr_t token_pos,
Value* element_type,
Value* num_elements)
- : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+ : TemplateDefinition<2>(Isolate::Current()->GetNextDeoptId()),
token_pos_(token_pos),
identity_(AliasIdentity::Unknown()) {
SetInputAt(kElementTypePos, element_type);
@@ -4041,6 +4107,9 @@ class CreateArrayInstr : public TemplateDefinition<2, Throws> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ // OutOfMemoryError can be called.
+ virtual bool MayThrow() const { return true; }
+
virtual AliasIdentity Identity() const { return identity_; }
virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
@@ -4052,12 +4121,7 @@ class CreateArrayInstr : public TemplateDefinition<2, Throws> {
};
-// Note: this instruction must not be moved without the indexed access that
-// depends on it (e.g. out of loops). GC may cause collect
-// the array while the external data-array is still accessed.
-// TODO(vegorov) enable LICMing this instruction by ensuring that array itself
-// is kept alive.
-class LoadUntaggedInstr : public TemplateDefinition<1, NoThrow> {
+class LoadUntaggedInstr : public TemplateDefinition<1> {
public:
LoadUntaggedInstr(Value* object, intptr_t offset) : offset_(offset) {
SetInputAt(0, object);
@@ -4074,9 +4138,16 @@ class LoadUntaggedInstr : public TemplateDefinition<1, NoThrow> {
virtual bool CanDeoptimize() const { return false; }
+ // This instruction must not be moved without the indexed access that
+ // depends on it (e.g. out of loops). GC may cause collect
+ // the array while the external data-array is still accessed.
+ virtual bool AllowsCSE() const { return false; }
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
intptr_t offset_;
@@ -4084,7 +4155,7 @@ class LoadUntaggedInstr : public TemplateDefinition<1, NoThrow> {
};
-class LoadClassIdInstr : public TemplateDefinition<1, NoThrow> {
+class LoadClassIdInstr : public TemplateDefinition<1> {
public:
explicit LoadClassIdInstr(Value* object) {
SetInputAt(0, object);
@@ -4101,18 +4172,20 @@ class LoadClassIdInstr : public TemplateDefinition<1, NoThrow> {
virtual bool CanDeoptimize() const { return false; }
virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
virtual EffectSet Dependencies() const {
return EffectSet::Externalization();
}
- virtual EffectSet Effects() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(LoadClassIdInstr);
};
-class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
+class LoadFieldInstr : public TemplateDefinition<1> {
public:
LoadFieldInstr(Value* instance,
intptr_t offset_in_bytes,
@@ -4193,6 +4266,8 @@ class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
virtual EffectSet Dependencies() const;
virtual bool AttributesEqual(Instruction* other) const;
+ virtual bool MayThrow() const { return false; }
+
private:
const intptr_t offset_in_bytes_;
const AbstractType& type_;
@@ -4207,13 +4282,13 @@ class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
};
-class InstantiateTypeInstr : public TemplateDefinition<1, Throws> {
+class InstantiateTypeInstr : public TemplateDefinition<1> {
public:
InstantiateTypeInstr(intptr_t token_pos,
const AbstractType& type,
const Class& instantiator_class,
Value* instantiator)
- : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+ : TemplateDefinition<1>(Isolate::Current()->GetNextDeoptId()),
token_pos_(token_pos),
type_(type),
instantiator_class_(instantiator_class) {
@@ -4235,6 +4310,8 @@ class InstantiateTypeInstr : public TemplateDefinition<1, Throws> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return true; }
+
private:
const intptr_t token_pos_;
const AbstractType& type_;
@@ -4244,13 +4321,13 @@ class InstantiateTypeInstr : public TemplateDefinition<1, Throws> {
};
-class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> {
+class InstantiateTypeArgumentsInstr : public TemplateDefinition<1> {
public:
InstantiateTypeArgumentsInstr(intptr_t token_pos,
const TypeArguments& type_arguments,
const Class& instantiator_class,
Value* instantiator)
- : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+ : TemplateDefinition<1>(Isolate::Current()->GetNextDeoptId()),
token_pos_(token_pos),
type_arguments_(type_arguments),
instantiator_class_(instantiator_class) {
@@ -4273,6 +4350,8 @@ class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return true; }
+
virtual Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4284,7 +4363,7 @@ class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> {
};
-class AllocateContextInstr : public TemplateDefinition<0, NoThrow> {
+class AllocateContextInstr : public TemplateDefinition<0> {
public:
AllocateContextInstr(intptr_t token_pos,
intptr_t num_context_variables)
@@ -4303,6 +4382,8 @@ class AllocateContextInstr : public TemplateDefinition<0, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
private:
const intptr_t token_pos_;
const intptr_t num_context_variables_;
@@ -4311,10 +4392,10 @@ class AllocateContextInstr : public TemplateDefinition<0, NoThrow> {
};
-class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
+class InitStaticFieldInstr : public TemplateInstruction<1> {
public:
InitStaticFieldInstr(Value* input, const Field& field)
- : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+ : TemplateInstruction<1>(Isolate::Current()->GetNextDeoptId()),
field_(field) {
SetInputAt(0, input);
}
@@ -4327,6 +4408,7 @@ class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
virtual intptr_t ArgumentCount() const { return 0; }
virtual bool CanDeoptimize() const { return true; }
virtual EffectSet Effects() const { return EffectSet::All(); }
+ virtual bool MayThrow() const { return true; }
virtual Instruction* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4336,8 +4418,7 @@ class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
};
-class AllocateUninitializedContextInstr
- : public TemplateDefinition<0, NoThrow> {
+class AllocateUninitializedContextInstr : public TemplateDefinition<0> {
public:
AllocateUninitializedContextInstr(intptr_t token_pos,
intptr_t num_context_variables)
@@ -4356,6 +4437,8 @@ class AllocateUninitializedContextInstr
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
private:
const intptr_t token_pos_;
const intptr_t num_context_variables_;
@@ -4364,10 +4447,10 @@ class AllocateUninitializedContextInstr
};
-class CloneContextInstr : public TemplateDefinition<1, NoThrow> {
+class CloneContextInstr : public TemplateDefinition<1> {
public:
CloneContextInstr(intptr_t token_pos, Value* context_value)
- : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+ : TemplateDefinition<1>(Isolate::Current()->GetNextDeoptId()),
token_pos_(token_pos) {
SetInputAt(0, context_value);
}
@@ -4382,6 +4465,8 @@ class CloneContextInstr : public TemplateDefinition<1, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
private:
const intptr_t token_pos_;
@@ -4389,10 +4474,10 @@ class CloneContextInstr : public TemplateDefinition<1, NoThrow> {
};
-class CheckEitherNonSmiInstr : public TemplateInstruction<2, NoThrow, Pure> {
+class CheckEitherNonSmiInstr : public TemplateInstruction<2> {
public:
CheckEitherNonSmiInstr(Value* left, Value* right, intptr_t deopt_id)
- : TemplateInstruction(deopt_id), licm_hoisted_(false) {
+ : TemplateInstruction<2>(deopt_id), licm_hoisted_(false) {
SetInputAt(0, left);
SetInputAt(1, right);
}
@@ -4408,8 +4493,13 @@ class CheckEitherNonSmiInstr : public TemplateInstruction<2, NoThrow, Pure> {
virtual Instruction* Canonicalize(FlowGraph* flow_graph);
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
void set_licm_hoisted(bool value) { licm_hoisted_ = value; }
private:
@@ -4419,7 +4509,7 @@ class CheckEitherNonSmiInstr : public TemplateInstruction<2, NoThrow, Pure> {
};
-class BoxDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class BoxDoubleInstr : public TemplateDefinition<1> {
public:
explicit BoxDoubleInstr(Value* value) {
SetInputAt(0, value);
@@ -4441,8 +4531,13 @@ class BoxDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
return kUnboxedDouble;
}
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4450,7 +4545,7 @@ class BoxDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class BoxFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
+class BoxFloat32x4Instr : public TemplateDefinition<1> {
public:
explicit BoxFloat32x4Instr(Value* value) {
SetInputAt(0, value);
@@ -4472,8 +4567,13 @@ class BoxFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(BoxFloat32x4)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4481,7 +4581,7 @@ class BoxFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class BoxFloat64x2Instr : public TemplateDefinition<1, NoThrow, Pure> {
+class BoxFloat64x2Instr : public TemplateDefinition<1> {
public:
explicit BoxFloat64x2Instr(Value* value) {
SetInputAt(0, value);
@@ -4503,8 +4603,13 @@ class BoxFloat64x2Instr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(BoxFloat64x2)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4513,7 +4618,7 @@ class BoxFloat64x2Instr : public TemplateDefinition<1, NoThrow, Pure> {
-class BoxInt32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
+class BoxInt32x4Instr : public TemplateDefinition<1> {
public:
explicit BoxInt32x4Instr(Value* value) {
SetInputAt(0, value);
@@ -4535,8 +4640,13 @@ class BoxInt32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(BoxInt32x4)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4544,7 +4654,7 @@ class BoxInt32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class BoxIntegerInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class BoxIntegerInstr : public TemplateDefinition<1> {
public:
explicit BoxIntegerInstr(Value* value) : is_smi_(false) {
SetInputAt(0, value);
@@ -4572,8 +4682,13 @@ class BoxIntegerInstr : public TemplateDefinition<1, NoThrow, Pure> {
virtual void InferRange(RangeAnalysis* analysis, Range* range);
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
virtual Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4583,10 +4698,10 @@ class BoxIntegerInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class UnboxDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class UnboxDoubleInstr : public TemplateDefinition<1> {
public:
UnboxDoubleInstr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -4604,8 +4719,13 @@ class UnboxDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(UnboxDouble)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4613,10 +4733,10 @@ class UnboxDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class UnboxFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
+class UnboxFloat32x4Instr : public TemplateDefinition<1> {
public:
UnboxFloat32x4Instr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -4633,8 +4753,13 @@ class UnboxFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(UnboxFloat32x4)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4642,10 +4767,10 @@ class UnboxFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class UnboxFloat64x2Instr : public TemplateDefinition<1, NoThrow, Pure> {
+class UnboxFloat64x2Instr : public TemplateDefinition<1> {
public:
UnboxFloat64x2Instr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -4662,8 +4787,13 @@ class UnboxFloat64x2Instr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(UnboxFloat64x2)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4671,10 +4801,10 @@ class UnboxFloat64x2Instr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class UnboxInt32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
+class UnboxInt32x4Instr : public TemplateDefinition<1> {
public:
UnboxInt32x4Instr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -4688,11 +4818,16 @@ class UnboxInt32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
return kUnboxedInt32x4;
}
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
DECLARE_INSTRUCTION(UnboxInt32x4)
virtual CompileType ComputeType() const;
+ virtual bool MayThrow() const { return false; }
+
Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4700,10 +4835,10 @@ class UnboxInt32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class UnboxIntegerInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class UnboxIntegerInstr : public TemplateDefinition<1> {
public:
UnboxIntegerInstr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -4725,8 +4860,13 @@ class UnboxIntegerInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(UnboxInteger)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
virtual Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -4734,7 +4874,7 @@ class UnboxIntegerInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class MathUnaryInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class MathUnaryInstr : public TemplateDefinition<1> {
public:
enum MathUnaryKind {
kIllegal,
@@ -4744,7 +4884,7 @@ class MathUnaryInstr : public TemplateDefinition<1, NoThrow, Pure> {
kDoubleSquare,
};
MathUnaryInstr(MathUnaryKind kind, Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id), kind_(kind) {
+ : TemplateDefinition<1>(deopt_id), kind_(kind) {
SetInputAt(0, value);
}
@@ -4774,10 +4914,15 @@ class MathUnaryInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(MathUnary)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return kind() == other->AsMathUnary()->kind();
}
+ virtual bool MayThrow() const { return false; }
+
Definition* Canonicalize(FlowGraph* flow_graph);
static const char* KindToCString(MathUnaryKind kind);
@@ -4790,14 +4935,14 @@ class MathUnaryInstr : public TemplateDefinition<1, NoThrow, Pure> {
// Represents Math's static min and max functions.
-class MathMinMaxInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class MathMinMaxInstr : public TemplateDefinition<2> {
public:
MathMinMaxInstr(MethodRecognizer::Kind op_kind,
Value* left_value,
Value* right_value,
intptr_t deopt_id,
intptr_t result_cid)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<2>(deopt_id),
op_kind_(op_kind),
result_cid_(result_cid) {
ASSERT((result_cid == kSmiCid) || (result_cid == kDoubleCid));
@@ -4838,8 +4983,13 @@ class MathMinMaxInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(MathMinMax)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const;
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
const intptr_t result_cid_;
@@ -4848,14 +4998,14 @@ class MathMinMaxInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class BinaryDoubleOpInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class BinaryDoubleOpInstr : public TemplateDefinition<2> {
public:
BinaryDoubleOpInstr(Token::Kind op_kind,
Value* left,
Value* right,
intptr_t deopt_id,
intptr_t token_pos)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<2>(deopt_id),
op_kind_(op_kind),
token_pos_(token_pos) {
SetInputAt(0, left);
@@ -4893,10 +5043,15 @@ class BinaryDoubleOpInstr : public TemplateDefinition<2, NoThrow, Pure> {
virtual Definition* Canonicalize(FlowGraph* flow_graph);
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsBinaryDoubleOp()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const Token::Kind op_kind_;
const intptr_t token_pos_;
@@ -4905,13 +5060,13 @@ class BinaryDoubleOpInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class BinaryFloat32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class BinaryFloat32x4OpInstr : public TemplateDefinition<2> {
public:
BinaryFloat32x4OpInstr(Token::Kind op_kind,
Value* left,
Value* right,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<2>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, left);
SetInputAt(1, right);
}
@@ -4943,10 +5098,15 @@ class BinaryFloat32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(BinaryFloat32x4Op)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsBinaryFloat32x4Op()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const Token::Kind op_kind_;
@@ -4954,12 +5114,12 @@ class BinaryFloat32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class Simd32x4ShuffleInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class Simd32x4ShuffleInstr : public TemplateDefinition<1> {
public:
Simd32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value,
intptr_t mask,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind), mask_(mask) {
+ : TemplateDefinition<1>(deopt_id), op_kind_(op_kind), mask_(mask) {
SetInputAt(0, value);
}
@@ -5009,11 +5169,16 @@ class Simd32x4ShuffleInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Simd32x4Shuffle)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return (op_kind() == other->AsSimd32x4Shuffle()->op_kind()) &&
(mask() == other->AsSimd32x4Shuffle()->mask());
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
const intptr_t mask_;
@@ -5022,11 +5187,11 @@ class Simd32x4ShuffleInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class Simd32x4ShuffleMixInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class Simd32x4ShuffleMixInstr : public TemplateDefinition<2> {
public:
Simd32x4ShuffleMixInstr(MethodRecognizer::Kind op_kind, Value* xy,
Value* zw, intptr_t mask, intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind), mask_(mask) {
+ : TemplateDefinition<2>(deopt_id), op_kind_(op_kind), mask_(mask) {
SetInputAt(0, xy);
SetInputAt(1, zw);
}
@@ -5068,11 +5233,16 @@ class Simd32x4ShuffleMixInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(Simd32x4ShuffleMix)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return (op_kind() == other->AsSimd32x4ShuffleMix()->op_kind()) &&
(mask() == other->AsSimd32x4ShuffleMix()->mask());
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
const intptr_t mask_;
@@ -5081,14 +5251,14 @@ class Simd32x4ShuffleMixInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class Float32x4ConstructorInstr : public TemplateDefinition<4, NoThrow, Pure> {
+class Float32x4ConstructorInstr : public TemplateDefinition<4> {
public:
Float32x4ConstructorInstr(Value* value0,
Value* value1,
Value* value2,
Value* value3,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<4>(deopt_id) {
SetInputAt(0, value0);
SetInputAt(1, value1);
SetInputAt(2, value2);
@@ -5122,17 +5292,22 @@ class Float32x4ConstructorInstr : public TemplateDefinition<4, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4Constructor)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Float32x4ConstructorInstr);
};
-class Float32x4SplatInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class Float32x4SplatInstr : public TemplateDefinition<1> {
public:
Float32x4SplatInstr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -5160,15 +5335,20 @@ class Float32x4SplatInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4Splat)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr);
};
// TODO(vegorov) replace with UnboxedConstantInstr.
-class Float32x4ZeroInstr : public TemplateDefinition<0, NoThrow, Pure> {
+class Float32x4ZeroInstr : public TemplateDefinition<0> {
public:
Float32x4ZeroInstr() { }
@@ -5181,20 +5361,25 @@ class Float32x4ZeroInstr : public TemplateDefinition<0, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4Zero)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr);
};
-class Float32x4ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class Float32x4ComparisonInstr : public TemplateDefinition<2> {
public:
Float32x4ComparisonInstr(MethodRecognizer::Kind op_kind,
Value* left,
Value* right,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<2>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, left);
SetInputAt(1, right);
}
@@ -5226,10 +5411,15 @@ class Float32x4ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4Comparison)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsFloat32x4Comparison()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -5237,13 +5427,13 @@ class Float32x4ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class Float32x4MinMaxInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class Float32x4MinMaxInstr : public TemplateDefinition<2> {
public:
Float32x4MinMaxInstr(MethodRecognizer::Kind op_kind,
Value* left,
Value* right,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<2>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, left);
SetInputAt(1, right);
}
@@ -5275,10 +5465,15 @@ class Float32x4MinMaxInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4MinMax)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsFloat32x4MinMax()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -5286,13 +5481,13 @@ class Float32x4MinMaxInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class Float32x4ScaleInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class Float32x4ScaleInstr : public TemplateDefinition<2> {
public:
Float32x4ScaleInstr(MethodRecognizer::Kind op_kind,
Value* left,
Value* right,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<2>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, left);
SetInputAt(1, right);
}
@@ -5327,10 +5522,15 @@ class Float32x4ScaleInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4Scale)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsFloat32x4Scale()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -5338,12 +5538,12 @@ class Float32x4ScaleInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class Float32x4SqrtInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class Float32x4SqrtInstr : public TemplateDefinition<1> {
public:
Float32x4SqrtInstr(MethodRecognizer::Kind op_kind,
Value* left,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<1>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, left);
}
@@ -5373,10 +5573,15 @@ class Float32x4SqrtInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4Sqrt)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsFloat32x4Sqrt()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -5385,12 +5590,12 @@ class Float32x4SqrtInstr : public TemplateDefinition<1, NoThrow, Pure> {
// TODO(vegorov) rename to Unary to match naming convention for arithmetic.
-class Float32x4ZeroArgInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class Float32x4ZeroArgInstr : public TemplateDefinition<1> {
public:
Float32x4ZeroArgInstr(MethodRecognizer::Kind op_kind,
Value* left,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<1>(deopt_id),
op_kind_(op_kind) {
SetInputAt(0, left);
}
@@ -5421,10 +5626,15 @@ class Float32x4ZeroArgInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4ZeroArg)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsFloat32x4ZeroArg()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -5432,13 +5642,13 @@ class Float32x4ZeroArgInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class Float32x4ClampInstr : public TemplateDefinition<3, NoThrow, Pure> {
+class Float32x4ClampInstr : public TemplateDefinition<3> {
public:
Float32x4ClampInstr(Value* left,
Value* lower,
Value* upper,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<3>(deopt_id) {
SetInputAt(0, left);
SetInputAt(1, lower);
SetInputAt(2, upper);
@@ -5470,20 +5680,25 @@ class Float32x4ClampInstr : public TemplateDefinition<3, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4Clamp)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Float32x4ClampInstr);
};
-class Float32x4WithInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class Float32x4WithInstr : public TemplateDefinition<2> {
public:
Float32x4WithInstr(MethodRecognizer::Kind op_kind,
Value* left,
Value* replacement,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<2>(deopt_id),
op_kind_(op_kind) {
SetInputAt(0, replacement);
SetInputAt(1, left);
@@ -5519,10 +5734,15 @@ class Float32x4WithInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4With)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsFloat32x4With()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -5530,13 +5750,13 @@ class Float32x4WithInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class Simd64x2ShuffleInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class Simd64x2ShuffleInstr : public TemplateDefinition<1> {
public:
Simd64x2ShuffleInstr(MethodRecognizer::Kind op_kind,
Value* value,
intptr_t mask,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind), mask_(mask) {
+ : TemplateDefinition<1>(deopt_id), op_kind_(op_kind), mask_(mask) {
SetInputAt(0, value);
}
@@ -5578,11 +5798,16 @@ class Simd64x2ShuffleInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Simd64x2Shuffle)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return (op_kind() == other->AsSimd64x2Shuffle()->op_kind()) &&
(mask() == other->AsSimd64x2Shuffle()->mask());
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
const intptr_t mask_;
@@ -5591,10 +5816,10 @@ class Simd64x2ShuffleInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class Float32x4ToInt32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
+class Float32x4ToInt32x4Instr : public TemplateDefinition<1> {
public:
Float32x4ToInt32x4Instr(Value* left, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, left);
}
@@ -5622,17 +5847,22 @@ class Float32x4ToInt32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4ToInt32x4)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Float32x4ToInt32x4Instr);
};
-class Float32x4ToFloat64x2Instr : public TemplateDefinition<1, NoThrow, Pure> {
+class Float32x4ToFloat64x2Instr : public TemplateDefinition<1> {
public:
Float32x4ToFloat64x2Instr(Value* left, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, left);
}
@@ -5660,17 +5890,22 @@ class Float32x4ToFloat64x2Instr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float32x4ToFloat64x2)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Float32x4ToFloat64x2Instr);
};
-class Float64x2ToFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
+class Float64x2ToFloat32x4Instr : public TemplateDefinition<1> {
public:
Float64x2ToFloat32x4Instr(Value* left, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, left);
}
@@ -5698,17 +5933,22 @@ class Float64x2ToFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float64x2ToFloat32x4)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Float64x2ToFloat32x4Instr);
};
-class Float64x2ConstructorInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class Float64x2ConstructorInstr : public TemplateDefinition<2> {
public:
Float64x2ConstructorInstr(Value* value0, Value* value1, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<2>(deopt_id) {
SetInputAt(0, value0);
SetInputAt(1, value1);
}
@@ -5738,17 +5978,22 @@ class Float64x2ConstructorInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float64x2Constructor)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Float64x2ConstructorInstr);
};
-class Float64x2SplatInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class Float64x2SplatInstr : public TemplateDefinition<1> {
public:
Float64x2SplatInstr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -5776,14 +6021,19 @@ class Float64x2SplatInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float64x2Splat)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Float64x2SplatInstr);
};
-class Float64x2ZeroInstr : public TemplateDefinition<0, NoThrow, Pure> {
+class Float64x2ZeroInstr : public TemplateDefinition<0> {
public:
Float64x2ZeroInstr() { }
@@ -5796,20 +6046,25 @@ class Float64x2ZeroInstr : public TemplateDefinition<0, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float64x2Zero)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Float64x2ZeroInstr);
};
// TODO(vegorov) rename to Unary to match arithmetic instructions.
-class Float64x2ZeroArgInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class Float64x2ZeroArgInstr : public TemplateDefinition<1> {
public:
Float64x2ZeroArgInstr(MethodRecognizer::Kind op_kind,
Value* left,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<1>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, left);
}
@@ -5843,10 +6098,15 @@ class Float64x2ZeroArgInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float64x2ZeroArg)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsFloat64x2ZeroArg()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -5854,13 +6114,13 @@ class Float64x2ZeroArgInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class Float64x2OneArgInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class Float64x2OneArgInstr : public TemplateDefinition<2> {
public:
Float64x2OneArgInstr(MethodRecognizer::Kind op_kind,
Value* left,
Value* right,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<2>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, left);
SetInputAt(1, right);
}
@@ -5900,10 +6160,15 @@ class Float64x2OneArgInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(Float64x2OneArg)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsFloat64x2OneArg()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -5911,14 +6176,14 @@ class Float64x2OneArgInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class Int32x4ConstructorInstr : public TemplateDefinition<4, NoThrow, Pure> {
+class Int32x4ConstructorInstr : public TemplateDefinition<4> {
public:
Int32x4ConstructorInstr(Value* value0,
Value* value1,
Value* value2,
Value* value3,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<4>(deopt_id) {
SetInputAt(0, value0);
SetInputAt(1, value1);
SetInputAt(2, value2);
@@ -5952,22 +6217,26 @@ class Int32x4ConstructorInstr : public TemplateDefinition<4, NoThrow, Pure> {
DECLARE_INSTRUCTION(Int32x4Constructor)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Int32x4ConstructorInstr);
};
-class Int32x4BoolConstructorInstr
- : public TemplateDefinition<4, NoThrow, Pure> {
+class Int32x4BoolConstructorInstr : public TemplateDefinition<4> {
public:
Int32x4BoolConstructorInstr(Value* value0,
Value* value1,
Value* value2,
Value* value3,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<4>(deopt_id) {
SetInputAt(0, value0);
SetInputAt(1, value1);
SetInputAt(2, value2);
@@ -6001,19 +6270,24 @@ class Int32x4BoolConstructorInstr
DECLARE_INSTRUCTION(Int32x4BoolConstructor)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Int32x4BoolConstructorInstr);
};
-class Int32x4GetFlagInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class Int32x4GetFlagInstr : public TemplateDefinition<1> {
public:
Int32x4GetFlagInstr(MethodRecognizer::Kind op_kind,
Value* value,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<1>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, value);
}
@@ -6043,10 +6317,15 @@ class Int32x4GetFlagInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Int32x4GetFlag)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsInt32x4GetFlag()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -6054,12 +6333,12 @@ class Int32x4GetFlagInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class Simd32x4GetSignMaskInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class Simd32x4GetSignMaskInstr : public TemplateDefinition<1> {
public:
Simd32x4GetSignMaskInstr(MethodRecognizer::Kind op_kind,
Value* value,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<1>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, value);
}
@@ -6093,10 +6372,15 @@ class Simd32x4GetSignMaskInstr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Simd32x4GetSignMask)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return other->AsSimd32x4GetSignMask()->op_kind() == op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -6104,13 +6388,13 @@ class Simd32x4GetSignMaskInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class Int32x4SelectInstr : public TemplateDefinition<3, NoThrow, Pure> {
+class Int32x4SelectInstr : public TemplateDefinition<3> {
public:
Int32x4SelectInstr(Value* mask,
Value* trueValue,
Value* falseValue,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<3>(deopt_id) {
SetInputAt(0, mask);
SetInputAt(1, trueValue);
SetInputAt(2, falseValue);
@@ -6145,20 +6429,25 @@ class Int32x4SelectInstr : public TemplateDefinition<3, NoThrow, Pure> {
DECLARE_INSTRUCTION(Int32x4Select)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Int32x4SelectInstr);
};
-class Int32x4SetFlagInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class Int32x4SetFlagInstr : public TemplateDefinition<2> {
public:
Int32x4SetFlagInstr(MethodRecognizer::Kind op_kind,
Value* value,
Value* flagValue,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<2>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, value);
SetInputAt(1, flagValue);
}
@@ -6193,10 +6482,15 @@ class Int32x4SetFlagInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(Int32x4SetFlag)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsInt32x4SetFlag()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind op_kind_;
@@ -6204,10 +6498,10 @@ class Int32x4SetFlagInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class Int32x4ToFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
+class Int32x4ToFloat32x4Instr : public TemplateDefinition<1> {
public:
Int32x4ToFloat32x4Instr(Value* left, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, left);
}
@@ -6235,20 +6529,25 @@ class Int32x4ToFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> {
DECLARE_INSTRUCTION(Int32x4ToFloat32x4)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Int32x4ToFloat32x4Instr);
};
-class BinaryInt32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class BinaryInt32x4OpInstr : public TemplateDefinition<2> {
public:
BinaryInt32x4OpInstr(Token::Kind op_kind,
Value* left,
Value* right,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<2>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, left);
SetInputAt(1, right);
}
@@ -6280,10 +6579,15 @@ class BinaryInt32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(BinaryInt32x4Op)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return op_kind() == other->AsBinaryInt32x4Op()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const Token::Kind op_kind_;
@@ -6291,13 +6595,13 @@ class BinaryInt32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class BinaryFloat64x2OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class BinaryFloat64x2OpInstr : public TemplateDefinition<2> {
public:
BinaryFloat64x2OpInstr(Token::Kind op_kind,
Value* left,
Value* right,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<2>(deopt_id), op_kind_(op_kind) {
SetInputAt(0, left);
SetInputAt(1, right);
}
@@ -6329,10 +6633,16 @@ class BinaryFloat64x2OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
DECLARE_INSTRUCTION(BinaryFloat64x2Op)
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
+ ASSERT(other->IsBinaryFloat64x2Op());
return op_kind() == other->AsBinaryFloat64x2Op()->op_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const Token::Kind op_kind_;
@@ -6340,12 +6650,12 @@ class BinaryFloat64x2OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
};
-class UnaryIntegerOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class UnaryIntegerOpInstr : public TemplateDefinition<1> {
public:
UnaryIntegerOpInstr(Token::Kind op_kind,
Value* value,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<1>(deopt_id), op_kind_(op_kind) {
ASSERT((op_kind == Token::kNEGATE) ||
(op_kind == Token::kBIT_NOT));
SetInputAt(0, value);
@@ -6360,6 +6670,9 @@ class UnaryIntegerOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
Value* value() const { return inputs_[0]; }
Token::Kind op_kind() const { return op_kind_; }
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return other->AsUnaryIntegerOp()->op_kind() == op_kind();
}
@@ -6370,6 +6683,8 @@ class UnaryIntegerOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
return GetDeoptId();
}
+ virtual bool MayThrow() const { return false; }
+
virtual void PrintOperandsTo(BufferFormatter* f) const;
DEFINE_INSTRUCTION_TYPE_CHECK(UnaryIntegerOp)
@@ -6456,13 +6771,13 @@ class UnaryMintOpInstr : public UnaryIntegerOpInstr {
};
-class BinaryIntegerOpInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class BinaryIntegerOpInstr : public TemplateDefinition<2> {
public:
BinaryIntegerOpInstr(Token::Kind op_kind,
Value* left,
Value* right,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<2>(deopt_id),
op_kind_(op_kind),
can_overflow_(true),
is_truncating_(false) {
@@ -6522,11 +6837,15 @@ class BinaryIntegerOpInstr : public TemplateDefinition<2, NoThrow, Pure> {
return false;
}
}
-
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const;
virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
+ virtual bool MayThrow() const { return false; }
+
virtual void PrintOperandsTo(BufferFormatter* f) const;
DEFINE_INSTRUCTION_TYPE_CHECK(BinaryIntegerOp)
@@ -6755,12 +7074,12 @@ class ShiftMintOpInstr : public BinaryIntegerOpInstr {
// Handles only NEGATE.
-class UnaryDoubleOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class UnaryDoubleOpInstr : public TemplateDefinition<1> {
public:
UnaryDoubleOpInstr(Token::Kind op_kind,
Value* value,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id), op_kind_(op_kind) {
+ : TemplateDefinition<1>(deopt_id), op_kind_(op_kind) {
ASSERT(op_kind == Token::kNEGATE);
SetInputAt(0, value);
}
@@ -6790,8 +7109,13 @@ class UnaryDoubleOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
return kUnboxedDouble;
}
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
const Token::Kind op_kind_;
@@ -6799,10 +7123,10 @@ class UnaryDoubleOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
+class CheckStackOverflowInstr : public TemplateInstruction<0> {
public:
CheckStackOverflowInstr(intptr_t token_pos, intptr_t loop_depth)
- : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+ : TemplateInstruction<0>(Isolate::Current()->GetNextDeoptId()),
token_pos_(token_pos),
loop_depth_(loop_depth) {
}
@@ -6819,6 +7143,8 @@ class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return false; }
+
virtual void PrintOperandsTo(BufferFormatter* f) const;
private:
@@ -6830,7 +7156,7 @@ class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
// TODO(vegorov): remove this instruction in favor of Int32ToDouble.
-class SmiToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class SmiToDoubleInstr : public TemplateDefinition<1> {
public:
SmiToDoubleInstr(Value* value, intptr_t token_pos)
: token_pos_(token_pos) {
@@ -6849,8 +7175,13 @@ class SmiToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
virtual bool CanDeoptimize() const { return false; }
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
const intptr_t token_pos_;
@@ -6858,7 +7189,7 @@ class SmiToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class Int32ToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class Int32ToDoubleInstr : public TemplateDefinition<1> {
public:
explicit Int32ToDoubleInstr(Value* value) {
SetInputAt(0, value);
@@ -6880,17 +7211,22 @@ class Int32ToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
virtual bool CanDeoptimize() const { return false; }
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(Int32ToDoubleInstr);
};
-class MintToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class MintToDoubleInstr : public TemplateDefinition<1> {
public:
MintToDoubleInstr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -6915,17 +7251,23 @@ class MintToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
}
virtual bool CanDeoptimize() const { return false; }
+
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
private:
DISALLOW_COPY_AND_ASSIGN(MintToDoubleInstr);
};
-class DoubleToIntegerInstr : public TemplateDefinition<1, Throws> {
+class DoubleToIntegerInstr : public TemplateDefinition<1> {
public:
DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call)
- : TemplateDefinition(instance_call->deopt_id()),
+ : TemplateDefinition<1>(instance_call->deopt_id()),
instance_call_(instance_call) {
SetInputAt(0, value);
}
@@ -6942,6 +7284,8 @@ class DoubleToIntegerInstr : public TemplateDefinition<1, Throws> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual bool MayThrow() const { return true; }
+
private:
InstanceCallInstr* instance_call_;
@@ -6951,10 +7295,10 @@ class DoubleToIntegerInstr : public TemplateDefinition<1, Throws> {
// Similar to 'DoubleToIntegerInstr' but expects unboxed double as input
// and creates a Smi.
-class DoubleToSmiInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class DoubleToSmiInstr : public TemplateDefinition<1> {
public:
DoubleToSmiInstr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -6972,19 +7316,21 @@ class DoubleToSmiInstr : public TemplateDefinition<1, NoThrow, Pure> {
virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
- virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+
+ virtual bool MayThrow() const { return false; }
private:
DISALLOW_COPY_AND_ASSIGN(DoubleToSmiInstr);
};
-class DoubleToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class DoubleToDoubleInstr : public TemplateDefinition<1> {
public:
DoubleToDoubleInstr(Value* value,
MethodRecognizer::Kind recognized_kind,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<1>(deopt_id),
recognized_kind_(recognized_kind) {
SetInputAt(0, value);
}
@@ -7009,10 +7355,15 @@ class DoubleToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return other->AsDoubleToDouble()->recognized_kind() == recognized_kind();
}
+ virtual bool MayThrow() const { return false; }
+
private:
const MethodRecognizer::Kind recognized_kind_;
@@ -7020,10 +7371,10 @@ class DoubleToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class DoubleToFloatInstr: public TemplateDefinition<1, NoThrow, Pure> {
+class DoubleToFloatInstr: public TemplateDefinition<1> {
public:
DoubleToFloatInstr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -7050,8 +7401,13 @@ class DoubleToFloatInstr: public TemplateDefinition<1, NoThrow, Pure> {
virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
virtual Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -7059,10 +7415,10 @@ class DoubleToFloatInstr: public TemplateDefinition<1, NoThrow, Pure> {
};
-class FloatToDoubleInstr: public TemplateDefinition<1, NoThrow, Pure> {
+class FloatToDoubleInstr: public TemplateDefinition<1> {
public:
FloatToDoubleInstr(Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {
+ : TemplateDefinition<1>(deopt_id) {
SetInputAt(0, value);
}
@@ -7085,8 +7441,13 @@ class FloatToDoubleInstr: public TemplateDefinition<1, NoThrow, Pure> {
virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
virtual Definition* Canonicalize(FlowGraph* flow_graph);
private:
@@ -7094,7 +7455,7 @@ class FloatToDoubleInstr: public TemplateDefinition<1, NoThrow, Pure> {
};
-class InvokeMathCFunctionInstr : public PureDefinition {
+class InvokeMathCFunctionInstr : public Definition {
public:
InvokeMathCFunctionInstr(ZoneGrowableArray<Value*>* inputs,
intptr_t deopt_id,
@@ -7134,6 +7495,9 @@ class InvokeMathCFunctionInstr : public PureDefinition {
return (*inputs_)[i];
}
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
InvokeMathCFunctionInstr* other_invoke = other->AsInvokeMathCFunction();
return other_invoke->recognized_kind() == recognized_kind();
@@ -7158,7 +7522,7 @@ class InvokeMathCFunctionInstr : public PureDefinition {
};
-class ExtractNthOutputInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class ExtractNthOutputInstr : public TemplateDefinition<1> {
public:
// Extract the Nth output register from value.
ExtractNthOutputInstr(Value* value,
@@ -7196,12 +7560,17 @@ class ExtractNthOutputInstr : public TemplateDefinition<1, NoThrow, Pure> {
return definition_rep_;
}
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
ExtractNthOutputInstr* other_extract = other->AsExtractNthOutput();
return (other_extract->representation() == representation()) &&
(other_extract->index() == index());
}
+ virtual bool MayThrow() const { return false; }
+
private:
const intptr_t index_;
const Representation definition_rep_;
@@ -7210,7 +7579,7 @@ class ExtractNthOutputInstr : public TemplateDefinition<1, NoThrow, Pure> {
};
-class MergedMathInstr : public PureDefinition {
+class MergedMathInstr : public Definition {
public:
enum Kind {
kTruncDivMod,
@@ -7284,6 +7653,9 @@ class MergedMathInstr : public PureDefinition {
DECLARE_INSTRUCTION(MergedMath)
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
MergedMathInstr* other_invoke = other->AsMergedMath();
return other_invoke->kind() == kind();
@@ -7308,7 +7680,7 @@ class MergedMathInstr : public PureDefinition {
};
-class CheckClassInstr : public TemplateInstruction<1, NoThrow> {
+class CheckClassInstr : public TemplateInstruction<1> {
public:
CheckClassInstr(Value* value,
intptr_t deopt_id,
@@ -7340,10 +7712,12 @@ class CheckClassInstr : public TemplateInstruction<1, NoThrow> {
static bool IsDenseMask(intptr_t mask);
virtual bool AllowsCSE() const { return true; }
- virtual EffectSet Dependencies() const;
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const;
virtual bool AttributesEqual(Instruction* other) const;
+ virtual bool MayThrow() const { return false; }
+
void set_licm_hoisted(bool value) { licm_hoisted_ = value; }
private:
@@ -7356,10 +7730,10 @@ class CheckClassInstr : public TemplateInstruction<1, NoThrow> {
};
-class CheckSmiInstr : public TemplateInstruction<1, NoThrow, Pure> {
+class CheckSmiInstr : public TemplateInstruction<1> {
public:
CheckSmiInstr(Value* value, intptr_t deopt_id, intptr_t token_pos)
- : TemplateInstruction(deopt_id),
+ : TemplateInstruction<1>(deopt_id),
token_pos_(token_pos),
licm_hoisted_(false) {
SetInputAt(0, value);
@@ -7376,8 +7750,13 @@ class CheckSmiInstr : public TemplateInstruction<1, NoThrow, Pure> {
virtual Instruction* Canonicalize(FlowGraph* flow_graph);
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
void set_licm_hoisted(bool value) { licm_hoisted_ = value; }
private:
@@ -7388,10 +7767,10 @@ class CheckSmiInstr : public TemplateInstruction<1, NoThrow, Pure> {
};
-class CheckClassIdInstr : public TemplateInstruction<1, NoThrow> {
+class CheckClassIdInstr : public TemplateInstruction<1> {
public:
CheckClassIdInstr(Value* value, intptr_t cid, intptr_t deopt_id)
- : TemplateInstruction(deopt_id), cid_(cid) {
+ : TemplateInstruction<1>(deopt_id), cid_(cid) {
SetInputAt(0, value);
}
@@ -7407,10 +7786,12 @@ class CheckClassIdInstr : public TemplateInstruction<1, NoThrow> {
virtual Instruction* Canonicalize(FlowGraph* flow_graph);
virtual bool AllowsCSE() const { return true; }
- virtual EffectSet Dependencies() const;
virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const;
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
virtual void PrintOperandsTo(BufferFormatter* f) const;
private:
@@ -7420,10 +7801,10 @@ class CheckClassIdInstr : public TemplateInstruction<1, NoThrow> {
};
-class CheckArrayBoundInstr : public TemplateInstruction<2, NoThrow, Pure> {
+class CheckArrayBoundInstr : public TemplateInstruction<2> {
public:
CheckArrayBoundInstr(Value* length, Value* index, intptr_t deopt_id)
- : TemplateInstruction(deopt_id),
+ : TemplateInstruction<2>(deopt_id),
generalized_(false),
licm_hoisted_(false) {
SetInputAt(kLengthPos, length);
@@ -7452,8 +7833,13 @@ class CheckArrayBoundInstr : public TemplateInstruction<2, NoThrow, Pure> {
static bool IsFixedLengthArrayType(intptr_t class_id);
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool MayThrow() const { return false; }
+
void set_licm_hoisted(bool value) { licm_hoisted_ = value; }
// Give a name to the location/input indices.
@@ -7470,7 +7856,7 @@ class CheckArrayBoundInstr : public TemplateInstruction<2, NoThrow, Pure> {
};
-class BoxIntNInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class BoxIntNInstr : public TemplateDefinition<1> {
public:
BoxIntNInstr(Representation representation, Value* value)
: from_representation_(representation) {
@@ -7496,10 +7882,15 @@ class BoxIntNInstr : public TemplateDefinition<1, NoThrow, Pure> {
return from_representation_;
}
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
return other->AsBoxIntN()->from_representation_ == from_representation_;
}
+ virtual bool MayThrow() const { return false; }
+
virtual Definition* Canonicalize(FlowGraph* flow_graph);
DEFINE_INSTRUCTION_TYPE_CHECK(BoxIntN)
@@ -7538,12 +7929,12 @@ class BoxInt32Instr : public BoxIntNInstr {
};
-class UnboxIntNInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class UnboxIntNInstr : public TemplateDefinition<1> {
public:
UnboxIntNInstr(Representation representation,
Value* value,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<1>(deopt_id),
representation_(representation),
is_truncating_(representation == kUnboxedUint32) {
SetInputAt(0, value);
@@ -7560,12 +7951,17 @@ class UnboxIntNInstr : public TemplateDefinition<1, NoThrow, Pure> {
virtual CompileType ComputeType() const;
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const {
UnboxIntNInstr* other_unbox = other->AsUnboxIntN();
return (other_unbox->representation_ == representation_) &&
(other_unbox->is_truncating_ == is_truncating_);
}
+ virtual bool MayThrow() const { return false; }
+
virtual Definition* Canonicalize(FlowGraph* flow_graph);
virtual void PrintOperandsTo(BufferFormatter* f) const;
@@ -7619,13 +8015,13 @@ class UnboxInt32Instr : public UnboxIntNInstr {
};
-class UnboxedIntConverterInstr : public TemplateDefinition<1, NoThrow> {
+class UnboxedIntConverterInstr : public TemplateDefinition<1> {
public:
UnboxedIntConverterInstr(Representation from,
Representation to,
Value* value,
intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ : TemplateDefinition<1>(deopt_id),
from_representation_(from),
to_representation_(to),
is_truncating_(to == kUnboxedUint32) {
@@ -7671,6 +8067,8 @@ class UnboxedIntConverterInstr : public TemplateDefinition<1, NoThrow> {
(converter->is_truncating() == is_truncating());
}
+ virtual bool MayThrow() const { return false; }
+
virtual void InferRange(RangeAnalysis* analysis, Range* range);
virtual void PrintOperandsTo(BufferFormatter* f) const;
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698