We don't need to remember the bottom stack frame because the
frame chain always ends with a NULL frame.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 include/vm/stack-trace.h |    7 -------
 vm/jato.c                |    4 ----
 vm/stack-trace.c         |    8 +++-----
 3 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/include/vm/stack-trace.h b/include/vm/stack-trace.h
index 315fb29..dcb68ac 100644
--- a/include/vm/stack-trace.h
+++ b/include/vm/stack-trace.h
@@ -88,13 +88,6 @@ static inline void *vm_native_stack_get_frame(void)
                        __builtin_frame_address(0);                     \
        } while (0)
 
-
-/*
- * Points to a native stack frame that is considered as bottom-most
- * for given thread.
- */
-extern __thread struct native_stack_frame *bottom_stack_frame;
-
 enum stack_trace_elem_type {
        STACK_TRACE_ELEM_TYPE_JIT,
        STACK_TRACE_ELEM_TYPE_JNI,
diff --git a/vm/jato.c b/vm/jato.c
index 453376d..4912243 100644
--- a/vm/jato.c
+++ b/vm/jato.c
@@ -889,14 +889,10 @@ main(int argc, char *argv[])
                goto out;
        }
 
-       bottom_stack_frame = __builtin_frame_address(0);
-
        void (*main_method_trampoline)(void)
                = vm_method_trampoline_ptr(vmm);
        main_method_trampoline();
 
-       bottom_stack_frame = NULL;
-
 out_check_exception:
        if (exception_occurred()) {
                vm_print_exception(exception_occurred());
diff --git a/vm/stack-trace.c b/vm/stack-trace.c
index 7fc444d..5964839 100644
--- a/vm/stack-trace.c
+++ b/vm/stack-trace.c
@@ -56,8 +56,6 @@ __thread unsigned long jni_stack_offset;
 __thread struct vm_native_stack_entry vm_native_stack[VM_NATIVE_STACK_SIZE];
 __thread unsigned long vm_native_stack_offset;
 
-__thread struct native_stack_frame *bottom_stack_frame;
-
 void init_stack_trace_printing(void)
 {
        vm_native_stack_offset = 0;
@@ -163,9 +161,6 @@ int stack_trace_elem_next(struct stack_trace_elem *elem)
        unsigned long ret_addr;
        void *new_frame;
 
-       if (elem->frame == bottom_stack_frame)
-               return -1;
-
        /* If previous element was a JNI call then we move to the JNI
         * caller's frame. We use the JNI stack_entry info to get the
         * frame because we don't trust JNI methods's frame
@@ -179,6 +174,9 @@ int stack_trace_elem_next(struct stack_trace_elem *elem)
                goto out;
        }
 
+       if (elem->frame == NULL)
+               return -1;
+
        /* Check if we hit the JNI interface frame */
        if (elem->jni_stack_index >= 0) {
                struct jni_stack_entry *tr =
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to