8217258: ZGC: Minor cleanup of ZBarrierSetAssembler

Reviewed-by: eosterlund, stefank
This commit is contained in:
Per Lidén 2019-01-23 08:55:09 +01:00
parent 6da8205aa0
commit e8a0007871
2 changed files with 21 additions and 10 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -37,8 +37,9 @@
#include "gc/z/c1/zBarrierSetC1.hpp" #include "gc/z/c1/zBarrierSetC1.hpp"
#endif // COMPILER1 #endif // COMPILER1
#undef __ ZBarrierSetAssembler::ZBarrierSetAssembler() :
#define __ masm-> _load_barrier_slow_stub(),
_load_barrier_weak_slow_stub() {}
#ifdef PRODUCT #ifdef PRODUCT
#define BLOCK_COMMENT(str) /* nothing */ #define BLOCK_COMMENT(str) /* nothing */
@ -46,6 +47,9 @@
#define BLOCK_COMMENT(str) __ block_comment(str) #define BLOCK_COMMENT(str) __ block_comment(str)
#endif #endif
#undef __
#define __ masm->
static void call_vm(MacroAssembler* masm, static void call_vm(MacroAssembler* masm,
address entry_point, address entry_point,
Register arg0, Register arg0,
@ -461,3 +465,11 @@ void ZBarrierSetAssembler::barrier_stubs_init() {
barrier_stubs_init_inner("zgc_load_barrier_stubs", ON_STRONG_OOP_REF, _load_barrier_slow_stub); barrier_stubs_init_inner("zgc_load_barrier_stubs", ON_STRONG_OOP_REF, _load_barrier_slow_stub);
barrier_stubs_init_inner("zgc_load_barrier_weak_stubs", ON_WEAK_OOP_REF, _load_barrier_weak_slow_stub); barrier_stubs_init_inner("zgc_load_barrier_weak_stubs", ON_WEAK_OOP_REF, _load_barrier_weak_slow_stub);
} }
address ZBarrierSetAssembler::load_barrier_slow_stub(Register reg) {
return _load_barrier_slow_stub[reg->encoding()];
}
address ZBarrierSetAssembler::load_barrier_weak_slow_stub(Register reg) {
return _load_barrier_weak_slow_stub[reg->encoding()];
}

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,16 +33,12 @@ class ZLoadBarrierStubC1;
#endif // COMPILER1 #endif // COMPILER1
class ZBarrierSetAssembler : public ZBarrierSetAssemblerBase { class ZBarrierSetAssembler : public ZBarrierSetAssemblerBase {
private:
address _load_barrier_slow_stub[RegisterImpl::number_of_registers]; address _load_barrier_slow_stub[RegisterImpl::number_of_registers];
address _load_barrier_weak_slow_stub[RegisterImpl::number_of_registers]; address _load_barrier_weak_slow_stub[RegisterImpl::number_of_registers];
public: public:
ZBarrierSetAssembler() : ZBarrierSetAssembler();
_load_barrier_slow_stub(),
_load_barrier_weak_slow_stub() {}
address load_barrier_slow_stub(Register reg) { return _load_barrier_slow_stub[reg->encoding()]; }
address load_barrier_weak_slow_stub(Register reg) { return _load_barrier_weak_slow_stub[reg->encoding()]; }
virtual void load_at(MacroAssembler* masm, virtual void load_at(MacroAssembler* masm,
DecoratorSet decorators, DecoratorSet decorators,
@ -87,6 +83,9 @@ public:
#endif // COMPILER1 #endif // COMPILER1
virtual void barrier_stubs_init(); virtual void barrier_stubs_init();
address load_barrier_slow_stub(Register reg);
address load_barrier_weak_slow_stub(Register reg);
}; };
#endif // CPU_X86_GC_Z_ZBARRIERSETASSEMBLER_X86_HPP #endif // CPU_X86_GC_Z_ZBARRIERSETASSEMBLER_X86_HPP