Skip to content

Commit

Permalink
[GR-57335] Add getters to KnownOffsets and helper to determine itable…
Browse files Browse the repository at this point in the history
… start offsets in OpenTypeWorld

PullRequest: graal/18989
  • Loading branch information
lewurm committed Oct 18, 2024
2 parents d93364d + 35d63a5 commit e49891c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ private boolean isFullyInitialized() {
return vtableEntrySize > 0;
}

public int getVTableBaseOffset() {
return vtableBaseOffset;
}

public int getVTableEntrySize() {
return vtableEntrySize;
}

/**
* Returns of the offset of the index either relative to the start of the vtable
* ({@code fromDynamicHubStart} == false) or start of the dynamic hub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static long loadDispatchTableStartingOffset(
}
}

private static long determineITableStartingOffset(
public static long determineITableStartingOffset(
DynamicHub checkedHub,
int interfaceID) {

Expand Down Expand Up @@ -120,7 +120,7 @@ class DispatchTableStartingOffsetLowering implements NodeLoweringProvider<LoadOp
@Override
public void lower(LoadOpenTypeWorldDispatchTableStartingOffset node, LoweringTool tool) {
SharedMethod target = node.getTarget();
int vtableStartingOffset = KnownOffsets.singleton().getVTableOffset(0, true);
int vtableStartingOffset = KnownOffsets.singleton().getVTableBaseOffset();
if (target != null) {
/*
* If the target is known, then we know whether to use the class dispatch table or
Expand Down

0 comments on commit e49891c

Please sign in to comment.