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

Unified Diff: pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart

Issue 968843003: Implement type argument access and reification of runtime types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
Index: pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
index 5d3cb519d2b99e2a7fa4b14d1eb1a670c5344ce5..2b3e95f937011c65655e16e26e35636cf8483f48 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
@@ -122,6 +122,8 @@ class Builder extends cps_ir.Visitor<Node> {
Expression getVariableReference(cps_ir.Reference reference) {
Variable variable = getVariable(reference.definition);
if (variable == null) {
+ // Note: this may fail because you forgot to implement a visit-function
+ // in the RegisterAllocator.
internalError(
CURRENT_ELEMENT_SPANNABLE,
"Reference to ${reference.definition} has no register");
@@ -622,5 +624,13 @@ class Builder extends cps_ir.Visitor<Node> {
Expression visitIsTrue(cps_ir.IsTrue node) {
return getVariableReference(node.value);
}
-}
+ Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) {
+ return new ReifyRuntimeType(getVariableReference(node.value));
+ }
+
+ Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) {
+ return new ReadTypeVariable(node.variable, node.context,
+ getVariableReference(node.target));
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698