-
Notifications
You must be signed in to change notification settings - Fork 21
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
Inlining doesn't respect JPMS access restrictions #11812
Comments
@lrytz want to milestone this? |
We don't have the infrastructure in place to check module access restrictions, so this is on hold until then.
|
(Related to scala/scala-dev#529) |
Another angle when inlining from the JDK: There should probably be a default exclusion list for classes with intrinsics. You don't want to accidentally inline from an intrinsic method that could be replaced by HotSpot with a native machine instruction. The resulting code will still work but it will run much slower. |
Good point; how can we find out what parts of the JDK the VMs intrinsify? |
The Scala optimizer respects Java access modifiers so it doesn't inline any code that needs to call other code which is not accessible at the call site. This is not the case for JPMS restrictions. For example, running on OpenJDK 11 with
-opt:l:inline -opt-inline-from:**
:This happens because the
String:toDouble
implementation from the JDK gets inlined into user code even though it cannot accessjdk.internal.math.FloatingDecimal
from outside the JDK.(It's probably a bad idea to inline from the JDK in the first place but the problem will become more pronounced as more and more libraries make use of Java Modules, too.)
The text was updated successfully, but these errors were encountered: