diff --git a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp index dce988daa22..b763b5b3ee4 100644 --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved. + * Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -824,7 +824,7 @@ void ShenandoahBarrierSetAssembler::gen_load_reference_barrier_stub(LIR_Assemble Register obj = stub->obj()->as_register(); Register res = stub->result()->as_register(); - Register addr = stub->addr()->as_register(); + Register addr = stub->addr()->as_pointer_register(); Register tmp1 = stub->tmp1()->as_register(); Register tmp2 = stub->tmp2()->as_register(); assert_different_registers(obj, res, addr, tmp1, tmp2); diff --git a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp index 2c1ed47808f..50dc7f68997 100644 --- a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp +++ b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved. + * Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -118,14 +118,14 @@ LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier(LIRGenerator* gen, LIR_Op LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr) { assert(ShenandoahLoadRefBarrier, "Should be enabled"); - obj = ensure_in_register(gen, obj); + obj = ensure_in_register(gen, obj, T_OBJECT); assert(obj->is_register(), "must be a register at this point"); - addr = ensure_in_register(gen, addr); + addr = ensure_in_register(gen, addr, T_ADDRESS); assert(addr->is_register(), "must be a register at this point"); LIR_Opr result = gen->result_register_for(obj->value_type()); __ move(obj, result); - LIR_Opr tmp1 = gen->new_register(T_OBJECT); - LIR_Opr tmp2 = gen->new_register(T_OBJECT); + LIR_Opr tmp1 = gen->new_register(T_ADDRESS); + LIR_Opr tmp2 = gen->new_register(T_ADDRESS); LIR_Opr thrd = gen->getThreadPointer(); LIR_Address* active_flag_addr = @@ -157,20 +157,14 @@ LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, L return result; } -LIR_Opr ShenandoahBarrierSetC1::ensure_in_register(LIRGenerator* gen, LIR_Opr obj) { +LIR_Opr ShenandoahBarrierSetC1::ensure_in_register(LIRGenerator* gen, LIR_Opr obj, BasicType type) { if (!obj->is_register()) { LIR_Opr obj_reg; if (obj->is_constant()) { - obj_reg = gen->new_register(T_OBJECT); + obj_reg = gen->new_register(type); __ move(obj, obj_reg); } else { -#ifdef AARCH64 - // AArch64 expects double-size register. obj_reg = gen->new_pointer_register(); -#else - // x86 expects single-size register. - obj_reg = gen->new_register(T_OBJECT); -#endif __ leal(obj, obj_reg); } obj = obj_reg; @@ -180,7 +174,7 @@ LIR_Opr ShenandoahBarrierSetC1::ensure_in_register(LIRGenerator* gen, LIR_Opr ob LIR_Opr ShenandoahBarrierSetC1::storeval_barrier(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, DecoratorSet decorators) { if (ShenandoahStoreValEnqueueBarrier) { - obj = ensure_in_register(gen, obj); + obj = ensure_in_register(gen, obj, T_OBJECT); pre_barrier(gen, info, decorators, LIR_OprFact::illegalOpr, obj); } return obj; @@ -221,7 +215,7 @@ void ShenandoahBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) BarrierSetC1::load_at_resolved(access, result); LIR_OprList* args = new LIR_OprList(); LIR_Opr addr = access.resolved_addr(); - addr = ensure_in_register(gen, addr); + addr = ensure_in_register(gen, addr, T_ADDRESS); args->append(result); args->append(addr); BasicTypeList signature; diff --git a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.hpp b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.hpp index 5757060b46f..263ad15895a 100644 --- a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.hpp +++ b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved. + * Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -198,7 +198,7 @@ private: LIR_Opr load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr); - LIR_Opr ensure_in_register(LIRGenerator* gen, LIR_Opr obj); + LIR_Opr ensure_in_register(LIRGenerator* gen, LIR_Opr obj, BasicType type); public: ShenandoahBarrierSetC1();