Skip to content

Commit

Permalink
Version 3.3.0-161.0.dev
Browse files Browse the repository at this point in the history
Merge e0116d3 into dev
  • Loading branch information
Dart CI committed Nov 23, 2023
2 parents fd19a0c + e0116d3 commit 83feef1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pkg/compiler/lib/src/js_emitter/startup_emitter/emitter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ class EmitterImpl extends ModularEmitterBase implements Emitter {
@override
Map<OutputUnit, int> get generatedSizes {
final mappedSizes = <OutputUnit, int>{};
_emitter.emittedOutputBuffers.forEach((outputUnit, outputData) {
mappedSizes[outputUnit] = outputData.length;
_emitter.emittedOutputSizes.forEach((outputUnit, dataLength) {
mappedSizes[outputUnit] = dataLength;
});
_emitter.omittedOutputUnits
.forEach((outputUnit) => mappedSizes[outputUnit] = 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class ModelEmitter {
final SourceInformationStrategy _sourceInformationStrategy;
final FragmentMerger fragmentMerger;

// The full code that is written to each hunk part-file.
final Map<OutputUnit, CodeOutput> emittedOutputBuffers = {};
// The length of the code that is written to each hunk part-file.
final Map<OutputUnit, int> emittedOutputSizes = {};

final Set<OutputUnit> omittedOutputUnits = {};

Expand Down Expand Up @@ -360,7 +360,7 @@ class ModelEmitter {
}

// Return the total program size.
return emittedOutputBuffers.values.fold(0, (a, b) => a + b.length);
return emittedOutputSizes.values.fold(0, (a, b) => a + b);
}

/// Generates a simple header that provides the compiler's build id.
Expand Down Expand Up @@ -433,7 +433,6 @@ var ${startupMetricsGlobal} =
CodeOutput mainOutput = StreamCodeOutput(
_outputProvider.createOutputSink('', 'js', api.OutputType.js),
codeOutputListeners);
emittedOutputBuffers[fragment.outputUnit] = mainOutput;

js.Program program = js.Program([
buildGeneratedBy(),
Expand Down Expand Up @@ -461,6 +460,7 @@ var ${startupMetricsGlobal} =
}

mainOutput.close();
emittedOutputSizes[fragment.outputUnit] = mainOutput.length;

if (_shouldGenerateSourceMap) {
_task.measureSubtask('source-maps', () {
Expand Down Expand Up @@ -540,6 +540,11 @@ var ${startupMetricsGlobal} =
} else {
output.close();
}
for (final fragment in fragmentCode) {
for (final outputUnit in fragment.codeFragment.outputUnits) {
emittedOutputSizes[outputUnit] = output.length;
}
}
}

/// Writes a list of [CodeFragments] to [CodeOutput].
Expand All @@ -552,9 +557,6 @@ var ${startupMetricsGlobal} =
for (var emittedCodeFragment in fragmentCode) {
var codeFragment = emittedCodeFragment.codeFragment;
var code = emittedCodeFragment.code;
for (var outputUnit in codeFragment.outputUnits) {
emittedOutputBuffers[outputUnit] = output;
}
fragmentHashes[codeFragment] =
writeCodeFragment(output, code, isFirst, outputFileName);
isFirst = false;
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 3
PATCH 0
PRERELEASE 160
PRERELEASE 161
PRERELEASE_PATCH 0

0 comments on commit 83feef1

Please sign in to comment.