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

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

Issue 10232011: Implement simple dynamic type check. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor edits. Created 8 years, 8 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/nodes.dart
diff --git a/lib/compiler/implementation/ssa/nodes.dart b/lib/compiler/implementation/ssa/nodes.dart
index 77dd73313ee2506dd70fb499586b161d113f28d0..01081691fa92151d567a88caefa9cad0a0878ccb 100644
--- a/lib/compiler/implementation/ssa/nodes.dart
+++ b/lib/compiler/implementation/ssa/nodes.dart
@@ -2089,19 +2089,25 @@ class HIndexAssign extends HInvokeStatic {
}
class HIs extends HInstruction {
- final Type typeName;
+ final Type typeExpression;
kasperl 2012/04/30 08:48:32 It really isn't an expression but I guess it isn't
karlklose 2012/05/01 11:20:55 This is actually reverting a renaming from an earl
final bool nullOk;
- HIs(this.typeName, HInstruction expression, [nullOk = false])
- : this.nullOk = nullOk, super(<HInstruction>[expression]);
+ HIs.withTypeInfo(this.typeExpression, HInstruction expression,
ngeoffray 2012/04/30 08:51:12 withTypeInfoCall?
karlklose 2012/05/01 11:20:55 Done.
+ HInstruction typeInfo, [nullOk = false])
kasperl 2012/04/30 08:48:32 Can't we use this.nullOk in the parameter list?
karlklose 2012/05/01 11:20:55 Done.
+ : this.nullOk = nullOk, super(<HInstruction>[expression, typeInfo]);
+
+ HIs(this.typeExpression, HInstruction expression, [nullOk = false])
+ : this.nullOk = nullOk, super(<HInstruction>[expression]);
HInstruction get expression() => inputs[0];
+ HInstruction get typeInfo() => inputs[1];
ngeoffray 2012/04/30 08:51:12 ditto
karlklose 2012/05/01 11:20:55 Done.
+
HType get guaranteedType() => HType.BOOLEAN;
accept(HVisitor visitor) => visitor.visitIs(this);
- toString() => "$expression is $typeName";
+ toString() => "$expression is $typeExpression";
}

Powered by Google App Engine
This is Rietveld 408576698