#include "config.h"
#include <assert.h>
+#include <stdint.h>
#include "md-abi.h"
#include "md-os.h"
#include "mm/memory.h"
#include "native/jni.h"
+#include "native/localref.h"
#include "native/native.h"
#include "threads/lock-common.h"
/* MEMORY *************************************************************/
- case ICMD_GETSTATIC:
- if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
+
+ case ICMD_GETSTATIC: /* ... ==> ..., value */
+
+ if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
uf = iptr->sx.s23.s3.uf;
fieldtype = uf->fieldref->parseddesc.fd->type;
- codegen_addpatchref(cd, PATCHER_get_putstatic, uf, 0);
- } else {
- fieldinfo *fi = iptr->sx.s23.s3.fmiref->p.field;
+ disp = 0;
+ codegen_addpatchref(cd, PATCHER_get_putstatic, uf, 0);
+ }
+ else {
+ fi = iptr->sx.s23.s3.fmiref->p.field;
fieldtype = fi->type;
+ disp = (intptr_t) fi->value;
+
if (!CLASS_IS_OR_ALMOST_INITIALIZED(fi->class)) {
- codegen_addpatchref(cd, PATCHER_initialize_class, fi->class, 0);
+ codegen_addpatchref(cd, PATCHER_initialize_class, fi->class,
+ 0);
}
-
- disp = (ptrint) &(fi->value);
}
+
M_AMOV_IMM(disp, REG_ATMP1);
switch (fieldtype) {
#if defined(ENABLE_SOFTFLOAT)
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
uf = iptr->sx.s23.s3.uf;
fieldtype = uf->fieldref->parseddesc.fd->type;
+ disp = 0;
codegen_addpatchref(cd, PATCHER_get_putstatic, uf, 0);
- } else {
+ }
+ else {
fi = iptr->sx.s23.s3.fmiref->p.field;
fieldtype = fi->type;
- disp = &(fi->value);
+ disp = (intptr_t) fi->value;
if (!CLASS_IS_OR_ALMOST_INITIALIZED(fi->class))
- codegen_addpatchref(cd, PATCHER_initialize_class, fi->class, 0);
+ codegen_addpatchref(cd, PATCHER_initialize_class, fi->class,
+ 0);
}
M_AMOV_IMM(disp, REG_ATMP1);
/* load object pointer (==argument 0) */
M_ALD(REG_ATMP1, REG_SP, 0);
/* implicit null-pointer check */
- M_ALD(REG_METHODPTR, REG_ATMP1, OFFSET(java_objectheader, vftbl));
+ M_ALD(REG_METHODPTR, REG_ATMP1, OFFSET(java_object_t, vftbl));
M_ALD(REG_ATMP3, REG_METHODPTR, s1);
/* generate the actual call */
M_JSR(REG_ATMP3);
M_ALD(REG_ATMP1, REG_SP, 0);
/* implicit null-pointer check */
- M_ALD(REG_METHODPTR, REG_ATMP1, OFFSET(java_objectheader, vftbl));
+ M_ALD(REG_METHODPTR, REG_ATMP1, OFFSET(java_object_t, vftbl));
M_ALD(REG_METHODPTR, REG_METHODPTR, s1);
M_ALD(REG_ATMP3, REG_METHODPTR, s2);
emit_label_beq(cd, BRANCH_LABEL_3);
}
- M_ALD(REG_ATMP1, s1, OFFSET(java_objectheader, vftbl));
+ M_ALD(REG_ATMP1, s1, OFFSET(java_object_t, vftbl));
M_ILD(REG_ITMP3, REG_ATMP1, OFFSET(vftbl_t, interfacetablelength));
M_IADD_IMM(-superindex, REG_ITMP3); /* -superindex may be patched patched */
M_ITST(REG_ITMP3);
emit_label_beq(cd, BRANCH_LABEL_5);
}
- M_ALD(REG_ATMP1, s1, OFFSET(java_objectheader, vftbl));
+ M_ALD(REG_ATMP1, s1, OFFSET(java_object_t, vftbl));
CODEGEN_CRITICAL_SECTION_START;
emit_label_beq(cd, BRANCH_LABEL_3);
}
- M_ALD(REG_ATMP2, s1, OFFSET(java_objectheader, vftbl));
+ M_ALD(REG_ATMP2, s1, OFFSET(java_object_t, vftbl));
M_ILD(REG_ITMP3, REG_ATMP2, OFFSET(vftbl_t, interfacetablelength));
M_IADD_IMM(-superindex, REG_ITMP3); /* superindex patched */
emit_label_beq(cd, BRANCH_LABEL_5);
}
- M_ALD(REG_ATMP2, s1, OFFSET(java_objectheader, vftbl));
+ M_ALD(REG_ATMP2, s1, OFFSET(java_object_t, vftbl));
CODEGEN_CRITICAL_SECTION_START;