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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 661783003: 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
« runtime/vm/intermediate_language.h ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index b4b37ab8b14651ce817dc757e65751aad74570f1..7a800233acfb0e9099b434284e344994f9850cc6 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -109,7 +109,7 @@ CheckClassInstr::CheckClassInstr(Value* value,
intptr_t deopt_id,
const ICData& unary_checks,
intptr_t token_pos)
- : TemplateInstruction<1>(deopt_id),
+ : TemplateInstruction(deopt_id),
unary_checks_(unary_checks),
cids_(unary_checks.NumberOfChecks()),
licm_hoisted_(false),
@@ -292,7 +292,8 @@ bool AssertAssignableInstr::AttributesEqual(Instruction* other) const {
bool StrictCompareInstr::AttributesEqual(Instruction* other) const {
StrictCompareInstr* other_op = other->AsStrictCompare();
ASSERT(other_op != NULL);
- return kind() == other_op->kind();
+ return ComparisonInstr::AttributesEqual(other) &&
+ (needs_number_check() == other_op->needs_number_check());
}
@@ -360,18 +361,6 @@ const Field& LoadStaticFieldInstr::StaticField() const {
}
-EffectSet LoadIndexedInstr::Dependencies() const {
- return EffectSet::All();
-}
-
-
-bool LoadIndexedInstr::AttributesEqual(Instruction* other) const {
- LoadIndexedInstr* other_load = other->AsLoadIndexed();
- ASSERT(other_load != NULL);
- return class_id() == other_load->class_id();
-}
-
-
ConstantInstr::ConstantInstr(const Object& value) : value_(value) {
// Check that the value is not an incorrect Integer representation.
ASSERT(!value.IsBigint() || !Bigint::Cast(value).FitsIntoSmi());
@@ -3048,8 +3037,7 @@ ComparisonInstr* TestCidsInstr::CopyWithNewOperands(Value* new_left,
bool TestCidsInstr::AttributesEqual(Instruction* other) const {
TestCidsInstr* other_instr = other->AsTestCids();
- ASSERT(other != NULL);
- if (kind() != other_instr->kind()) {
+ if (!ComparisonInstr::AttributesEqual(other)) {
return false;
}
if (cid_results().length() != other_instr->cid_results().length()) {
@@ -3223,7 +3211,7 @@ InvokeMathCFunctionInstr::InvokeMathCFunctionInstr(
intptr_t deopt_id,
MethodRecognizer::Kind recognized_kind,
intptr_t token_pos)
- : Definition(deopt_id),
+ : PureDefinition(deopt_id),
inputs_(inputs),
recognized_kind_(recognized_kind),
token_pos_(token_pos) {
@@ -3344,7 +3332,7 @@ const char* MathUnaryInstr::KindToCString(MathUnaryKind kind) {
MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs,
intptr_t deopt_id,
MergedMathInstr::Kind kind)
- : Definition(deopt_id),
+ : PureDefinition(deopt_id),
inputs_(inputs),
kind_(kind) {
ASSERT(inputs_->length() == InputCountFor(kind_));
« runtime/vm/intermediate_language.h ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698