44f8e21c82
Introduce a helper library to trim components based on what we believe it is needed for modular bytecode compilation. The script is configured to accept a set of entry points, so unreachable libraries can be removed entirely. The contents of the retained libraries is trimmed to remove method bodies, constructor bodies, and initializers, except for where they may be needed. In the near future, this should be expanded to: * include proper unit testing in the CFE * review whether additional trimming operations can be made * consider an explicit representation of trimmed content, to help the CFE recover when assumptions are not met (e.g. sentinel markers to establish whether a value has been trimmed) * CFE produces trimmed data directly if needed, without having to first produce the full dill. Tests that specifically stress that we don't over-trim include: apply_mixin (requires preserving method bodies), const_body (requires preserving initializers). TEST=existing and new e2e dynamic module aot tests. b/394936876 Change-Id: I26db8385bdfe1664b2aea234ec8bb896c7c21230 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418702 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Sigmund Cherem <sigmund@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
9 lines
263 B
Dart
9 lines
263 B
Dart
// Copyright (c) 2025, 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.
|
|
|
|
class B {
|
|
final int x;
|
|
const B(this.x);
|
|
}
|