JavaClass memory optimization (part 1)
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 08 Dec 2014 23:03:45 +0000
changeset 3290 76d4443744ed
parent 3289 3aaf43a51816
child 3291 2cf782f380f2
JavaClass memory optimization (part 1) In various Java class housekeeping datastructures keep indices to constant pool instead of keeping classrefs. This is to decouple constant pool from these structures. Namely in: * method's exception table * class's interface list * EnclosingClass attribute * InnerClasses attribute * MissingTypes attribute
JavaBehavior.st
JavaClass.st
JavaClassReader.st
JavaClassReloader.st
JavaExceptionTests.st
JavaInnerClasses.st
JavaInvokeDynamic2.st
JavaMethodWithException.st
JavaNativeMethodImpl_OpenJDK6.st
--- a/JavaBehavior.st	Mon Dec 08 18:08:33 2014 +0000
+++ b/JavaBehavior.st	Mon Dec 08 23:03:45 2014 +0000
@@ -161,21 +161,30 @@
 
 interfaceNames
     "Returns set of intefaces as java names (dotted)"
-    ^( interfaces ? #() ) collect:[:e|e isJavaClassRef ifTrue:[e javaClassName] ifFalse:[e javaName]].
+
+    | cp |
+
+    cp := self constantPool.
+    interfaces notNil ifTrue:[
+         ^ interfaces collect:[:ifaceRefIndex | | ifaceRef | ifaceRef := cp at: ifaceRefIndex. ifaceRef isJavaClassRef ifTrue:[ifaceRef javaClassName] ifFalse:[ifaceRef javaName]].
+    ].
+    ^ #()
 
     "Created: / 13-02-2013 / 09:33:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 08-10-2013 / 22:40:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 27-11-2014 / 17:00:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 interfaces
-    interfaces notNil 
-        ifTrue:
-            [ interfaces := interfaces collect:
-                [:clsRef | clsRef javaClass ] ].
+    | cp |
 
-    ^ interfaces ? #()
+    cp := self constantPool.
+    interfaces notNil ifTrue:[ 
+        ^ interfaces collect: [:ifaceRefIndex | (cp at: ifaceRefIndex) javaClass ] 
+    ].
 
-    "Modified: / 31-05-2011 / 09:40:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    ^ #()
+
+    "Modified: / 27-11-2014 / 16:58:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaBehavior methodsFor:'accessing-Java'!
--- a/JavaClass.st	Mon Dec 08 18:08:33 2014 +0000
+++ b/JavaClass.st	Mon Dec 08 23:03:45 2014 +0000
@@ -690,16 +690,20 @@
 
     innerClassesAttr := self getAttribute: #InnerClasses.
     innerClassesAttr notNil ifTrue:[ 
-        innerClassesAttr do:[:each | 
-            (each innerClassRef name = binaryName and:[each outerClassRef notNil]) ifTrue:[  
-                ^ each outerClassRef resolve: false.
+        innerClassesAttr do:[:each |
+            | innerClassRef outerClassRef |
+
+            innerClassRef := constantPool at: each innerClassRefIndex.
+            outerClassRef := each outerClassRefIndex ~~ 0 ifTrue:[ constantPool at: each outerClassRefIndex  ] ifFalse:[ nil ].
+            (innerClassRef name = binaryName and:[outerClassRef notNil]) ifTrue:[  
+                ^ outerClassRef resolve: false.
             ]
         ].
     ].
     ^ nil
 
     "Created: / 04-08-2014 / 22:42:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 05-08-2014 / 22:16:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-12-2014 / 14:23:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 enclosingClass
@@ -713,10 +717,10 @@
     enclosingMethodAttr isNil ifTrue:[ 
         ^ self declaringClass
     ].
-    ^ enclosingMethodAttr first resolve: false.
+    ^ (constantPool at: enclosingMethodAttr first) resolve: false.
 
     "Created: / 13-09-2013 / 01:26:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (comment): / 05-08-2014 / 09:49:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-12-2014 / 12:59:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 enclosingMethod
@@ -724,12 +728,12 @@
 
     enclosingMethodAttr := self getAttribute: #EnclosingMethod.
     enclosingMethodAttr isNil ifTrue:[ ^ nil ].
-    enclosingMethodAttr second isNil ifTrue:[ ^ nil ].
-    enclosingClass := enclosingMethodAttr first resolve: false.
-    ^ enclosingClass compiledMethodAt: enclosingMethodAttr second selector
+    enclosingMethodAttr second == 0 ifTrue:[ ^ nil ].
+    enclosingClass := (constantPool at: enclosingMethodAttr first) resolve: false.
+    ^ enclosingClass compiledMethodAt: (constantPool at: enclosingMethodAttr second) selector
 
     "Created: / 13-09-2013 / 01:28:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 22-09-2013 / 12:14:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-12-2014 / 13:00:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 ensureHasAnnotations
@@ -2417,8 +2421,8 @@
 
     super setInterfaces: aCollection.
     aCollection notEmptyOrNil ifTrue:[
-        aCollection do:[:iface|
-            iface name = 'groovy/lang/GroovyObject' ifTrue:[
+        aCollection do:[:ifaceRefIndex|
+            (constantPool at: ifaceRefIndex) name = 'groovy/lang/GroovyObject' ifTrue:[
                 self class changeClassTo: GroovyMetaclass.
                 self class setSuperclass: GroovyClass.
             ]
@@ -2426,7 +2430,7 @@
     ]
 
     "Created: / 20-02-2012 / 22:47:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 05-05-2014 / 09:35:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 27-11-2014 / 17:03:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 setLockWord
@@ -2646,14 +2650,17 @@
         | innerClasses |
 
         innerClasses := Set new.
-        innerClassesAttr do:[:each | 
-            (each innerClassRef name ~= binaryName) ifTrue:[
+        innerClassesAttr do:[:each |
+            | innerClassRef |
+
+            innerClassRef := constantPool at: each innerClassRefIndex.
+            (innerClassRef name ~= binaryName) ifTrue:[
                 | innerClass |
 
                 innerClass := ignoreUnloaded ifTrue:[
-                        JavaVM classNamed:each innerClassRef name definedBy:classLoader
+                        JavaVM classNamed:innerClassRef name definedBy:classLoader
                     ] ifFalse:[
-                        each innerClassRef resolve:false
+                        innerClassRef resolve:false
                     ].
                 innerClass notNil ifTrue:[
                     innerClasses add:innerClass.
@@ -2665,7 +2672,7 @@
     ^ #()
 
     "Created: / 08-08-2014 / 16:06:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 12-08-2014 / 22:32:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-12-2014 / 14:11:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 isAnonymous
--- a/JavaClassReader.st	Mon Dec 08 18:08:33 2014 +0000
+++ b/JavaClassReader.st	Mon Dec 08 23:03:45 2014 +0000
@@ -73,9 +73,9 @@
     Verbose := false.
     Silent := true.
     AbsolutelySilent := false.
-     
+
     "/LazyClassLoading := false.
-    
+
     LazyClassLoading := true.
     ClassLoaderQuerySignal := QuerySignal new.
     ClassLoaderQuerySignal defaultAnswer:[ JavaVM systemClassLoader ].
@@ -112,7 +112,7 @@
 
 initializeInternedStrings
      "Constant pool strings are interned to save memory
-     and kept in InternedStrings variable"        
+     and kept in InternedStrings variable"
     InternedStrings := Set new
 
     "Modified (comment): / 13-11-2014 / 12:12:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -132,7 +132,6 @@
     "Created: 3.8.1997 / 18:17:21 / cg"
 ! !
 
-
 !JavaClassReader class methodsFor:'constants'!
 
 fileMajorVersions
@@ -619,8 +618,8 @@
     "/
 
     interfaces := self readInterfaces.
-    interfaces do:[:interface |
-        interface javaClassName = 'java/lang/Cloneable' ifTrue:[
+    interfaces do:[:ifaceRefIndex |
+        (constants at: ifaceRefIndex) javaClassName = 'java/lang/Cloneable' ifTrue:[
             access_flags := access_flags bitOr: ACX_CLONEABLE.
         ].
     ].
@@ -709,7 +708,7 @@
     "Modified: / 15-10-2010 / 17:37:38 / Jan Kurs <kurs.jan@post.cz>"
     "Modified: / 28-01-2011 / 15:09:48 / Marcel Hlopko <hlopik@gmail.com>"
     "Modified: / 18-05-2011 / 15:30:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-    "Modified: / 06-12-2014 / 13:37:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 27-11-2014 / 17:02:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 readMagic
@@ -1086,6 +1085,12 @@
     "Modified: / 19-10-2010 / 21:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+readAttributeLength
+    ^ inStream nextUnsignedLongMSB:msb
+
+    "Created: / 03-12-2014 / 12:53:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 readAttributesFor:something
     |attributes_count|
 
@@ -1109,24 +1114,14 @@
 !
 
 readEnclosingMethodAttributeFor:something
-"/        ('JAVA [info]: unhandled attribute: EnclosingMethod') infoPrintCR.
-"/        self skipAttribute:'EnclosingMethod'.
-
-    |attribute_length class_index class_ref method_index method_ref |
-
-    attribute_length := inStream nextUnsignedLongMSB:msb.
-
-    class_index := inStream nextUnsignedShortMSB:msb.
-    class_ref := constants at: class_index.
-
-    method_index := inStream nextUnsignedShortMSB:msb.
-    method_index ~~ 0 ifTrue:[
-        method_ref := constants at: method_index.
-    ].
-
-    attributes add: #EnclosingMethod; add: (Array with: class_ref with: method_ref)
-
-    "Modified: / 13-09-2013 / 01:07:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    | class_ref_index method_ref_index |
+
+    self skipAttributeLength.
+    class_ref_index := inStream nextUnsignedShortMSB:msb.
+    method_ref_index := inStream nextUnsignedShortMSB:msb.
+    attributes add: #EnclosingMethod; add: (Array with: class_ref_index with: method_ref_index)
+
+    "Modified: / 03-12-2014 / 12:56:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 readInnerClassesAttributeFor:something
@@ -1137,29 +1132,19 @@
     classes := JavaInnerClasses new: number_of_classes.
     self assert: attribute_length == ((number_of_classes * 8) + 2).
     1 to: number_of_classes do:[:i |
-        | entry index |
+        | entry |
 
         entry := JavaInnerClasses::Entry new.
-        index := inStream nextUnsignedShortMSB:msb.
-        index ~~ 0 ifTrue:[
-            entry setInnerClassRef: (constants at: index).
-        ].
-        index := inStream nextUnsignedShortMSB:msb.
-        index ~~ 0 ifTrue:[
-            entry setOuterClassRef: (constants at: index).
-        ].
-        index := inStream nextUnsignedShortMSB:msb.
-        index ~~ 0 ifTrue:[
-            entry setName: (constants at: index)
-        ].
+        entry setInnerClassRefIndex:(inStream nextUnsignedShortMSB:msb).
+        entry setOuterClassRefIndex:(inStream nextUnsignedShortMSB:msb).
+        entry setNameIndex: (inStream nextUnsignedShortMSB:msb).
         entry setAccessFlags: (inStream nextUnsignedShortMSB:msb).
-
         classes at: i put:  entry
     ].
 
     attributes add: #InnerClasses; add: classes.
 
-    "Modified: / 16-10-2013 / 09:53:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-12-2014 / 14:06:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 readLocalVariableTypeTableAttributeFor:something
@@ -1175,7 +1160,7 @@
     missingTypes := Array new: numMissingTypes.
     self assert: attribute_length == ((numMissingTypes * 2) + 2).
     1 to: numMissingTypes do:[: i |
-        missingTypes at: i put: (constants at:  (inStream nextUnsignedShortMSB:msb))
+        missingTypes at: i put: (inStream nextUnsignedShortMSB:msb)
     ].
 
     attributes add: #MissingTypes; add: missingTypes.
@@ -1329,6 +1314,12 @@
 
     "Created: / 09-04-1998 / 18:12:46 / cg"
     "Modified: / 06-12-2014 / 10:54:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+skipAttributeLength
+    inStream skip:4.
+
+    "Created: / 03-12-2014 / 12:53:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaClassReader methodsFor:'file reading - attributes-ST'!
@@ -1525,13 +1516,13 @@
     "/ get constant pool
     "/
     constantPoolSize := inStream nextUnsignedShortMSB: msb.
-    Verbose ifTrue:[ 
+    Verbose ifTrue:[
         self info: 'constantPoolSize = ' , constantPoolSize printString.
     ].
     constants := JavaConstantPool new: constantPoolSize - 1.
     constSlot := 1.
     [ constSlot < constantPoolSize ] whileTrue: [
-            Verbose ifTrue:[ 
+            Verbose ifTrue:[
                 self info: 'const slot: ' , constSlot printString.
             ].
             const := self readConstant.
@@ -1598,12 +1589,12 @@
     | nameIndex |
 
     nameIndex := inStream nextUnsignedShortMSB: msb.
-    Verbose ifTrue:[ 
-        ((constants at: nameIndex) isNil) ifTrue: [ 
+    Verbose ifTrue:[
+        ((constants at: nameIndex) isNil) ifTrue: [
                 self info: ('reading class; index=' , nameIndex printString , ' name='
-                            , (constants at: nameIndex) printString) 
-        ] ifFalse: [ 
-            self info: ('reading class; index= ' , nameIndex printString)   
+                            , (constants at: nameIndex) printString)
+        ] ifFalse: [
+            self info: ('reading class; index= ' , nameIndex printString)
         ].
     ].
     ^ JavaClassRef2 in: constants withNameAt: nameIndex.
@@ -1775,7 +1766,7 @@
     nameAndTypeIndex := inStream nextUnsignedShortMSB: msb.
 
     ^ JavaInvokeDynamic2
-        in: constants        
+        in: constants
         bootstrapMethodAttrIndex:bootstrapMethodAttrIndex
         nameAndTypeIndex:nameAndTypeIndex
 
@@ -1812,7 +1803,7 @@
     reference_kind := inStream next.
     reference_index := inStream nextUnsignedShortMSB: msb.
 
-    ^ JavaMethodHandle2 
+    ^ JavaMethodHandle2
         in:constants
         kind:reference_kind
         index:reference_index
@@ -1824,7 +1815,7 @@
     | descriptorIndex |
 
     descriptorIndex := inStream nextUnsignedShortMSB: msb.
-    ^ JavaMethodType2 
+    ^ JavaMethodType2
         in:constants
         index:descriptorIndex
 
@@ -2206,7 +2197,7 @@
 !JavaClassReader methodsFor:'file reading - interfaces'!
 
 readInterfaces
-    |interfacesCount interface_index interface interfaces|
+    | interfacesCount interface_index interfaces |
 
     "/
     "/ get interfaces
@@ -2217,11 +2208,9 @@
     interfaces := Array new:interfacesCount.
 
     1 to:interfacesCount do:[:i |
-	Verbose ifTrue:[Transcript show:'interface: '; showCR:i].
-	interface_index := inStream nextUnsignedShortMSB:msb.
-	interface := constants at:interface_index.
-
-	interfaces at:i put:interface.
+        Verbose ifTrue:[Transcript show:'interface: '; showCR:i].
+        interface_index := inStream nextUnsignedShortMSB:msb.
+        interfaces at:i put:interface_index.
     ].
     ^ interfaces
 
@@ -2229,8 +2218,8 @@
      JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
     "
 
-    "Created: 15.4.1996 / 15:31:59 / cg"
-    "Modified: 15.4.1996 / 15:33:28 / cg"
+    "Created: / 15-04-1996 / 15:31:59 / cg"
+    "Modified: / 27-11-2014 / 16:55:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaClassReader methodsFor:'file reading - methods'!
@@ -2333,14 +2322,13 @@
 
     exception_table_length := inStream nextUnsignedShortMSB:msb.
     exception_table_length ~~ 0 ifTrue:[
-	exception_table := Array new:exception_table_length.
-	1 to:exception_table_length do:[:i |
-	    |idx ex|
-
-	    idx := inStream nextUnsignedShortMSB:msb.
-	    ex := constants at:idx.
-	    exception_table at:i put:ex.
-	].
+        exception_table := Array new:exception_table_length.
+        1 to:exception_table_length do:[:i |
+            | idx |
+
+            idx := inStream nextUnsignedShortMSB:msb.
+            exception_table at:i put:idx.
+        ].
     ].
 
     Verbose ifTrue:[Transcript showCR:'method has an exceptionTable'].
@@ -2348,8 +2336,8 @@
     aJavaMethod setExceptionTable:exception_table.
     ^ true
 
-    "Modified: 15.4.1996 / 15:33:28 / cg"
-    "Created: 15.4.1996 / 15:40:17 / cg"
+    "Created: / 15-04-1996 / 15:40:17 / cg"
+    "Modified: / 04-12-2014 / 14:29:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 readLineNumberTableAttributeFor:aJavaMethod
@@ -2495,7 +2483,7 @@
             ]
         ].
     ] ifFalse:[
-        "/ Reading method for non-Java class    
+        "/ Reading method for non-Java class
         self error: 'Not really supported'.
 
         m := Method new.
--- a/JavaClassReloader.st	Mon Dec 08 18:08:33 2014 +0000
+++ b/JavaClassReloader.st	Mon Dec 08 23:03:45 2014 +0000
@@ -162,13 +162,13 @@
     ] on: RecompileRequest do:[:recompileRequest |
         "/ Catch all recompile requests
         (recompileRequests contains:[:each | each parameter == recompileRequest parameter]) ifFalse:[
-            recompileRequests add: recompileRequest 
+            recompileRequests add: recompileRequest
         ].
         recompileRequest proceed.
     ] on: ReloadRequest do:[:reloadRequest |
         "/ Catch all reload requests
         (reloadRequests contains:[:each | each parameter == reloadRequest parameter]) ifFalse:[
-            reloadRequests add: reloadRequest 
+            reloadRequests add: reloadRequest
         ].
         reloadRequest proceed.
     ].
@@ -194,19 +194,19 @@
             JavaVM registry unregisterClass: subclass ignoring: ignoredClasses
         ].
     ].
-    oldClass innerClassesIgnoreUnloaded do:[:innerclass | 
+    oldClass innerClassesIgnoreUnloaded do:[:innerclass |
         (ignoredClasses includes: innerclass) ifFalse:[
             JavaVM registry unregisterClass: innerclass ignoring: ignoredClasses
         ]
     ].
-    JavaVM registry allClassesDo:[:cls|        
+    JavaVM registry allClassesDo:[:cls|
         "/ JV: Q: Should we remove all users of the interface? Let's do it, but not
         "/        sure if that's necessary/desirable
         | ifaces |
 
-        ifaces := cls getInterfaces.
+        ifaces := cls interfaces.
         ifaces notNil ifTrue:[
-            (ifaces  anySatisfy:[:ref| ref isJavaClass ifTrue:[ ref == oldClass]  ifFalse:[ ref name =  oldClass binaryName ] ]) ifTrue:[
+            (ifaces anySatisfy:[:iface | iface == oldClass]) ifTrue:[
                 (ignoredClasses includes: cls) ifFalse:[
                     JavaVM registry unregisterClass: cls ignoring: ignoredClasses
                 ].
@@ -288,7 +288,7 @@
     "Modified: / 09-04-2014 / 18:43:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-invalidateClass: javaClass 
+invalidateClass: javaClass
     ^ javaClass ~~ oldClass and:[javaClass constantPool invalidateForClass: oldClass binaryName]
 
     "Created: / 21-02-2012 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -299,7 +299,7 @@
 migrate
     "Possibly migrate instances and class. Return the class that should
      be installed in registry once reloader finishes his job.
-     
+
      At this point, all references are already invalidated (see #reload)
      "
 
@@ -346,7 +346,7 @@
 !
 
 prepare
-    "Analyze and prepare data for reloading" 
+    "Analyze and prepare data for reloading"
 
     self prepareInstFieldMapping.
     self prepareStaticFieldMapping.
@@ -422,7 +422,7 @@
 
 updateOldClass
     "At this point we know that both classes have same layout. So we can
-     simply copy methods and other info from new class to old one. 
+     simply copy methods and other info from new class to old one.
      References must be flushed anyway!! We need to copy constant pool over,
      indices may have changed. And we will copy fields as well, types may
      have been generalized.
@@ -552,7 +552,7 @@
                             and:[entry classRef name = givenMethod javaClass binaryName
                             and:[(entry nameAndType name , entry nameAndType descriptor) = givenMethod selector]]]].
         recompile ifTrue:[
-            self requestRecompile: cls.    
+            self requestRecompile: cls.
         ].
     ].
 
@@ -587,7 +587,7 @@
     old := something.
 !
 
-old:oldArg new:newArg 
+old:oldArg new:newArg
     old := oldArg.
     new := newArg.
 ! !
@@ -599,7 +599,7 @@
 
     | oldD newD |
 
-    (old isNil or:[new isNil]) ifTrue:[ 
+    (old isNil or:[new isNil]) ifTrue:[
         ^ true "Either one is missing, must migrate"
     ].
 
@@ -617,7 +617,7 @@
     (oldD first == $L and: [newD first == $L]) ifTrue:[
         (oldD = newD) ifTrue: [ ^ true ] ifFalse: [
             ^ [
-                (old typeClass includesBehavior: new typeClass) not.    
+                (old typeClass includesBehavior: new typeClass) not.
             ] on: JAVA java lang ClassNotFoundException do:[
                 false
             ]
@@ -628,11 +628,11 @@
         ((oldD at: i) == $L and: [ (newD at: i) == $L ]) ifTrue:[
             (oldD = newD) ifTrue: [ ^ true ] ifFalse: [
                 ^ [
-                    (old typeClass includesBehavior: new typeClass) not.    
+                    (old typeClass includesBehavior: new typeClass) not.
                 ] on: JAVA java lang ClassNotFoundException do:[
                     false
                 ]
-            ].  
+            ].
         ].
         ((oldD at: i) ~~ $[ or: [ (newD at: i) ~~ $[ ]) ifTrue:[
             ^true"Different primitive/array types, must migrate"
--- a/JavaExceptionTests.st	Mon Dec 08 18:08:33 2014 +0000
+++ b/JavaExceptionTests.st	Mon Dec 08 23:03:45 2014 +0000
@@ -65,6 +65,7 @@
     "Created: / 30-03-2012 / 13:38:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+
 !JavaExceptionTests methodsFor:'callbacks'!
 
 call: trhower with: aBoolean 
--- a/JavaInnerClasses.st	Mon Dec 08 18:08:33 2014 +0000
+++ b/JavaInnerClasses.st	Mon Dec 08 23:03:45 2014 +0000
@@ -28,7 +28,7 @@
 !
 
 Object subclass:#Entry
-	instanceVariableNames:'innerClassRef outerClassRef name accessFlags'
+	instanceVariableNames:'innerClassRefIndex outerClassRefIndex nameIndex accessFlags'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:JavaInnerClasses
@@ -98,28 +98,28 @@
     ^ accessFlags
 !
 
-innerClassName
-    ^ innerClassRef name
-
-    "Created: / 04-08-2014 / 22:25:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+innerClassRefIndex
+    ^ innerClassRefIndex
 !
 
-innerClassRef
-    ^ innerClassRef
+innerClassRefIndex:something
+    innerClassRefIndex := something.
 !
 
-name
-    ^ name
+nameIndex
+    ^ nameIndex
 !
 
-outerClassName
-    ^ outerClassRef notNil ifTrue:[ outerClassRef name ] ifFalse: [ nil ]
-
-    "Created: / 04-08-2014 / 22:26:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+nameIndex:something
+    nameIndex := something.
 !
 
-outerClassRef
-    ^ outerClassRef
+outerClassRefIndex
+    ^ outerClassRefIndex
+!
+
+outerClassRefIndex:something
+    outerClassRefIndex := something.
 ! !
 
 !JavaInnerClasses::Entry methodsFor:'initialization'!
@@ -130,20 +130,20 @@
     "Created: / 16-10-2013 / 09:24:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-setInnerClassRef: aJavaClassRef
-    innerClassRef := aJavaClassRef
+setInnerClassRefIndex:aJavaClassRef 
+    innerClassRefIndex := aJavaClassRef
 
     "Created: / 16-10-2013 / 09:22:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-setName: aString
-    name := aString
+setNameIndex: aString
+    nameIndex := aString
 
-    "Created: / 04-08-2014 / 22:50:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 03-12-2014 / 14:06:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-setOuterClassRef: aJavaClassRef
-    outerClassRef := aJavaClassRef
+setOuterClassRefIndex:aJavaClassRef 
+    outerClassRefIndex := aJavaClassRef
 
     "Created: / 16-10-2013 / 09:22:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
--- a/JavaInvokeDynamic2.st	Mon Dec 08 18:08:33 2014 +0000
+++ b/JavaInvokeDynamic2.st	Mon Dec 08 23:03:45 2014 +0000
@@ -83,3 +83,10 @@
     nameAndTypeIndex := anInteger.
 ! !
 
+!JavaInvokeDynamic2 class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/JavaMethodWithException.st	Mon Dec 08 18:08:33 2014 +0000
+++ b/JavaMethodWithException.st	Mon Dec 08 23:03:45 2014 +0000
@@ -65,18 +65,24 @@
     "Return a collection of declared exception classes that this method
      throws"    
     exceptionTable isNil ifTrue: [ ^ nil ].
-    ^ exceptionTable collect: [:classRef | classRef resolve ].
+    ^ self exceptionTable collect: [:classRef | classRef resolve ].
 
     "Created: / 01-08-2012 / 10:09:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-12-2014 / 14:29:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 exceptionTable
     "return exception table - collection of classRefs"
-    ^ exceptionTable.
+
+    | cp |
+
+    exceptionTable isNil ifTrue:[ ^ nil ].
+    cp := self constantPool.
+    ^ exceptionTable collect:[ :classRefIndex | cp at: classRefIndex ]
 
     "Created: / 05-11-1998 / 19:58:38 / cg"
-    "Modified: / 04-02-2011 / 22:07:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 04-06-2011 / 17:20:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 04-12-2014 / 14:30:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 getExceptionTable
@@ -101,9 +107,10 @@
     "copy values from another javaMethod"
 
     super fromMethod:aJavaMethod.
-    exceptionTable := aJavaMethod exceptionTable
+    exceptionTable := aJavaMethod getExceptionTable
 
     "Created: / 14-08-2014 / 12:39:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-12-2014 / 14:31:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaMethodWithException class methodsFor:'documentation'!
--- a/JavaNativeMethodImpl_OpenJDK6.st	Mon Dec 08 18:08:33 2014 +0000
+++ b/JavaNativeMethodImpl_OpenJDK6.st	Mon Dec 08 23:03:45 2014 +0000
@@ -9994,15 +9994,15 @@
     attr := cls getAttribute: #EnclosingMethod.
     attr notNil ifTrue:[ 
         info := _java_lang_Object_CLASS javaArrayClass new: 3.
-        info at: 1 put: (JavaVM reflection javaClassObjectForClass: (attr first resolve: false)).
-        attr second notNil ifTrue:[ 
-            info at: 2 put: (Java as_String: attr second name).
-            info at: 3 put: (Java as_String: attr second descriptor).
+        info at: 1 put: (JavaVM reflection javaClassObjectForClass: ((cls constantPool at: attr first) resolve: false)).
+        attr second ~~ 0 ifTrue:[ 
+            info at: 2 put: (Java as_String: (cls constantPool at: attr second) name).
+            info at: 3 put: (Java as_String: (cls constantPool at: attr second) descriptor).
         ].
     ].
     ^ info.
 
-    "Modified: / 13-08-2014 / 17:04:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-12-2014 / 13:04:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 _java_lang_Class_getGenericSignature: this