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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 12334070: Support runtime check of function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fix Created 7 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: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index ce291f22e1685b73ec61edb9b7f60d258fddc13b..f8ef54e8c134f8f613b17c7e6f0e5c1da1cb5b30 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -596,8 +596,14 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
HInstruction visitTypeConversion(HTypeConversion node) {
HInstruction value = node.inputs[0];
DartType type = node.typeExpression;
- if (type != null && (!type.isRaw || type.kind == TypeKind.TYPE_VARIABLE)) {
- return node;
+ if (type != null) {
+ if (!type.isRaw || type.kind == TypeKind.TYPE_VARIABLE) {
+ return node;
+ }
+ if (type.kind == TypeKind.FUNCTION) {
+ // TODO(johnniwinther): Optimize function type conversions.
+ return node;
+ }
}
HType convertedType = node.instructionType;
if (convertedType.isUnknown()) return node;

Powered by Google App Engine
This is Rietveld 408576698