Files
sdk/runtime/tests/vm/dart/split_aot_kernel_generation_test.dart
T
Ryan Macnak f4b34ad31b [vm, gc] Add missing promotion of Finalizer external size. Remove race incrementing external size.
When a FinalizerEntry's target gets promoted, the associated external size needs to also get promoted. We were handling the cases where the FinalizerEntry itself was either already old or remained new, but not the case where it was promoted. Failing to promote the external size meant that when the finalizer was collected, external size was subtraced from old space that was still being attributed to new space, so the old space total external size became negative.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50537
Change-Id: Id2fe2d748311de73f04de367c9cd153d87b74ad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272350
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-30 17:14:59 +00:00

49 lines
1.5 KiB
Dart

// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// OtherResources=splay_test.dart splay_common.dart
// Tests AOT kernel generation split into 2 steps using '--from-dill' option.
import 'dart:io' show Platform;
import 'package:path/path.dart' as path;
import 'snapshot_test_helper.dart';
Future<void> runSplitAOTKernelGenerationTest(Uri testScriptUri) async {
await withTempDir((String temp) async {
final intermediateDillPath = path.join(temp, 'intermediate.dill');
final outputDillPath = path.join(temp, 'output.dill');
final snapshotPath = path.join(temp, 'aot.snapshot');
await runGenKernel('BUILD INTERMEDIATE DILL FILE', [
'--no-aot',
'--link-platform',
'--output=$intermediateDillPath',
testScriptUri.toFilePath(),
]);
await runGenKernel('BUILD FINAL DILL FILE', [
'--aot',
'--from-dill=$intermediateDillPath',
'--link-platform',
'--output=$outputDillPath',
testScriptUri.toFilePath(),
]);
await runGenSnapshot('GENERATE SNAPSHOT', [
'--snapshot-kind=app-aot-elf',
'--elf=$snapshotPath',
outputDillPath,
]);
await runBinary('RUN SNAPSHOT', dartPrecompiledRuntime, [snapshotPath]);
});
}
main() async {
await runSplitAOTKernelGenerationTest(
Platform.script.resolve('splay_test.dart'));
}