| Index: pkg/compiler/lib/src/js_emitter/metadata_collector.dart
|
| diff --git a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
|
| index 6c84560cf07c3ba54f2004301471b4ec77c811f0..ba5707794f9a6ae189b1d723da7b7d1b747b31a3 100644
|
| --- a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
|
| +++ b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
|
| @@ -116,8 +116,7 @@ class _MetadataList extends jsAst.DeferredExpression {
|
| jsAst.Expression _value;
|
|
|
| void setExpression(jsAst.Expression value) {
|
| - // TODO(herhut): Enable the below assertion once incremental mode is gone.
|
| - // assert(_value == null);
|
| + assert(_value == null);
|
| assert(value.precedenceLevel == this.precedenceLevel);
|
| _value = value;
|
| }
|
| @@ -156,12 +155,6 @@ class MetadataCollector implements jsAst.TokenFinalizer {
|
| Map<OutputUnit, Map<ResolutionDartType, _BoundMetadataEntry>> _typesMap =
|
| <OutputUnit, Map<ResolutionDartType, _BoundMetadataEntry>>{};
|
|
|
| - // To support incremental compilation, we have to be able to eagerly emit
|
| - // metadata and add metadata later on. We use the below two counters for
|
| - // this.
|
| - int _globalMetadataCounter = 0;
|
| - int _globalTypesCounter = 0;
|
| -
|
| MetadataCollector(this._compiler, this._emitter) {
|
| _globalMetadataMap = new Map<String, _BoundMetadataEntry>();
|
| }
|
| @@ -320,11 +313,7 @@ class MetadataCollector implements jsAst.TokenFinalizer {
|
| String printed =
|
| jsAst.prettyPrint(node, _compiler, renamerForNames: nameToKey);
|
| return _globalMetadataMap.putIfAbsent(printed, () {
|
| - _BoundMetadataEntry result = new _BoundMetadataEntry(node);
|
| - if (_compiler.options.hasIncrementalSupport) {
|
| - result.finalize(_globalMetadataCounter++);
|
| - }
|
| - return result;
|
| + return new _BoundMetadataEntry(node);
|
| });
|
| }
|
|
|
| @@ -356,13 +345,8 @@ class MetadataCollector implements jsAst.TokenFinalizer {
|
| new Map<ResolutionDartType, _BoundMetadataEntry>();
|
| }
|
| return _typesMap[outputUnit].putIfAbsent(type, () {
|
| - _BoundMetadataEntry result = new _BoundMetadataEntry(
|
| - _computeTypeRepresentation(type,
|
| - ignoreTypeVariables: ignoreTypeVariables));
|
| - if (_compiler.options.hasIncrementalSupport) {
|
| - result.finalize(_globalTypesCounter++);
|
| - }
|
| - return result;
|
| + return new _BoundMetadataEntry(_computeTypeRepresentation(type,
|
| + ignoreTypeVariables: ignoreTypeVariables));
|
| });
|
| }
|
|
|
| @@ -399,11 +383,6 @@ class MetadataCollector implements jsAst.TokenFinalizer {
|
| }
|
|
|
| jsAst.ArrayInitializer finalizeMap(Map<dynamic, _BoundMetadataEntry> map) {
|
| - // When in incremental mode, we allocate entries eagerly.
|
| - if (_compiler.options.hasIncrementalSupport) {
|
| - return new jsAst.ArrayInitializer(map.values.toList());
|
| - }
|
| -
|
| bool isUsed(_BoundMetadataEntry entry) => entry.isUsed;
|
| List<_BoundMetadataEntry> entries = map.values.where(isUsed).toList();
|
| entries.sort();
|
|
|