@@ -2246,8 +2246,6 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
22462246
22472247 Address src_length_addr = Address (src, arrayOopDesc::length_offset_in_bytes ());
22482248 Address dst_length_addr = Address (dst, arrayOopDesc::length_offset_in_bytes ());
2249- Address src_klass_addr = Address (src, oopDesc::klass_offset_in_bytes ());
2250- Address dst_klass_addr = Address (dst, oopDesc::klass_offset_in_bytes ());
22512249
22522250 // test for null
22532251 if (flags & LIR_OpArrayCopy::src_null_check) {
@@ -2308,15 +2306,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
23082306 // We don't know the array types are compatible
23092307 if (basic_type != T_OBJECT) {
23102308 // Simple test for basic type arrays
2311- if (UseCompressedClassPointers) {
2312- __ ldrw (tmp, src_klass_addr);
2313- __ ldrw (rscratch1, dst_klass_addr);
2314- __ cmpw (tmp, rscratch1);
2315- } else {
2316- __ ldr (tmp, src_klass_addr);
2317- __ ldr (rscratch1, dst_klass_addr);
2318- __ cmp (tmp, rscratch1);
2319- }
2309+ __ cmp_klass (src, dst, tmp, rscratch1);
23202310 __ br (Assembler::NE, *stub->entry ());
23212311 } else {
23222312 // For object arrays, if src is a sub class of dst then we can
@@ -2438,36 +2428,14 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
24382428 // but not necessarily exactly of type default_type.
24392429 Label known_ok, halt;
24402430 __ mov_metadata (tmp, default_type->constant_encoding ());
2441- if (UseCompressedClassPointers) {
2442- __ encode_klass_not_null (tmp);
2443- }
24442431
24452432 if (basic_type != T_OBJECT) {
2446-
2447- if (UseCompressedClassPointers) {
2448- __ ldrw (rscratch1, dst_klass_addr);
2449- __ cmpw (tmp, rscratch1);
2450- } else {
2451- __ ldr (rscratch1, dst_klass_addr);
2452- __ cmp (tmp, rscratch1);
2453- }
2433+ __ cmp_klass (dst, tmp, rscratch1);
24542434 __ br (Assembler::NE, halt);
2455- if (UseCompressedClassPointers) {
2456- __ ldrw (rscratch1, src_klass_addr);
2457- __ cmpw (tmp, rscratch1);
2458- } else {
2459- __ ldr (rscratch1, src_klass_addr);
2460- __ cmp (tmp, rscratch1);
2461- }
2435+ __ cmp_klass (src, tmp, rscratch1);
24622436 __ br (Assembler::EQ, known_ok);
24632437 } else {
2464- if (UseCompressedClassPointers) {
2465- __ ldrw (rscratch1, dst_klass_addr);
2466- __ cmpw (tmp, rscratch1);
2467- } else {
2468- __ ldr (rscratch1, dst_klass_addr);
2469- __ cmp (tmp, rscratch1);
2470- }
2438+ __ cmp_klass (dst, tmp, rscratch1);
24712439 __ br (Assembler::EQ, known_ok);
24722440 __ cmp (src, dst);
24732441 __ br (Assembler::EQ, known_ok);
@@ -2551,7 +2519,12 @@ void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) {
25512519 }
25522520
25532521 if (UseCompressedClassPointers) {
2554- __ ldrw (result, Address (obj, oopDesc::klass_offset_in_bytes ()));
2522+ if (UseCompactObjectHeaders) {
2523+ __ ldr (result, Address (obj, oopDesc::mark_offset_in_bytes ()));
2524+ __ lsr (result, result, markWord::klass_shift);
2525+ } else {
2526+ __ ldrw (result, Address (obj, oopDesc::klass_offset_in_bytes ()));
2527+ }
25552528 __ decode_klass_not_null (result);
25562529 } else {
25572530 __ ldr (result, Address (obj, oopDesc::klass_offset_in_bytes ()));
0 commit comments