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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10830339: Propagate class ids using existing type propagation framework. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
« 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
===================================================================
--- runtime/vm/intermediate_language.cc (revision 10775)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -329,6 +329,14 @@
}
+intptr_t BindInstr::GetPropagatedCid() {
+ if (has_propagated_cid()) return propagated_cid();
+ intptr_t cid = computation()->ResultCid();
+ ASSERT(cid != kIllegalCid);
+ SetPropagatedCid(cid);
+ return cid;
+}
+
void BindInstr::RecordAssignedVars(BitVector* assigned_vars,
intptr_t fixed_parameter_count) {
computation()->RecordAssignedVars(assigned_vars, fixed_parameter_count);
@@ -568,6 +576,19 @@
}
+intptr_t ConstantVal::ResultCid() const {
+ if (value().IsNull()) {
+ return kNullCid;
+ }
+ if (value().IsInstance()) {
+ return Class::Handle(value().clazz()).id();
+ } else {
+ ASSERT(value().IsAbstractTypeArguments());
+ return kDynamicCid;
+ }
+}
+
+
RawAbstractType* UseVal::CompileType() const {
if (definition()->HasPropagatedType()) {
return definition()->PropagatedType();
@@ -581,6 +602,11 @@
}
+intptr_t UseVal::ResultCid() const {
+ return definition()->GetPropagatedCid();
+}
+
+
RawAbstractType* AssertAssignableComp::CompileType() const {
const AbstractType& value_compile_type =
AbstractType::Handle(value()->CompileType());
« 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