/*
- * jit-except.cpp - Exception handling functions.
+ * jit-except.c - Exception handling functions.
*
* Copyright (C) 2004 Southern Storm Software, Pty Ltd.
*
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/*
-
-This file must be compiled with a C++ compiler, because it uses
-C++ exceptions to manage JIT exception throws. It is otherwise
-straight vanilla ANSI C.
-
-*/
-
#include "jit-internal.h"
#include "jit-rules.h"
#include <config.h>
* data at the pointer is determined by the front end.
* @end deftypefun
@*/
-extern "C" void *jit_exception_get_last(void)
+void *jit_exception_get_last(void)
{
jit_thread_control_t control = _jit_thread_get_control();
if(control)
* both @code{jit_exception_get_last} and @code{jit_exception_clear_last}.
* @end deftypefun
@*/
-extern "C" void *jit_exception_get_last_and_clear(void)
+void *jit_exception_get_last_and_clear(void)
{
jit_thread_control_t control = _jit_thread_get_control();
if(control)
* exception object before returning to regular code.
* @end deftypefun
@*/
-extern "C" void jit_exception_set_last(void *object)
+void jit_exception_set_last(void *object)
{
jit_thread_control_t control = _jit_thread_get_control();
if(control)
* with a parameter of NULL.
* @end deftypefun
@*/
-extern "C" void jit_exception_clear_last(void)
+void jit_exception_clear_last(void)
{
jit_exception_set_last(0);
}
* copied back into a location that is visible to the collector once more.
* @end deftypefun
@*/
-extern "C" void jit_exception_throw(void *object)
+void jit_exception_throw(void *object)
{
jit_thread_control_t control = _jit_thread_get_control();
if(control)
* @end table
* @end deftypefun
@*/
-extern "C" void jit_exception_builtin(int exception_type)
+void jit_exception_builtin(int exception_type)
{
jit_exception_func handler;
void *object;
* Returns the previous exception handler.
* @end deftypefun
@*/
-extern "C" jit_exception_func jit_exception_set_handler
+jit_exception_func jit_exception_set_handler
(jit_exception_func handler)
{
jit_exception_func previous;
* Get the builtin exception handler for the current thread.
* @end deftypefun
@*/
-extern "C" jit_exception_func jit_exception_get_handler(void)
+jit_exception_func jit_exception_get_handler(void)
{
jit_thread_control_t control = _jit_thread_get_control();
if(control)
* insufficient memory to create it.
* @end deftypefun
@*/
-extern "C" jit_stack_trace_t jit_exception_get_stack_trace(void)
+jit_stack_trace_t jit_exception_get_stack_trace(void)
{
jit_thread_control_t control;
jit_backtrace_t top;
* Get the size of a stack trace.
* @end deftypefun
@*/
-extern "C" unsigned int jit_stack_trace_get_size(jit_stack_trace_t trace)
+unsigned int jit_stack_trace_get_size(jit_stack_trace_t trace)
{
if(trace)
{
* @code{posn} within the stack trace.
* @end deftypefun
@*/
-extern "C" jit_function_t jit_stack_trace_get_function
+jit_function_t jit_stack_trace_get_function
(jit_context_t context, jit_stack_trace_t trace, unsigned int posn)
{
if(trace && posn < trace->size)
* where execution had reached at the time of the trace.
* @end deftypefun
@*/
-extern "C" void *jit_stack_trace_get_pc
+void *jit_stack_trace_get_pc
(jit_stack_trace_t trace, unsigned int posn)
{
if(trace && posn < trace->size)
* is no bytecode offset associated with @code{posn}.
* @end deftypefun
@*/
-extern "C" unsigned int jit_stack_trace_get_offset
+unsigned int jit_stack_trace_get_offset
(jit_context_t context, jit_stack_trace_t trace, unsigned int posn)
{
/* TODO */
* Free the memory associated with a stack trace.
* @end deftypefun
@*/
-extern "C" void jit_stack_trace_free(jit_stack_trace_t trace)
+void jit_stack_trace_free(jit_stack_trace_t trace)
{
if(trace)
{
}
}
-extern "C" void _jit_backtrace_push
+void _jit_backtrace_push
(jit_backtrace_t trace, void *pc, void *catch_pc, void *sp)
{
jit_thread_control_t control = _jit_thread_get_control();
}
}
-extern "C" void _jit_backtrace_pop(void)
+void _jit_backtrace_pop(void)
{
jit_thread_control_t control = _jit_thread_get_control();
jit_backtrace_t trace;
}
}
-extern "C" void _jit_backtrace_set(jit_backtrace_t trace)
+void _jit_backtrace_set(jit_backtrace_t trace)
{
jit_thread_control_t control = _jit_thread_get_control();
if(control)
}
}
-extern "C" void _jit_unwind_push_setjmp(jit_jmp_buf *jbuf)
+void _jit_unwind_push_setjmp(jit_jmp_buf *jbuf)
{
jit_thread_control_t control = _jit_thread_get_control();
if(control)
}
}
-extern "C" void _jit_unwind_pop_setjmp(void)
+void _jit_unwind_pop_setjmp(void)
{
jit_thread_control_t control = _jit_thread_get_control();
if(control && control->setjmp_head)
control->setjmp_head = control->setjmp_head->parent;
}
}
-
-extern "C" void _jit_unwind_fix_setjmp(void)
-{
- jit_thread_control_t control = _jit_thread_get_control();
- if(control && control->setjmp_head)
- {
- control->backtrace_head = control->setjmp_head->trace;
- }
-}
/*
- * jit-interp.cpp - Fallback interpreter implementation.
+ * jit-interp.c - Fallback interpreter implementation.
*
* Copyright (C) 2004 Southern Storm Software, Pty Ltd.
*
jit_apply(signature, func, apply_args, num_fixed_args, return_area);
}
-void _jit_run_function(jit_function_interp *func, jit_item *args,
+void _jit_run_function(jit_function_interp_t func, jit_item *args,
jit_item *return_area)
{
jit_item *frame;
jit_exception_builtin(builtin_exception);
}
-extern "C" int jit_function_apply
+int jit_function_apply
(jit_function_t func, void **args, void *return_area)
{
if(func)
}
/* Imported from "jit-rules-interp.c" */
-extern "C" unsigned int _jit_interp_calculate_arg_size
+unsigned int _jit_interp_calculate_arg_size
(jit_function_t func, jit_type_t signature);
-extern "C" int jit_function_apply_vararg
+int jit_function_apply_vararg
(jit_function_t func, jit_type_t signature, void **args, void *return_area)
{
struct jit_backtrace call_trace;
- jit_function_interp *entry;
+ jit_function_interp_t entry;
jit_item interp_return_area;
jit_item *arg_buffer;
jit_item *temp_arg;
/* Make sure that the function is compiled */
if(func->is_compiled)
{
- entry = (jit_function_interp *)(func->entry_point);
+ entry = (jit_function_interp_t)(func->entry_point);
}
else
{
- entry = (jit_function_interp *)
+ entry = (jit_function_interp_t)
_jit_function_compile_on_demand(func);
}