2169 // object array case, if no type check is needed then either the |
2169 // object array case, if no type check is needed then either the |
2170 // dst type is exactly the expected type and the src type is a |
2170 // dst type is exactly the expected type and the src type is a |
2171 // subtype which we can't check or src is the same array as dst |
2171 // subtype which we can't check or src is the same array as dst |
2172 // but not necessarily exactly of type default_type. |
2172 // but not necessarily exactly of type default_type. |
2173 Label known_ok, halt; |
2173 Label known_ok, halt; |
2174 jobject2reg(op->expected_type()->encoding(), tmp); |
2174 jobject2reg(op->expected_type()->constant_encoding(), tmp); |
2175 __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); |
2175 __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); |
2176 if (basic_type != T_OBJECT) { |
2176 if (basic_type != T_OBJECT) { |
2177 __ cmp(tmp, tmp2); |
2177 __ cmp(tmp, tmp2); |
2178 __ br(Assembler::notEqual, false, Assembler::pn, halt); |
2178 __ br(Assembler::notEqual, false, Assembler::pn, halt); |
2179 __ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2); |
2179 __ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2); |
2427 ciProfileData* data = md->bci_to_data(bci); |
2427 ciProfileData* data = md->bci_to_data(bci); |
2428 assert(data != NULL, "need data for checkcast"); |
2428 assert(data != NULL, "need data for checkcast"); |
2429 assert(data->is_BitData(), "need BitData for checkcast"); |
2429 assert(data->is_BitData(), "need BitData for checkcast"); |
2430 Register mdo = k_RInfo; |
2430 Register mdo = k_RInfo; |
2431 Register data_val = Rtmp1; |
2431 Register data_val = Rtmp1; |
2432 jobject2reg(md->encoding(), mdo); |
2432 jobject2reg(md->constant_encoding(), mdo); |
2433 |
2433 |
2434 int mdo_offset_bias = 0; |
2434 int mdo_offset_bias = 0; |
2435 if (!Assembler::is_simm13(md->byte_offset_of_slot(data, DataLayout::header_offset()) + data->size_in_bytes())) { |
2435 if (!Assembler::is_simm13(md->byte_offset_of_slot(data, DataLayout::header_offset()) + data->size_in_bytes())) { |
2436 // The offset is large so bias the mdo by the base of the slot so |
2436 // The offset is large so bias the mdo by the base of the slot so |
2437 // that the ld can use simm13s to reference the slots of the data |
2437 // that the ld can use simm13s to reference the slots of the data |
2450 |
2450 |
2451 Label done; |
2451 Label done; |
2452 // patching may screw with our temporaries on sparc, |
2452 // patching may screw with our temporaries on sparc, |
2453 // so let's do it before loading the class |
2453 // so let's do it before loading the class |
2454 if (k->is_loaded()) { |
2454 if (k->is_loaded()) { |
2455 jobject2reg(k->encoding(), k_RInfo); |
2455 jobject2reg(k->constant_encoding(), k_RInfo); |
2456 } else { |
2456 } else { |
2457 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); |
2457 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); |
2458 } |
2458 } |
2459 assert(obj != k_RInfo, "must be different"); |
2459 assert(obj != k_RInfo, "must be different"); |
2460 __ cmp(obj, 0); |
2460 __ cmp(obj, 0); |
2511 klass_RInfo = obj; |
2511 klass_RInfo = obj; |
2512 } |
2512 } |
2513 // patching may screw with our temporaries on sparc, |
2513 // patching may screw with our temporaries on sparc, |
2514 // so let's do it before loading the class |
2514 // so let's do it before loading the class |
2515 if (k->is_loaded()) { |
2515 if (k->is_loaded()) { |
2516 jobject2reg(k->encoding(), k_RInfo); |
2516 jobject2reg(k->constant_encoding(), k_RInfo); |
2517 } else { |
2517 } else { |
2518 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); |
2518 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); |
2519 } |
2519 } |
2520 assert(obj != k_RInfo, "must be different"); |
2520 assert(obj != k_RInfo, "must be different"); |
2521 __ cmp(obj, 0); |
2521 __ cmp(obj, 0); |
2715 assert(data->is_CounterData(), "need CounterData for calls"); |
2715 assert(data->is_CounterData(), "need CounterData for calls"); |
2716 assert(op->mdo()->is_single_cpu(), "mdo must be allocated"); |
2716 assert(op->mdo()->is_single_cpu(), "mdo must be allocated"); |
2717 assert(op->tmp1()->is_single_cpu(), "tmp1 must be allocated"); |
2717 assert(op->tmp1()->is_single_cpu(), "tmp1 must be allocated"); |
2718 Register mdo = op->mdo()->as_register(); |
2718 Register mdo = op->mdo()->as_register(); |
2719 Register tmp1 = op->tmp1()->as_register(); |
2719 Register tmp1 = op->tmp1()->as_register(); |
2720 jobject2reg(md->encoding(), mdo); |
2720 jobject2reg(md->constant_encoding(), mdo); |
2721 int mdo_offset_bias = 0; |
2721 int mdo_offset_bias = 0; |
2722 if (!Assembler::is_simm13(md->byte_offset_of_slot(data, CounterData::count_offset()) + |
2722 if (!Assembler::is_simm13(md->byte_offset_of_slot(data, CounterData::count_offset()) + |
2723 data->size_in_bytes())) { |
2723 data->size_in_bytes())) { |
2724 // The offset is large so bias the mdo by the base of the slot so |
2724 // The offset is large so bias the mdo by the base of the slot so |
2725 // that the ld can use simm13s to reference the slots of the data |
2725 // that the ld can use simm13s to reference the slots of the data |
2772 for (i = 0; i < VirtualCallData::row_limit(); i++) { |
2772 for (i = 0; i < VirtualCallData::row_limit(); i++) { |
2773 ciKlass* receiver = vc_data->receiver(i); |
2773 ciKlass* receiver = vc_data->receiver(i); |
2774 if (receiver == NULL) { |
2774 if (receiver == NULL) { |
2775 Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) - |
2775 Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) - |
2776 mdo_offset_bias); |
2776 mdo_offset_bias); |
2777 jobject2reg(known_klass->encoding(), tmp1); |
2777 jobject2reg(known_klass->constant_encoding(), tmp1); |
2778 __ st_ptr(tmp1, recv_addr); |
2778 __ st_ptr(tmp1, recv_addr); |
2779 Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - |
2779 Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - |
2780 mdo_offset_bias); |
2780 mdo_offset_bias); |
2781 __ lduw(data_addr, tmp1); |
2781 __ lduw(data_addr, tmp1); |
2782 __ add(tmp1, DataLayout::counter_increment, tmp1); |
2782 __ add(tmp1, DataLayout::counter_increment, tmp1); |