269 // NOTE that there are platform-specific additions to this table in |
269 // NOTE that there are platform-specific additions to this table in |
270 // vmStructs_<os>_<cpu>.hpp. |
270 // vmStructs_<os>_<cpu>.hpp. |
271 |
271 |
272 #define VM_STRUCTS(nonstatic_field, \ |
272 #define VM_STRUCTS(nonstatic_field, \ |
273 static_field, \ |
273 static_field, \ |
|
274 static_ptr_volatile_field, \ |
274 unchecked_nonstatic_field, \ |
275 unchecked_nonstatic_field, \ |
275 volatile_nonstatic_field, \ |
276 volatile_nonstatic_field, \ |
276 nonproduct_nonstatic_field, \ |
277 nonproduct_nonstatic_field, \ |
277 c1_nonstatic_field, \ |
278 c1_nonstatic_field, \ |
278 c2_nonstatic_field, \ |
279 c2_nonstatic_field, \ |
1094 volatile_nonstatic_field(ObjectMonitor, _recursions, intptr_t) \ |
1095 volatile_nonstatic_field(ObjectMonitor, _recursions, intptr_t) \ |
1095 nonstatic_field(ObjectMonitor, FreeNext, ObjectMonitor*) \ |
1096 nonstatic_field(ObjectMonitor, FreeNext, ObjectMonitor*) \ |
1096 volatile_nonstatic_field(BasicLock, _displaced_header, markOop) \ |
1097 volatile_nonstatic_field(BasicLock, _displaced_header, markOop) \ |
1097 nonstatic_field(BasicObjectLock, _lock, BasicLock) \ |
1098 nonstatic_field(BasicObjectLock, _lock, BasicLock) \ |
1098 nonstatic_field(BasicObjectLock, _obj, oop) \ |
1099 nonstatic_field(BasicObjectLock, _obj, oop) \ |
1099 static_field(ObjectSynchronizer, gBlockList, ObjectMonitor*) \ |
1100 static_ptr_volatile_field(ObjectSynchronizer,gBlockList, ObjectMonitor*) \ |
1100 \ |
1101 \ |
1101 /*********************/ \ |
1102 /*********************/ \ |
1102 /* Matcher (C2 only) */ \ |
1103 /* Matcher (C2 only) */ \ |
1103 /*********************/ \ |
1104 /*********************/ \ |
1104 \ |
1105 \ |
2679 |
2680 |
2680 // This macro generates a VMStructEntry line for a static field |
2681 // This macro generates a VMStructEntry line for a static field |
2681 #define GENERATE_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ |
2682 #define GENERATE_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ |
2682 { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, &typeName::fieldName }, |
2683 { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, &typeName::fieldName }, |
2683 |
2684 |
|
2685 // This macro generates a VMStructEntry line for a static pointer volatile field, |
|
2686 // e.g.: "static ObjectMonitor * volatile gBlockList;" |
|
2687 #define GENERATE_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ |
|
2688 { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, (void*)&typeName::fieldName }, |
|
2689 |
2684 // This macro generates a VMStructEntry line for an unchecked |
2690 // This macro generates a VMStructEntry line for an unchecked |
2685 // nonstatic field, in which the size of the type is also specified. |
2691 // nonstatic field, in which the size of the type is also specified. |
2686 // The type string is given as NULL, indicating an "opaque" type. |
2692 // The type string is given as NULL, indicating an "opaque" type. |
2687 #define GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, size) \ |
2693 #define GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, size) \ |
2688 { QUOTE(typeName), QUOTE(fieldName), NULL, 0, cast_uint64_t(offset_of(typeName, fieldName)), NULL }, |
2694 { QUOTE(typeName), QUOTE(fieldName), NULL, 0, cast_uint64_t(offset_of(typeName, fieldName)), NULL }, |
2704 |
2710 |
2705 // This macro checks the type of a volatile VMStructEntry by comparing pointer types |
2711 // This macro checks the type of a volatile VMStructEntry by comparing pointer types |
2706 #define CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ |
2712 #define CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ |
2707 {typedef type dummyvtype; typeName *dummyObj = NULL; volatile dummyvtype* dummy = &dummyObj->fieldName; } |
2713 {typedef type dummyvtype; typeName *dummyObj = NULL; volatile dummyvtype* dummy = &dummyObj->fieldName; } |
2708 |
2714 |
2709 // This macro checks the type of a VMStructEntry by comparing pointer types |
2715 // This macro checks the type of a static VMStructEntry by comparing pointer types |
2710 #define CHECK_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ |
2716 #define CHECK_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ |
2711 {type* dummy = &typeName::fieldName; } |
2717 {type* dummy = &typeName::fieldName; } |
|
2718 |
|
2719 // This macro checks the type of a static pointer volatile VMStructEntry by comparing pointer types, |
|
2720 // e.g.: "static ObjectMonitor * volatile gBlockList;" |
|
2721 #define CHECK_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ |
|
2722 {type volatile * dummy = &typeName::fieldName; } |
2712 |
2723 |
2713 // This macro ensures the type of a field and its containing type are |
2724 // This macro ensures the type of a field and its containing type are |
2714 // present in the type table. The assertion string is shorter than |
2725 // present in the type table. The assertion string is shorter than |
2715 // preferable because (incredibly) of a bug in Solstice NFS client |
2726 // preferable because (incredibly) of a bug in Solstice NFS client |
2716 // which seems to prevent very long lines from compiling. This assertion |
2727 // which seems to prevent very long lines from compiling. This assertion |
2901 // as long as class VMStructs is a friend |
2912 // as long as class VMStructs is a friend |
2902 VMStructEntry VMStructs::localHotSpotVMStructs[] = { |
2913 VMStructEntry VMStructs::localHotSpotVMStructs[] = { |
2903 |
2914 |
2904 VM_STRUCTS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2915 VM_STRUCTS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2905 GENERATE_STATIC_VM_STRUCT_ENTRY, |
2916 GENERATE_STATIC_VM_STRUCT_ENTRY, |
|
2917 GENERATE_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY, |
2906 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, |
2918 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, |
2907 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2919 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2908 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, |
2920 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, |
2909 GENERATE_C1_NONSTATIC_VM_STRUCT_ENTRY, |
2921 GENERATE_C1_NONSTATIC_VM_STRUCT_ENTRY, |
2910 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, |
2922 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, |
3059 // debug builds, to ensure that all of the field types are present. |
3071 // debug builds, to ensure that all of the field types are present. |
3060 void |
3072 void |
3061 VMStructs::init() { |
3073 VMStructs::init() { |
3062 VM_STRUCTS(CHECK_NONSTATIC_VM_STRUCT_ENTRY, |
3074 VM_STRUCTS(CHECK_NONSTATIC_VM_STRUCT_ENTRY, |
3063 CHECK_STATIC_VM_STRUCT_ENTRY, |
3075 CHECK_STATIC_VM_STRUCT_ENTRY, |
|
3076 CHECK_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY, |
3064 CHECK_NO_OP, |
3077 CHECK_NO_OP, |
3065 CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, |
3078 CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, |
3066 CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, |
3079 CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, |
3067 CHECK_C1_NONSTATIC_VM_STRUCT_ENTRY, |
3080 CHECK_C1_NONSTATIC_VM_STRUCT_ENTRY, |
3068 CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY, |
3081 CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY, |
3174 CHECK_NO_OP, |
3187 CHECK_NO_OP, |
3175 CHECK_NO_OP, |
3188 CHECK_NO_OP, |
3176 CHECK_NO_OP, |
3189 CHECK_NO_OP, |
3177 CHECK_NO_OP, |
3190 CHECK_NO_OP, |
3178 CHECK_NO_OP, |
3191 CHECK_NO_OP, |
|
3192 CHECK_NO_OP, |
3179 CHECK_NO_OP)); |
3193 CHECK_NO_OP)); |
3180 debug_only(VM_STRUCTS(CHECK_NO_OP, |
3194 debug_only(VM_STRUCTS(CHECK_NO_OP, |
|
3195 ENSURE_FIELD_TYPE_PRESENT, |
3181 ENSURE_FIELD_TYPE_PRESENT, |
3196 ENSURE_FIELD_TYPE_PRESENT, |
3182 CHECK_NO_OP, |
3197 CHECK_NO_OP, |
3183 ENSURE_FIELD_TYPE_PRESENT, |
3198 ENSURE_FIELD_TYPE_PRESENT, |
3184 ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, |
3199 ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, |
3185 ENSURE_C1_FIELD_TYPE_PRESENT, |
3200 ENSURE_C1_FIELD_TYPE_PRESENT, |