Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6653858
Votes 0
Synopsis dynamic languages need to be able to load anonymous classes
Category hotspot:compiler2
Reported Against
Release Fixed hs14(b08), 7(b40) (Bug ID:2170002)
State 10-Fix Delivered, request for enhancement
Priority: 3-Medium
Related Bugs 6471009
Submit Date 23-JAN-2008
Description
http://blogs.sun.com/jrose/entry/anonymous_classes_in_the_vm

One pain point in dynamic language implementation is managing
code dynamically.  Too often the JVM's class loaders and
naming conventions get in the way.

Desired features:
 - load an arbitrary class from bytecodes
 - put class in class hierarchy but *not* in any class loader
 - piggyback on a "host class" as if it were an inner class
 - element of the anonymous constant pool can be patched easily
 - string constants can be replaced by arbitrary objects in CP

Why the patching stuff?  Mainly, it makes some use cases much easier.
Second, the constant pool needed some internal patching anyway,
to anonymize the loaded class itself.  Also, if you are going
to use this seriously, you'll want to build anonymous classes
on top of pre-existing anonymous classes, and that requires patching.

Finally, generated code often needs to get to complex constants
(e.g., lists or tables) and this provides a hook to introduce
them directly via the CP.

We want to cut ClassLoaders and the system dictionary out of the loop.
This means there will be fewer locks and no GC entanglements.
Drop the last  customer , and the class goes away too, just as it should.
Posted Date : 2008-01-23 00:18:46.0
Work Around
N/A
Evaluation
http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/a45484ea312d
Posted Date : 2008-11-13 09:12:13.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang