ibmruntimes / openj9-openjdk-jdk11

Extensions for OpenJDK 11 for Eclipse OpenJ9
GNU General Public License v2.0
32 stars 111 forks source link

wip Stable and unique Lambda and LambdaForm class names #791

Open ThanHenderson opened 2 months ago

ThanHenderson commented 2 months ago

This WIP patch accompanies https://github.com/eclipse-openj9/openj9/pull/19763 and replaces the index number in Lambda class names with a stable hash-code, and adds a stable hash code to customized LambdaForm classes.

The intent is to enable:

  1. LambdaForms to be stored in SCC
  2. early lookup in the SCC for both Lambda and LambdaForm classes
  3. reduction or elimination of the number of class byte comparisons for Lambdas when creating ROM classes

Signed-off-by: Nathan Henderson nathan.henderson@ibm.com

ThanHenderson commented 2 months ago

@babsingh @hangshao0 Could you guys take a look?

My main point of concern here is "uniqueness" of the uniqueIDs. The Lambda and LambdaForm class names are stable with these uniqueIDs included, and the probability of collisions is low but not impossible. This would cause issues if we are doing an early lookup to produce a class from the SCC based only on the class name. In practice, I haven't observed any collisions.

I am open to any other suggestions in how we should be generating the uniqueID.