Skip to content

Commit

Permalink
LayerUse should only set ClosedTypeWorldHubLayout, not ClosedTypeWorld.
Browse files Browse the repository at this point in the history
  • Loading branch information
cstancu committed Sep 12, 2024
1 parent 5e9a6c0 commit bacac43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static void processLayerOptions(EconomicMap<OptionKey<?>, Object> values)
if (layerUseValue.toString().isEmpty()) {
/* Nothing to do, an empty --layer-use= disables the layer application. */
} else {
SubstrateOptions.ClosedTypeWorld.update(values, false);
SubstrateOptions.ClosedTypeWorldHubLayout.update(values, false);
SubstrateOptions.ParseRuntimeOptions.update(values, false);
if (imageLayerEnabledHandler != null) {
imageLayerEnabledHandler.onOptionEnabled(values);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@
public final class VTableBuilder {
private final HostedUniverse hUniverse;
private final HostedMetaAccess hMetaAccess;
private final boolean closedTypeWorldHubLayout;

private VTableBuilder(HostedUniverse hUniverse, HostedMetaAccess hMetaAccess) {
this.hUniverse = hUniverse;
this.hMetaAccess = hMetaAccess;
closedTypeWorldHubLayout = SubstrateOptions.useClosedTypeWorldHubLayout();
}

public static void buildTables(HostedUniverse hUniverse, HostedMetaAccess hMetaAccess) {
Expand Down Expand Up @@ -118,7 +120,7 @@ private List<HostedMethod> generateITable(HostedType type) {

private List<HostedMethod> generateDispatchTable(HostedType type, int startingIndex) {
Predicate<HostedMethod> includeMethod;
if (hUniverse.hostVM().isClosedTypeWorld()) {
if (closedTypeWorldHubLayout) {
// include only methods which will be indirect calls
includeMethod = m -> m.implementations.length > 1 || m.wrapped.isVirtualRootMethod();
} else {
Expand Down

0 comments on commit bacac43

Please sign in to comment.