Skip to content

[XABT] Separate marshal method storage from MarshalMethodClassifier to MarshalMethodsCollection. #10077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Apr 24, 2025

Today the marshal method scanning process is tightly coupled to scanning for JavaCallableWrappers. That is, when building CallableWrapperType objects, the MarshalMethodsClassifier is used to classify methods as marshal methods by calling ShouldBeDynamicallyRegistered (...).

However ShouldBeDynamicallyRegistered doesn't just return a simple bool, it has the side effect of building a list of MarshalMethodEntry objects that are used extensively throughout the build process.

We are likely going to need to build this list in places other than JavaCallableWrappers scanning: assembly rewriting will likely be before JCWs, and GenerateNativeMarshalMethodSources will likely be after JCWs.

As such:

  • Rework MarshalMethodsClassifier to simply classify methods as LLVM marshal method eligible or not (dynamically registered).
  • Move storage to a new MarshalMethodsCollection.

Future:

  • We will likely need MarshalMethodsClassifier to also be able to detect marshal methods that have already been rewritten.

@jpobst jpobst changed the title [XABT] Separate marshal method storage from MarshalMethodClassifier to MarshalMethodCollection. [XABT] Separate marshal method storage from MarshalMethodClassifier to MarshalMethodsCollection. Apr 24, 2025
@jpobst jpobst force-pushed the dev/jpobst/marshal-method-collection branch 3 times, most recently from 9fcf537 to ddd9d3d Compare April 25, 2025 21:34
@jpobst jpobst force-pushed the dev/jpobst/marshal-method-collection branch from ddd9d3d to f89b4ed Compare April 25, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant