Skip to content

Commit

Permalink
[GR-58129] LayerUse should only disable ClosedTypeWorldHubLayout, not…
Browse files Browse the repository at this point in the history
… ClosedTypeWorld.

PullRequest: graal/18816
  • Loading branch information
cstancu committed Sep 14, 2024
2 parents f8ed697 + bacac43 commit a07c67c
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 a07c67c

Please sign in to comment.