* src/vm/resolve.c (resolve_method_lazy): Removed dependence on
[cacao.git] / src / vm / jit / stacktrace.h
index 4bdb1cdff2fc66b4bd578b8cb79f37f8e63adec0..31379a964ff9d393f724044b0f7a9a7dda8338fa 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: stacktrace.h 4406 2006-02-03 13:19:36Z twisti $
+   $Id: stacktrace.h 5088 2006-07-08 20:16:05Z twisti $
 
 */
 
@@ -64,8 +64,8 @@ struct stackframeinfo {
        u1             *xpc;                /* XPC (for inline stubs)             */
 };
 
-#if defined(USE_THREADS)
-#define STACKFRAMEINFO    (stackframeinfo **) (&THREADINFO->_stackframeinfo)
+#if defined(ENABLE_THREADS)
+#define STACKFRAMEINFO    (&(THREADOBJECT->_stackframeinfo))
 #else
 extern stackframeinfo *_no_threads_stackframeinfo;
 
@@ -87,13 +87,13 @@ struct stacktrace_entry {
 
 /* stacktracebuffer ***********************************************************/
 
-#define STACKTRACE_CAPACITY_DEFAULT      40
-#define STACKTRACE_CAPACITY_INCREMENT    40
+#define STACKTRACE_CAPACITY_DEFAULT      80
+#define STACKTRACE_CAPACITY_INCREMENT    80
 
 struct stacktracebuffer {
-       s4               capacity;          /* size of the buffer                 */
-       s4               used;              /* current entries in the buffer      */
-       stacktrace_entry entries[1];        /* the actual entries                 */
+       s4                capacity;         /* size of the buffer                 */
+       s4                used;             /* current entries in the buffer      */
+       stacktrace_entry *entries;          /* the actual entries                 */
 };
 
 
@@ -118,21 +118,39 @@ void stacktrace_remove_stackframeinfo(stackframeinfo *sfi);
 /* inline exception creating functions */
 java_objectheader *stacktrace_inline_arithmeticexception(u1 *pv, u1 *sp, u1 *ra,
                                                                                                                 u1 *xpc);
+#define STACKTRACE_inline_arithmeticexception \
+    (functionptr) stacktrace_inline_arithmeticexception
+                                                                                               
 
 java_objectheader *stacktrace_inline_arrayindexoutofboundsexception(u1 *pv,
                                                                                                                                        u1 *sp,
                                                                                                                                        u1 *ra,
                                                                                                                                        u1 *xpc,
                                                                                                                                        s4 index);
+#define STACKTRACE_inline_arrayindexoutofboundsexception \
+    (functionptr) stacktrace_inline_arrayindexoutofboundsexception
 
 java_objectheader *stacktrace_inline_arraystoreexception(u1 *pv, u1 *sp, u1 *ra,
                                                                                                                 u1 *xpc);
+#define STACKTRACE_inline_arraystoreexception \
+    (functionptr) stacktrace_inline_arraystoreexception
 
 java_objectheader *stacktrace_inline_classcastexception(u1 *pv, u1 *sp, u1 *ra,
-                                                                                                               u1 *xpc);
+                                                                                                               u1 *xpc,
+                                                                                                               java_objectheader *o);
+#define STACKTRACE_inline_classcastexception \
+    (functionptr) stacktrace_inline_classcastexception
 
 java_objectheader *stacktrace_inline_nullpointerexception(u1 *pv, u1 *sp,
                                                                                                                  u1 *ra, u1 *xpc);
+#define STACKTRACE_inline_nullpointerexception \
+    (functionptr) stacktrace_inline_nullpointerexception
+
+/* refill the stacktrace of an existing exception */
+java_objectheader *stacktrace_inline_fillInStackTrace(u1 *pv, u1 *sp, u1 *ra,
+                                                                                                         u1 *xpc);
+#define STACKTRACE_inline_fillInStackTrace \
+    (functionptr) stacktrace_inline_fillInStackTrace
 
 
 /* hardware exception creating functions */
@@ -142,13 +160,10 @@ java_objectheader *stacktrace_hardware_arithmeticexception(u1 *pv, u1 *sp,
 java_objectheader *stacktrace_hardware_nullpointerexception(u1 *pv, u1 *sp,
                                                                                                                        u1 *ra, u1 *xpc);
 
-/* refill the stacktrace of an existing exception */
-java_objectheader *stacktrace_inline_fillInStackTrace(u1 *pv, u1 *sp, u1 *ra,
-                                                                                                         u1 *xpc);
 
 stacktracebuffer  *stacktrace_fillInStackTrace(void);
 java_objectarray  *stacktrace_getClassContext(void);
-java_objectheader *stacktrace_getCallingClassLoader(void);
+classinfo         *stacktrace_getCurrentClass(void);
 java_objectarray  *stacktrace_getStack(void);
 
 void stacktrace_dump_trace(void);
@@ -165,6 +180,10 @@ u1 *md_stacktrace_get_returnaddress(u1 *sp, u4 framesize);
 u1 *intrp_md_stacktrace_get_returnaddress(u1 *sp, u4 framesize);
 #endif
 
+#if defined(ENABLE_CYCLES_STATS)
+void stacktrace_print_cycles_stats(FILE *file);
+#endif
+
 #endif /* _STACKTRACE_H */