-
Couldn't load subscription status.
- Fork 1.8k
Fix jniobjecthandles #12371
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
base: master
Are you sure you want to change the base?
Fix jniobjecthandles #12371
Conversation
Removed HandleWeakReference and made ObjectHandlesImpl to be a storage class
In JNIGlobalHandles created 2 instances of ObjectHandlesImpl (one for strong and one for weak hadles). I divided the total global handels range into two halfs at bit 62. Bit 62 is 0 for strong global handles and 1 for weak global handles. Therefore a validation tag is redused from 32 bit to 31 bit
|
Hello Dr. @christianhaeubl, per our discussion, I've opened this PR with the strong/weak handle refactoring. I'd appreciate your review when you have a moment. Thank you! |
resolved some grammar mistakes and updated the split point in JNIGlobalHandles and replaced it from bit 62 to bit 30, because it did not fit in the global handles range
|
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
1c0319c to
29dee8d
Compare
|
Thank you for signing the OCA. |
Delected the duplicated variables in JNIGlobalHandles
In ObjectHandlesImpl all methods specific to weak handles (like createWeak, isWeak, and destroyWeak) were removed. It no longer knows the difference between a strong and a weak handle. Its only job is to store an object at a given index and retrieve it.
In JNIGlobalHandles the single ObjectHandlesImpl instance was replaced with two separate instances: strongGlobalHandles and weakGlobalHandles. The 64-bit global handle space was split into two distinct ranges (strong and weak) by using a bit flag (bit 62). Two new methods, encodeStrong and encodeWeak, were created to correctly place a handle's value into its designated range.