#include "config.h"
#include <assert.h>
+#include <stdint.h>
#include "md-abi.h"
#include "md-os.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);
/* generate stubs */
emit_patcher_stubs(jd);
- REPLACEMENT_EMIT_STUBS(jd);
return true;
}