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

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

Issue 22903036: Use predicates to check simple function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Small updates. Created 7 years, 4 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/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 916928248af9b5cde784246791d2614044acf750..2e4407261d997fa5332f58add06fae38c27cb547 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -1776,6 +1776,10 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
return new HTypeConversion.withTypeRepresentation(type, kind, subtype,
original, typeVariable);
} else if (type.kind == TypeKind.FUNCTION) {
+ FunctionType functionType = type;
+ if (functionType.isSimple) {
+ return original.convertType(compiler, type, kind);
+ }
HType subtype = original.instructionType;
if (type.containsTypeVariables) {
bool contextIsTypeArguments = false;
@@ -2794,6 +2798,10 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
HInstruction buildIsNode(Node node, DartType type, HInstruction expression) {
type = type.unalias(compiler);
if (type.kind == TypeKind.FUNCTION) {
+ FunctionType functionType = type;
+ if (functionType.isSimple) {
+ return new HIs(type, <HInstruction>[expression], HIs.RAW_CHECK);
+ }
Element checkFunctionSubtype = backend.getCheckFunctionSubtype();
HInstruction signatureName = graph.addConstantString(

Powered by Google App Engine
This is Rietveld 408576698