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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 11571004: Implement is-checks for static functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Nicolas' comments. Created 8 years 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index b70c32c2aaa78bac336c88971e1f1c5153986a08..3cb1dc84d5a28e970101aae03b2d04cbec8973ae 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -1251,6 +1251,7 @@ $lazyInitializerLogic
buffer.add(functionBuffer);
buffer.add('$N$n');
}
+
void emitStaticFunctionsWithNamer(CodeBuffer buffer,
Map<Element, CodeBuffer> generatedCode,
String functionNamer(Element element)) {
@@ -1293,6 +1294,15 @@ $lazyInitializerLogic
// in case it is used in spawnFunction.
String fieldName = namer.STATIC_CLOSURE_NAME_NAME;
buffer.add('$fieldAccess.$fieldName$_=$_"$staticName"$N');
+ for (TypedefElement typedef in checkedTypedefs) {
+ FunctionType typedefType =
+ typedef.computeType(compiler).unalias(compiler);
+ if (compiler.types.isSubtype(element.computeType(compiler),
+ typedefType)) {
+ String operator = namer.operatorIs(typedef);
+ buffer.add('$fieldAccess.$operator$_=${_}true$N');
+ }
+ }
}
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698