1 /*
 2  * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
 3  * Copyright (c) 2012, 2015 SAP SE. 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_PPC_C1_MACROASSEMBLER_PPC_HPP
27 #define CPU_PPC_C1_MACROASSEMBLER_PPC_HPP
28 
29   void pd_init() { /* nothing to do */ }
30 
31  public:
32    void try_allocate(
33     Register obj,                      // result: pointer to object after successful allocation
34     Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
35     int      con_size_in_bytes,        // object size in bytes if   known at compile time
36     Register t1,                       // temp register
37     Register t2,                       // temp register
38     Label&   slow_case                 // continuation point if fast allocation fails
39   );
40 
41   void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2);
42   void initialize_body(Register base, Register index);
43   void initialize_body(Register obj, Register tmp1, Register tmp2, int obj_size_in_bytes, int hdr_size_in_bytes);
44 
45   void initialize_object(
46     Register obj,                      // result: pointer to object after successful allocation
47     Register klass,                    // object klass
48     Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
49     int      con_size_in_bytes,        // object size in bytes if   known at compile time
50     Register t1,                       // temp register
51     Register t2                        // temp register
52   );
53 
54   // Allocation of fixed-size objects
55   // (Can also be used to allocate fixed-size arrays, by setting
56   // hdr_size correctly and storing the array length afterwards.)
57   void allocate_object(
58     Register obj,                      // result: pointer to object after successful allocation
59     Register t1,                       // temp register
60     Register t2,                       // temp register
61     Register t3,                       // temp register
62     int      hdr_size,                 // object header size in words
63     int      obj_size,                 // object size in words
64     Register klass,                    // object klass
65     Label&   slow_case                 // continuation point if fast allocation fails
66   );
67 
68   enum {
69     max_array_allocation_length = 0x40000000 // ppc friendly value, requires lis only
70   };
71 
72   // Allocation of arrays
73   void allocate_array(
74     Register obj,                      // result: pointer to array after successful allocation
75     Register len,                      // array length
76     Register t1,                       // temp register
77     Register t2,                       // temp register
78     Register t3,                       // temp register
79     int      hdr_size,                 // object header size in words
80     int      elt_size,                 // element size in bytes
81     Register klass,                    // object klass
82     Label&   slow_case                 // continuation point if fast allocation fails
83   );
84 
85   void null_check(Register r, Label *Lnull = NULL);
86 
87   address call_c_with_frame_resize(address dest, int frame_resize);
88 
89 #endif // CPU_PPC_C1_MACROASSEMBLER_PPC_HPP