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

Unified Diff: runtime/vm/il_printer.cc

Issue 12221139: Revert "Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « runtime/vm/flow_graph_type_propagator.cc ('k') | 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/il_printer.cc
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index 02db6e237a1ffe642908f9b0f3a1d533fa656a33..bd501ace930f669541eab7a06e23cbe37f1f9559 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -88,12 +88,17 @@ void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function,
const AbstractType& dst_type,
const String& dst_name,
bool eliminated) {
+ const Script& script = Script::Handle(parsed_function.function().script());
const char* compile_type_name = "unknown";
if (value != NULL) {
- compile_type_name = value->Type()->ToCString();
+ const AbstractType& type = AbstractType::Handle(value->CompileType());
+ if (!type.IsNull()) {
+ compile_type_name = String::Handle(type.Name()).ToCString();
+ }
}
- OS::Print("%s type check: compile type %s is %s specific than "
- "type '%s' of '%s'.\n",
+ Parser::PrintMessage(script, token_pos, "",
+ "%s type check: compile type '%s' is %s specific than "
+ "type '%s' of '%s'.",
eliminated ? "Eliminated" : "Generated",
compile_type_name,
eliminated ? "more" : "not more",
@@ -102,31 +107,6 @@ void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function,
}
-void CompileType::PrintTo(BufferFormatter* f) const {
- f->Print("T{");
- f->Print("%s, ", is_nullable_ ? "null" : "not-null");
- if (cid_ != kIllegalCid) {
- const Class& cls =
- Class::Handle(Isolate::Current()->class_table()->At(cid_));
- f->Print("%s, ", String::Handle(cls.Name()).ToCString());
- } else {
- f->Print("?, ");
- }
- f->Print("%s}", (type_ != NULL) ? String::Handle(type_->Name()).ToCString()
- : "?");
-}
-
-
-const char* CompileType::ToCString() const {
- char buffer[1024];
- BufferFormatter f(buffer, sizeof(buffer));
- PrintTo(&f);
- return Isolate::Current()->current_zone()->MakeCopyOfString(buffer);
-}
-
-
-
-
static void PrintICData(BufferFormatter* f, const ICData& ic_data) {
f->Print(" IC[%"Pd": ", ic_data.NumberOfChecks());
Function& target = Function::Handle();
@@ -154,6 +134,20 @@ static void PrintICData(BufferFormatter* f, const ICData& ic_data) {
}
+static void PrintPropagatedType(BufferFormatter* f, const Definition& def) {
+ if (def.HasPropagatedType()) {
+ String& name = String::Handle();
+ name = AbstractType::Handle(def.PropagatedType()).Name();
+ f->Print(" {PT: %s}", name.ToCString());
+ }
+ if (def.has_propagated_cid()) {
+ const Class& cls = Class::Handle(
+ Isolate::Current()->class_table()->At(def.propagated_cid()));
+ f->Print(" {PCid: %s}", String::Handle(cls.Name()).ToCString());
+ }
+}
+
+
static void PrintUse(BufferFormatter* f, const Definition& definition) {
if (definition.is_used()) {
if (definition.HasSSATemp()) {
@@ -188,15 +182,11 @@ void Definition::PrintTo(BufferFormatter* f) const {
f->Print("%s:%"Pd"(", DebugName(), GetDeoptId());
PrintOperandsTo(f);
f->Print(")");
+ PrintPropagatedType(f, *this);
if (range_ != NULL) {
f->Print(" ");
range_->PrintTo(f);
}
-
- if (type_ != NULL) {
- f->Print(" ");
- type_->PrintTo(f);
- }
}
@@ -210,11 +200,6 @@ void Definition::PrintOperandsTo(BufferFormatter* f) const {
void Value::PrintTo(BufferFormatter* f) const {
PrintUse(f, *definition());
- if ((reaching_type_ != NULL) &&
- (reaching_type_ != definition()->Type())) {
- f->Print(" ");
- reaching_type_->PrintTo(f);
- }
}
@@ -291,9 +276,10 @@ const char* RangeBoundary::ToCString() const {
void AssertAssignableInstr::PrintOperandsTo(BufferFormatter* f) const {
value()->PrintTo(f);
- f->Print(", %s, '%s'",
- dst_type().ToCString(),
- dst_name().ToCString());
+ f->Print(", %s, '%s'%s",
+ String::Handle(dst_type().Name()).ToCString(),
+ dst_name().ToCString(),
+ is_eliminated() ? " eliminated" : "");
f->Print(" instantiator(");
instantiator()->PrintTo(f);
f->Print(")");
@@ -305,6 +291,7 @@ void AssertAssignableInstr::PrintOperandsTo(BufferFormatter* f) const {
void AssertBooleanInstr::PrintOperandsTo(BufferFormatter* f) const {
value()->PrintTo(f);
+ f->Print("%s", is_eliminated() ? " eliminated" : "");
}
@@ -620,6 +607,7 @@ void PhiInstr::PrintTo(BufferFormatter* f) const {
if (i < inputs_.length() - 1) f->Print(", ");
}
f->Print(")");
+ PrintPropagatedType(f, *this);
if (is_alive()) {
f->Print(" alive");
} else {
@@ -629,10 +617,6 @@ void PhiInstr::PrintTo(BufferFormatter* f) const {
f->Print(" ");
range_->PrintTo(f);
}
- if (type_ != NULL) {
- f->Print(" ");
- type_->PrintTo(f);
- }
}
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698