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

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

Issue 10807069: Split TypeGuard and BailoutTarget. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 1e163d67c3a7d1ffa0cfab2592e2dfd372852b29..8f218e5ea9a6b3bb746a4a309411fd153f894534 100644
--- a/lib/compiler/implementation/ssa/tracer.dart
+++ b/lib/compiler/implementation/ssa/tracer.dart
@@ -204,6 +204,16 @@ class HInstructionStringifier implements HVisitor<String> {
return "$prefix${instruction.id}";
}
+ String visitBailoutTarget(HBailoutTarget node) {
+ StringBuffer envBuffer = new StringBuffer();
+ List<HInstruction> inputs = node.inputs;
+ for (int i = 0; i < inputs.length; i++) {
+ envBuffer.add(" ${temporaryId(inputs[i])}");
+ }
+ String on = node.isEnabled ? "enabled" : "disabled";
+ return "BailoutTarget($on): id: ${node.state} env: $envBuffer";
+ }
+
String visitBoolify(HBoolify node) {
return "Boolify: ${temporaryId(node.inputs[0])}";
}
@@ -479,16 +489,24 @@ class HInstructionStringifier implements HVisitor<String> {
} else {
throw new CompilerCancelledException('Unexpected type guard: $type');
}
+ HInstruction guarded = node.guarded;
+ HInstruction bailoutTarget = node.bailoutTarget;
StringBuffer envBuffer = new StringBuffer();
List<HInstruction> inputs = node.inputs;
+ bool skippedFirstGuarded = false;
for (int i = 0; i < inputs.length; i++) {
- if (inputs[i] !== node.guarded) {
- envBuffer.add(" ${temporaryId(inputs[i])}");
+ if (inputs[i] == guarded && !skippedFirstGuarded) {
+ skippedFirstGuarded = true;
ricow1 2012/07/23 12:52:26 you should add a comment explaining why we can saf
floitsch 2012/07/23 13:27:48 refactored code.
+ continue;
}
+ if (inputs[i] != bailoutTarget) continue;
+ envBuffer.add(" ${temporaryId(inputs[i])}");
}
String on = node.isEnabled ? "enabled" : "disabled";
- String id = temporaryId(node.guarded);
- return "TypeGuard($on): $id is $type env: $envBuffer";
+ String guardedId = temporaryId(node.guarded);
+ String bailoutId = temporaryId(node.bailoutTarget);
+ return "TypeGuard($on): $guardedId is $type bailout: $bailoutId "
+ "env: $envBuffer";
}
String visitIs(HIs node) {
« lib/compiler/implementation/ssa/nodes.dart ('K') | « lib/compiler/implementation/ssa/nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698