Skip to content
Permalink
Browse files

8238851: Shenandoah: C1: Resolve into registers of correct type

Reviewed-by: shade
  • Loading branch information
rkennke committed Feb 11, 2020
1 parent 1e0167e commit 411766b6bba0d3640e439221c123baf343a39336
@@ -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);
@@ -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;
@@ -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 @@ class ShenandoahBarrierSetC1 : public BarrierSetC1 {

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();

0 comments on commit 411766b

Please sign in to comment.