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

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

Issue 27524003: Generate tear-off closures dynamically. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r30954 Created 7 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
Index: dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 9644ba2e92e2dc5d54413abbe35cd57160b9e11d..7f94ba02745562858abe19f8dc0bbe0148ba3074 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -811,6 +811,11 @@ class JavaScriptBackend extends Backend {
enqueueClass(enqueuer, jsPlainJavaScriptObjectClass, elements);
}
}
+ if (cls == compiler.closureClass) {
+ enqueue(enqueuer,
+ compiler.findHelper('closureFromTearOff'),
+ elements);
+ }
ClassElement result = null;
if (cls == compiler.stringClass || cls == jsStringClass) {
addInterceptors(jsStringClass, enqueuer, elements);
@@ -991,6 +996,7 @@ class JavaScriptBackend extends Backend {
}
void registerIsCheck(DartType type, Enqueuer world, TreeElements elements) {
+ enqueueInResolution(getThrowRuntimeError(), elements);
type = type.unalias(compiler);
enqueueClass(world, compiler.boolClass, elements);
bool inCheckedMode = compiler.enableTypeAssertions;
@@ -1048,6 +1054,7 @@ class JavaScriptBackend extends Backend {
}
void registerAsCheck(DartType type, Enqueuer world, TreeElements elements) {
+ enqueueInResolution(getThrowRuntimeError(), elements);
type = type.unalias(compiler);
if (!world.isResolutionQueue) {
// All helpers are added to resolution queue in enqueueHelpers. These
@@ -1736,6 +1743,8 @@ class JavaScriptBackend extends Backend {
* system.
*/
bool isAccessibleByReflection(Element element) {
+ // TODO(ahe): This isn't sufficient: simply importing dart:mirrors
+ // causes hasInsufficientMirrorsUsed to become true.
if (hasInsufficientMirrorsUsed) return true;
return isNeededForReflection(element);
}

Powered by Google App Engine
This is Rietveld 408576698