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

Unified Diff: lib/compiler/implementation/ssa/tracer.dart

Issue 10827180: Move types out of the HInstructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cosmetic change (updated comment). 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: lib/compiler/implementation/ssa/tracer.dart
diff --git a/lib/compiler/implementation/ssa/tracer.dart b/lib/compiler/implementation/ssa/tracer.dart
index eab32e1e22c0350c9a543adf4e471ab5e3a4fbd9..4fcb29f41724dabca56e2fbaf10504485f2260d3 100644
--- a/lib/compiler/implementation/ssa/tracer.dart
+++ b/lib/compiler/implementation/ssa/tracer.dart
@@ -12,6 +12,7 @@ final bool GENERATE_SSA_TRACE = false;
final String SSA_TRACE_FILTER = null;
class HTracer extends HGraphVisitor implements Tracer {
+ JavaScriptWorkItem work;
int indent = 0;
final RandomAccessFile output;
final bool enabled = GENERATE_SSA_TRACE;
@@ -25,8 +26,9 @@ class HTracer extends HGraphVisitor implements Tracer {
if (enabled) output.closeSync();
}
- void traceCompilation(String methodName) {
+ void traceCompilation(String methodName, JavaScriptWorkItem workItem) {
if (!enabled) return;
+ this.work = workItem;
traceActive =
SSA_TRACE_FILTER == null || methodName.contains(SSA_TRACE_FILTER);
if (!traceActive) return;
@@ -73,12 +75,13 @@ class HTracer extends HGraphVisitor implements Tracer {
void addInstructions(HInstructionStringifier stringifier,
HInstructionList list) {
+ HTypeMap types = work.types;
for (HInstruction instruction = list.first;
instruction !== null;
instruction = instruction.next) {
int bci = 0;
int uses = instruction.usedBy.length;
- String changes = instruction.hasSideEffects() ? '!' : ' ';
+ String changes = instruction.hasSideEffects(types) ? '!' : ' ';
String depends = instruction.dependsOnSomething() ? '?' : '';
addIndent();
String temporaryId = stringifier.temporaryId(instruction);
@@ -88,7 +91,8 @@ class HTracer extends HGraphVisitor implements Tracer {
}
void visitBasicBlock(HBasicBlock block) {
- HInstructionStringifier stringifier = new HInstructionStringifier(block);
+ HInstructionStringifier stringifier =
+ new HInstructionStringifier(work, block);
assert(block.id !== null);
tag("block", () {
printProperty("name", "B${block.id}");
@@ -161,15 +165,16 @@ class HTracer extends HGraphVisitor implements Tracer {
}
class HInstructionStringifier implements HVisitor<String> {
+ JavaScriptWorkItem work;
HBasicBlock currentBlock;
- HInstructionStringifier(this.currentBlock);
+ HInstructionStringifier(this.work, this.currentBlock);
visit(HInstruction node) => node.accept(this);
String temporaryId(HInstruction instruction) {
String prefix;
- HType type = instruction.propagatedType;
+ HType type = work.types[instruction];
if (!type.isPrimitive()) {
prefix = 'U';
} else {
@@ -512,7 +517,6 @@ class HInstructionStringifier implements HVisitor<String> {
}
String visitTypeConversion(HTypeConversion node) {
- String type = node.propagatedType.toString();
- return "TypeConversion: ${temporaryId(node.inputs[0])} to $type";
+ return "TypeConversion: ${temporaryId(node.inputs[0])} to ${node.type}";
}
}

Powered by Google App Engine
This is Rietveld 408576698