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

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: Update test expectations. 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 7ae47a5c134e79a5ad369d2a07259bf3dd9c03d7..cecf42d12e78bc924108bbbc1217600bad0b8d70 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -1280,7 +1280,7 @@ class TypePropagationVisitor implements Visitor {
}
void visitCreateInstance(CreateInstance node) {
- setValue(node, nonConstant(typeSystem.nonNullExact(node.classElement)));
+ setValue(node, nonConstant(typeSystem.nonNullExact(node.classElement.declaration)));
}
void visitReifyRuntimeType(ReifyRuntimeType node) {
@@ -1304,6 +1304,19 @@ class TypePropagationVisitor implements Visitor {
// TODO(asgerf): Expose [Invocation] type.
setValue(node, nonConstant(typeSystem.nonNullType));
}
+
+ @override
+ visitForeignCode(ForeignCode node) {
+ if (node.continuation != null) {
+ Continuation continuation = node.continuation.definition;
+ setReachable(continuation);
+
+ assert(continuation.parameters.length == 1);
+ Parameter returnValue = continuation.parameters.first;
+ setValue(returnValue, nonConstant(node.type));
+ }
+ setValue(node, nonConstant());
+ }
}
/// Represents the abstract value of a primitive value at some point in the
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698