src/os/solaris/dtrace/libjvm_db.c
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
8004128_2 Cdiff src/os/solaris/dtrace/libjvm_db.c
src/os/solaris/dtrace/libjvm_db.c
Print this page
*** 162,172 ****
uint64_t CodeCache_segmap_high;
int32_t SIZE_CodeCache_log2_segment;
uint64_t methodPtr;
! uint64_t bcx;
Nmethod_t *N; /*Inlined methods support */
Frame_t prev_fr;
Frame_t curr_fr;
};
--- 162,172 ----
uint64_t CodeCache_segmap_high;
int32_t SIZE_CodeCache_log2_segment;
uint64_t methodPtr;
! uint64_t bcp;
Nmethod_t *N; /*Inlined methods support */
Frame_t prev_fr;
Frame_t curr_fr;
};
*** 1066,1088 ****
if (debug)
fprintf(stderr, "name_for_nmethod: FAIL \n\n");
return err;
}
- int is_bci(intptr_t bcx) {
- switch (DATA_MODEL) {
- case PR_MODEL_LP64:
- return ((uintptr_t) bcx) <= ((uintptr_t) MAX_METHOD_CODE_SIZE) ;
- case PR_MODEL_ILP32:
- default:
- return 0 <= bcx && bcx <= MAX_METHOD_CODE_SIZE;
- }
- }
-
static int
name_for_imethod(jvm_agent_t* J,
! uint64_t bcx,
uint64_t method,
char *result,
size_t size,
Jframe_t *jframe
) {
--- 1066,1078 ----
if (debug)
fprintf(stderr, "name_for_nmethod: FAIL \n\n");
return err;
}
static int
name_for_imethod(jvm_agent_t* J,
! uint64_t bcp,
uint64_t method,
char *result,
size_t size,
Jframe_t *jframe
) {
*** 1093,1103 ****
int32_t err;
err = read_pointer(J, method + OFFSET_Method_constMethod, &constMethod);
CHECK_FAIL(err);
! bci = is_bci(bcx) ? bcx : bcx - (constMethod + (uint64_t) SIZE_ConstMethod);
if (debug)
fprintf(stderr, "\t name_for_imethod: BEGIN: method: %#llx\n", method);
err = name_for_methodPtr(J, method, result, size);
--- 1083,1093 ----
int32_t err;
err = read_pointer(J, method + OFFSET_Method_constMethod, &constMethod);
CHECK_FAIL(err);
! bci = bcp - (constMethod + (uint64_t) SIZE_ConstMethod);
if (debug)
fprintf(stderr, "\t name_for_imethod: BEGIN: method: %#llx\n", method);
err = name_for_methodPtr(J, method, result, size);
*** 1167,1177 ****
* and regular interpreted frames.
*/
if (err == PS_OK && strncmp(name, "Interpreter", 11) == 0) {
*is_interpreted = 1;
if (is_method(J, J->methodPtr)) {
! return name_for_imethod(J, J->bcx, J->methodPtr, result, size, jframe);
}
}
if (err == PS_OK) {
strncpy(result, name, size);
--- 1157,1167 ----
* and regular interpreted frames.
*/
if (err == PS_OK && strncmp(name, "Interpreter", 11) == 0) {
*is_interpreted = 1;
if (is_method(J, J->methodPtr)) {
! return name_for_imethod(J, J->bcp, J->methodPtr, result, size, jframe);
}
}
if (err == PS_OK) {
strncpy(result, name, size);
*** 1324,1334 ****
uintptr_t fp;
uintptr_t pc;
/* arguments given to read_pointer need to be worst case sized */
uint64_t methodPtr = 0;
uint64_t sender_sp;
! uint64_t bcx = 0;
int is_interpreted = 0;
int result = PS_OK;
int err = PS_OK;
if (J == NULL) {
--- 1314,1324 ----
uintptr_t fp;
uintptr_t pc;
/* arguments given to read_pointer need to be worst case sized */
uint64_t methodPtr = 0;
uint64_t sender_sp;
! uint64_t bcp = 0;
int is_interpreted = 0;
int result = PS_OK;
int err = PS_OK;
if (J == NULL) {
*** 1355,1365 ****
/* The following workaround is for SPARC. CALL instruction occupates 8 bytes.
* In the pcDesc structure return pc offset is recorded for CALL instructions.
* regs[R_PC] contains a CALL instruction pc offset.
*/
pc += 8;
! bcx = (uintptr_t) regs[R_L1];
methodPtr = (uintptr_t) regs[R_L2];
sender_sp = regs[R_I5];
if (debug > 2) {
fprintf(stderr, "\nregs[R_I1]=%lx, regs[R_I2]=%lx, regs[R_I5]=%lx, regs[R_L1]=%lx, regs[R_L2]=%lx\n",
regs[R_I1], regs[R_I2], regs[R_I5], regs[R_L1], regs[R_L2]);
--- 1345,1355 ----
/* The following workaround is for SPARC. CALL instruction occupates 8 bytes.
* In the pcDesc structure return pc offset is recorded for CALL instructions.
* regs[R_PC] contains a CALL instruction pc offset.
*/
pc += 8;
! bcp = (uintptr_t) regs[R_L1];
methodPtr = (uintptr_t) regs[R_L2];
sender_sp = regs[R_I5];
if (debug > 2) {
fprintf(stderr, "\nregs[R_I1]=%lx, regs[R_I2]=%lx, regs[R_I5]=%lx, regs[R_L1]=%lx, regs[R_L2]=%lx\n",
regs[R_I1], regs[R_I2], regs[R_I5], regs[R_L1], regs[R_L2]);
*** 1383,1410 ****
methodPtr = 0;
}
if (read_pointer(J, fp + OFFSET_interpreter_frame_sender_sp, &sender_sp) != PS_OK) {
sender_sp = 0;
}
! if (read_pointer(J, fp + OFFSET_interpreter_frame_bcx_offset, &bcx) != PS_OK) {
! bcx = 0;
}
#endif /* i386 */
J->methodPtr = methodPtr;
! J->bcx = bcx;
/* On x86 with C2 JVM: native frame may have wrong regs[R_FP]
* For example: JVM_SuspendThread frame poins to the top interpreted frame.
* If we call is_method(J, methodPtr) before codecache_contains(J, pc)
* then we go over and omit both: nmethod and I2CAdapter frames.
* Note, that regs[R_PC] is always correct if frame defined correctly.
* So it is better to call codecache_contains(J, pc) from the beginning.
*/
#ifndef X86_COMPILER2
if (is_method(J, J->methodPtr)) {
! result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe);
/* If the methodPtr is a method then this is highly likely to be
an interpreter frame */
if (result >= 0) {
is_interpreted = 1;
}
--- 1373,1400 ----
methodPtr = 0;
}
if (read_pointer(J, fp + OFFSET_interpreter_frame_sender_sp, &sender_sp) != PS_OK) {
sender_sp = 0;
}
! if (read_pointer(J, fp + OFFSET_interpreter_frame_bcp_offset, &bcp) != PS_OK) {
! bcp = 0;
}
#endif /* i386 */
J->methodPtr = methodPtr;
! J->bcp = bcp;
/* On x86 with C2 JVM: native frame may have wrong regs[R_FP]
* For example: JVM_SuspendThread frame poins to the top interpreted frame.
* If we call is_method(J, methodPtr) before codecache_contains(J, pc)
* then we go over and omit both: nmethod and I2CAdapter frames.
* Note, that regs[R_PC] is always correct if frame defined correctly.
* So it is better to call codecache_contains(J, pc) from the beginning.
*/
#ifndef X86_COMPILER2
if (is_method(J, J->methodPtr)) {
! result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe);
/* If the methodPtr is a method then this is highly likely to be
an interpreter frame */
if (result >= 0) {
is_interpreted = 1;
}
*** 1414,1424 ****
if (codecache_contains(J, pc)) {
result = name_for_codecache(J, fp, pc, name, size, jframe, &is_interpreted);
}
#ifdef X86_COMPILER2
else if (is_method(J, J->methodPtr)) {
! result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe);
/* If the methodPtr is a method then this is highly likely to be
an interpreter frame */
if (result >= 0) {
is_interpreted = 1;
}
--- 1404,1414 ----
if (codecache_contains(J, pc)) {
result = name_for_codecache(J, fp, pc, name, size, jframe, &is_interpreted);
}
#ifdef X86_COMPILER2
else if (is_method(J, J->methodPtr)) {
! result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe);
/* If the methodPtr is a method then this is highly likely to be
an interpreter frame */
if (result >= 0) {
is_interpreted = 1;
}
src/os/solaris/dtrace/libjvm_db.c
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File