1 /*
 2  * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
 3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 4  *
 5  * This code is free software; you can redistribute it and/or modify it
 6  * under the terms of the GNU General Public License version 2 only, as
 7  * published by the Free Software Foundation.
 8  *
 9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  *
23  */
24 
25 #ifndef CPU_ARM_C1_MACROASSEMBLER_ARM_HPP
26 #define CPU_ARM_C1_MACROASSEMBLER_ARM_HPP
27 
28  private:
29 
30   void pd_init() { /* not used */ }
31 
32  public:
33 
34   // Puts address of allocated object into register `obj` and end of allocated object into register `obj_end`.
35   // `size_expression` should be a register or constant which can be used as immediate in "add" instruction.
36   void try_allocate(Register obj, Register obj_end, Register tmp1, Register tmp2,
37                     RegisterOrConstant size_expression, Label& slow_case);
38 
39   void initialize_header(Register obj, Register klass, Register len, Register tmp);
40 
41   // Cleans object body [base..obj_end]. Clobbers `base` and `tmp` registers.
42   void initialize_body(Register base, Register obj_end, Register tmp);
43 
44   void initialize_object(Register obj, Register obj_end, Register klass,
45                          Register len, Register tmp1, Register tmp2,
46                          RegisterOrConstant header_size_expression, int obj_size_in_bytes,
47                          bool is_tlab_allocated);
48 
49   void allocate_object(Register obj, Register tmp1, Register tmp2, Register tmp3,
50                        int header_size, int object_size,
51                        Register klass, Label& slow_case);
52 
53   void allocate_array(Register obj, Register len,
54                       Register tmp1, Register tmp2, Register tmp3,
55                       int header_size_in_bytes, int element_size,
56                       Register klass, Label& slow_case);
57 
58   enum {
59     max_array_allocation_length = 0x01000000
60   };
61 
62   int lock_object(Register hdr, Register obj, Register disp_hdr, Label& slow_case);
63 
64   void unlock_object(Register hdr, Register obj, Register disp_hdr, Label& slow_case);
65 
66   // This platform only uses signal-based null checks. The Label is not needed.
67   void null_check(Register r, Label *Lnull = NULL) { MacroAssembler::null_check(r); }
68 
69 #endif // CPU_ARM_C1_MACROASSEMBLER_ARM_HPP
--- EOF ---