]> source.dussan.org Git - dcevm.git/commit
Better enums support feature/experimental
authorIvan Dubrov <idubrov@guidewire.com>
Sun, 5 Jul 2015 05:03:13 +0000 (22:03 -0700)
committerIvan Dubrov <idubrov@guidewire.com>
Fri, 10 Jul 2015 02:25:25 +0000 (19:25 -0700)
commit63245b47e747a09a3d812db482ca4694d636cffc
tree8959197110d28a411fe47705bb67364fc5b17daf
parent4d67683d0d7a5af417efa8f0d4da7d4b34d61863
Better enums support

Let enums to re-initialize so all new literals are instantiated. Since we might
have references to old instances, copy old instances into new enum. Ideally,
we would like to replace old instances with new ones, but we re-initialize enums
only after redefinition is finished and therefore we cannot do the heap update.

Theoretically, we can instantiate new literals before re-initializing enums,
replace old references with new ones and somehow intercept instantiation of
new literals to use the memory we allocated already instead of creating new
ones.

Or maybe just after we re-initialize enums we do byte-by-byte copy from
initialized instances to instances we created during heap inspection.
dcevm/src/test/java7/com/github/dcevm/test/fields/EnumTest.java
dcevm/src/test/java7/com/github/dcevm/test/methods/AnnotationTest.java
hotspot/.hg/patches/enum-support.patch [new file with mode: 0644]
hotspot/.hg/patches/series