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

Unified Diff: pkg/compiler/lib/src/cps_ir/type_propagation.dart

Issue 1185633003: cps-ir: Support foreign code. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Status file updates. Created 5 years, 6 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/cps_ir/type_propagation.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index 027a3d67a972c19c2f67004f01160ababc442565..eacc21a82ec523dc77d4a5c6742307eca5a643cf 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -1055,7 +1055,7 @@ class TypePropagationVisitor implements Visitor {
}
void visitCreateInstance(CreateInstance node) {
- setValue(node, nonConstant(typeSystem.exact(node.classElement)));
+ setValue(node, nonConstant(typeSystem.exact(node.classElement.declaration)));
}
void visitReifyRuntimeType(ReifyRuntimeType node) {
@@ -1079,6 +1079,17 @@ class TypePropagationVisitor implements Visitor {
// TODO(asgerf): Expose [Invocation] type.
setValue(node, nonConstant(typeSystem.nonNullType));
}
+
+ @override
+ visitForeignCode(ForeignCode node) {
+ Continuation continuation = node.continuation.definition;
+ setReachable(continuation);
+
+ assert(continuation.parameters.length == 1);
+ Parameter returnValue = continuation.parameters.first;
+
+ setValue(returnValue, nonConstant(node.type));
+ }
}
/// Represents the abstract value of a primitive value at some point in the

Powered by Google App Engine
This is Rietveld 408576698