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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 710653002: Simplify type propagation and IL declarations of TemplateInstruction. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_type_propagator.cc
===================================================================
--- runtime/vm/flow_graph_type_propagator.cc (revision 41566)
+++ runtime/vm/flow_graph_type_propagator.cc (working copy)
@@ -327,15 +327,6 @@
}
-// Unwrap all assert assignable and get a real definition of the value.
-static Definition* UnwrapAsserts(Definition* defn) {
- while (defn->IsAssertAssignable()) {
- defn = defn->AsAssertAssignable()->value()->definition();
- }
- return defn;
-}
-
-
// In the given block strengthen type assertions by hoisting first class or smi
// check over the same value up to the point before the assertion. This allows
// to eliminate type assertions that are postdominated by class or smi checks as
@@ -351,7 +342,7 @@
// If this is the first type assertion checking given value record it.
AssertAssignableInstr* assert = instr->AsAssertAssignable();
if (assert != NULL) {
- Definition* defn = UnwrapAsserts(assert->value()->definition());
+ Definition* defn = assert->value()->definition()->OriginalDefinition();
if ((*asserts_)[defn->ssa_temp_index()] == NULL) {
(*asserts_)[defn->ssa_temp_index()] = assert;
collected_asserts_->Add(defn->ssa_temp_index());
@@ -373,7 +364,7 @@
AssertAssignableInstr* kStrengthenedAssertMarker =
reinterpret_cast<AssertAssignableInstr*>(-1);
- Definition* defn = UnwrapAsserts(check->InputAt(0)->definition());
+ Definition* defn = check->InputAt(0)->definition()->OriginalDefinition();
AssertAssignableInstr* assert = (*asserts_)[defn->ssa_temp_index()];
if ((assert == NULL) || (assert == kStrengthenedAssertMarker)) {
@@ -679,12 +670,12 @@
CompileType RedefinitionInstr::ComputeType() const {
- return CompileType::None();
+ return *value()->Type();
}
bool RedefinitionInstr::RecomputeType() {
- return UpdateType(*value()->Type());
+ return UpdateType(ComputeType());
}
@@ -776,7 +767,7 @@
return CompileType::Null();
}
- return CompileType::FromAbstractType(dst_type(), value_type->is_nullable());
+ return CompileType::Create(value_type->ToCid(), dst_type());
}
@@ -887,14 +878,14 @@
}
-CompileType* DropTempsInstr::ComputeInitialType() const {
- return value()->Type();
+CompileType DropTempsInstr::ComputeType() const {
+ return *value()->Type();
}
-CompileType* StoreLocalInstr::ComputeInitialType() const {
+CompileType StoreLocalInstr::ComputeType() const {
// Returns stored value.
- return value()->Type();
+ return *value()->Type();
}
@@ -914,11 +905,6 @@
}
-CompileType* StoreInstanceFieldInstr::ComputeInitialType() const {
- return value()->Type();
-}
-
-
CompileType LoadStaticFieldInstr::ComputeType() const {
bool is_nullable = CompileType::kNullable;
intptr_t cid = kDynamicCid;
@@ -942,11 +928,6 @@
}
-CompileType* StoreStaticFieldInstr::ComputeInitialType() const {
- return value()->Type();
-}
-
-
CompileType CreateArrayInstr::ComputeType() const {
// TODO(fschneider): Add abstract type and type arguments to the compile type.
return CompileType::FromCid(kArrayCid);
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698