java_handle_t *e;
java_object_t *o;
- /* create the stackframeinfo (XPC is equal to RA) */
+ /* Fill and add a stackframeinfo (XPC is equal to RA). */
- stacktrace_create_extern_stackframeinfo(&sfi, NULL, sp, ra, ra);
+ stacktrace_stackframeinfo_add(&sfi, NULL, sp, ra, ra);
/* create the exception */
e = exceptions_new_error(utf_java_lang_AbstractMethodError);
#endif
- /* remove the stackframeinfo */
+ /* Remove the stackframeinfo. */
- stacktrace_remove_stackframeinfo(&sfi);
+ stacktrace_stackframeinfo_remove(&sfi);
/* unwrap the exception */
/* ATTENTION: do the this _after_ the stackframeinfo was removed */
xptr = LLNI_WRAP(xptro);
xpc = ADDR_MASK(xpc);
- /* create the stackframeinfo (XPC is equal to RA) */
+ /* Fill and add a stackframeinfo (XPC is equal to RA). */
- stacktrace_create_extern_stackframeinfo(&sfi, pv, sp, xpc, xpc);
+ stacktrace_stackframeinfo_add(&sfi, pv, sp, xpc, xpc);
result = NULL;
exceptions_handle_exception_return:
- /* remove the stackframeinfo */
+ /* Remove the stackframeinfo. */
- stacktrace_remove_stackframeinfo(&sfi);
+ stacktrace_stackframeinfo_remove(&sfi);
return result;
}
/* Add a stackframeinfo for this native method. We don't have RA
and XPC here. These are determined in
- stacktrace_stackframeinfo_create. */
+ stacktrace_stackframeinfo_add. */
- stacktrace_create_extern_stackframeinfo(sfi, pv, sp, NULL, NULL);
+ stacktrace_stackframeinfo_add(sfi, pv, sp, NULL, NULL);
/* Return a wrapped classinfo for static methods. */
sfi = (stackframeinfo *) (datasp - sizeof(stackframeinfo));
- /* remove current stackframeinfo from chain */
+ /* Remove current stackframeinfo from chain. */
- stacktrace_remove_stackframeinfo(sfi);
+ stacktrace_stackframeinfo_remove(sfi);
#if defined(ENABLE_HANDLES)
/* unwrap the return value from the local reference table */
/* create the stackframeinfo (subtract 1 from RA as it points to the */
/* instruction after the call) */
- stacktrace_create_extern_stackframeinfo(&sfi, NULL, sp, ra, ra-1);
+ stacktrace_stackframeinfo_add(&sfi, NULL, sp, ra, ra-1);
/* actually compile the method */
/* remove the stackframeinfo */
- stacktrace_remove_stackframeinfo(&sfi);
+ stacktrace_stackframeinfo_remove(&sfi);
/* there was a problem during compilation */
/* create the stackframeinfo */
/* RA is passed as NULL, but the XPC is correct and can be used in
- stacktrace_create_extern_stackframeinfo for
- md_codegen_get_pv_from_pc. */
+ stacktrace_stackframeinfo_add for md_codegen_get_pv_from_pc. */
/*
fprintf(stderr, "EXT STACKFRAME: sfi=%x pv=%x, sp=%x, xpc=%x\n", &sfi, pv, sp+7*4, xpc);
*/
- stacktrace_create_extern_stackframeinfo(&sfi, pv, sp + 7 * 4, xpc, xpc);
+ stacktrace_stackframeinfo_add(&sfi, pv, sp + 7 * 4, xpc, xpc);
/* call the proper patcher function */
result = (patcher_function)(sp);
/* remove the stackframeinfo */
- stacktrace_remove_stackframeinfo(&sfi);
+ stacktrace_stackframeinfo_remove(&sfi);
/* check for return value and exit accordingly */
if (result == false) {
printf("patcher opening sfi for xpc=%p\n", xpc);
- stacktrace_create_extern_stackframeinfo(&sfi, pv, javasp, ra, xpc);
+ stacktrace_stackframeinfo_add(&sfi, pv, javasp, ra, xpc);
/* call the proper patcher function */
/* remove the stackframeinfo */
- stacktrace_remove_stackframeinfo(&sfi);
+ stacktrace_stackframeinfo_remove(&sfi);
printf("patcher closing sfi for xpc=%p\n", xpc);
/* check for return value and exit accordingly */
CYCLES_STATS_DECLARE(stacktrace_getStack ,40,10000)
-/* stacktrace_create_stackframeinfo ********************************************
+/* stacktrace_stackframeinfo_add ***********************************************
- Creates an stackframe info structure for inline code in the
- interpreter.
+ Fills a stackframe info structure with the given or calculated
+ values and adds it to the chain.
*******************************************************************************/
-#if defined(ENABLE_INTRP)
-void stacktrace_create_stackframeinfo(stackframeinfo *sfi, u1 *pv, u1 *sp,
- u1 *ra)
-{
- stackframeinfo **psfi;
- methodinfo *m;
- codeinfo *code;
-
- /* get current stackframe info pointer */
-
- psfi = &STACKFRAMEINFO;
-
- /* if we don't have pv handy */
-
- if (pv == NULL) {
-#if defined(ENABLE_INTRP)
- if (opt_intrp)
- pv = codegen_get_pv_from_pc(ra);
- else
-#endif
- {
-#if defined(ENABLE_JIT)
- pv = md_codegen_get_pv_from_pc(ra);
-#endif
- }
- }
-
- /* get codeinfo pointer from data segment */
-
- code = *((codeinfo **) (pv + CodeinfoPointer));
-
- /* For asm_vm_call_method the codeinfo pointer is NULL. */
-
- m = (code == NULL) ? NULL : code->m;
-
- /* fill new stackframe info structure */
-
- sfi->prev = *psfi;
- sfi->method = m;
- sfi->pv = pv;
- sfi->sp = sp;
- sfi->ra = ra;
-
- /* xpc is the same as ra, but is required in stacktrace_create */
-
- sfi->xpc = ra;
-
- /* store new stackframe info pointer */
-
- *psfi = sfi;
-}
-#endif /* defined(ENABLE_INTRP) */
-
-
-/* stacktrace_create_extern_stackframeinfo *************************************
-
- Creates an stackframe info structure for an extern exception
- (hardware or assembler).
-
-*******************************************************************************/
-
-void stacktrace_create_extern_stackframeinfo(stackframeinfo *sfi, u1 *pv,
- u1 *sp, u1 *ra, u1 *xpc)
+void stacktrace_stackframeinfo_add(stackframeinfo *sfi, u1 *pv, u1 *sp, u1 *ra, u1 *xpc)
{
stackframeinfo **psfi;
methodinfo *m;
}
-/* stacktrace_remove_stackframeinfo ********************************************
+/* stacktrace_stackframeinfo_remove ********************************************
- Remove the topmost stackframeinfo in the current thread.
+ Remove the given stackframeinfo from the chain in the current
+ thread.
*******************************************************************************/
-void stacktrace_remove_stackframeinfo(stackframeinfo *sfi)
+void stacktrace_stackframeinfo_remove(stackframeinfo *sfi)
{
stackframeinfo **psfi;
/* function prototypes ********************************************************/
-#if defined(ENABLE_INTRP)
-void stacktrace_create_stackframeinfo(stackframeinfo *sfi, u1 *pv, u1 *sp,
- u1 *ra);
-#endif
-
-void stacktrace_create_extern_stackframeinfo(stackframeinfo *sfi, u1 *pv,
- u1 *sp, u1 *ra, u1 *xpc);
-
-void stacktrace_create_native_stackframeinfo(stackframeinfo *sfi, u1 *pv,
- u1 *sp, u1 *ra);
-
-void stacktrace_remove_stackframeinfo(stackframeinfo *sfi);
+void stacktrace_stackframeinfo_add(stackframeinfo *sfi, u1 *pv, u1 *sp, u1 *ra, u1 *xpc);
+void stacktrace_stackframeinfo_remove(stackframeinfo *sfi);
stacktracebuffer *stacktrace_create(stackframeinfo *sfi);
case EXCEPTION_HARDWARE_COMPILER:
/* In this case the passed PV points to the compiler stub. We
get the methodinfo pointer here and set PV to NULL so
- stacktrace_stackframeinfo_create determines the PV for the
+ stacktrace_stackframeinfo_add determines the PV for the
parent Java method. */
m = code_get_methodinfo_for_pv(pv);
break;
}
- /* create stackframeinfo */
+ /* Fill and add a stackframeinfo. */
- stacktrace_create_extern_stackframeinfo(&sfi, pv, sp, ra, xpc);
+ stacktrace_stackframeinfo_add(&sfi, pv, sp, ra, xpc);
switch (type) {
case EXCEPTION_HARDWARE_NULLPOINTER:
p = NULL;
}
- /* remove stackframeinfo */
+ /* Remove stackframeinfo. */
- stacktrace_remove_stackframeinfo(&sfi);
+ stacktrace_stackframeinfo_remove(&sfi);
/* unwrap and return the exception object */
/* AFTER: removing stackframeinfo */