< prev index next >
src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
Print this page
rev 50905 : Move Shenandoah stubs generation into ShenandoahBarrierSetAssembler
rev 50906 : [mq]: stubgen-v2.patch
rev 50907 : [mq]: stubgen-v3.patch
*** 23,32 ****
--- 23,33 ----
#include "precompiled.hpp"
#include "gc/shenandoah/brooksPointer.hpp"
#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
#include "gc/shenandoah/shenandoahConnectionMatrix.hpp"
+ #include "gc/shenandoah/shenandoahHeap.hpp"
#include "gc/shenandoah/shenandoahHeapRegion.hpp"
#include "gc/shenandoah/shenandoahRuntime.hpp"
#include "gc/shenandoah/shenandoahThreadLocalData.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interp_masm.hpp"
*** 38,47 ****
--- 39,51 ----
#include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
#endif
#define __ masm->
+ address ShenandoahBarrierSetAssembler::_shenandoah_wb = NULL;
+ address ShenandoahBarrierSetAssembler::_shenandoah_wb_C = NULL;
+
void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
Register addr, Register count, RegSet saved_regs) {
if (is_oop) {
bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0;
if (!dest_uninitialized) {
*** 572,576 ****
--- 576,657 ----
}
#undef __
#endif // COMPILER1
+
+ address ShenandoahBarrierSetAssembler::shenandoah_wb() {
+ assert(_shenandoah_wb != NULL, "need write barrier stub");
+ return _shenandoah_wb;
+ }
+
+ address ShenandoahBarrierSetAssembler::shenandoah_wb_C() {
+ assert(_shenandoah_wb_C != NULL, "need write barrier stub");
+ return _shenandoah_wb_C;
+ }
+
+ #define __ cgen->assembler()->
+
+ // Shenandoah write barrier.
+ //
+ // Input:
+ // r0: OOP to evacuate. Not null.
+ //
+ // Output:
+ // r0: Pointer to evacuated OOP.
+ //
+ // Trash rscratch1, rscratch2. Preserve everything else.
+ address ShenandoahBarrierSetAssembler::generate_shenandoah_wb(StubCodeGenerator* cgen, bool c_abi, bool do_cset_test) {
+
+ __ align(6);
+ StubCodeMark mark(cgen, "StubRoutines", "shenandoah_wb");
+ address start = __ pc();
+
+ if (do_cset_test) {
+ Label work;
+ __ mov(rscratch2, ShenandoahHeap::in_cset_fast_test_addr());
+ __ lsr(rscratch1, r0, ShenandoahHeapRegion::region_size_bytes_shift_jint());
+ __ ldrb(rscratch2, Address(rscratch2, rscratch1));
+ __ tbnz(rscratch2, 0, work);
+ __ ret(lr);
+ __ bind(work);
+ }
+
+ Register obj = r0;
+
+ __ enter(); // required for proper stackwalking of RuntimeStub frame
+
+ if (!c_abi) {
+ __ push_call_clobbered_registers();
+ } else {
+ __ push_call_clobbered_fp_registers();
+ }
+
+ __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_barrier_JRT));
+ __ blrt(lr, 1, 0, MacroAssembler::ret_type_integral);
+ if (!c_abi) {
+ __ mov(rscratch1, obj);
+ __ pop_call_clobbered_registers();
+ __ mov(obj, rscratch1);
+ } else {
+ __ pop_call_clobbered_fp_registers();
+ }
+
+ __ leave(); // required for proper stackwalking of RuntimeStub frame
+ __ ret(lr);
+
+ return start;
+ }
+
+ #undef __
+
+ void ShenandoahBarrierSetAssembler::barrier_stubs_init() {
+ if (ShenandoahWriteBarrier || ShenandoahStoreValEnqueueBarrier) {
+ int stub_code_size = 2048;
+ ResourceMark rm;
+ BufferBlob* bb = BufferBlob::create("shenandoah_barrier_stubs", stub_code_size);
+ CodeBuffer buf(bb);
+ StubCodeGenerator cgen(&buf);
+ _shenandoah_wb = generate_shenandoah_wb(&cgen, false, true);
+ _shenandoah_wb_C = generate_shenandoah_wb(&cgen, true, !ShenandoahWriteBarrierCsetTestInIR);
+ }
+ }
< prev index next >