@@ -2243,8 +2243,6 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
22432243
22442244 Address src_length_addr = Address (src, arrayOopDesc::length_offset_in_bytes ());
22452245 Address dst_length_addr = Address (dst, arrayOopDesc::length_offset_in_bytes ());
2246- Address src_klass_addr = Address (src, oopDesc::klass_offset_in_bytes ());
2247- Address dst_klass_addr = Address (dst, oopDesc::klass_offset_in_bytes ());
22482246
22492247 // test for null
22502248 if (flags & LIR_OpArrayCopy::src_null_check) {
@@ -2305,15 +2303,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
23052303 // We don't know the array types are compatible
23062304 if (basic_type != T_OBJECT) {
23072305 // Simple test for basic type arrays
2308- if (UseCompressedClassPointers) {
2309- __ ldrw (tmp, src_klass_addr);
2310- __ ldrw (rscratch1, dst_klass_addr);
2311- __ cmpw (tmp, rscratch1);
2312- } else {
2313- __ ldr (tmp, src_klass_addr);
2314- __ ldr (rscratch1, dst_klass_addr);
2315- __ cmp (tmp, rscratch1);
2316- }
2306+ __ cmp_klasses_from_objects (src, dst, tmp, rscratch1);
23172307 __ br (Assembler::NE, *stub->entry ());
23182308 } else {
23192309 // For object arrays, if src is a sub class of dst then we can
@@ -2435,36 +2425,14 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
24352425 // but not necessarily exactly of type default_type.
24362426 Label known_ok, halt;
24372427 __ mov_metadata (tmp, default_type->constant_encoding ());
2438- if (UseCompressedClassPointers) {
2439- __ encode_klass_not_null (tmp);
2440- }
24412428
24422429 if (basic_type != T_OBJECT) {
2443-
2444- if (UseCompressedClassPointers) {
2445- __ ldrw (rscratch1, dst_klass_addr);
2446- __ cmpw (tmp, rscratch1);
2447- } else {
2448- __ ldr (rscratch1, dst_klass_addr);
2449- __ cmp (tmp, rscratch1);
2450- }
2430+ __ cmp_klass (dst, tmp, rscratch1);
24512431 __ br (Assembler::NE, halt);
2452- if (UseCompressedClassPointers) {
2453- __ ldrw (rscratch1, src_klass_addr);
2454- __ cmpw (tmp, rscratch1);
2455- } else {
2456- __ ldr (rscratch1, src_klass_addr);
2457- __ cmp (tmp, rscratch1);
2458- }
2432+ __ cmp_klass (src, tmp, rscratch1);
24592433 __ br (Assembler::EQ, known_ok);
24602434 } else {
2461- if (UseCompressedClassPointers) {
2462- __ ldrw (rscratch1, dst_klass_addr);
2463- __ cmpw (tmp, rscratch1);
2464- } else {
2465- __ ldr (rscratch1, dst_klass_addr);
2466- __ cmp (tmp, rscratch1);
2467- }
2435+ __ cmp_klass (dst, tmp, rscratch1);
24682436 __ br (Assembler::EQ, known_ok);
24692437 __ cmp (src, dst);
24702438 __ br (Assembler::EQ, known_ok);
@@ -2547,12 +2515,7 @@ void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) {
25472515 add_debug_info_for_null_check_here (info);
25482516 }
25492517
2550- if (UseCompressedClassPointers) {
2551- __ ldrw (result, Address (obj, oopDesc::klass_offset_in_bytes ()));
2552- __ decode_klass_not_null (result);
2553- } else {
2554- __ ldr (result, Address (obj, oopDesc::klass_offset_in_bytes ()));
2555- }
2518+ __ load_klass (result, obj);
25562519}
25572520
25582521void LIR_Assembler::emit_profile_call (LIR_OpProfileCall* op) {
0 commit comments