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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10829451: Make Value not a subclass of Computation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 8 years, 4 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
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 11037)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -44,13 +44,13 @@
}
-bool UseVal::AttributesEqual(Computation* other) const {
+bool UseVal::Equals(Value* other) const {
return other->IsUse()
&& definition() == other->AsUse()->definition();
}
-bool ConstantVal::AttributesEqual(Computation* other) const {
+bool ConstantVal::Equals(Value* other) const {
return other->IsConstant()
&& value().raw() == other->AsConstant()->value().raw();
}
@@ -93,7 +93,7 @@
if (bind == NULL) {
return false;
}
- return bind->computation()->AsConstant() != NULL;
+ return bind->computation()->AsMaterialize() != NULL;
}
@@ -103,9 +103,9 @@
if (bind == NULL) {
return false;
}
- ConstantVal* constant = bind->computation()->AsConstant();
+ MaterializeComp* constant = bind->computation()->AsMaterialize();
if (constant != NULL) {
- return constant->value().IsNull();
+ return constant->constant_val()->value().IsNull();
}
return false;
}
@@ -115,9 +115,9 @@
ASSERT(BindsToConstant());
BindInstr* bind = definition()->AsBind();
ASSERT(bind != NULL);
- ConstantVal* constant = bind->computation()->AsConstant();
+ MaterializeComp* constant = bind->computation()->AsMaterialize();
ASSERT(constant != NULL);
- return constant->value();
+ return constant->constant_val()->value();
}
@@ -721,6 +721,17 @@
}
+
+RawAbstractType* MaterializeComp::CompileType() const {
+ return constant_val()->CompileType();
+}
+
+
+intptr_t MaterializeComp::ResultCid() const {
+ return constant_val()->ResultCid();
+}
+
+
RawAbstractType* AssertAssignableComp::CompileType() const {
const AbstractType& value_compile_type =
AbstractType::Handle(value()->CompileType());
@@ -1353,16 +1364,6 @@
}
-LocationSummary* UseVal::MakeLocationSummary() const {
- return NULL;
-}
-
-
-void UseVal::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
-}
-
-
void AssertAssignableComp::EmitNativeCode(FlowGraphCompiler* compiler) {
if (!is_eliminated()) {
compiler->GenerateAssertAssignable(deopt_id(),
@@ -1512,8 +1513,8 @@
// Helper to either use the constant value of a definition or the definition.
static Value* UseDefinition(Definition* defn) {
- if (defn->IsBind() && defn->AsBind()->computation()->IsConstant()) {
- return defn->AsBind()->computation()->AsConstant();
+ if (defn->IsBind() && defn->AsBind()->computation()->IsMaterialize()) {
+ return defn->AsBind()->computation()->AsMaterialize()->constant_val();
} else {
return new UseVal(defn);
}

Powered by Google App Engine
This is Rietveld 408576698