1 /*
   2  * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2015-2018, Azul Systems, Inc. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef CPU_AARCH32_GC_SHARED_BARRIERSETASSEMBLER_AARCH32_HPP
  27 #define CPU_AARCH32_GC_SHARED_BARRIERSETASSEMBLER_AARCH32_HPP
  28 
  29 #include "asm/macroAssembler.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "oops/access.hpp"
  32 
  33 class BarrierSetAssembler: public CHeapObj<mtGC> {
  34 private:
  35   void incr_allocated_bytes(MacroAssembler* masm,
  36                             Register var_size_in_bytes, int con_size_in_bytes,
  37                             Register t1 = noreg);
  38 
  39 public:
  40   virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
  41                                   Register addr, Register count) {}
  42   virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
  43                                   Register start, Register end, Register tmp) {}
  44   virtual void load_word_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
  45                             Register dst, Address src, Register tmp1, Register tmp_thread);
  46   virtual void store_word_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
  47                              Address dst, Register val, Register tmp1, Register tmp2);
  48   virtual void load_tos_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
  49                            Address src, Register tmp1, Register tmp_thread);
  50   virtual void store_tos_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
  51                             Address dst, Register tmp1, Register tmp2);
  52 
  53   virtual void obj_equals(MacroAssembler* masm,
  54                           Register obj1, Register obj2);
  55 
  56   virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env,
  57                                              Register obj, Register tmp, Label& slowpath);
  58 
  59   virtual void tlab_allocate(MacroAssembler* masm,
  60     Register obj,                      // result: pointer to object after successful allocation
  61     Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
  62     int      con_size_in_bytes,        // object size in bytes if   known at compile time
  63     Register t1,                       // temp register
  64     Register t2,                       // temp register
  65     Label&   slow_case                 // continuation point if fast allocation fails
  66   );
  67 
  68   void eden_allocate(MacroAssembler* masm,
  69     Register obj,                      // result: pointer to object after successful allocation
  70     Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
  71     int      con_size_in_bytes,        // object size in bytes if   known at compile time
  72     Register t1,                       // temp register
  73     Label&   slow_case                 // continuation point if fast allocation fails
  74   );
  75   virtual void barrier_stubs_init() {}
  76 };
  77 
  78 #endif // CPU_AARCH32_GC_SHARED_BARRIERSETASSEMBLER_AARCH32_HPP