You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clean up places that need to distinguish Q type from L type prefix #12237
In the prototype implementation of value types support, the letter Q is used as a prefix in the bytecode for the signatures of classes that are value types, as distinguished from concrete identity type classes, interfaces and abstract classes, whose signatures are prefixed with the letter L.
Minimal changes to handle the Q prefix in the JIT compiler were merged into OpenJ9 in pull request #9030.
Charlene @Charlmzz prototyped additional changes in the JIT compiler for places in OpenJ9 and OMR where the JIT compiler checks for a prefix of L that likely should also check for a prefix of Q.
These changes need to be double-checked for correctness and completeness, and should be delivered with any necessary corrections. They can be found in commit 6fa5892 and OMR commit eclipse-omr/omr@b12967f
Thanks for your interest in helping with this issue @teriyakiSauce23!
Where most cases with type 'L' are being replaced with "L or Q" behavior.
Am I on the right track here? In which files do changes need to be made?
Yes, that's right. In most cases, I expect we will just need to check for 'Q' and treat it the same as 'L' is treated. However, there might be cases where we will need to treat 'Q' differently from 'L'. Each instance will have to be examined to understand how the test of the prefix character is being used.
In OpenJ9, you'll want to look at files within the runtime/compiler directory and its subdirectories. In OMR, look at files within the compiler directory and its subdirectories.
I think the first step will be to look at Charlene's commits, and rebase them on the latest version of the code. Then the second step will be to check whether there are additional cases of checks for an 'L' prefix that Charlene missed or that have crept in since she implemented her changes. The last, and most important step will be a careful analysis of each test to determine whether it can simply be expanded to treat 'Q' in the same way 'L' is treated, or if some different kind of treatment is required. I'd be happy to help with figuring that out, and if there are cases where I'm unsure, there are many other developers who can advise us.
If you're still interested, I will assign the issue to you.
I was rebasing some of the code, and I noticed this change in 6fa5892:
for (i = 0; i < numDims; i++)
sig[i] = '[';
if (* name != '[')
- sig[i++] = 'L';- memcpy(sig+i, name, len);+ if (isValueTypeClass(myClass))+ sig[i++] = 'Q';+ else+ sig[i++] = 'L';
i += len;
if (* name != '[')
sig[i++] = ';';
Is there a reason memcpy(sig+i, name, len); isn't moved to after the if statement? Seems like removing it would yield different behavior.
I think I've changed nearly everything, but could have very well missed something as the compiler files are quite large. I looked at files that relate to classes mostly as I suspect the use of the prefixes would mostly be there. As for next steps, how would I go about testing everything?
As for next steps, how would I go about testing everything?
Thanks for the update, Lawrence @teriyakiSauce23 . For basic testing, if you haven't already read the following, you might want to check out https://github.com/eclipse/openj9/blob/master/test/docs/OpenJ9TestUserGuide.md. I'm by no means an expert on the contents of all the tests, but running _functional tests might be a good thing to try.
In addition there are specific value types sanity tests that you can run specifying a functional/Valhalla as your BUILD_LIST. In order to run those value types tests, you'll need to enable the prototype value types support. You can do that by running the configure tool with the --enable-inline-types option included.
Beyond that, as I said we'll probably need to go over each change carefully to understand the context in which the check is being performed, to verify that treating 'L' and 'Q' the same way is the right thing to do.
@dsouzai Although I used the phrase "Clean up" in the title of this issue, it probably doesn't qualify as technical debt - it's part of the on-going prototype support for value types.
I updated Charlene's changes in openj9 #13535 and eclipse-omr/omr#6183. One left issue that's not covered in these two PR is the L reference in classNameToSignature in Aliases.cpp. The existing API classNameToSignature doesn't have a class pointer for us to distinguish if the class is a VT or not. It will not be a trivial change like the rest of them. It should be put in a separate PR.
Activity
Lawqup commentedon Mar 18, 2021
I'd like to work on this issue if anyone else isn't. I'm quite new to this so I would appreciate some clarification on what I should do.
In 6fa5892 I see changes like this:
Where most cases with type 'L' are being replaced with "L or Q" behavior.
Am I on the right track here? In which files do changes need to be made?
hzongaro commentedon Mar 18, 2021
Thanks for your interest in helping with this issue @teriyakiSauce23!
Yes, that's right. In most cases, I expect we will just need to check for 'Q' and treat it the same as 'L' is treated. However, there might be cases where we will need to treat 'Q' differently from 'L'. Each instance will have to be examined to understand how the test of the prefix character is being used.
In OpenJ9, you'll want to look at files within the
runtime/compilerdirectory and its subdirectories. In OMR, look at files within thecompilerdirectory and its subdirectories.I think the first step will be to look at Charlene's commits, and rebase them on the latest version of the code. Then the second step will be to check whether there are additional cases of checks for an 'L' prefix that Charlene missed or that have crept in since she implemented her changes. The last, and most important step will be a careful analysis of each test to determine whether it can simply be expanded to treat 'Q' in the same way 'L' is treated, or if some different kind of treatment is required. I'd be happy to help with figuring that out, and if there are cases where I'm unsure, there are many other developers who can advise us.
If you're still interested, I will assign the issue to you.
Lawqup commentedon Mar 18, 2021
Thank you! Yes, I'd like you to assign this to me. I'll start working on it today.
Lawqup commentedon Mar 18, 2021
I was rebasing some of the code, and I noticed this change in 6fa5892:
for (i = 0; i < numDims; i++) sig[i] = '['; if (* name != '[') - sig[i++] = 'L'; - memcpy(sig+i, name, len); + if (isValueTypeClass(myClass)) + sig[i++] = 'Q'; + else + sig[i++] = 'L'; i += len; if (* name != '[') sig[i++] = ';';Is there a reason
memcpy(sig+i, name, len);isn't moved to after the if statement? Seems like removing it would yield different behavior.hzongaro commentedon Mar 19, 2021
Hmmm - I don't see a reason why that memcopy should have been removed. Good catch!
Lawqup commentedon Mar 20, 2021
I think I've changed nearly everything, but could have very well missed something as the compiler files are quite large. I looked at files that relate to classes mostly as I suspect the use of the prefixes would mostly be there. As for next steps, how would I go about testing everything?
hzongaro commentedon Mar 23, 2021
Thanks for the update, Lawrence @teriyakiSauce23 . For basic testing, if you haven't already read the following, you might want to check out https://github.com/eclipse/openj9/blob/master/test/docs/OpenJ9TestUserGuide.md. I'm by no means an expert on the contents of all the tests, but running
_functionaltests might be a good thing to try.In addition there are specific value types sanity tests that you can run specifying a
functional/Valhallaas yourBUILD_LIST. In order to run those value types tests, you'll need to enable the prototype value types support. You can do that by running theconfiguretool with the--enable-inline-typesoption included.Beyond that, as I said we'll probably need to go over each change carefully to understand the context in which the check is being performed, to verify that treating 'L' and 'Q' the same way is the right thing to do.
hzongaro commentedon Apr 16, 2021
@dsouzai Although I used the phrase "Clean up" in the title of this issue, it probably doesn't qualify as technical debt - it's part of the on-going prototype support for value types.
hzongaro commentedon Sep 1, 2021
Lawrence @Lawqup, are you still looking at this issue? Perhaps we could help you to get your changes through to delivery.
a7ehuo commentedon Sep 7, 2021
I'll take a look at Charlene's changes since more issues related to missing Q type descriptor is likely to surface when we do more tests
a7ehuo commentedon Sep 20, 2021
I updated Charlene's changes in openj9 #13535 and eclipse-omr/omr#6183. One left issue that's not covered in these two PR is the
Lreference inclassNameToSignaturein Aliases.cpp. The existing APIclassNameToSignaturedoesn't have a class pointer for us to distinguish if the class is a VT or not. It will not be a trivial change like the rest of them. It should be put in a separate PR.Add 'Q' prefix handling
Add 'Q' prefix handling
Add 'Q' prefix handling
Add 'Q' prefix handling
Add 'Q' prefix handling