125 #if SIZEOF_VOID_P == 8
147 #if SIZEOF_VOID_P == 8
223 int32_t lo, hi, disp;
227 hi = (short) (((disp) - lo) >> 16);
258 int32_t
s1,
s2,
s3, d = 0;
270 #if SIZEOF_VOID_P == 8
332 #if SIZEOF_VOID_P == 8
350 #if SIZEOF_VOID_P == 8
363 #if SIZEOF_VOID_P == 8
379 #if SIZEOF_VOID_P == 8
401 #if SIZEOF_VOID_P == 8
427 if ((iptr->
sx.
val.
i >= -32768) && (iptr->
sx.
val.
i <= 32767))
438 #if SIZEOF_VOID_P == 8
444 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
445 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
448 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
464 #if SIZEOF_VOID_P == 8
467 if ((iptr->
sx.
val.
l >= -32768) && (iptr->
sx.
val.
l <= 32767))
475 if ((iptr->
sx.
val.
l >= 0) && (iptr->
sx.
val.
l <= 32767)) {
481 else if ((iptr->
sx.
val.
l >= (-32768 + 1)) && (iptr->
sx.
val.
l < 0)) {
482 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
485 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
491 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
494 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
517 if ((iptr->
sx.
val.
i >= -32767) && (iptr->
sx.
val.
i <= 32768))
528 #if SIZEOF_VOID_P == 8
534 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
535 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
538 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
539 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP2);
545 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
555 #if SIZEOF_VOID_P == 8
558 if ((iptr->
sx.
val.
l >= -32767) && (iptr->
sx.
val.
l <= 32768))
566 if ((iptr->
sx.
val.
l >= 0) && (iptr->
sx.
val.
l <= 32768)) {
567 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
570 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
574 else if ((iptr->
sx.
val.
l >= -32767) && (iptr->
sx.
val.
l < 0)) {
582 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
585 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
621 #if SIZEOF_VOID_P == 8
630 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
631 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
637 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP2);
645 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
646 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
693 #if SIZEOF_VOID_P == 8
736 bte = iptr->
sx.
s23.s3.bte;
754 #if SIZEOF_VOID_P == 8
777 if ((iptr->
sx.
val.
i >= 0) && (iptr->
sx.
val.
i <= 0xffff)) {
796 #if SIZEOF_VOID_P == 8
819 if ((iptr->
sx.
val.
l >= 0) && (iptr->
sx.
val.
l <= 0xffff)) {
896 #if SIZEOF_VOID_P == 8
931 #if SIZEOF_VOID_P == 8
994 if ((iptr->
sx.
val.
i >= 0) && (iptr->
sx.
val.
i <= 0xffff))
1005 #if SIZEOF_VOID_P == 8
1011 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP2);
1012 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP3);
1015 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
1016 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP3);
1025 #if SIZEOF_VOID_P == 8
1028 if ((iptr->
sx.
val.
l >= 0) && (iptr->
sx.
val.
l <= 0xffff))
1036 if ((iptr->
sx.
val.
l >= 0) && (iptr->
sx.
val.
l <= 0xffff)) {
1043 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
1045 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP3);
1066 if ((iptr->
sx.
val.
i >= 0) && (iptr->
sx.
val.
i <= 0xffff))
1077 #if SIZEOF_VOID_P == 8
1083 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP2);
1084 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP3);
1087 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
1088 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP3);
1097 #if SIZEOF_VOID_P == 8
1100 if ((iptr->
sx.
val.
l >= 0) && (iptr->
sx.
val.
l <= 0xffff))
1108 if ((iptr->
sx.
val.
l >= 0) && (iptr->
sx.
val.
l <= 0xffff)) {
1115 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
1117 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP3);
1138 if ((iptr->
sx.
val.
i >= 0) && (iptr->
sx.
val.
i <= 0xffff))
1149 #if SIZEOF_VOID_P == 8
1155 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP2);
1156 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP3);
1159 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
1160 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP3);
1169 #if SIZEOF_VOID_P == 8
1172 if ((iptr->
sx.
val.
l >= 0) && (iptr->
sx.
val.
l <= 0xffff))
1180 if ((iptr->
sx.
val.
l >= 0) && (iptr->
sx.
val.
l <= 0xffff)) {
1187 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
1189 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP3);
1199 #if SIZEOF_VOID_P == 8
1207 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
1208 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
1214 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
1215 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP2);
1421 #if SUPPORT_FLOAT_CMP
1455 #if SUPPORT_DOUBLE_CMP
1556 #if SIZEOF_VOID_P == 8
1652 #if SIZEOF_VOID_P == 8
1752 #if SIZEOF_VOID_P == 8
1774 uf = iptr->
sx.
s23.s3.uf;
1781 fi = iptr->
sx.
s23.s3.fmiref->p.field;
1782 fieldtype = fi->
type;
1792 switch (fieldtype) {
1798 #if SIZEOF_VOID_P == 8
1827 uf = iptr->
sx.
s23.s3.uf;
1834 fi = iptr->
sx.
s23.s3.fmiref->p.field;
1835 fieldtype = fi->
type;
1845 switch (fieldtype) {
1851 #if SIZEOF_VOID_P == 8
1879 uf = iptr->
sx.
s23.s3.uf;
1886 fi = iptr->
sx.
s23.s3.fmiref->p.field;
1887 fieldtype = fi->
type;
1897 switch (fieldtype) {
1926 uf = iptr->
sx.
s23.s3.uf;
1933 fi = iptr->
sx.
s23.s3.fmiref->p.field;
1934 fieldtype = fi->
type;
1938 switch (fieldtype) {
1944 #if SIZEOF_VOID_P == 8
1949 M_LLD_GETFIELD(d, s1, disp);
1977 uf = iptr->
sx.
s23.s3.uf;
1982 fi = iptr->
sx.
s23.s3.fmiref->p.field;
1983 fieldtype = fi->
type;
1987 #if SIZEOF_VOID_P == 8
2006 switch (fieldtype) {
2008 M_IST(s2, s1, disp);
2011 M_LST(s2, s1, disp);
2014 M_AST(s2, s1, disp);
2017 M_FST(s2, s1, disp);
2020 M_DST(s2, s1, disp);
2034 uf = iptr->
sx.
s23.s3.uf;
2041 fi = iptr->
sx.
s23.s3.fmiref->p.field;
2042 fieldtype = fi->
type;
2046 switch (fieldtype) {
2086 if ((iptr->
sx.
val.
i >= -32768) && (iptr->
sx.
val.
i <= 32767))
2098 if ((iptr->
sx.
val.
i >= -32769) && (iptr->
sx.
val.
i <= 32766)) {
2119 if ((iptr->
sx.
val.
i >= -32769) && (iptr->
sx.
val.
i <= 32766)) {
2133 if ((iptr->
sx.
val.
i >= -32768) && (iptr->
sx.
val.
i <= 32767))
2144 #if SIZEOF_VOID_P == 8
2147 emit_beqz(cd, iptr->
dst.
block, s1);
2153 if (iptr->
sx.
val.
l == 0) {
2159 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2162 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
2173 #if SIZEOF_VOID_P == 8
2176 emit_bltz(cd, iptr->
dst.
block, s1);
2178 if ((iptr->
sx.
val.
l >= -32768) && (iptr->
sx.
val.
l <= 32767))
2187 if (iptr->
sx.
val.
l == 0) {
2189 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2190 emit_bltz(cd, iptr->
dst.
block, s1);
2193 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2198 s2 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
2209 #if SIZEOF_VOID_P == 8
2212 emit_blez(cd, iptr->
dst.
block, s1);
2214 if ((iptr->
sx.
val.
l >= -32769) && (iptr->
sx.
val.
l <= 32766)) {
2225 if (iptr->
sx.
val.
l == 0) {
2233 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2238 s2 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
2249 #if SIZEOF_VOID_P == 8
2252 emit_bnez(cd, iptr->
dst.
block, s1);
2258 if (iptr->
sx.
val.
l == 0) {
2264 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2267 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
2278 #if SIZEOF_VOID_P == 8
2281 emit_bgtz(cd, iptr->
dst.
block, s1);
2283 if ((iptr->
sx.
val.
l >= -32769) && (iptr->
sx.
val.
l <= 32766)) {
2294 if (iptr->
sx.
val.
l == 0) {
2302 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2307 s2 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
2318 #if SIZEOF_VOID_P == 8
2321 emit_bgez(cd, iptr->
dst.
block, s1);
2323 if ((iptr->
sx.
val.
l >= -32768) && (iptr->
sx.
val.
l <= 32767)) {
2333 if (iptr->
sx.
val.
l == 0) {
2335 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2336 emit_bgez(cd, iptr->
dst.
block, s1);
2339 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2344 s2 = emit_load_s1_low(jd, iptr,
REG_ITMP3);
2353 #if SIZEOF_VOID_P == 8
2359 emit_beq(cd, iptr->
dst.
block, s1, s2);
2362 #if SIZEOF_VOID_P == 4
2366 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2367 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
2369 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
2370 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP2);
2371 emit_beq(cd, iptr->
dst.
block, s1, s2);
2376 #if SIZEOF_VOID_P == 8
2382 emit_bne(cd, iptr->
dst.
block, s1, s2);
2385 #if SIZEOF_VOID_P == 4
2389 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2390 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
2391 emit_bne(cd, iptr->
dst.
block, s1, s2);
2392 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
2393 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP2);
2394 emit_bne(cd, iptr->
dst.
block, s1, s2);
2399 #if SIZEOF_VOID_P == 8
2409 #if SIZEOF_VOID_P == 4
2412 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2413 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
2418 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
2419 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP2);
2427 #if SIZEOF_VOID_P == 8
2437 #if SIZEOF_VOID_P == 4
2440 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2441 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
2446 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
2447 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP2);
2455 #if SIZEOF_VOID_P == 8
2465 #if SIZEOF_VOID_P == 4
2468 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2469 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
2474 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
2475 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP2);
2483 #if SIZEOF_VOID_P == 8
2493 #if SIZEOF_VOID_P == 4
2496 s1 = emit_load_s1_high(jd, iptr,
REG_ITMP1);
2497 s2 = emit_load_s2_high(jd, iptr,
REG_ITMP2);
2502 s1 = emit_load_s1_low(jd, iptr,
REG_ITMP1);
2503 s2 = emit_load_s2_low(jd, iptr,
REG_ITMP2);
2517 l = iptr->
sx.
s23.s2.tablelow;
2518 i = iptr->
sx.
s23.s3.tablehigh;
2523 else if (l <= 32768) {
2560 bte = iptr->
sx.
s23.s3.bte;
2561 if (bte->
stub == NULL) {
2590 um = iptr->
sx.
s23.s3.um;
2597 lm = iptr->
sx.
s23.s3.fmiref->p.method;
2613 um = iptr->
sx.
s23.s3.um;
2619 lm = iptr->
sx.
s23.s3.fmiref->p.method;
2638 um = iptr->
sx.
s23.s3.um;
2645 lm = iptr->
sx.
s23.s3.fmiref->p.method;
2676 super = iptr->
sx.
s23.s3.c.cls;
2677 superindex = super->
index;
2684 if (super == NULL) {
2701 if (super == NULL) {
2731 if (super == NULL) {
2754 if (super == NULL || super->
vftbl->subtype_depth >= DISPLAY_SIZE) {
2768 if (super == NULL) {
2821 if (super == NULL) {
2866 super = iptr->
sx.
s23.s3.c.cls;
2873 super = iptr->
sx.
s23.s3.c.cls;
2874 superindex = super->
index;
2889 if (super == NULL) {
2906 if (super == NULL) {
2908 iptr->
sx.
s23.s3.c.ref, 0);
2934 if (super == NULL) {
2956 if (super == NULL || super->
vftbl->subtype_depth >= DISPLAY_SIZE) {
2970 if (super == NULL) {
3026 if (super == NULL) {
3043 var =
VAR(iptr->
sx.
s23.s2.args[s1]);
3049 #if SIZEOF_VOID_P == 8
3080 #if SIZEOF_VOID_P == 8
3101 vm_abort(
"Unknown ICMD %d during code generation", iptr->
opc);
3140 #if SIZEOF_VOID_P == 4
3166 #if SIZEOF_VOID_P == 8
3220 #if SIZEOF_VOID_P == 8
3260 for (i = md->
paramcount - 1, j = i + skipparams; i >= 0; i--, j--) {
3269 #if SIZEOF_VOID_P == 8
3279 #if SIZEOF_VOID_P == 8
3293 #if SIZEOF_VOID_P == 8
3314 #if SIZEOF_VOID_P == 8
3338 #if SIZEOF_VOID_P == 8
3359 #if SIZEOF_VOID_P == 8
3406 #if SIZEOF_VOID_P == 8
3449 #if SIZEOF_VOID_P == 8
void codegen_emit_instruction(jitdata *jd, instruction *iptr)
Generates machine code for one ICMD.
s4 dseg_add_double(codegendata *cd, double value)
#define BUILTIN_FAST_canstore
#define PATCHER_resolve_classref_to_flags
s4 emit_load_s3(jitdata *jd, instruction *iptr, s4 tempreg)
s4 emit_load_s1(jitdata *jd, instruction *iptr, s4 tempreg)
#define M_ALD(a, b, disp)
#define PATCHER_invokeinterface
#define M_LST_INTERN(a, b, disp)
#define M_LST(a, b, disp)
#define M_ILD(a, b, disp)
s4 dseg_add_unique_address(codegendata *cd, void *value)
#define PATCHER_resolve_classref_to_vftbl
#define BUILTIN_multianewarray
#define IS_INT_LNG_TYPE(a)
#define M_IST(a, b, disp)
#define M_LDA(a, b, disp)
#define PATCHER_get_putfield
#define M_FLD_INTERN(a, b, disp)
#define M_AADD_IMM(a, b, c)
#define M_LSLL_IMM(a, b, c)
s4 dseg_add_address(codegendata *cd, void *value)
#define M_OR_IMM(a, b, c)
#define REG_ITMP12_PACKED
#define dseg_add_functionptr(cd, value)
#define M_IST_INTERN(a, b, disp)
void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int skipparams)
typedef void(JNICALL *jvmtiEventSingleStep)(jvmtiEnv *jvmti_env
void emit_arraystore_check(codegendata *cd, instruction *iptr)
#define M_FST(a, b, disp)
#define M_CMPULT_IMM(a, b, c)
patchref_t * patcher_add_patch_ref(jitdata *jd, functionptr patcher, void *ref, s4 disp)
#define M_FLD(a, b, disp)
void dseg_add_target(codegendata *cd, basicblock *target)
java_object_t * codegen_finish_native_call(u1 *sp, u1 *pv)
JNIEnv jthread jobject jclass jlong size
#define PATCHER_get_putstatic
static int code_is_leafmethod(codeinfo *code)
#define BUILTIN_arraycheckcast
void vm_abort(const char *text,...)
void(* functionptr)(void)
java_handle_t * codegen_start_native_call(u1 *sp, u1 *pv)
#define PATCHER_instanceof_interface
#define IS_2_WORD_TYPE(a)
void emit_exception_check(codegendata *cd, instruction *iptr)
s4 codegen_reg_of_dst(jitdata *jd, instruction *iptr, s4 tempregnum)
#define M_CMPULT(a, b, c)
#define M_ISRA_IMM(a, b, c)
#define M_ISUB_IMM(a, b, c)
void emit_patcher_traps(jitdata *jd)
#define M_LSRA_IMM(a, b, c)
#define M_XOR_IMM(a, b, c)
#define M_SST(a, b, disp)
constant_FMIref * fieldref
void emit_label_br(codegendata *cd, s4 label)
s4 emit_load_s2(jitdata *jd, instruction *iptr, s4 tempreg)
#define REG_ITMP23_PACKED
#define IS_FLT_DBL_TYPE(a)
#define M_ALD_INTERN(a, b, disp)
#define M_LSRL_IMM(a, b, c)
#define M_CMPLT_IMM(a, b, c)
#define M_ASUB_IMM(a, b, c)
s4 emit_load(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
s4 dseg_add_unique_s4(codegendata *cd, s4 value)
#define M_AST(a, b, disp)
union instruction::@12 sx
void emit_arithmetic_check(codegendata *cd, instruction *iptr, s4 reg)
#define PACK_REGS(low, high)
#define PATCHER_checkcast_interface
#define M_ASLL_IMM(a, b, c)
void emit_store_dst(jitdata *jd, instruction *iptr, s4 d)
#define M_LADD_IMM(a, b, c)
#define PATCHER_invokestatic_special
#define M_BST(a, b, disp)
#define M_FST_INTERN(a, b, disp)
#define M_AND_IMM(a, b, c)
#define PATCHER_invokevirtual
#define M_ISRL_IMM(a, b, c)
void codegen_emit_epilog(jitdata *jd)
Generates machine code for the method epilog.
#define M_LLD_INTERN(a, b, disp)
#define M_AST_INTERN(a, b, c)
void emit_classcast_check(codegendata *cd, instruction *iptr, s4 condition, s4 reg, s4 s1)
#define M_BLDS(a, b, disp)
#define M_ISLL_IMM(a, b, c)
#define M_DLD_INTERN(a, b, disp)
static bool class_is_or_almost_initialized(classinfo *c)
#define PATCHER_initialize_class
#define M_CMPUGT(a, b, c)
#define M_DST(a, b, disp)
#define INSTRUCTION_IS_UNRESOLVED(iptr)
struct instruction::@12::@13 s23
void codegen_emit_prolog(jitdata *jd)
Generates machine code for the method prolog.
#define M_LLD(a, b, disp)
const parseddesc_t parseddesc
static void emit_fmove(codegendata *cd, int s, int d)
Generates a float-move from register s to d.
#define PATCHER_resolve_classref_to_classinfo
void emit_label(codegendata *cd, s4 label)
#define M_SLDU(a, b, disp)
#define M_IADD_IMM(a, b, c)
void emit_arrayindexoutofbounds_check(codegendata *cd, instruction *iptr, s4 s1, s4 s2)
static void emit_dmove(codegendata *cd, int s, int d)
Generates an double-move from register s to d.
#define M_DLD(a, b, disp)
s4 dseg_add_float(codegendata *cd, float value)
#define M_SLDS(a, b, disp)
void emit_nullpointer_check(codegendata *cd, instruction *iptr, s4 reg)
static VM * get_current()
#define REG_RESULT_PACKED
#define M_DST_INTERN(a, b, disp)
#define M_ILD_INTERN(a, b, disp)