OpenJDK / jdk / jdk
changeset 57524:59ddac265649
8236179: C1 register allocation error with T_ADDRESS
Reviewed-by: rkennke, vlivanov, roland, mdoerr
Contributed-by: Aditya Mandaleeka <adityam@microsoft.com>
author | mdoerr |
---|---|
date | Fri, 20 Dec 2019 19:51:00 +0100 |
parents | f93bd058a4ce |
children | a063e9c8d0f0 |
files | src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp src/hotspot/cpu/arm/c1_FrameMap_arm.cpp src/hotspot/cpu/ppc/c1_FrameMap_ppc.cpp src/hotspot/cpu/s390/c1_FrameMap_s390.cpp src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp src/hotspot/cpu/sparc/c1_FrameMap_sparc.cpp src/hotspot/cpu/x86/c1_FrameMap_x86.cpp src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp src/hotspot/share/c1/c1_FrameMap.hpp |
diffstat | 10 files changed, 25 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp Fri Dec 20 09:28:57 2019 +0000 +++ b/src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp Fri Dec 20 19:51:00 2019 +0100 @@ -49,6 +49,8 @@ opr = as_oop_opr(reg); } else if (type == T_METADATA) { opr = as_metadata_opr(reg); + } else if (type == T_ADDRESS) { + opr = as_address_opr(reg); } else { opr = as_opr(reg); }
--- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp Fri Dec 20 09:28:57 2019 +0000 +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp Fri Dec 20 19:51:00 2019 +0100 @@ -759,7 +759,7 @@ if (is_reference_type(type)) { __ str(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix())); __ verify_oop(src->as_register()); - } else if (type == T_METADATA || type == T_DOUBLE) { + } else if (type == T_METADATA || type == T_DOUBLE || type == T_ADDRESS) { __ str(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix())); } else { __ strw(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix())); @@ -872,7 +872,7 @@ if (is_reference_type(type)) { __ ldr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); __ verify_oop(dest->as_register()); - } else if (type == T_METADATA) { + } else if (type == T_METADATA || type == T_ADDRESS) { __ ldr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); } else { __ ldrw(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
--- a/src/hotspot/cpu/arm/c1_FrameMap_arm.cpp Fri Dec 20 09:28:57 2019 +0000 +++ b/src/hotspot/cpu/arm/c1_FrameMap_arm.cpp Fri Dec 20 19:51:00 2019 +0100 @@ -80,10 +80,12 @@ Register reg = r_1->as_Register(); if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) { opr = as_long_opr(reg, r_2->as_Register()); - } else if (type == T_OBJECT || type == T_ARRAY) { + } else if (is_reference_type(type)) { opr = as_oop_opr(reg); } else if (type == T_METADATA) { opr = as_metadata_opr(reg); + } else if (type == T_ADDRESS) { + opr = as_address_opr(reg); } else { // PreferInterpreterNativeStubs should ensure we never need to // handle a long opr passed as R3+stack_slot
--- a/src/hotspot/cpu/ppc/c1_FrameMap_ppc.cpp Fri Dec 20 09:28:57 2019 +0000 +++ b/src/hotspot/cpu/ppc/c1_FrameMap_ppc.cpp Fri Dec 20 19:51:00 2019 +0100 @@ -54,6 +54,10 @@ opr = as_long_opr(reg); } else if (is_reference_type(type)) { opr = as_oop_opr(reg); + } else if (type == T_METADATA) { + opr = as_metadata_opr(reg); + } else if (type == T_ADDRESS) { + opr = as_address_opr(reg); } else { opr = as_opr(reg); }
--- a/src/hotspot/cpu/s390/c1_FrameMap_s390.cpp Fri Dec 20 09:28:57 2019 +0000 +++ b/src/hotspot/cpu/s390/c1_FrameMap_s390.cpp Fri Dec 20 19:51:00 2019 +0100 @@ -50,6 +50,8 @@ opr = as_oop_opr(reg); } else if (type == T_METADATA) { opr = as_metadata_opr(reg); + } else if (type == T_ADDRESS) { + opr = as_address_opr(reg); } else { opr = as_opr(reg); }
--- a/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp Fri Dec 20 09:28:57 2019 +0000 +++ b/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp Fri Dec 20 19:51:00 2019 +0100 @@ -1007,7 +1007,7 @@ if (is_reference_type(type)) { __ mem2reg_opt(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()), true); __ verify_oop(dest->as_register()); - } else if (type == T_METADATA) { + } else if (type == T_METADATA || type == T_ADDRESS) { __ mem2reg_opt(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()), true); } else { __ mem2reg_opt(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()), false); @@ -1035,7 +1035,7 @@ if (is_reference_type(type)) { __ verify_oop(src->as_register()); __ reg2mem_opt(src->as_register(), dst, true); - } else if (type == T_METADATA) { + } else if (type == T_METADATA || type == T_ADDRESS) { __ reg2mem_opt(src->as_register(), dst, true); } else { __ reg2mem_opt(src->as_register(), dst, false);
--- a/src/hotspot/cpu/sparc/c1_FrameMap_sparc.cpp Fri Dec 20 09:28:57 2019 +0000 +++ b/src/hotspot/cpu/sparc/c1_FrameMap_sparc.cpp Fri Dec 20 19:51:00 2019 +0100 @@ -55,6 +55,8 @@ opr = as_oop_opr(reg); } else if (type == T_METADATA) { opr = as_metadata_opr(reg); + } else if (type == T_ADDRESS) { + opr = as_address_opr(reg); } else { opr = as_opr(reg); }
--- a/src/hotspot/cpu/x86/c1_FrameMap_x86.cpp Fri Dec 20 09:28:57 2019 +0000 +++ b/src/hotspot/cpu/x86/c1_FrameMap_x86.cpp Fri Dec 20 19:51:00 2019 +0100 @@ -54,6 +54,8 @@ opr = as_oop_opr(reg); } else if (type == T_METADATA) { opr = as_metadata_opr(reg); + } else if (type == T_ADDRESS) { + opr = as_address_opr(reg); } else { opr = as_opr(reg); }
--- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp Fri Dec 20 09:28:57 2019 +0000 +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp Fri Dec 20 19:51:00 2019 +0100 @@ -935,7 +935,7 @@ if (is_reference_type(type)) { __ verify_oop(src->as_register()); __ movptr (dst, src->as_register()); - } else if (type == T_METADATA) { + } else if (type == T_METADATA || type == T_ADDRESS) { __ movptr (dst, src->as_register()); } else { __ movl (dst, src->as_register()); @@ -1116,7 +1116,7 @@ if (is_reference_type(type)) { __ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); __ verify_oop(dest->as_register()); - } else if (type == T_METADATA) { + } else if (type == T_METADATA || type == T_ADDRESS) { __ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); } else { __ movl(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
--- a/src/hotspot/share/c1/c1_FrameMap.hpp Fri Dec 20 09:28:57 2019 +0000 +++ b/src/hotspot/share/c1/c1_FrameMap.hpp Fri Dec 20 19:51:00 2019 +0100 @@ -185,6 +185,10 @@ return LIR_OprFact::single_cpu_metadata(cpu_reg2rnr(r)); } + static LIR_Opr as_address_opr(Register r) { + return LIR_OprFact::single_cpu_address(cpu_reg2rnr(r)); + } + FrameMap(ciMethod* method, int monitors, int reserved_argument_area_size); bool finalize_frame(int nof_slots);