-
Notifications
You must be signed in to change notification settings - Fork 729
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
ConstantDynamic: Building ROM and RAM Classes #1271
Comments
As you pointed out on the whiteboard, moving Indy CP entries back into the constantpool will increase the romclass size slightly in the common case of invokedynamics not sharing cp entries. This design can do the Condy side and leave the Indy representation as is. |
The layout of the ROM / RAM cp entries must match the layout of Constant_Class / Constant_String entries due to the resolution check in the |
I wasn't sure if we reached a consensus yesterday. I have updated the design to exclude InvokeDynamic.
Yes, they currently match. I've added the existing String CPentries to the design for comparison |
@fengxue-IS Are you looking at this? |
Marking CPEntries
Marking which CP entries are used by
ldc
will have to be updated to account for Condy entries.computeConstantMapAndSizes
will also have to be updated to include Condy CP entries.Add new CP entry type
Add new CP description types to BCT_J9DescriptionCPType and J9DescriptionBits (j9nonbuilder.h) for Condy. This will be used to detect the CP type in the bytecode interpreter during ldc (ldc_2 and ldc2_w) bytecodes.Update ConstantPoolWriter (RomClassWriter.cpp) to add
visitCondyType
. This will write out CP entries for Condy in the romConstantPool. The first CP entry slot is a SRP to the NameAndSignature. The second slot is the bootstrap Method index or’ed with the J9DescriptionCPType.This matches the RomStringRef type
The first 4bits of second slot in the romCPEntry must contain the cpType. This is checked by the ldc bytecode to determine what type of resolution to perform for the cp entry.
Update
constantPoolDo
in ConstantPoolMap for the new cp entry.RamClass layout
The ramConstantPool entry for Condy is:This is done to match existing RamStringRefs. By convention the first slot is NULL checked to see if the ref requires resolution. For this reason the Condy constant must be the first slot.
The text was updated successfully, but these errors were encountered: