--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java Wed Sep 14 16:28:39 2011 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java Wed Sep 14 13:57:32 2011 -0700
@@ -513,10 +513,9 @@
void iterateStaticFieldsInternal(OopVisitor visitor) {
TypeArray fields = getFields();
int length = getJavaFieldsCount();
- for (int index = 0; index < length; index += FIELD_SLOTS) {
- short accessFlags = fields.getShortAt(index + ACCESS_FLAGS_OFFSET);
- short signatureIndex = fields.getShortAt(index + SIGNATURE_INDEX_OFFSET);
- FieldType type = new FieldType(getConstants().getSymbolAt(signatureIndex));
+ for (int index = 0; index < length; index++) {
+ short accessFlags = getFieldAccessFlags(index);
+ FieldType type = new FieldType(getFieldSignature(index));
AccessFlags access = new AccessFlags(accessFlags);
if (access.isStatic()) {
visitField(visitor, type, index);
@@ -545,11 +544,9 @@
TypeArray fields = getFields();
int length = getJavaFieldsCount();
- for (int index = 0; index < length; index += FIELD_SLOTS) {
- short accessFlags = fields.getShortAt(index + ACCESS_FLAGS_OFFSET);
- short signatureIndex = fields.getShortAt(index + SIGNATURE_INDEX_OFFSET);
-
- FieldType type = new FieldType(getConstants().getSymbolAt(signatureIndex));
+ for (int index = 0; index < length; index++) {
+ short accessFlags = getFieldAccessFlags(index);
+ FieldType type = new FieldType(getFieldSignature(index));
AccessFlags access = new AccessFlags(accessFlags);
if (!access.isStatic()) {
visitField(visitor, type, index);
@@ -562,11 +559,9 @@
TypeArray fields = getFields();
int length = (int) fields.getLength();
ConstantPool cp = getConstants();
- for (int i = 0; i < length; i += FIELD_SLOTS) {
- int nameIndex = fields.getShortAt(i + NAME_INDEX_OFFSET);
- int sigIndex = fields.getShortAt(i + SIGNATURE_INDEX_OFFSET);
- Symbol f_name = cp.getSymbolAt(nameIndex);
- Symbol f_sig = cp.getSymbolAt(sigIndex);
+ for (int i = 0; i < length; i++) {
+ Symbol f_name = getFieldName(i);
+ Symbol f_sig = getFieldSignature(i);
if (name.equals(f_name) && sig.equals(f_sig)) {
return newField(i);
}
@@ -641,8 +636,8 @@
/** Get field by its index in the fields array. Only designed for
use in a debugging system. */
- public Field getFieldByIndex(int fieldArrayIndex) {
- return newField(fieldArrayIndex);
+ public Field getFieldByIndex(int fieldIndex) {
+ return newField(fieldIndex);
}
@@ -657,7 +652,7 @@
int length = getJavaFieldsCount();
List immediateFields = new ArrayList(length);
- for (int index = 0; index < length; index += FIELD_SLOTS) {
+ for (int index = 0; index < length; index++) {
immediateFields.add(getFieldByIndex(index));
}
@@ -845,8 +840,7 @@
// Creates new field from index in fields TypeArray
private Field newField(int index) {
TypeArray fields = getFields();
- short signatureIndex = fields.getShortAt(index + SIGNATURE_INDEX_OFFSET);
- FieldType type = new FieldType(getConstants().getSymbolAt(signatureIndex));
+ FieldType type = new FieldType(getFieldSignature(index));
if (type.isOop()) {
if (VM.getVM().isCompressedOopsEnabled()) {
return new NarrowOopField(this, index);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Wed Sep 14 16:28:39 2011 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Wed Sep 14 13:57:32 2011 -0700
@@ -310,7 +310,7 @@
usingServerCompiler = false;
} else {
// Determine whether C2 is present
- if (type.getField("_interpreter_invocation_count", false, false) != null) {
+ if (db.lookupType("Matcher", false) != null) {
usingServerCompiler = true;
} else {
usingClientCompiler = true;
--- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Wed Sep 14 16:28:39 2011 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Wed Sep 14 13:57:32 2011 -0700
@@ -58,7 +58,7 @@
// Compute the real number of Java fields
int java_fields = ikh()->java_fields_count();
- write_u2(java_fields * FieldInfo::field_slots);
+ write_u2(java_fields);
for (JavaFieldStream fs(ikh()); !fs.done(); fs.next()) {
AccessFlags access_flags = fs.access_flags();
int name_index = fs.name_index();