Skip to content

Commit 6086363

Browse files
committed
Workaround the C2 bug in codegen
1 parent d88f559 commit 6086363

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

openjdk/share/barriers/mmtkObjectBarrier.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,15 @@ void MMTkObjectBarrierSetC2::object_reference_write_post(GraphKit* kit, Node* sr
113113
shift = __ AndI(__ ConvL2I(shift), __ ConI(7));
114114
Node* result = __ AndI(__ URShiftI(byte, shift), __ ConI(1));
115115

116+
// XXX zixianc
117+
// Workaround C2 bug in compare-and-swap codegen on RISC-V
116118
__ if_then(result, BoolTest::ne, zero, unlikely); {
117-
const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM);
118-
Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), "mmtk_barrier_call", src, slot, val);
119+
const TypeFunc* tf = __ func_type(src->bottom_type());
120+
Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), "mmtk_barrier_call", src);
119121
} __ end_if();
120122
#else
121-
const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM);
122-
Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_post_call), "mmtk_barrier_call", src, slot, val);
123+
const TypeFunc* tf = __ func_type(src->bottom_type());
124+
Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_post_call), "mmtk_barrier_call", src);
123125
#endif
124126

125127
kit->final_sync(ideal); // Final sync IdealKit and GraphKit.

0 commit comments

Comments
 (0)