#include "native/localref.h"
#include "native/native.h"
-#if defined(WITH_CLASSPATH_SUN)
+#if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
# include "native/include/java_lang_Object.h"
# include "native/include/java_lang_String.h" /* required by j.l.CL */
# include "native/include/java_nio_ByteBuffer.h" /* required by j.l.CL */
# include "native/include/java_lang_ClassLoader.h"
#endif
-#if defined(WITH_CLASSPATH_CLDC1_1)
+#if defined(WITH_JAVA_RUNTIME_LIBRARY_CLDC1_1)
# include "native/include/java_lang_String.h"
#endif
#include "native/include/java_lang_Class.h"
-#include "threads/threads-common.h"
+#include "threads/thread.h"
#include "vm/builtin.h"
#include "vm/exceptions.h"
void codegen_branch_label_add(codegendata *cd, s4 label, s4 condition, s4 reg, u4 options)
{
- list_t *list;
+ list_t *l;
branch_label_ref_t *br;
s4 mpc;
- /* get the label list */
+ /* Get the label list. */
- list = cd->brancheslabel;
+ l = cd->brancheslabel;
/* calculate the current mpc */
br->reg = reg;
br->options = options;
- /* add the branch to the list */
+ /* Add the branch to the list. */
- list_add_last_unsynced(list, br);
+ list_add_last(l, br);
}
#if defined(ENABLE_THREADS)
void codegen_critical_section_new(codegendata *cd)
{
- list_t *list;
+ list_t *l;
critical_section_ref_t *csr;
s4 mpc;
- /* get the critical section list */
+ /* Get the critical section list. */
- list = cd->listcritical;
+ l = cd->listcritical;
/* calculate the current mpc */
csr->end = -1;
csr->restart = mpc;
- /* add the branch to the list */
+ /* Add the branch to the list. */
- list_add_last_unsynced(list, csr);
+ list_add_last(l, csr);
}
#endif
#if defined(ENABLE_THREADS)
void codegen_critical_section_start(codegendata *cd)
{
- list_t *list;
+ list_t *l;
critical_section_ref_t *csr;
s4 mpc;
- /* get the critical section list */
+ /* Get the critical section list. */
- list = cd->listcritical;
+ l = cd->listcritical;
/* calculate the current mpc */
mpc = cd->mcodeptr - cd->mcodebase;
- /* get the current critical section */
+ /* Get the current critical section. */
- csr = list_last_unsynced(list);
+ csr = list_last(l);
/* set the start point */
#if defined(ENABLE_THREADS)
void codegen_critical_section_end(codegendata *cd)
{
- list_t *list;
+ list_t *l;
critical_section_ref_t *csr;
s4 mpc;
- /* get the critical section list */
+ /* Get the critical section list. */
- list = cd->listcritical;
+ l = cd->listcritical;
/* calculate the current mpc */
mpc = cd->mcodeptr - cd->mcodebase;
- /* get the current critical section */
+ /* Get the current critical section. */
- csr = list_last_unsynced(list);
+ csr = list_last(l);
/* set the end point */
{
codeinfo *code;
codegendata *cd;
- list_t *list;
+ list_t *l;
critical_section_ref_t *csr;
critical_section_node_t *csn;
code = jd->code;
cd = jd->cd;
- /* get the critical section list */
+ /* Get the critical section list. */
- list = cd->listcritical;
+ l = cd->listcritical;
/* iterate over all critical sections */
- for (csr = list_first_unsynced(list); csr != NULL;
- csr = list_next_unsynced(list, csr)) {
+ for (csr = list_first(l); csr != NULL; csr = list_next(l, csr)) {
/* check if all points are set */
assert(csr->start != -1);
#endif
s4 alignedmcodelen;
jumpref *jr;
- patchref_t *pr;
u1 *epoint;
s4 alignedlen;
/* patcher resolving */
- pr = list_first_unsynced(code->patchers);
- while (pr) {
- pr->mpc += (ptrint) epoint;
- pr->datap = (ptrint) (pr->disp + epoint);
- pr = list_next_unsynced(code->patchers, pr);
- }
+ patcher_resolve(jd);
#if defined(ENABLE_REPLACEMENT)
/* replacement point resolving */
void codegen_disassemble_stub(methodinfo *m, u1 *start, u1 *end)
{
printf("Stub code: ");
- if (m->class != NULL)
- utf_fprint_printable_ascii_classname(stdout, m->class->name);
+ if (m->clazz != NULL)
+ utf_fprint_printable_ascii_classname(stdout, m->clazz->name);
else
printf("NULL");
printf(".");
#endif
#if !defined(NDEBUG)
-# if defined(__ALPHA__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__X86_64__) || defined(__S390__)
+# if defined(__ALPHA__) || defined(__I386__) || defined(__M68K__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__S390__) || defined(__X86_64__)
/* print the call-trace if necesarry */
/* BEFORE: filling the local reference table */
/* Return a wrapped classinfo for static methods. */
if (m->flags & ACC_STATIC)
- return (java_handle_t *) LLNI_classinfo_wrap(m->class);
+ return (java_handle_t *) LLNI_classinfo_wrap(m->clazz);
else
return NULL;
}
#elif defined(__I386__)
datasp = sp + framesize;
ret_regs = (uint64_t *) (sp + 2 * SIZEOF_VOID_P);
-#elif defined(__M68K__) || defined(__X86_64__)
+#elif defined(__M68K__)
+ datasp = sp + framesize;
+ ret_regs = (uint64_t *) (sp + 2 * 8);
+#elif defined(__X86_64__)
datasp = sp + framesize;
ret_regs = (uint64_t *) sp;
#elif defined(__POWERPC__)
#endif
#if !defined(NDEBUG)
-# if defined(__ALPHA__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__X86_64__) || defined(__S390__)
+# if defined(__ALPHA__) || defined(__I386__) || defined(__M68K__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__S390__) || defined(__X86_64__)
/* print the call-trace if necesarry */
/* AFTER: unwrapping the return value */