50 #include "oops/method.hpp" 51 #include "oops/oop.hpp" 52 #include "oops/symbol.hpp" 53 #include "runtime/virtualspace.hpp" 54 #include "runtime/vmStructs.hpp" 55 #include "utilities/accessFlags.hpp" 56 #include "utilities/globalDefinitions.hpp" 57 58 // These are defined somewhere for Solaris 59 #define PR_MODEL_ILP32 1 60 #define PR_MODEL_LP64 2 61 62 #ifdef COMPILER1 63 #ifdef ASSERT 64 65 /* 66 * To avoid the most part of potential link errors 67 * we link this program with -z nodefs . 68 * 69 * But for 'debug1' and 'fastdebug1' we still have to provide 70 * a particular workaround for the following symbols bellow. 71 * It will be good to find out a generic way in the future. 72 */ 73 74 #pragma weak tty 75 #pragma weak CMSExpAvgFactor 76 77 #if defined(i386) || defined(__i386) || defined(__amd64) 78 #pragma weak noreg 79 #endif /* i386 */ 80 81 LIR_Opr LIR_OprFact::illegalOpr = (LIR_Opr) 0; 82 83 address StubRoutines::_call_stub_return_address = NULL; 84 85 StubQueue* AbstractInterpreter::_code = NULL; 86 87 #endif /* ASSERT */ 88 #endif /* COMPILER1 */ 89 90 #define GEN_OFFS(Type,Name) \ 91 switch(gen_variant) { \ 92 case GEN_OFFSET: \ 93 printf("#define OFFSET_%-33s %ld\n", \ 94 #Type #Name, offset_of(Type, Name)); \ 95 break; \ 96 case GEN_INDEX: \ 97 printf("#define IDX_OFFSET_%-33s %d\n", \ 98 #Type #Name, index++); \ 99 break; \ 100 case GEN_TABLE: \ 101 printf("\tOFFSET_%s,\n", #Type #Name); \ 102 break; \ 103 } 104 105 #define GEN_SIZE(Type) \ 106 switch(gen_variant) { \ 107 case GEN_OFFSET: \ 108 printf("#define SIZE_%-35s %ld\n", \ 109 #Type, sizeof(Type)); \ 110 break; \ 111 case GEN_INDEX: \ 112 printf("#define IDX_SIZE_%-35s %d\n", \ 113 #Type, index++); \ 114 break; \ 115 case GEN_TABLE: \ 116 printf("\tSIZE_%s,\n", #Type); \ 117 break; \ 118 } 119 120 #define GEN_VALUE(String,Value) \ 121 switch(gen_variant) { \ 122 case GEN_OFFSET: \ 123 printf("#define %-40s %d\n", #String, Value); \ 124 break; \ 227 GEN_OFFS(Method, _constMethod); 228 GEN_OFFS(Method, _constants); 229 GEN_OFFS(Method, _access_flags); 230 printf("\n"); 231 232 GEN_OFFS(ConstMethod, _flags); 233 GEN_OFFS(ConstMethod, _code_size); 234 GEN_OFFS(ConstMethod, _name_index); 235 GEN_OFFS(ConstMethod, _signature_index); 236 printf("\n"); 237 238 GEN_OFFS(CodeHeap, _memory); 239 GEN_OFFS(CodeHeap, _segmap); 240 GEN_OFFS(CodeHeap, _log2_segment_size); 241 printf("\n"); 242 243 GEN_OFFS(VirtualSpace, _low_boundary); 244 GEN_OFFS(VirtualSpace, _high_boundary); 245 GEN_OFFS(VirtualSpace, _low); 246 GEN_OFFS(VirtualSpace, _high); 247 printf("\n"); 248 249 GEN_OFFS(CodeBlob, _name); 250 GEN_OFFS(CodeBlob, _header_size); 251 GEN_OFFS(CodeBlob, _content_offset); 252 GEN_OFFS(CodeBlob, _code_offset); 253 GEN_OFFS(CodeBlob, _data_offset); 254 GEN_OFFS(CodeBlob, _frame_size); 255 printf("\n"); 256 257 GEN_OFFS(nmethod, _method); 258 GEN_OFFS(nmethod, _oops_offset); 259 GEN_OFFS(nmethod, _scopes_data_offset); 260 GEN_OFFS(nmethod, _scopes_pcs_offset); 261 GEN_OFFS(nmethod, _handler_table_offset); 262 GEN_OFFS(nmethod, _deoptimize_offset); 263 GEN_OFFS(nmethod, _orig_pc_offset); 264 265 GEN_OFFS(PcDesc, _pc_offset); 266 GEN_OFFS(PcDesc, _scope_decode_offset); | 50 #include "oops/method.hpp" 51 #include "oops/oop.hpp" 52 #include "oops/symbol.hpp" 53 #include "runtime/virtualspace.hpp" 54 #include "runtime/vmStructs.hpp" 55 #include "utilities/accessFlags.hpp" 56 #include "utilities/globalDefinitions.hpp" 57 58 // These are defined somewhere for Solaris 59 #define PR_MODEL_ILP32 1 60 #define PR_MODEL_LP64 2 61 62 #ifdef COMPILER1 63 #ifdef ASSERT 64 65 /* 66 * To avoid the most part of potential link errors 67 * we link this program with -z nodefs . 68 * 69 * But for 'debug1' and 'fastdebug1' we still have to provide 70 * a particular workaround for the following symbols below. 71 * It will be good to find out a generic way in the future. 72 */ 73 74 #pragma weak tty 75 #pragma weak CMSExpAvgFactor 76 77 #if defined(i386) || defined(__i386) || defined(__amd64) 78 #pragma weak noreg 79 #endif /* i386 */ 80 81 LIR_Opr LIR_OprFact::illegalOpr = (LIR_Opr) 0; 82 83 address StubRoutines::_call_stub_return_address = NULL; 84 85 StubQueue* AbstractInterpreter::_code = NULL; 86 87 #endif /* ASSERT */ 88 #endif /* COMPILER1 */ 89 90 #define GEN_OFFS_NAME(Type,Name,OutputType) \ 91 switch(gen_variant) { \ 92 case GEN_OFFSET: \ 93 printf("#define OFFSET_%-33s %ld\n", \ 94 #OutputType #Name, offset_of(Type, Name)); \ 95 break; \ 96 case GEN_INDEX: \ 97 printf("#define IDX_OFFSET_%-33s %d\n", \ 98 #OutputType #Name, index++); \ 99 break; \ 100 case GEN_TABLE: \ 101 printf("\tOFFSET_%s,\n", #OutputType #Name); \ 102 break; \ 103 } 104 105 #define GEN_OFFS(Type,Name) \ 106 GEN_OFFS_NAME(Type,Name,Type) 107 108 #define GEN_SIZE(Type) \ 109 switch(gen_variant) { \ 110 case GEN_OFFSET: \ 111 printf("#define SIZE_%-35s %ld\n", \ 112 #Type, sizeof(Type)); \ 113 break; \ 114 case GEN_INDEX: \ 115 printf("#define IDX_SIZE_%-35s %d\n", \ 116 #Type, index++); \ 117 break; \ 118 case GEN_TABLE: \ 119 printf("\tSIZE_%s,\n", #Type); \ 120 break; \ 121 } 122 123 #define GEN_VALUE(String,Value) \ 124 switch(gen_variant) { \ 125 case GEN_OFFSET: \ 126 printf("#define %-40s %d\n", #String, Value); \ 127 break; \ 230 GEN_OFFS(Method, _constMethod); 231 GEN_OFFS(Method, _constants); 232 GEN_OFFS(Method, _access_flags); 233 printf("\n"); 234 235 GEN_OFFS(ConstMethod, _flags); 236 GEN_OFFS(ConstMethod, _code_size); 237 GEN_OFFS(ConstMethod, _name_index); 238 GEN_OFFS(ConstMethod, _signature_index); 239 printf("\n"); 240 241 GEN_OFFS(CodeHeap, _memory); 242 GEN_OFFS(CodeHeap, _segmap); 243 GEN_OFFS(CodeHeap, _log2_segment_size); 244 printf("\n"); 245 246 GEN_OFFS(VirtualSpace, _low_boundary); 247 GEN_OFFS(VirtualSpace, _high_boundary); 248 GEN_OFFS(VirtualSpace, _low); 249 GEN_OFFS(VirtualSpace, _high); 250 printf("\n"); 251 252 /* We need to use different names here because of the template parameter */ 253 GEN_OFFS_NAME(GrowableArray<CodeHeap*>, _data, GrowableArray_CodeHeap); 254 GEN_OFFS_NAME(GrowableArray<CodeHeap*>, _len, GrowableArray_CodeHeap); 255 printf("\n"); 256 257 GEN_OFFS(CodeBlob, _name); 258 GEN_OFFS(CodeBlob, _header_size); 259 GEN_OFFS(CodeBlob, _content_offset); 260 GEN_OFFS(CodeBlob, _code_offset); 261 GEN_OFFS(CodeBlob, _data_offset); 262 GEN_OFFS(CodeBlob, _frame_size); 263 printf("\n"); 264 265 GEN_OFFS(nmethod, _method); 266 GEN_OFFS(nmethod, _oops_offset); 267 GEN_OFFS(nmethod, _scopes_data_offset); 268 GEN_OFFS(nmethod, _scopes_pcs_offset); 269 GEN_OFFS(nmethod, _handler_table_offset); 270 GEN_OFFS(nmethod, _deoptimize_offset); 271 GEN_OFFS(nmethod, _orig_pc_offset); 272 273 GEN_OFFS(PcDesc, _pc_offset); 274 GEN_OFFS(PcDesc, _scope_decode_offset); |