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

Unified Diff: pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart

Issue 1221333015: dart2js: Move field-visiting code to the program-builder. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Change order. Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
index 0dc9df9e160035552f5678b329048e6b0b7ef37e..b31c335188a176a91152c107e9e381f7f1a5d71b 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
@@ -8,6 +8,7 @@ import '../js_emitter.dart' show computeMixinClass, Emitter;
import '../model.dart';
import '../../common.dart';
+import '../../closure.dart' show ClosureFieldElement;
import '../../js/js.dart' as js;
import '../../js_backend/js_backend.dart' show
@@ -24,13 +25,18 @@ import '../js_emitter.dart' show
RuntimeTypeGenerator,
TypeTestProperties;
-import '../../elements/elements.dart' show ParameterElement, MethodElement;
+import '../../elements/elements.dart' show
+ ClosureFieldElement,
herhut 2015/07/09 13:28:39 I don't think this exists in elements.dart?
floitsch 2015/07/09 13:50:24 Done.
+ FieldElement,
+ ParameterElement,
+ MethodElement;
import '../../universe/universe.dart' show Universe, TypeMaskSet;
import '../../deferred_load.dart' show DeferredLoadTask, OutputUnit;
part 'collector.dart';
part 'registry.dart';
+part 'field_visitor.dart';
/// Builds a self-contained representation of the program that can then be
/// emitted more easily by the individual emitters.
@@ -42,7 +48,8 @@ class ProgramBuilder {
/// Contains the collected information the program builder used to build
/// the model.
// The collector will be filled on the first call to `buildProgram`.
- // It is stored and publicly exposed for backwards compatibility.
+ // It is stored and publicly exposed for backwards compatibility. New code
+ // (and in particular new emitters) should not use it.
final Collector collector;
final Registry _registry;
@@ -54,12 +61,11 @@ class ProgramBuilder {
Namer namer,
this._task,
Emitter emitter,
- Emitter oldEmitter,
Set<ClassElement> rtiNeededClasses)
: this._compiler = compiler,
this.namer = namer,
- this.collector = new Collector(
- compiler, namer, rtiNeededClasses, emitter, oldEmitter),
+ this.collector =
+ new Collector(compiler, namer, rtiNeededClasses, emitter),
this._registry = new Registry(compiler);
JavaScriptBackend get backend => _compiler.backend;
@@ -661,7 +667,7 @@ class ProgramBuilder {
List<Field> _buildFields(Element holder, bool visitStatics) {
List<Field> fields = <Field>[];
- _task.oldEmitter.classEmitter.visitFields(
+ new FieldVisitor(_compiler, namer).visitFields(
holder, visitStatics, (VariableElement field,
js.Name name,
js.Name accessorName,

Powered by Google App Engine
This is Rietveld 408576698