/* src/vm/jit/intrp/engine.c - #included by engine1.c and engine2.c
- Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
- C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
- E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
- J. Wenninger, Institut f. Computersprachen - TU Wien
+ Copyright (C) 1996-2005, 2006, 2007, 2008
+ CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Contact: cacao@cacaojvm.org
-
- Authors: Christian Thalinger
- Anton Ertl
-
- Changes:
-
- $Id: engine.c 5666 2006-10-04 15:04:52Z twisti $
*/
-#define VM_DEBUG
+/* #define VM_DEBUG */
#include "config.h"
#include <assert.h>
+#include "vm/types.h"
+
#include "arch.h"
+
#include "vm/jit/intrp/intrp.h"
#include "md-abi.h" /* required for TRACE_ARGS_NUM */
-#include "vm/builtin.h"
-#include "vm/exceptions.h"
-#include "vm/loader.h"
+#include "mm/memory.hpp"
+
+#include "threads/thread.hpp"
+
+#include "vm/jit/builtin.hpp"
+#include "vm/loader.hpp"
#include "vm/options.h"
+
#include "vm/jit/methodheader.h"
#include "vm/jit/patcher.h"
+#include "vm/jit/stacktrace.hpp"
+
#if defined(ENABLE_THREADS)
-# ifndef USE_FAKE_ATOMIC_INSTRUCTIONS
-# include "machine-instr.h"
-# else
-# include "threads/native/generic-primitives.h"
-# endif
+# include "threads/atomic.hpp"
#endif
#if !defined(STORE_ORDER_BARRIER) && !defined(ENABLE_THREADS)
#define THROW_CLASSCASTEXCEPTION(o) \
{ \
classcastexception_object = o; \
- THROW(nullpointerexception); \
+ THROW(classcastexception); \
}
#define CHECK_OUT_OF_BOUNDS(_array, _idx) \
#define access_array_float(array, index) \
((((java_floatarray*)(array))->data)[index])
-#define MAXLOCALS(stub) (((Cell *)stub)[1])
+/* (see createcompilerstub in codegen.c) */
+#define FRAMESIZE(stub) (((Cell *)stub)[1])
#if 0
#define CLEARSTACK(_start, _end) \
{
Inst *ip;
register Cell *sp SPREG = sp0;
- Inst ca1; /* code address; this is the next dispatched instruction */
+ /* Inst ca1; XXX unused? */ /* code address; this is the next dispatched instruction */
IF_spTOS(register Cell spTOS TOSREG;)
static Inst labels[] = {
#define INST_ADDR(_inst) (&&I_##_inst)
-#include "java-labels.i"
+#include <java-labels.i>
#undef INST_ADDR
NULL,
#define INST_ADDR(_inst) (&&J_##_inst)
-#include "java-labels.i"
+#include <java-labels.i>
#undef INST_ADDR
#define INST_ADDR(_inst) (&&K_##_inst)
-#include "java-labels.i"
+#include <java-labels.i>
#undef INST_ADDR
(Label)&&after_last,
(Label)&&before_goto,
(Label)&&after_goto,
#define INST_ADDR(_inst) (&&H_##_inst)
-#include "java-labels.i"
+#include <java-labels.i>
#undef INST_ADDR
};
/* local variables for the various throw codes; this helps make
Label throw_classcastexception = &&throw_classcastexception1;
Label throw_nullpointerexception = &&throw_nullpointerexception1;
Label throw_arraystoreexception = &&throw_arraystoreexception1;
- java_objectheader *classcastexception_object;
- s4 arrayindexoutofbounds_index; /* pass the index to the throw code */
+ java_objectheader *classcastexception_object = NULL;
+ s4 arrayindexoutofbounds_index = 0; /* pass the index to the throw code */
if (vm_debug)
fprintf(vm_out,"entering engine(%p,%p,%p)\n",ip0,sp,fp);
NEXT;
#define INST_ADDR(_inst) (&&I_##_inst)
-#include "java-vm.i"
+#include <java-vm.i>
#undef NAME
after_last: return NULL;
}
* c-basic-offset: 4
* tab-width: 4
* End:
+ * vim:noexpandtab:sw=4:ts=4:
*/