comparison src/os/solaris/dtrace/jhelper.d @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 2fe087c3e814
children 8e47bac5643a
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
42 #endif 42 #endif
43 43
44 extern pointer __JvmOffsets; 44 extern pointer __JvmOffsets;
45 45
46 extern pointer __1cJCodeCacheF_heap_; 46 extern pointer __1cJCodeCacheF_heap_;
47 extern pointer __1cIUniverseP_methodKlassObj_;
48 extern pointer __1cIUniverseO_collectedHeap_; 47 extern pointer __1cIUniverseO_collectedHeap_;
49 extern pointer __1cIUniverseL_narrow_oop_; 48 extern pointer __1cIUniverseL_narrow_oop_;
50 #ifdef _LP64 49 #ifdef _LP64
51 extern pointer UseCompressedOops; 50 extern pointer UseCompressedOops;
52 #endif 51 #endif
53 52
54 extern pointer __1cHnmethodG__vtbl_; 53 extern pointer __1cHnmethodG__vtbl_;
54 extern pointer __1cGMethodG__vtbl_;
55 extern pointer __1cKBufferBlobG__vtbl_; 55 extern pointer __1cKBufferBlobG__vtbl_;
56 56
57 #define copyin_ptr(ADDR) *(pointer*) copyin((pointer) (ADDR), sizeof(pointer)) 57 #define copyin_ptr(ADDR) *(pointer*) copyin((pointer) (ADDR), sizeof(pointer))
58 #define copyin_uchar(ADDR) *(uchar_t*) copyin((pointer) (ADDR), sizeof(uchar_t)) 58 #define copyin_uchar(ADDR) *(uchar_t*) copyin((pointer) (ADDR), sizeof(uchar_t))
59 #define copyin_uint16(ADDR) *(uint16_t*) copyin((pointer) (ADDR), sizeof(uint16_t)) 59 #define copyin_uint16(ADDR) *(uint16_t*) copyin((pointer) (ADDR), sizeof(uint16_t))
79 * this initialization can be removed. 79 * this initialization can be removed.
80 */ 80 */
81 init_done = 0; 81 init_done = 0;
82 this->error = (char *) NULL; 82 this->error = (char *) NULL;
83 this->result = (char *) NULL; 83 this->result = (char *) NULL;
84 this->methodOop = 0; 84 this->isMethod = 0;
85 this->codecache = 0; 85 this->codecache = 0;
86 this->klass = (pointer) NULL; 86 this->klass = (pointer) NULL;
87 this->vtbl = (pointer) NULL; 87 this->vtbl = (pointer) NULL;
88 this->suffix = '\0'; 88 this->suffix = '\0';
89 } 89 }
107 copyin_offset(OFFSET_MemRegion_word_size); 107 copyin_offset(OFFSET_MemRegion_word_size);
108 copyin_offset(SIZE_HeapWord); 108 copyin_offset(SIZE_HeapWord);
109 109
110 copyin_offset(OFFSET_interpreter_frame_method); 110 copyin_offset(OFFSET_interpreter_frame_method);
111 copyin_offset(OFFSET_Klass_name); 111 copyin_offset(OFFSET_Klass_name);
112 copyin_offset(OFFSET_constantPoolOopDesc_pool_holder); 112 copyin_offset(OFFSET_ConstantPool_pool_holder);
113 113
114 copyin_offset(OFFSET_HeapBlockHeader_used); 114 copyin_offset(OFFSET_HeapBlockHeader_used);
115 copyin_offset(OFFSET_oopDesc_metadata); 115 copyin_offset(OFFSET_oopDesc_metadata);
116 116
117 copyin_offset(OFFSET_Symbol_length); 117 copyin_offset(OFFSET_Symbol_length);
118 copyin_offset(OFFSET_Symbol_body); 118 copyin_offset(OFFSET_Symbol_body);
119 119
120 copyin_offset(OFFSET_methodOopDesc_constMethod); 120 copyin_offset(OFFSET_Method_constMethod);
121 copyin_offset(OFFSET_constMethodOopDesc_constants); 121 copyin_offset(OFFSET_ConstMethod_constants);
122 copyin_offset(OFFSET_constMethodOopDesc_name_index); 122 copyin_offset(OFFSET_ConstMethod_name_index);
123 copyin_offset(OFFSET_constMethodOopDesc_signature_index); 123 copyin_offset(OFFSET_ConstMethod_signature_index);
124 124
125 copyin_offset(OFFSET_CodeHeap_memory); 125 copyin_offset(OFFSET_CodeHeap_memory);
126 copyin_offset(OFFSET_CodeHeap_segmap); 126 copyin_offset(OFFSET_CodeHeap_segmap);
127 copyin_offset(OFFSET_CodeHeap_log2_segment_size); 127 copyin_offset(OFFSET_CodeHeap_log2_segment_size);
128 128
132 copyin_offset(OFFSET_CodeBlob_name); 132 copyin_offset(OFFSET_CodeBlob_name);
133 133
134 copyin_offset(OFFSET_nmethod_method); 134 copyin_offset(OFFSET_nmethod_method);
135 copyin_offset(SIZE_HeapBlockHeader); 135 copyin_offset(SIZE_HeapBlockHeader);
136 copyin_offset(SIZE_oopDesc); 136 copyin_offset(SIZE_oopDesc);
137 copyin_offset(SIZE_constantPoolOopDesc); 137 copyin_offset(SIZE_ConstantPool);
138 138
139 copyin_offset(OFFSET_NarrowOopStruct_base); 139 copyin_offset(OFFSET_NarrowOopStruct_base);
140 copyin_offset(OFFSET_NarrowOopStruct_shift); 140 copyin_offset(OFFSET_NarrowOopStruct_shift);
141 141
142 /* 142 /*
143 * The PC to translate is in arg0. 143 * The PC to translate is in arg0.
144 */ 144 */
145 this->pc = arg0; 145 this->pc = arg0;
146 146
147 /* 147 /*
148 * The methodOopPtr is in %l2 on SPARC. This can be found at 148 * The methodPtr is in %l2 on SPARC. This can be found at
149 * offset 8 from the frame pointer on 32-bit processes. 149 * offset 8 from the frame pointer on 32-bit processes.
150 */ 150 */
151 #if defined(__sparc) 151 #if defined(__sparc)
152 this->methodOopPtr = copyin_ptr(arg1 + 2 * sizeof(pointer) + STACK_BIAS); 152 this->methodPtr = copyin_ptr(arg1 + 2 * sizeof(pointer) + STACK_BIAS);
153 #elif defined(__i386) || defined(__amd64) 153 #elif defined(__i386) || defined(__amd64)
154 this->methodOopPtr = copyin_ptr(arg1 + OFFSET_interpreter_frame_method); 154 this->methodPtr = copyin_ptr(arg1 + OFFSET_interpreter_frame_method);
155 #else 155 #else
156 #error "Don't know architecture" 156 #error "Don't know architecture"
157 #endif 157 #endif
158 158
159 this->Universe_methodKlassOop = copyin_ptr(&``__1cIUniverseP_methodKlassObj_);
160 this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_); 159 this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_);
161 160
162 /* Reading volatile values */ 161 /* Reading volatile values */
163 #ifdef _LP64 162 #ifdef _LP64
164 this->Use_Compressed_Oops = copyin_uint8(&``UseCompressedOops); 163 this->Use_Compressed_Oops = copyin_uint8(&``UseCompressedOops);
183 this->CodeCache_segmap_high = copyin_ptr(this->CodeCache_heap_address + 182 this->CodeCache_segmap_high = copyin_ptr(this->CodeCache_heap_address +
184 OFFSET_CodeHeap_segmap + OFFSET_VirtualSpace_high); 183 OFFSET_CodeHeap_segmap + OFFSET_VirtualSpace_high);
185 184
186 this->CodeHeap_log2_segment_size = copyin_uint32( 185 this->CodeHeap_log2_segment_size = copyin_uint32(
187 this->CodeCache_heap_address + OFFSET_CodeHeap_log2_segment_size); 186 this->CodeCache_heap_address + OFFSET_CodeHeap_log2_segment_size);
187
188 this->Method_vtbl = (pointer) &``__1cGMethodG__vtbl_;
188 189
189 /* 190 /*
190 * Get Java heap bounds 191 * Get Java heap bounds
191 */ 192 */
192 this->Universe_collectedHeap = copyin_ptr(&``__1cIUniverseO_collectedHeap_); 193 this->Universe_collectedHeap = copyin_ptr(&``__1cIUniverseO_collectedHeap_);
296 297
297 dtrace:helper:ustack: 298 dtrace:helper:ustack:
298 /!this->done && this->vtbl == this->nmethod_vtbl/ 299 /!this->done && this->vtbl == this->nmethod_vtbl/
299 { 300 {
300 MARK_LINE; 301 MARK_LINE;
301 this->methodOopPtr = copyin_ptr(this->start + OFFSET_nmethod_method); 302 this->methodPtr = copyin_ptr(this->start + OFFSET_nmethod_method);
302 this->suffix = '*'; 303 this->suffix = '*';
303 this->methodOop = 1; 304 this->isMethod = 1;
304 } 305 }
305 306
306 dtrace:helper:ustack: 307 dtrace:helper:ustack:
307 /!this->done && this->vtbl == this->BufferBlob_vtbl/ 308 /!this->done && this->vtbl == this->BufferBlob_vtbl/
308 { 309 {
309 MARK_LINE; 310 MARK_LINE;
310 this->name = copyin_ptr(this->start + OFFSET_CodeBlob_name); 311 this->name = copyin_ptr(this->start + OFFSET_CodeBlob_name);
311 } 312 }
312 313
313 dtrace:helper:ustack: 314
314 /!this->done && this->vtbl == this->BufferBlob_vtbl && 315 dtrace:helper:ustack:
315 this->Use_Compressed_Oops == 0 && 316 /!this->done && this->vtbl == this->BufferBlob_vtbl && this->methodPtr != 0/
316 this->methodOopPtr > this->heap_start && this->methodOopPtr < this->heap_end/ 317 {
317 { 318 MARK_LINE;
318 MARK_LINE; 319 this->klass = copyin_ptr(this->methodPtr);
319 this->klass = copyin_ptr(this->methodOopPtr + OFFSET_oopDesc_metadata); 320 this->isMethod = this->klass == this->Method_vtbl;
320 this->methodOop = this->klass == this->Universe_methodKlassOop; 321 this->done = !this->isMethod;
321 this->done = !this->methodOop; 322 }
322 } 323
323 324 dtrace:helper:ustack:
324 dtrace:helper:ustack: 325 /!this->done && !this->isMethod/
325 /!this->done && this->vtbl == this->BufferBlob_vtbl &&
326 this->Use_Compressed_Oops != 0 &&
327 this->methodOopPtr > this->heap_start && this->methodOopPtr < this->heap_end/
328 {
329 MARK_LINE;
330 /*
331 * Read compressed pointer and decode heap oop, same as oop.inline.hpp
332 */
333 this->cklass = copyin_uint32(this->methodOopPtr + OFFSET_oopDesc_metadata);
334 this->klass = (uint64_t)((uintptr_t)this->Universe_narrow_oop_base +
335 ((uintptr_t)this->cklass << this->Universe_narrow_oop_shift));
336 this->methodOop = this->klass == this->Universe_methodKlassOop;
337 this->done = !this->methodOop;
338 }
339
340 dtrace:helper:ustack:
341 /!this->done && !this->methodOop/
342 { 326 {
343 MARK_LINE; 327 MARK_LINE;
344 this->name = copyin_ptr(this->start + OFFSET_CodeBlob_name); 328 this->name = copyin_ptr(this->start + OFFSET_CodeBlob_name);
345 this->result = this->name != 0 ? copyinstr(this->name) : "<CodeBlob>"; 329 this->result = this->name != 0 ? copyinstr(this->name) : "<CodeBlob>";
346 this->done = 1; 330 this->done = 1;
347 } 331 }
348 332
349 dtrace:helper:ustack: 333 dtrace:helper:ustack:
350 /!this->done && this->methodOop/ 334 /!this->done && this->isMethod/
351 { 335 {
352 MARK_LINE; 336 MARK_LINE;
353 this->constMethod = copyin_ptr(this->methodOopPtr + 337 this->constMethod = copyin_ptr(this->methodPtr +
354 OFFSET_methodOopDesc_constMethod); 338 OFFSET_Method_constMethod);
355 339
356 this->nameIndex = copyin_uint16(this->constMethod + 340 this->nameIndex = copyin_uint16(this->constMethod +
357 OFFSET_constMethodOopDesc_name_index); 341 OFFSET_ConstMethod_name_index);
358 342
359 this->signatureIndex = copyin_uint16(this->constMethod + 343 this->signatureIndex = copyin_uint16(this->constMethod +
360 OFFSET_constMethodOopDesc_signature_index); 344 OFFSET_ConstMethod_signature_index);
361 345
362 this->constantPool = copyin_ptr(this->constMethod + 346 this->constantPool = copyin_ptr(this->constMethod +
363 OFFSET_constMethodOopDesc_constants); 347 OFFSET_ConstMethod_constants);
364 348
365 this->nameSymbol = copyin_ptr(this->constantPool + 349 this->nameSymbol = copyin_ptr(this->constantPool +
366 this->nameIndex * sizeof (pointer) + SIZE_constantPoolOopDesc); 350 this->nameIndex * sizeof (pointer) + SIZE_ConstantPool);
367 351
368 this->nameSymbolLength = copyin_uint16(this->nameSymbol + 352 this->nameSymbolLength = copyin_uint16(this->nameSymbol +
369 OFFSET_Symbol_length); 353 OFFSET_Symbol_length);
370 354
371 this->signatureSymbol = copyin_ptr(this->constantPool + 355 this->signatureSymbol = copyin_ptr(this->constantPool +
372 this->signatureIndex * sizeof (pointer) + SIZE_constantPoolOopDesc); 356 this->signatureIndex * sizeof (pointer) + SIZE_ConstantPool);
373 357
374 this->signatureSymbolLength = copyin_uint16(this->signatureSymbol + 358 this->signatureSymbolLength = copyin_uint16(this->signatureSymbol +
375 OFFSET_Symbol_length); 359 OFFSET_Symbol_length);
376 360
377 this->klassPtr = copyin_ptr(this->constantPool + 361 this->klassPtr = copyin_ptr(this->constantPool +
378 OFFSET_constantPoolOopDesc_pool_holder); 362 OFFSET_ConstantPool_pool_holder);
379 363
380 this->klassSymbol = copyin_ptr(this->klassPtr + 364 this->klassSymbol = copyin_ptr(this->klassPtr +
381 OFFSET_Klass_name + SIZE_oopDesc); 365 OFFSET_Klass_name);
382 366
383 this->klassSymbolLength = copyin_uint16(this->klassSymbol + 367 this->klassSymbolLength = copyin_uint16(this->klassSymbol +
384 OFFSET_Symbol_length); 368 OFFSET_Symbol_length);
385 369
386 /* 370 /*