Code Review for 7086585

Prepared by:never on Fri Sep 9 11:55:10 PDT 2011
Workspace:/net/smite.us.oracle.com/export/ws/synth
Compare against: ssh://hg.openjdk.java.net/hsx/hotspot-comp-gate/hotspot
Summary of changes: 1698 lines changed: 712 ins; 629 del; 357 mod; 69899 unchg
Patch of changes: 7086585.patch
Author comments:
7086585: make Java field injection more flexible
Reviewed-by:

Classes which are special to the JVM often need fields for the VM's
use. Currently the mechanism for this is adhoc or relies on the Java
code declaring the needed fields. We need a mechanism for flexibly
injecting needed fields. The basic idea is to built a standard
mechanism for declaring injected fields and to inject them during
class file parsing so that they get laid out and tracked like normal
fields. This is also means that they can simply be looked up when CDS
is used so we don't have to rely on hardcoding them. To do this I
hide the encoding of the fields array and replaced all existing
iteration with a new set of *FieldStream classes. JavaFieldStream
only iterates true Java fields so the behavious of existing code is
completely unchanged.

The new fields use a special access flag JVM_ACC_INTERNAL to describe
themselves and instead of having the name_index and signature_index
refer to the constant pool they are vmSymbols::SID so they are looked
up directly from the vmSymbols. All of this is hidden inside the
RawFieldDescriptor class which is responsible for decoding fields from
the field array.

I also cleaned up the field layout code a bit. I eliminated the
_ALIGNED_ AllocationType since there's no longer any difference in how
we align double word types. I turned FieldAllocationCount into a real
class and moved some of the layout code into it.

I deleted the nonexistent MethodHandle::vmslot field. I moved
ClassLoader::parallelCapable into java_lang_ClassLoader. I deleted
some dead field injection like the Reference.discovered field which
has existed since 1.5, and the existing logic for java.lang.Class
fields since it now uses the field injection machinery.

Tested with runthese, the sajdi tests, the tmtools suite, the nsk
regression, jdb, jdi, jvmti, hprof and jit subsuites along with
vm/mlvm, but with and without the JDK changes that remove these fields
and rely on injection to introduce them. They will be removed under
7088481 and those changes are http://cr.openjdk.java.net/~never/7088481.

Bug id: 7086585 make Java field injection more flexible
Legend: Modified file
Deleted file
New file

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/classfile/javaClasses.hpp

123 lines changed: 87 ins; 25 del; 11 mod; 1323 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/classfile/javaClasses.cpp

215 lines changed: 93 ins; 77 del; 45 mod; 3152 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/oops/instanceKlass.hpp

37 lines changed: 15 ins; 16 del; 6 mod; 994 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/oops/instanceKlass.cpp

67 lines changed: 3 ins; 42 del; 22 mod; 2909 unchg

------ ------ ------ ------ --- New Patch Raw src/share/vm/oops/fieldInfo.hpp

132 lines changed: 132 ins; 0 del; 0 mod; 0 unchg

------ ------ ------ ------ --- New Patch Raw src/share/vm/oops/fieldStreams.hpp

174 lines changed: 174 ins; 0 del; 0 mod; 0 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/oops/instanceKlassKlass.cpp

1 line changed: 0 ins; 0 del; 1 mod; 769 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/oops/cpCacheOop.cpp

6 lines changed: 0 ins; 4 del; 2 mod; 577 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/classfile/classFileParser.cpp

461 lines changed: 81 ins; 295 del; 85 mod; 4209 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/classfile/classFileParser.hpp

27 lines changed: 5 ins; 19 del; 3 mod; 280 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/classfile/systemDictionary.hpp

20 lines changed: 5 ins; 0 del; 15 mod; 672 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/classfile/systemDictionary.cpp

4 lines changed: 0 ins; 0 del; 4 mod; 2895 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/classfile/vmSymbols.hpp

7 lines changed: 5 ins; 0 del; 2 mod; 1120 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/interpreter/interpreterRuntime.cpp

7 lines changed: 0 ins; 5 del; 2 mod; 1258 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/ci/ciInstanceKlass.cpp

60 lines changed: 16 ins; 36 del; 8 mod; 558 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/prims/jni.cpp

2 lines changed: 0 ins; 0 del; 2 mod; 3700 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/prims/jvm.cpp

24 lines changed: 1 ins; 9 del; 14 mod; 4415 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/prims/jvmtiClassFileReconstituter.cpp

18 lines changed: 2 ins; 4 del; 12 mod; 684 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/prims/jvmtiEnv.cpp

4 lines changed: 0 ins; 4 del; 0 mod; 3452 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/prims/jvmtiEnvBase.cpp

9 lines changed: 0 ins; 9 del; 0 mod; 1486 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/prims/jvmtiEnvBase.hpp

2 lines changed: 0 ins; 2 del; 0 mod; 611 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/prims/jvmtiRedefineClasses.cpp

42 lines changed: 7 ins; 16 del; 19 mod; 3402 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/prims/methodHandles.cpp

6 lines changed: 1 ins; 4 del; 1 mod; 3258 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/prims/unsafe.cpp

1 line changed: 0 ins; 0 del; 1 mod; 1663 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/runtime/fieldDescriptor.hpp

52 lines changed: 26 ins; 9 del; 17 mod; 79 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/runtime/fieldDescriptor.cpp

23 lines changed: 1 ins; 9 del; 13 mod; 155 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/runtime/reflectionUtils.hpp

14 lines changed: 0 ins; 5 del; 9 mod; 211 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/runtime/thread.cpp

1 line changed: 0 ins; 0 del; 1 mod; 4387 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/runtime/vmStructs.cpp

28 lines changed: 14 ins; 8 del; 6 mod; 2525 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/utilities/accessFlags.hpp

13 lines changed: 9 ins; 0 del; 4 mod; 232 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/cpu/sparc/vm/assembler_sparc.cpp

9 lines changed: 0 ins; 5 del; 4 mod; 5032 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/cpu/x86/vm/assembler_x86.cpp

9 lines changed: 0 ins; 5 del; 4 mod; 9625 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw agent/test/jdi/sasanity.sh

1 line changed: 0 ins; 0 del; 1 mod; 79 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java

50 lines changed: 32 ins; 0 del; 18 mod; 883 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java

13 lines changed: 0 ins; 7 del; 6 mod; 2159 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java

7 lines changed: 0 ins; 3 del; 4 mod; 211 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java

4 lines changed: 0 ins; 0 del; 4 mod; 726 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java

2 lines changed: 0 ins; 0 del; 2 mod; 75 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw agent/src/share/classes/sun/jvm/hotspot/oops/Field.java

23 lines changed: 3 ins; 11 del; 9 mod; 133 unchg

This code review page was prepared using /never/bin/webrev (vers 23.18-hg-never).