-
Notifications
You must be signed in to change notification settings - Fork 722
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
Add getDefaultValue helper function #15030
Conversation
@hangshao0 |
@ehrenjulzert Thank you for making this change! @hzongaro and I have a question: Will |
I'm not 100% sure but I don't think it's required for the JIT |
It is possible that GC could change it. But @tajila or @dmitripivkine can confirm (or correct if I am wrong). |
|
If
|
I haven't needed to do something like this before, but if you look at some of the methods in So maybe if we had the helper return the address of the flattened class cache instead - let's say
|
Thanks for the example @hzongaro! @hangshao0 @ehrenjulzert Since |
Correct, |
The flattenedClassCache will not change, but I'd like to avoid increasing the cost of a potential refactor. What is the drawback of doing:
If the FCC is returned, you'd still have to do a deference |
There is none really. Just looking at how the JIT gets various fields from However, if you think it's unlikely that the JIT would ever need anything else that could conceivably be put into the flattened class cache, then returning the address of the default value slot would be fine. |
Im mostly worried about the cost of refactoring things in the FCC if we pass it out directly. It has already changed from its original format. So far the impact is contained to the VM. If we make it accessible outside the VM im worried that refactoring may involve more complexities. Most of the other things in the FCC are already accessible via helpers (eg. |
I've updated the function signature to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Ehren Julien-Neitzert <ehren.julien-neitzert@ibm.com>
Jenkins test sanity win jdk8 |
Jenkins test sanity,extended zlinuxval jdknext |
Jenkins test sanity plinuxvalst jdknext |
I just realized Other helper calls used by JIT such as j9object_t*
getDefaultValueSlotAddress(J9Class* clazz)
{
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
Assert_VM_true(J9_IS_J9CLASS_VALUETYPE(clazz));
Assert_VM_true(J9ClassInitSucceeded == clazz->initializeStatus); /* make sure class has been initialized (otherwise defaultValue won't exist) */
j9object_t* result = &clazz->flattenedClassCache->defaultValue;
Assert_VM_notNull(*result);
return result;
#else
return NULL;
#endif /* #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
} |
@ehrenjulzert can you make that change? |
Sure, I can change that |
New PR: #15132 |
Signed-off-by: Ehren Julien-Neitzert ehren.julien-neitzert@ibm.com