28 #define DEBUG
29
30 #ifdef DEBUG
31 #define MARK_LINE this->line = __LINE__
32 #else
33 #define MARK_LINE
34 #endif
35
36 #ifdef _LP64
37 #define STACK_BIAS 0x7ff
38 #define pointer uint64_t
39 #else
40 #define STACK_BIAS 0
41 #define pointer uint32_t
42 #endif
43
44 extern pointer __JvmOffsets;
45
46 extern pointer __1cJCodeCacheF_heap_;
47 extern pointer __1cIUniverseO_collectedHeap_;
48 extern pointer __1cIUniverseL_narrow_oop_;
49 #ifdef _LP64
50 extern pointer UseCompressedOops;
51 #endif
52
53 extern pointer __1cHnmethodG__vtbl_;
54 extern pointer __1cNMethodG__vtbl_;
55 extern pointer __1cKBufferBlobG__vtbl_;
56
57 #define copyin_ptr(ADDR) *(pointer*) copyin((pointer) (ADDR), sizeof(pointer))
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))
60 #define copyin_uint32(ADDR) *(uint32_t*) copyin((pointer) (ADDR), sizeof(uint32_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))
63
64 #define SAME(x) x
65 #define copyin_offset(JVM_CONST) JVM_CONST = \
66 copyin_int32(JvmOffsetsPtr + SAME(IDX_)JVM_CONST * sizeof(int32_t))
67
68 int init_done;
69
70 dtrace:helper:ustack:
71 {
119
120 copyin_offset(OFFSET_Method_constMethod);
121 copyin_offset(OFFSET_ConstMethod_constants);
122 copyin_offset(OFFSET_ConstMethod_name_index);
123 copyin_offset(OFFSET_ConstMethod_signature_index);
124
125 copyin_offset(OFFSET_CodeHeap_memory);
126 copyin_offset(OFFSET_CodeHeap_segmap);
127 copyin_offset(OFFSET_CodeHeap_log2_segment_size);
128
129 copyin_offset(OFFSET_VirtualSpace_low);
130 copyin_offset(OFFSET_VirtualSpace_high);
131
132 copyin_offset(OFFSET_CodeBlob_name);
133
134 copyin_offset(OFFSET_nmethod_method);
135 copyin_offset(SIZE_HeapBlockHeader);
136 copyin_offset(SIZE_oopDesc);
137 copyin_offset(SIZE_ConstantPool);
138
139 copyin_offset(OFFSET_NarrowOopStruct_base);
140 copyin_offset(OFFSET_NarrowOopStruct_shift);
141
142 /*
143 * The PC to translate is in arg0.
144 */
145 this->pc = arg0;
146
147 /*
148 * The methodPtr is in %l2 on SPARC. This can be found at
149 * offset 8 from the frame pointer on 32-bit processes.
150 */
151 #if defined(__sparc)
152 this->methodPtr = copyin_ptr(arg1 + 2 * sizeof(pointer) + STACK_BIAS);
153 #elif defined(__i386) || defined(__amd64)
154 this->methodPtr = copyin_ptr(arg1 + OFFSET_interpreter_frame_method);
155 #else
156 #error "Don't know architecture"
157 #endif
158
159 this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_);
160
161 /* Reading volatile values */
162 #ifdef _LP64
163 this->Use_Compressed_Oops = copyin_uint8(&``UseCompressedOops);
164 #else
165 this->Use_Compressed_Oops = 0;
166 #endif
167
168 this->Universe_narrow_oop_base = copyin_ptr(&``__1cIUniverseL_narrow_oop_ +
169 OFFSET_NarrowOopStruct_base);
170 this->Universe_narrow_oop_shift = copyin_int32(&``__1cIUniverseL_narrow_oop_ +
171 OFFSET_NarrowOopStruct_shift);
172
173 this->CodeCache_low = copyin_ptr(this->CodeCache_heap_address +
174 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low);
175
176 this->CodeCache_high = copyin_ptr(this->CodeCache_heap_address +
177 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high);
178
179 this->CodeCache_segmap_low = copyin_ptr(this->CodeCache_heap_address +
180 OFFSET_CodeHeap_segmap + OFFSET_VirtualSpace_low);
181
182 this->CodeCache_segmap_high = copyin_ptr(this->CodeCache_heap_address +
183 OFFSET_CodeHeap_segmap + OFFSET_VirtualSpace_high);
184
185 this->CodeHeap_log2_segment_size = copyin_uint32(
186 this->CodeCache_heap_address + OFFSET_CodeHeap_log2_segment_size);
187
188 this->Method_vtbl = (pointer) &``__1cNMethodG__vtbl_;
189
190 /*
191 * Get Java heap bounds
192 */
|
28 #define DEBUG
29
30 #ifdef DEBUG
31 #define MARK_LINE this->line = __LINE__
32 #else
33 #define MARK_LINE
34 #endif
35
36 #ifdef _LP64
37 #define STACK_BIAS 0x7ff
38 #define pointer uint64_t
39 #else
40 #define STACK_BIAS 0
41 #define pointer uint32_t
42 #endif
43
44 extern pointer __JvmOffsets;
45
46 extern pointer __1cJCodeCacheF_heap_;
47 extern pointer __1cIUniverseO_collectedHeap_;
48
49 extern pointer __1cHnmethodG__vtbl_;
50 extern pointer __1cNMethodG__vtbl_;
51 extern pointer __1cKBufferBlobG__vtbl_;
52
53 #define copyin_ptr(ADDR) *(pointer*) copyin((pointer) (ADDR), sizeof(pointer))
54 #define copyin_uchar(ADDR) *(uchar_t*) copyin((pointer) (ADDR), sizeof(uchar_t))
55 #define copyin_uint16(ADDR) *(uint16_t*) copyin((pointer) (ADDR), sizeof(uint16_t))
56 #define copyin_uint32(ADDR) *(uint32_t*) copyin((pointer) (ADDR), sizeof(uint32_t))
57 #define copyin_int32(ADDR) *(int32_t*) copyin((pointer) (ADDR), sizeof(int32_t))
58 #define copyin_uint8(ADDR) *(uint8_t*) copyin((pointer) (ADDR), sizeof(uint8_t))
59
60 #define SAME(x) x
61 #define copyin_offset(JVM_CONST) JVM_CONST = \
62 copyin_int32(JvmOffsetsPtr + SAME(IDX_)JVM_CONST * sizeof(int32_t))
63
64 int init_done;
65
66 dtrace:helper:ustack:
67 {
115
116 copyin_offset(OFFSET_Method_constMethod);
117 copyin_offset(OFFSET_ConstMethod_constants);
118 copyin_offset(OFFSET_ConstMethod_name_index);
119 copyin_offset(OFFSET_ConstMethod_signature_index);
120
121 copyin_offset(OFFSET_CodeHeap_memory);
122 copyin_offset(OFFSET_CodeHeap_segmap);
123 copyin_offset(OFFSET_CodeHeap_log2_segment_size);
124
125 copyin_offset(OFFSET_VirtualSpace_low);
126 copyin_offset(OFFSET_VirtualSpace_high);
127
128 copyin_offset(OFFSET_CodeBlob_name);
129
130 copyin_offset(OFFSET_nmethod_method);
131 copyin_offset(SIZE_HeapBlockHeader);
132 copyin_offset(SIZE_oopDesc);
133 copyin_offset(SIZE_ConstantPool);
134
135 copyin_offset(OFFSET_NarrowPtrStruct_base);
136 copyin_offset(OFFSET_NarrowPtrStruct_shift);
137
138 /*
139 * The PC to translate is in arg0.
140 */
141 this->pc = arg0;
142
143 /*
144 * The methodPtr is in %l2 on SPARC. This can be found at
145 * offset 8 from the frame pointer on 32-bit processes.
146 */
147 #if defined(__sparc)
148 this->methodPtr = copyin_ptr(arg1 + 2 * sizeof(pointer) + STACK_BIAS);
149 #elif defined(__i386) || defined(__amd64)
150 this->methodPtr = copyin_ptr(arg1 + OFFSET_interpreter_frame_method);
151 #else
152 #error "Don't know architecture"
153 #endif
154
155 this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_);
156
157 /* Reading volatile values */
158 this->CodeCache_low = copyin_ptr(this->CodeCache_heap_address +
159 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low);
160
161 this->CodeCache_high = copyin_ptr(this->CodeCache_heap_address +
162 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high);
163
164 this->CodeCache_segmap_low = copyin_ptr(this->CodeCache_heap_address +
165 OFFSET_CodeHeap_segmap + OFFSET_VirtualSpace_low);
166
167 this->CodeCache_segmap_high = copyin_ptr(this->CodeCache_heap_address +
168 OFFSET_CodeHeap_segmap + OFFSET_VirtualSpace_high);
169
170 this->CodeHeap_log2_segment_size = copyin_uint32(
171 this->CodeCache_heap_address + OFFSET_CodeHeap_log2_segment_size);
172
173 this->Method_vtbl = (pointer) &``__1cNMethodG__vtbl_;
174
175 /*
176 * Get Java heap bounds
177 */
|