* src/vm/jit/stacktrace.c (stacktrace_create_stackframeinfo): Removed.
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Wed, 3 Oct 2007 21:43:17 +0000 (23:43 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Wed, 3 Oct 2007 21:43:17 +0000 (23:43 +0200)
(stacktrace_create_extern_stackframeinfo): Renamed to
stacktrace_stackframeinfo_add.
(stacktrace_remove_stackframeinfo): Renamed to
stacktrace_stackframeinfo_remove.
* src/vm/jit/stacktrace.h: Likewise.

* src/vm/exceptions.c,
src/vm/jit/codegen-common.c,
src/vm/jit/jit.c,
src/vm/jit/m68k/patcher.c,
src/vm/jit/sparc64/patcher.c,
src/vm/signal.c: Renamed functions as above.

src/vm/exceptions.c
src/vm/jit/codegen-common.c
src/vm/jit/jit.c
src/vm/jit/m68k/patcher.c
src/vm/jit/sparc64/patcher.c
src/vm/jit/stacktrace.c
src/vm/jit/stacktrace.h
src/vm/signal.c

index 1616d9d6717e5ec5d2553d73fc61ad0321637da9..d303ef80d5833e77994aa18f71844157b36ad645 100644 (file)
@@ -650,9 +650,9 @@ java_object_t *exceptions_asm_new_abstractmethoderror(u1 *sp, u1 *ra)
        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 */
 
@@ -662,9 +662,9 @@ java_object_t *exceptions_asm_new_abstractmethoderror(u1 *sp, u1 *ra)
        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 */
@@ -1734,9 +1734,9 @@ u1 *exceptions_handle_exception(java_object_t *xptro, u1 *xpc, u1 *pv, u1 *sp)
        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;
 
@@ -1915,9 +1915,9 @@ u1 *exceptions_handle_exception(java_object_t *xptro, u1 *xpc, u1 *pv, u1 *sp)
 
 exceptions_handle_exception_return:
 
-       /* remove the stackframeinfo */
+       /* Remove the stackframeinfo. */
 
-       stacktrace_remove_stackframeinfo(&sfi);
+       stacktrace_stackframeinfo_remove(&sfi);
 
        return result;
 }
index 5e5b43276b3b68c3a3b6fa24f6622a95a7ddcbf5..35f87ba031a67accdcba9d6497a170d195971091 100644 (file)
@@ -1619,9 +1619,9 @@ java_handle_t *codegen_start_native_call(u1 *sp, u1 *pv)
 
        /* 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. */
 
@@ -1694,9 +1694,9 @@ java_object_t *codegen_finish_native_call(u1 *sp, u1 *pv)
 
        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 */
index 98d165b1edd7b8db8a3dfdf1d4e845bdf0521e1b..70d84ca5e5f19df1e06af792ad9a34c85d7c24b4 100644 (file)
@@ -1692,7 +1692,7 @@ u1 *jit_asm_compile(methodinfo *m, u1 *mptr, u1 *sp, u1 *ra)
        /* 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 */
 
@@ -1700,7 +1700,7 @@ u1 *jit_asm_compile(methodinfo *m, u1 *mptr, u1 *sp, u1 *ra)
 
        /* remove the stackframeinfo */
 
-       stacktrace_remove_stackframeinfo(&sfi);
+       stacktrace_stackframeinfo_remove(&sfi);
 
        /* there was a problem during compilation */
 
index 41640b83241200c54288d0275bb1eed333a21205..7ffae478b02f6996e362de2b239a941a209b0a30 100644 (file)
@@ -101,20 +101,19 @@ java_objectheader *patcher_wrapper(u1 *sp, u1 *pv, u1 *ra)
        /* 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) {
index c38b0860ec61bea70bd068306708ae3b517a2e0f..5352114dc031997181cf8f71836bb959b01710fe 100644 (file)
@@ -115,7 +115,7 @@ java_object_t *patcher_wrapper(u1 *sp, u1 *pv, u1 *ra)
 
        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 */
 
@@ -123,7 +123,7 @@ java_object_t *patcher_wrapper(u1 *sp, u1 *pv, u1 *ra)
 
        /* 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 */
index e13c47d0844b9ef486cd6fa52937aac7d59a7f1b..373106faf9fdc8b21c4de782e9cdd99aea40ed0d 100644 (file)
@@ -83,76 +83,14 @@ CYCLES_STATS_DECLARE(stacktrace_getCurrentClass ,40,5000)
 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;
@@ -259,13 +197,14 @@ void stacktrace_create_extern_stackframeinfo(stackframeinfo *sfi, u1 *pv,
 }
 
 
-/* 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;
 
index 9708c8456f1bb890aa5791fcefe0102d489043ab..c2531481c037302adc0296fcf60a1b588fa8991d 100644 (file)
@@ -97,18 +97,8 @@ struct stacktracebuffer {
 
 /* 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);
index 804922fbcfdc141c542830810ab98972a8da1c5f..fb700c19795f7be36b731f845703d7ed05d1fe7a 100644 (file)
@@ -247,7 +247,7 @@ void *signal_handle(int type, intptr_t val,
        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);
@@ -259,9 +259,9 @@ void *signal_handle(int type, intptr_t val,
                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:
@@ -330,9 +330,9 @@ void *signal_handle(int type, intptr_t val,
                p = NULL;
        }
 
-       /* remove stackframeinfo */
+       /* Remove stackframeinfo. */
 
-       stacktrace_remove_stackframeinfo(&sfi);
+       stacktrace_stackframeinfo_remove(&sfi);
 
        /* unwrap and return the exception object */
        /* AFTER: removing stackframeinfo */