Index: gc_gen/src/common/gc_for_class.cpp =================================================================== --- gc_gen/src/common/gc_for_class.cpp (revision 515632) +++ gc_gen/src/common/gc_for_class.cpp (working copy) @@ -70,7 +70,7 @@ unsigned idx; for(idx = 0; idx < num_fields; idx++) { Field_Handle fh = class_get_instance_field_recursive(ch, idx); - if(field_is_gc_enumerable(fh)) { + if(field_is_enumerable_reference(fh)){ num_ref_fields++; } } @@ -102,7 +102,7 @@ int *result = new_ref_array; for(unsigned int idx = 0; idx < num_fields; idx++) { Field_Handle fh = class_get_instance_field_recursive(ch, idx); - if(field_is_gc_enumerable(fh)) { + if(field_is_enumerable_reference(fh)) { int offset = field_get_offset(fh); #ifndef BUILD_IN_REFERENT if(is_reference && offset == gc_referent_offset) continue; Index: include/open/vm.h =================================================================== --- include/open/vm.h (revision 515632) +++ include/open/vm.h (working copy) @@ -430,12 +430,27 @@ */ VMEXPORT Class_Handle field_get_class(Field_Handle fh); + /** + * @return TRUE if the field is of reference type + * + * This function doesn't cause resolution of the class of the field. + */ + VMEXPORT Boolean field_is_reference(Field_Handle fh); + +/** + * @return TRUE if the field is a magic type field + * + * This function doesn't cause resolution of the class of the field. + */ + VMEXPORT Boolean field_is_magic(Field_Handle fh); + +/** * @return TRUE if the field must be enumerated by GC * * This function doesn't cause resolution of the class of the field. */ - VMEXPORT Boolean field_is_gc_enumerable(Field_Handle fh); + VMEXPORT Boolean field_is_enumerable_reference(Field_Handle fh); /** * @return TRUE if the field is literal. In Java, it means that the Index: vmcore/src/gc/root_set_enum_common.cpp =================================================================== --- vmcore/src/gc/root_set_enum_common.cpp (revision 515632) +++ vmcore/src/gc/root_set_enum_common.cpp (working copy) @@ -95,7 +95,7 @@ for(unsigned i = 0; i < n_fields; i++) { Field* f = c->get_field(i); if(f->is_static()) { - if(field_is_gc_enumerable(f)) { + if(field_is_enumerable_reference(f)){ // The field is static and it is a reference. if (global_env->compress_references) { vm_enumerate_compressed_root_reference((uint32 *)f->get_address(), FALSE); Index: vmcore/src/jvmti/jvmti_trace.cpp =================================================================== --- vmcore/src/jvmti/jvmti_trace.cpp (revision 515632) +++ vmcore/src/jvmti/jvmti_trace.cpp (working copy) @@ -100,7 +100,7 @@ unsigned i; for (i = 0; i < num_fields; i++) { Field_Handle fh = class_get_instance_field_recursive(ch, i); - if (field_is_gc_enumerable(fh)) { + if(field_is_enumerable_reference(fh)){ int offset = field_get_offset(fh); Slot slot((void*)((UDATA)referrer + offset)); if (slot.is_null()) continue; Index: vmcore/src/class_support/C_Interface.cpp =================================================================== --- vmcore/src/class_support/C_Interface.cpp (revision 515632) +++ vmcore/src/class_support/C_Interface.cpp (working copy) @@ -1790,14 +1790,28 @@ } //field_get_class_of_field_value -Boolean field_is_gc_enumerable(Field_Handle fh) +Boolean field_is_reference(Field_Handle fh) { assert((Field *)fh); Java_Type typ = field_get_type(fh); - return (typ == JAVA_TYPE_CLASS || typ == JAVA_TYPE_ARRAY) && !fh->is_magic_type(); + return (typ == JAVA_TYPE_CLASS || typ == JAVA_TYPE_ARRAY); } //field_is_reference +Boolean field_is_magic(Field_Handle fh) +{ + assert((Field *)fh); + + return fh->is_magic_type(); +} //field_is_magic + +Boolean field_is_enumerable_reference(Field_Handle fh) +{ + assert((Field *)fh); + return ((field_is_reference(fh) && !field_is_magic(fh))); +} //field_is_enumerable_reference + + Boolean field_is_injected(Field_Handle f) { assert(f); Index: gc_cc/src/prepare.cpp =================================================================== --- gc_cc/src/prepare.cpp (revision 515632) +++ gc_cc/src/prepare.cpp (working copy) @@ -64,7 +64,7 @@ unsigned idx; for(idx = 0; idx < num_fields; idx++) { Field_Handle fh = class_get_instance_field_recursive(ch, idx); - if(field_is_gc_enumerable(fh)) { + if(field_is_enumerable_reference(fh)) { num_ref_fields++; } } @@ -93,7 +93,7 @@ for(idx = 0; idx < num_fields; idx++) { Field_Handle fh = class_get_instance_field_recursive(ch, idx); - if(field_is_gc_enumerable(fh)) { + if(field_is_enumerable_reference(fh)){ int offset = field_get_offset(fh); if (offset == skip) continue; *refs = offset;