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

Unified Diff: pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart

Issue 2568723007: Create Namer and Emitter on codegen start. (Closed)
Patch Set: Small fix. Created 4 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: pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart
index f0a6e0fe82a90cd1b6ef679d2a4e2d11d6324642..9bdf1468b67292d19c374e59864a1b4569c90431 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart
@@ -5,8 +5,11 @@
part of dart2js.js_emitter.full_emitter;
class NsmEmitter extends CodeEmitterHelper {
+ final ClosedWorld closedWorld;
final List<Selector> trivialNsmHandlers = <Selector>[];
+ NsmEmitter(this.closedWorld);
+
/// If this is true then we can generate the noSuchMethod handlers at startup
/// time, instead of them being emitted as part of the Object class.
bool get generateTrivialNsmHandlers => true;
@@ -19,8 +22,9 @@ class NsmEmitter extends CodeEmitterHelper {
static const MAX_MINIFIED_LENGTH_FOR_DIFF_ENCODING = 4;
void emitNoSuchMethodHandlers(AddPropertyFunction addProperty) {
- ClassStubGenerator generator =
- new ClassStubGenerator(compiler, namer, backend);
+ ClassStubGenerator generator = new ClassStubGenerator(
+ namer, backend, codegenWorld, closedWorld,
+ enableMinification: compiler.options.enableMinification);
// Keep track of the JavaScript names we've already added so we
// do not introduce duplicates (bad for code size).
@@ -55,7 +59,7 @@ class NsmEmitter extends CodeEmitterHelper {
generator.generateStubForNoSuchMethod(jsName, selector);
addProperty(method.name, method.code);
if (reflectionName != null) {
- bool accessible = compiler.closedWorld.allFunctions
+ bool accessible = closedWorld.allFunctions
.filter(selector, null)
.any((Element e) => backend.isAccessibleByReflection(e));
addProperty(

Powered by Google App Engine
This is Rietveld 408576698