0

I was looking through the OpenJDK class file parser source and I came across something I've never heard of - Constant Pool Patching. What is this? I've read the JVM specification before but it didn't mention anything like this, and searching on Google failed to turn anything up.

Antimony
  • 37,781
  • 10
  • 100
  • 107

1 Answers1

1

To put it simply, the patching procedure replaces constant pool entries at class parse time in order to handle JSR-229, which implements invokedynamic. It is used to rewrite UTF-8, class, and value (float, int, etc.) entries when loading anonymous classes.

For a primer on how invokedynamic is implemented, see http://blog.headius.com/2008/09/first-taste-of-invokedynamic.html

obataku
  • 29,212
  • 3
  • 44
  • 57