Skip to content
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

Set java.lang.reflect.Field flags for value types #20552

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

theresa-m
Copy link
Contributor

@theresa-m theresa-m commented Nov 8, 2024

The value types java.lang.reflect.Field replaces the trustedFinal boolean with a flags int. Set TRUSTED_ACCESS and
NULL_RESTRICTED flags.

Fixes: #20372

edit: I ran a personal build to confirm that sanity tests with a valhalla build will pass with this change https://hyc-runtimes-jenkins.swg-devops.com/view/OpenJ9%20-%20Personal/job/Pipeline-Build-Test-Personal/24974/

@theresa-m theresa-m requested a review from hangshao0 November 8, 2024 19:07
@theresa-m theresa-m added comp:vm project:valhalla Used to track Project Valhalla related work labels Nov 8, 2024
runtime/jcl/common/reflecthelp.c Outdated Show resolved Hide resolved
runtime/jcl/common/reflecthelp.c Outdated Show resolved Hide resolved
@hangshao0
Copy link
Contributor

Also we missed setting flag MN_NULL_RESTRICTED here:

if (J9ROMFIELD_IS_NULL_RESTRICTED(romField)) {

The title of this PR is "Set java.lang.Field flags for value types", so this can be fix in a separate PR.

runtime/oti/j9consts.h Outdated Show resolved Hide resolved
runtime/oti/j9consts.h Show resolved Hide resolved
@hangshao0
Copy link
Contributor

Jenkins test sanity.functional,extended.functional alinuxvalst jdknext

@hangshao0
Copy link
Contributor

Jenkins compile amac jdknext

@hangshao0
Copy link
Contributor

Jenkins test sanity.functional,extended zlinuxval jdknext

@@ -950,6 +950,12 @@ extern "C" {
#define PREVIEW_MINOR_VERSION 65535
#define J9_IS_CLASSFILE_OR_ROMCLASS_VALUETYPE_VERSION(classfileOrRomClass) (((classfileOrRomClass)->majorVersion >= VALUE_TYPES_MAJOR_VERSION) && (PREVIEW_MINOR_VERSION == (classfileOrRomClass)->minorVersion))

#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
/* Constants for java.lang.Field flags */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be java.lang.reflect.Field

@hangshao0
Copy link
Contributor

Link of aarch64_linux_vt_standard build: https://openj9-jenkins.osuosl.org/job/Pipeline_Build_Test_JDKnext_aarch64_linux_vt_standard/30/

All other PR builds passed.

@theresa-m
Copy link
Contributor Author

this should be java.lang.reflect.Field

This has been updated.

@hangshao0 hangshao0 changed the title Set java.lang.Field flags for value types Set java.lang.reflect.Field flags for value types Nov 12, 2024
@hangshao0
Copy link
Contributor

this should be java.lang.reflect.Field

This has been updated.

Commit message needs to be updated as well.

The value types java.lang.reflect.Field replaces the trustedFinal
 boolean with a flags int. Set TRUSTED_ACCESS and
NULL_RESTRICTED flags.

Signed-off-by: Theresa Mammarella <[email protected]>
@theresa-m
Copy link
Contributor Author

this should be java.lang.reflect.Field

This has been updated.

Commit message needs to be updated as well.

Updated

@hangshao0 hangshao0 merged commit 6f623b4 into eclipse-openj9:master Nov 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm project:valhalla Used to track Project Valhalla related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

java.lang.IllegalAccessException thrown for jdk.internal.misc.Unsafe.theUnsafe in Valhalla vt_standard testing
3 participants