< prev index next >

src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp

Print this page

*** 198,208 **** __ push_reg(opr->as_register_lo()); } else if (opr->is_stack()) { __ push_addr(frame_map()->address_for_slot(opr->single_stack_ix())); } else if (opr->is_constant()) { LIR_Const* const_opr = opr->as_constant_ptr(); ! if (const_opr->type() == T_OBJECT) { __ push_oop(const_opr->as_jobject()); } else if (const_opr->type() == T_INT) { __ push_jint(const_opr->as_jint()); } else { ShouldNotReachHere(); --- 198,208 ---- __ push_reg(opr->as_register_lo()); } else if (opr->is_stack()) { __ push_addr(frame_map()->address_for_slot(opr->single_stack_ix())); } else if (opr->is_constant()) { LIR_Const* const_opr = opr->as_constant_ptr(); ! if (const_opr->type() == T_OBJECT || const_opr->type() == T_VALUETYPE) { __ push_oop(const_opr->as_jobject()); } else if (const_opr->type() == T_INT) { __ push_jint(const_opr->as_jint()); } else { ShouldNotReachHere();
*** 628,637 **** --- 628,638 ---- __ movptr(dest->as_register_hi(), c->as_jint_hi()); #endif // _LP64 break; } + case T_VALUETYPE: // Fall through case T_OBJECT: { if (patch_code != lir_patch_none) { jobject2reg_with_patching(dest->as_register(), info); } else { __ movoop(dest->as_register(), c->as_jobject());
*** 710,719 **** --- 711,721 ---- case T_ADDRESS: __ movptr(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jint_bits()); break; + case T_VALUETYPE: // Fall through case T_OBJECT: __ movoop(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jobject()); break; case T_LONG: // fall through
*** 749,758 **** --- 751,761 ---- case T_ADDRESS: __ movptr(as_Address(addr), c->as_jint_bits()); break; + case T_VALUETYPE: // fall through case T_OBJECT: // fall through case T_ARRAY: if (c->as_jobject() == NULL) { if (UseCompressedOops && !wide) { __ movl(as_Address(addr), (int32_t)NULL_WORD);
*** 837,854 **** move_regs(src->as_register_lo(), dest->as_register()); return; } #endif assert(src->is_single_cpu(), "must match"); ! if (src->type() == T_OBJECT) { __ verify_oop(src->as_register()); } move_regs(src->as_register(), dest->as_register()); } else if (dest->is_double_cpu()) { #ifdef _LP64 ! if (src->type() == T_OBJECT || src->type() == T_ARRAY) { // Surprising to me but we can see move of a long to t_object __ verify_oop(src->as_register()); move_regs(src->as_register(), dest->as_register_lo()); return; } --- 840,857 ---- move_regs(src->as_register_lo(), dest->as_register()); return; } #endif assert(src->is_single_cpu(), "must match"); ! if (src->type() == T_OBJECT || src->type() == T_VALUETYPE) { __ verify_oop(src->as_register()); } move_regs(src->as_register(), dest->as_register()); } else if (dest->is_double_cpu()) { #ifdef _LP64 ! if (src->type() == T_OBJECT || src->type() == T_ARRAY || src->type() == T_VALUETYPE) { // Surprising to me but we can see move of a long to t_object __ verify_oop(src->as_register()); move_regs(src->as_register(), dest->as_register_lo()); return; }
*** 915,925 **** assert(src->is_register(), "should not call otherwise"); assert(dest->is_stack(), "should not call otherwise"); if (src->is_single_cpu()) { Address dst = frame_map()->address_for_slot(dest->single_stack_ix()); ! if (type == T_OBJECT || type == T_ARRAY) { __ verify_oop(src->as_register()); __ movptr (dst, src->as_register()); } else if (type == T_METADATA) { __ movptr (dst, src->as_register()); } else { --- 918,928 ---- assert(src->is_register(), "should not call otherwise"); assert(dest->is_stack(), "should not call otherwise"); if (src->is_single_cpu()) { Address dst = frame_map()->address_for_slot(dest->single_stack_ix()); ! if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) { __ verify_oop(src->as_register()); __ movptr (dst, src->as_register()); } else if (type == T_METADATA) { __ movptr (dst, src->as_register()); } else {
*** 961,971 **** void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool wide, bool /* unaligned */) { LIR_Address* to_addr = dest->as_address_ptr(); PatchingStub* patch = NULL; Register compressed_src = rscratch1; ! if (type == T_ARRAY || type == T_OBJECT) { __ verify_oop(src->as_register()); #ifdef _LP64 if (UseCompressedOops && !wide) { __ movptr(compressed_src, src->as_register()); __ encode_heap_oop(compressed_src); --- 964,974 ---- void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool wide, bool /* unaligned */) { LIR_Address* to_addr = dest->as_address_ptr(); PatchingStub* patch = NULL; Register compressed_src = rscratch1; ! if (type == T_ARRAY || type == T_OBJECT || type == T_VALUETYPE) { __ verify_oop(src->as_register()); #ifdef _LP64 if (UseCompressedOops && !wide) { __ movptr(compressed_src, src->as_register()); __ encode_heap_oop(compressed_src);
*** 1006,1015 **** --- 1009,1019 ---- else __ fst_d (as_Address(to_addr)); } break; } + case T_VALUETYPE: // fall through case T_ARRAY: // fall through case T_OBJECT: // fall through if (UseCompressedOops && !wide) { __ movl(as_Address(to_addr), compressed_src); } else {
*** 1096,1106 **** void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) { assert(src->is_stack(), "should not call otherwise"); assert(dest->is_register(), "should not call otherwise"); if (dest->is_single_cpu()) { ! if (type == T_ARRAY || type == T_OBJECT) { __ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); __ verify_oop(dest->as_register()); } else if (type == T_METADATA) { __ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); } else { --- 1100,1110 ---- void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) { assert(src->is_stack(), "should not call otherwise"); assert(dest->is_register(), "should not call otherwise"); if (dest->is_single_cpu()) { ! if (type == T_ARRAY || type == T_OBJECT || type == T_VALUETYPE) { __ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); __ verify_oop(dest->as_register()); } else if (type == T_METADATA) { __ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); } else {
*** 1137,1147 **** } void LIR_Assembler::stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type) { if (src->is_single_stack()) { ! if (type == T_OBJECT || type == T_ARRAY) { __ pushptr(frame_map()->address_for_slot(src ->single_stack_ix())); __ popptr (frame_map()->address_for_slot(dest->single_stack_ix())); } else { #ifndef _LP64 __ pushl(frame_map()->address_for_slot(src ->single_stack_ix())); --- 1141,1151 ---- } void LIR_Assembler::stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type) { if (src->is_single_stack()) { ! if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) { __ pushptr(frame_map()->address_for_slot(src ->single_stack_ix())); __ popptr (frame_map()->address_for_slot(dest->single_stack_ix())); } else { #ifndef _LP64 __ pushl(frame_map()->address_for_slot(src ->single_stack_ix()));
*** 1176,1186 **** assert(dest->is_register(), "should not call otherwise"); LIR_Address* addr = src->as_address_ptr(); Address from_addr = as_Address(addr); ! if (addr->base()->type() == T_OBJECT) { __ verify_oop(addr->base()->as_pointer_register()); } switch (type) { case T_BOOLEAN: // fall through --- 1180,1190 ---- assert(dest->is_register(), "should not call otherwise"); LIR_Address* addr = src->as_address_ptr(); Address from_addr = as_Address(addr); ! if (addr->base()->type() == T_OBJECT || addr->base()->type() == T_VALUETYPE) { __ verify_oop(addr->base()->as_pointer_register()); } switch (type) { case T_BOOLEAN: // fall through
*** 1229,1238 **** --- 1233,1243 ---- __ fld_d(from_addr); } break; } + case T_VALUETYPE: // fall through case T_OBJECT: // fall through case T_ARRAY: // fall through if (UseCompressedOops && !wide) { __ movl(dest->as_register(), from_addr); } else {
*** 1338,1348 **** if (patch != NULL) { patching_epilog(patch, patch_code, addr->base()->as_register(), info); } ! if (type == T_ARRAY || type == T_OBJECT) { #ifdef _LP64 if (UseCompressedOops && !wide) { __ decode_heap_oop(dest->as_register()); } #endif --- 1343,1353 ---- if (patch != NULL) { patching_epilog(patch, patch_code, addr->base()->as_register(), info); } ! if (type == T_ARRAY || type == T_OBJECT || type == T_VALUETYPE) { #ifdef _LP64 if (UseCompressedOops && !wide) { __ decode_heap_oop(dest->as_register()); } #endif
*** 1575,1585 **** void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) { Register len = op->len()->as_register(); LP64_ONLY( __ movslq(len, len); ) ! if (UseSlowPath || (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) || (!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) { __ jmp(*op->stub()->entry()); } else { Register tmp1 = op->tmp1()->as_register(); --- 1580,1590 ---- void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) { Register len = op->len()->as_register(); LP64_ONLY( __ movslq(len, len); ) ! if (UseSlowPath || op->type() == T_VALUETYPE || (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) || (!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) { __ jmp(*op->stub()->entry()); } else { Register tmp1 = op->tmp1()->as_register();
*** 2496,2506 **** } #endif // _LP64 } else { #ifdef _LP64 Register r_lo; ! if (right->type() == T_OBJECT || right->type() == T_ARRAY) { r_lo = right->as_register(); } else { r_lo = right->as_register_lo(); } #else --- 2501,2511 ---- } #endif // _LP64 } else { #ifdef _LP64 Register r_lo; ! if (right->type() == T_OBJECT || right->type() == T_ARRAY || right->type() == T_VALUETYPE) { r_lo = right->as_register(); } else { r_lo = right->as_register_lo(); } #else
*** 2609,2637 **** void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Op2* op) { if (opr1->is_single_cpu()) { Register reg1 = opr1->as_register(); if (opr2->is_single_cpu()) { // cpu register - cpu register ! if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) { __ cmpoop(reg1, opr2->as_register()); } else { ! assert(opr2->type() != T_OBJECT && opr2->type() != T_ARRAY, "cmp int, oop?"); __ cmpl(reg1, opr2->as_register()); } } else if (opr2->is_stack()) { // cpu register - stack ! if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) { __ cmpoop(reg1, frame_map()->address_for_slot(opr2->single_stack_ix())); } else { __ cmpl(reg1, frame_map()->address_for_slot(opr2->single_stack_ix())); } } else if (opr2->is_constant()) { // cpu register - constant LIR_Const* c = opr2->as_constant_ptr(); if (c->type() == T_INT) { __ cmpl(reg1, c->as_jint()); ! } else if (c->type() == T_OBJECT || c->type() == T_ARRAY) { // In 64bit oops are single register jobject o = c->as_jobject(); if (o == NULL) { __ cmpptr(reg1, (int32_t)NULL_WORD); } else { --- 2614,2642 ---- void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Op2* op) { if (opr1->is_single_cpu()) { Register reg1 = opr1->as_register(); if (opr2->is_single_cpu()) { // cpu register - cpu register ! if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY || opr1->type() == T_VALUETYPE) { __ cmpoop(reg1, opr2->as_register()); } else { ! assert(opr2->type() != T_OBJECT && opr2->type() != T_ARRAY && opr2->type() != T_VALUETYPE, "cmp int, oop?"); __ cmpl(reg1, opr2->as_register()); } } else if (opr2->is_stack()) { // cpu register - stack ! if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY || opr1->type() == T_VALUETYPE) { __ cmpoop(reg1, frame_map()->address_for_slot(opr2->single_stack_ix())); } else { __ cmpl(reg1, frame_map()->address_for_slot(opr2->single_stack_ix())); } } else if (opr2->is_constant()) { // cpu register - constant LIR_Const* c = opr2->as_constant_ptr(); if (c->type() == T_INT) { __ cmpl(reg1, c->as_jint()); ! } else if (c->type() == T_OBJECT || c->type() == T_ARRAY || c->type() == T_VALUETYPE) { // In 64bit oops are single register jobject o = c->as_jobject(); if (o == NULL) { __ cmpptr(reg1, (int32_t)NULL_WORD); } else {
*** 2727,2737 **** __ fcmp(noreg, opr2->fpu(), op->fpu_pop_count() > 0, op->fpu_pop_count() > 1); } else if (opr1->is_address() && opr2->is_constant()) { LIR_Const* c = opr2->as_constant_ptr(); #ifdef _LP64 ! if (c->type() == T_OBJECT || c->type() == T_ARRAY) { assert(condition == lir_cond_equal || condition == lir_cond_notEqual, "need to reverse"); __ movoop(rscratch1, c->as_jobject()); } #endif // LP64 if (op->info() != NULL) { --- 2732,2742 ---- __ fcmp(noreg, opr2->fpu(), op->fpu_pop_count() > 0, op->fpu_pop_count() > 1); } else if (opr1->is_address() && opr2->is_constant()) { LIR_Const* c = opr2->as_constant_ptr(); #ifdef _LP64 ! if (c->type() == T_OBJECT || c->type() == T_ARRAY || c->type() == T_VALUETYPE) { assert(condition == lir_cond_equal || condition == lir_cond_notEqual, "need to reverse"); __ movoop(rscratch1, c->as_jobject()); } #endif // LP64 if (op->info() != NULL) {
*** 2739,2749 **** } // special case: address - constant LIR_Address* addr = opr1->as_address_ptr(); if (c->type() == T_INT) { __ cmpl(as_Address(addr), c->as_jint()); ! } else if (c->type() == T_OBJECT || c->type() == T_ARRAY) { #ifdef _LP64 // %%% Make this explode if addr isn't reachable until we figure out a // better strategy by giving noreg as the temp for as_Address __ cmpoop(rscratch1, as_Address(addr, noreg)); #else --- 2744,2754 ---- } // special case: address - constant LIR_Address* addr = opr1->as_address_ptr(); if (c->type() == T_INT) { __ cmpl(as_Address(addr), c->as_jint()); ! } else if (c->type() == T_OBJECT || c->type() == T_ARRAY || c->type() == T_VALUETYPE) { #ifdef _LP64 // %%% Make this explode if addr isn't reachable until we figure out a // better strategy by giving noreg as the temp for as_Address __ cmpoop(rscratch1, as_Address(addr, noreg)); #else
< prev index next >