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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/code_emitter_task.dart

Issue 785303003: Add option for outputting a deferred loading mapping. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated format Created 5 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter"); 7 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter");
8 8
9 /** 9 /**
10 * Generates the code for all used classes in the program. Static fields (even 10 * Generates the code for all used classes in the program. Static fields (even
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 oldEmitter = new OldEmitter(compiler, namer, generateSourceMap, this); 52 oldEmitter = new OldEmitter(compiler, namer, generateSourceMap, this);
53 emitter = USE_NEW_EMITTER 53 emitter = USE_NEW_EMITTER
54 ? new new_js_emitter.Emitter(compiler, namer) 54 ? new new_js_emitter.Emitter(compiler, namer)
55 : oldEmitter; 55 : oldEmitter;
56 nativeEmitter = new NativeEmitter(this); 56 nativeEmitter = new NativeEmitter(this);
57 } 57 }
58 58
59 jsAst.Expression isolateStaticClosureAccess(Element element) { 59 jsAst.Expression isolateStaticClosureAccess(Element element) {
60 return emitter.isolateStaticClosureAccess(element); 60 return emitter.isolateStaticClosureAccess(element);
61 } 61 }
62 62
63 jsAst.Expression isolateLazyInitializerAccess(Element element) { 63 jsAst.Expression isolateLazyInitializerAccess(Element element) {
64 return emitter.isolateLazyInitializerAccess(element); 64 return emitter.isolateLazyInitializerAccess(element);
65 } 65 }
66 66
67 jsAst.Expression generateEmbeddedGlobalAccess(String global) { 67 jsAst.Expression generateEmbeddedGlobalAccess(String global) {
68 return emitter.generateEmbeddedGlobalAccess(global); 68 return emitter.generateEmbeddedGlobalAccess(global);
69 } 69 }
70 70
71 jsAst.Expression constantReference(ConstantValue value) { 71 jsAst.Expression constantReference(ConstantValue value) {
72 return emitter.constantReference(value); 72 return emitter.constantReference(value);
73 } 73 }
74 74
75 jsAst.Expression staticFieldAccess(Element e) { 75 jsAst.Expression staticFieldAccess(Element e) {
76 return emitter.staticFunctionAccess(e); 76 return emitter.staticFunctionAccess(e);
77 } 77 }
78 78
79 jsAst.Expression staticFunctionAccess(Element e) { 79 jsAst.Expression staticFunctionAccess(Element e) {
80 return emitter.staticFunctionAccess(e); 80 return emitter.staticFunctionAccess(e);
81 } 81 }
82 82
83 jsAst.Expression classAccess(Element e) { 83 jsAst.Expression classAccess(Element e) {
84 return emitter.classAccess(e); 84 return emitter.classAccess(e);
85 } 85 }
86 86
87 jsAst.Expression typedefAccess(Element e) { 87 jsAst.Expression typedefAccess(Element e) {
88 return emitter.typedefAccess(e); 88 return emitter.typedefAccess(e);
89 } 89 }
90 90
91 void registerReadTypeVariable(TypeVariableElement element) { 91 void registerReadTypeVariable(TypeVariableElement element) {
92 readTypeVariables.add(element); 92 readTypeVariables.add(element);
93 } 93 }
94 94
95 Set<ClassElement> interceptorsReferencedFromConstants() { 95 Set<ClassElement> interceptorsReferencedFromConstants() {
96 Set<ClassElement> classes = new Set<ClassElement>(); 96 Set<ClassElement> classes = new Set<ClassElement>();
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } 376 }
377 377
378 abstract class Emitter { 378 abstract class Emitter {
379 void emitProgram(Program program); 379 void emitProgram(Program program);
380 380
381 jsAst.Expression isolateLazyInitializerAccess(Element element); 381 jsAst.Expression isolateLazyInitializerAccess(Element element);
382 jsAst.Expression isolateStaticClosureAccess(Element element); 382 jsAst.Expression isolateStaticClosureAccess(Element element);
383 jsAst.Expression generateEmbeddedGlobalAccess(String global); 383 jsAst.Expression generateEmbeddedGlobalAccess(String global);
384 jsAst.Expression constantReference(ConstantValue value); 384 jsAst.Expression constantReference(ConstantValue value);
385 jsAst.PropertyAccess staticFunctionAccess(Element element); 385 jsAst.PropertyAccess staticFunctionAccess(Element element);
386 386
387 // TODO(zarah): Split into more fine-grained accesses. 387 // TODO(zarah): Split into more fine-grained accesses.
388 /// Generates access to the js constructor of the class represented by 388 /// Generates access to the js constructor of the class represented by
389 /// [element] 389 /// [element]
390 jsAst.PropertyAccess classAccess(Element element); 390 jsAst.PropertyAccess classAccess(Element element);
391 jsAst.PropertyAccess typedefAccess(Element element); 391 jsAst.PropertyAccess typedefAccess(Element element);
392 jsAst.PropertyAccess staticFieldAccess(Element element); 392 jsAst.PropertyAccess staticFieldAccess(Element element);
393 393
394 394
395 int compareConstants(ConstantValue a, ConstantValue b); 395 int compareConstants(ConstantValue a, ConstantValue b);
396 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); 396 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant);
397 397
398 void invalidateCaches(); 398 void invalidateCaches();
399 } 399 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698