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

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

Issue 12334070: Support runtime check of function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Register dependency Created 7 years, 9 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/codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index 267d6114ef156502e9d66761f8a31e7ae971f37b..257b553a11cad8d1feb15ce6093133315d547a0f 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -2255,9 +2255,15 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
message: 'Attempt to check malformed type $type'));
world.registerIsCheck(type, work.resolutionTree);
Element element = type.element;
+ String operatorIs;
+ if (type is FunctionType) {
ngeoffray 2013/03/13 09:30:46 Use the kind?
Johnni Winther 2013/03/22 07:30:24 Refactored.
+ operatorIs = backend.namer.operatorIsFunctionType(type);
+ } else {
+ operatorIs = backend.namer.operatorIs(element);
+ }
use(input);
js.PropertyAccess field =
- new js.PropertyAccess.field(pop(), backend.namer.operatorIs(element));
+ new js.PropertyAccess.field(pop(), operatorIs);
if (backend.emitter.nativeEmitter.requiresNativeIsCheck(element)) {
push(new js.Call(field, <js.Expression>[]));
if (negative) push(new js.Prefix('!', pop()));

Powered by Google App Engine
This is Rietveld 408576698