1.1 --- a/src/share/vm/runtime/vmStructs.cpp Wed Apr 15 11:14:58 2020 +0800 1.2 +++ b/src/share/vm/runtime/vmStructs.cpp Wed Apr 15 11:49:55 2020 +0800 1.3 @@ -271,6 +271,7 @@ 1.4 1.5 #define VM_STRUCTS(nonstatic_field, \ 1.6 static_field, \ 1.7 + static_ptr_volatile_field, \ 1.8 unchecked_nonstatic_field, \ 1.9 volatile_nonstatic_field, \ 1.10 nonproduct_nonstatic_field, \ 1.11 @@ -1096,7 +1097,7 @@ 1.12 volatile_nonstatic_field(BasicLock, _displaced_header, markOop) \ 1.13 nonstatic_field(BasicObjectLock, _lock, BasicLock) \ 1.14 nonstatic_field(BasicObjectLock, _obj, oop) \ 1.15 - static_field(ObjectSynchronizer, gBlockList, ObjectMonitor*) \ 1.16 + static_ptr_volatile_field(ObjectSynchronizer,gBlockList, ObjectMonitor*) \ 1.17 \ 1.18 /*********************/ \ 1.19 /* Matcher (C2 only) */ \ 1.20 @@ -2681,6 +2682,11 @@ 1.21 #define GENERATE_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ 1.22 { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, &typeName::fieldName }, 1.23 1.24 +// This macro generates a VMStructEntry line for a static pointer volatile field, 1.25 +// e.g.: "static ObjectMonitor * volatile gBlockList;" 1.26 +#define GENERATE_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ 1.27 + { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, (void*)&typeName::fieldName }, 1.28 + 1.29 // This macro generates a VMStructEntry line for an unchecked 1.30 // nonstatic field, in which the size of the type is also specified. 1.31 // The type string is given as NULL, indicating an "opaque" type. 1.32 @@ -2706,10 +2712,15 @@ 1.33 #define CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ 1.34 {typedef type dummyvtype; typeName *dummyObj = NULL; volatile dummyvtype* dummy = &dummyObj->fieldName; } 1.35 1.36 -// This macro checks the type of a VMStructEntry by comparing pointer types 1.37 +// This macro checks the type of a static VMStructEntry by comparing pointer types 1.38 #define CHECK_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ 1.39 {type* dummy = &typeName::fieldName; } 1.40 1.41 +// This macro checks the type of a static pointer volatile VMStructEntry by comparing pointer types, 1.42 +// e.g.: "static ObjectMonitor * volatile gBlockList;" 1.43 +#define CHECK_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ 1.44 + {type volatile * dummy = &typeName::fieldName; } 1.45 + 1.46 // This macro ensures the type of a field and its containing type are 1.47 // present in the type table. The assertion string is shorter than 1.48 // preferable because (incredibly) of a bug in Solstice NFS client 1.49 @@ -2903,6 +2914,7 @@ 1.50 1.51 VM_STRUCTS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, 1.52 GENERATE_STATIC_VM_STRUCT_ENTRY, 1.53 + GENERATE_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY, 1.54 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, 1.55 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, 1.56 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, 1.57 @@ -3061,6 +3073,7 @@ 1.58 VMStructs::init() { 1.59 VM_STRUCTS(CHECK_NONSTATIC_VM_STRUCT_ENTRY, 1.60 CHECK_STATIC_VM_STRUCT_ENTRY, 1.61 + CHECK_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY, 1.62 CHECK_NO_OP, 1.63 CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, 1.64 CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, 1.65 @@ -3176,9 +3189,11 @@ 1.66 CHECK_NO_OP, 1.67 CHECK_NO_OP, 1.68 CHECK_NO_OP, 1.69 + CHECK_NO_OP, 1.70 CHECK_NO_OP)); 1.71 debug_only(VM_STRUCTS(CHECK_NO_OP, 1.72 ENSURE_FIELD_TYPE_PRESENT, 1.73 + ENSURE_FIELD_TYPE_PRESENT, 1.74 CHECK_NO_OP, 1.75 ENSURE_FIELD_TYPE_PRESENT, 1.76 ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT,