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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_emitter/nsm_emitter.dart

Issue 27524003: Generate tear-off closures dynamically. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed unit tests. 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_emitter/nsm_emitter.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_emitter/nsm_emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_emitter/nsm_emitter.dart
index 4e61cd7aa04b3226f837c349887c2419ab414ea0..42aa63d8127fe1d276af37b196ad12db660253f9 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_emitter/nsm_emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_emitter/nsm_emitter.dart
@@ -18,7 +18,7 @@ class NsmEmitter extends CodeEmitterHelper {
static const MAX_MINIFIED_LENGTH_FOR_DIFF_ENCODING = 4;
- void emitNoSuchMethodHandlers(DefineStubFunction defineStub) {
+ void emitNoSuchMethodHandlers(AddPropertyFunction addProperty) {
// Do not generate no such method handlers if there is no class.
if (compiler.codegenWorld.instantiatedClasses.isEmpty) return;
@@ -55,7 +55,7 @@ class NsmEmitter extends CodeEmitterHelper {
compiler.codegenWorld.invokedSetters.forEach(addNoSuchMethodHandlers);
// Set flag used by generateMethod helper below. If we have very few
- // handlers we use defineStub for them all, rather than try to generate them
+ // handlers we use addProperty for them all, rather than try to generate them
ngeoffray 2013/12/04 14:38:28 Line too long.
Johnni Winther 2013/12/05 11:49:56 Long line.
ahe 2013/12/06 15:57:54 Done.
ahe 2013/12/06 15:57:54 Done.
// at runtime.
bool haveVeryFewNoSuchMemberHandlers =
(addedJsNames.length < VERY_FEW_NO_SUCH_METHOD_HANDLERS);
@@ -104,12 +104,12 @@ class NsmEmitter extends CodeEmitterHelper {
Selector selector = addedJsNames[jsName];
jsAst.Expression method = generateMethod(jsName, selector);
if (method != null) {
- defineStub(jsName, method);
+ addProperty(jsName, method);
String reflectionName = task.getReflectionName(selector, jsName);
if (reflectionName != null) {
bool accessible = compiler.world.allFunctions.filter(selector).any(
(Element e) => backend.isAccessibleByReflection(e));
- defineStub('+$reflectionName', js(accessible ? '1' : '0'));
+ addProperty('+$reflectionName', js(accessible ? '1' : '0'));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698