8217258: ZGC: Minor cleanup of ZBarrierSetAssembler
authorpliden
Wed, 23 Jan 2019 08:55:09 +0100
changeset 53440 a0b98a2af86c
parent 53439 4b42f828e0c3
child 53441 5c2c9555afc1
8217258: ZGC: Minor cleanup of ZBarrierSetAssembler Reviewed-by: eosterlund, stefank
src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp
src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp
--- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp	Wed Jan 23 08:55:09 2019 +0100
+++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp	Wed Jan 23 08:55:09 2019 +0100
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,8 +37,9 @@
 #include "gc/z/c1/zBarrierSetC1.hpp"
 #endif // COMPILER1
 
-#undef __
-#define __ masm->
+ZBarrierSetAssembler::ZBarrierSetAssembler() :
+    _load_barrier_slow_stub(),
+    _load_barrier_weak_slow_stub() {}
 
 #ifdef PRODUCT
 #define BLOCK_COMMENT(str) /* nothing */
@@ -46,6 +47,9 @@
 #define BLOCK_COMMENT(str) __ block_comment(str)
 #endif
 
+#undef __
+#define __ masm->
+
 static void call_vm(MacroAssembler* masm,
                     address entry_point,
                     Register arg0,
@@ -461,3 +465,11 @@
   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);
 }
+
+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()];
+}
--- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp	Wed Jan 23 08:55:09 2019 +0100
+++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp	Wed Jan 23 08:55:09 2019 +0100
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,16 +33,12 @@
 #endif // COMPILER1
 
 class ZBarrierSetAssembler : public ZBarrierSetAssemblerBase {
+private:
   address _load_barrier_slow_stub[RegisterImpl::number_of_registers];
   address _load_barrier_weak_slow_stub[RegisterImpl::number_of_registers];
 
 public:
-  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()]; }
+  ZBarrierSetAssembler();
 
   virtual void load_at(MacroAssembler* masm,
                        DecoratorSet decorators,
@@ -87,6 +83,9 @@
 #endif // COMPILER1
 
   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