comparison src/os/solaris/dtrace/jhelper.d @ 642:660978a2a31a

6791178: Specialize for zero as the compressed oop vm heap base Summary: Use zero based compressed oops if java heap is below 32gb and unscaled compressed oops if java heap is below 4gb. Reviewed-by: never, twisti, jcoomes, coleenp
author kvn
date Thu, 12 Mar 2009 10:37:46 -0700
parents d1605aabd0a1
children bd02caa94611
comparison
equal deleted inserted replaced
641:6af0a709d52b 642:660978a2a31a
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_; 47 extern pointer __1cIUniverseP_methodKlassObj_;
48 extern pointer __1cIUniverseO_collectedHeap_; 48 extern pointer __1cIUniverseO_collectedHeap_;
49 extern pointer __1cIUniverseK_heap_base_; 49 extern pointer __1cIUniverseL_narrow_oop_;
50 #ifdef _LP64
51 extern pointer UseCompressedOops;
52 #endif
50 53
51 extern pointer __1cHnmethodG__vtbl_; 54 extern pointer __1cHnmethodG__vtbl_;
52 extern pointer __1cKBufferBlobG__vtbl_; 55 extern pointer __1cKBufferBlobG__vtbl_;
53 56
54 #define copyin_ptr(ADDR) *(pointer*) copyin((pointer) (ADDR), sizeof(pointer)) 57 #define copyin_ptr(ADDR) *(pointer*) copyin((pointer) (ADDR), sizeof(pointer))
55 #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))
56 #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))
57 #define copyin_uint32(ADDR) *(uint32_t*) copyin((pointer) (ADDR), sizeof(uint32_t)) 60 #define copyin_uint32(ADDR) *(uint32_t*) copyin((pointer) (ADDR), sizeof(uint32_t))
58 #define copyin_int32(ADDR) *(int32_t*) copyin((pointer) (ADDR), sizeof(int32_t)) 61 #define copyin_int32(ADDR) *(int32_t*) copyin((pointer) (ADDR), sizeof(int32_t))
62 #define copyin_uint8(ADDR) *(uint8_t*) copyin((pointer) (ADDR), sizeof(uint8_t))
59 63
60 #define SAME(x) x 64 #define SAME(x) x
61 #define copyin_offset(JVM_CONST) JVM_CONST = \ 65 #define copyin_offset(JVM_CONST) JVM_CONST = \
62 copyin_int32(JvmOffsetsPtr + SAME(IDX_)JVM_CONST * sizeof(int32_t)) 66 copyin_int32(JvmOffsetsPtr + SAME(IDX_)JVM_CONST * sizeof(int32_t))
63 67
130 copyin_offset(OFFSET_nmethod_method); 134 copyin_offset(OFFSET_nmethod_method);
131 copyin_offset(SIZE_HeapBlockHeader); 135 copyin_offset(SIZE_HeapBlockHeader);
132 copyin_offset(SIZE_oopDesc); 136 copyin_offset(SIZE_oopDesc);
133 copyin_offset(SIZE_constantPoolOopDesc); 137 copyin_offset(SIZE_constantPoolOopDesc);
134 138
139 copyin_offset(OFFSET_NarrowOopStruct_base);
140 copyin_offset(OFFSET_NarrowOopStruct_shift);
141
135 /* 142 /*
136 * The PC to translate is in arg0. 143 * The PC to translate is in arg0.
137 */ 144 */
138 this->pc = arg0; 145 this->pc = arg0;
139 146
149 #error "Don't know architecture" 156 #error "Don't know architecture"
150 #endif 157 #endif
151 158
152 this->Universe_methodKlassOop = copyin_ptr(&``__1cIUniverseP_methodKlassObj_); 159 this->Universe_methodKlassOop = copyin_ptr(&``__1cIUniverseP_methodKlassObj_);
153 this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_); 160 this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_);
154 this->Universe_heap_base = copyin_ptr(&``__1cIUniverseK_heap_base_);
155 161
156 /* Reading volatile values */ 162 /* Reading volatile values */
163 #ifdef _LP64
164 this->Use_Compressed_Oops = copyin_uint8(&``UseCompressedOops);
165 #else
166 this->Use_Compressed_Oops = 0;
167 #endif
168
169 this->Universe_narrow_oop_base = copyin_ptr(&``__1cIUniverseL_narrow_oop_ +
170 OFFSET_NarrowOopStruct_base);
171 this->Universe_narrow_oop_shift = copyin_int32(&``__1cIUniverseL_narrow_oop_ +
172 OFFSET_NarrowOopStruct_shift);
173
157 this->CodeCache_low = copyin_ptr(this->CodeCache_heap_address + 174 this->CodeCache_low = copyin_ptr(this->CodeCache_heap_address +
158 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); 175 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low);
159 176
160 this->CodeCache_high = copyin_ptr(this->CodeCache_heap_address + 177 this->CodeCache_high = copyin_ptr(this->CodeCache_heap_address +
161 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); 178 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high);
293 this->name = copyin_ptr(this->start + OFFSET_CodeBlob_name); 310 this->name = copyin_ptr(this->start + OFFSET_CodeBlob_name);
294 } 311 }
295 312
296 dtrace:helper:ustack: 313 dtrace:helper:ustack:
297 /!this->done && this->vtbl == this->BufferBlob_vtbl && 314 /!this->done && this->vtbl == this->BufferBlob_vtbl &&
298 this->Universe_heap_base == NULL && 315 this->Use_Compressed_Oops == 0 &&
299 this->methodOopPtr > this->heap_start && this->methodOopPtr < this->heap_end/ 316 this->methodOopPtr > this->heap_start && this->methodOopPtr < this->heap_end/
300 { 317 {
301 MARK_LINE; 318 MARK_LINE;
302 this->klass = copyin_ptr(this->methodOopPtr + OFFSET_oopDesc_metadata); 319 this->klass = copyin_ptr(this->methodOopPtr + OFFSET_oopDesc_metadata);
303 this->methodOop = this->klass == this->Universe_methodKlassOop; 320 this->methodOop = this->klass == this->Universe_methodKlassOop;
304 this->done = !this->methodOop; 321 this->done = !this->methodOop;
305 } 322 }
306 323
307 dtrace:helper:ustack: 324 dtrace:helper:ustack:
308 /!this->done && this->vtbl == this->BufferBlob_vtbl && 325 /!this->done && this->vtbl == this->BufferBlob_vtbl &&
309 this->Universe_heap_base != NULL && 326 this->Use_Compressed_Oops != 0 &&
310 this->methodOopPtr > this->heap_start && this->methodOopPtr < this->heap_end/ 327 this->methodOopPtr > this->heap_start && this->methodOopPtr < this->heap_end/
311 { 328 {
312 MARK_LINE; 329 MARK_LINE;
313 /* 330 /*
314 * Read compressed pointer and decode heap oop, same as oop.inline.hpp 331 * Read compressed pointer and decode heap oop, same as oop.inline.hpp
315 */ 332 */
316 this->cklass = copyin_uint32(this->methodOopPtr + OFFSET_oopDesc_metadata); 333 this->cklass = copyin_uint32(this->methodOopPtr + OFFSET_oopDesc_metadata);
317 this->klass = (uint64_t)((uintptr_t)this->Universe_heap_base + 334 this->klass = (uint64_t)((uintptr_t)this->Universe_narrow_oop_base +
318 ((uintptr_t)this->cklass << 3)); 335 ((uintptr_t)this->cklass << this->Universe_narrow_oop_shift));
319 this->methodOop = this->klass == this->Universe_methodKlassOop; 336 this->methodOop = this->klass == this->Universe_methodKlassOop;
320 this->done = !this->methodOop; 337 this->done = !this->methodOop;
321 } 338 }
322 339
323 dtrace:helper:ustack: 340 dtrace:helper:ustack: