c1_MacroAssembler_ppc.hpp revision 9751:4a24de859a87
11897Swollman/*
21897Swollman * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
31897Swollman * Copyright 2012, 2015 SAP AG. All rights reserved.
41897Swollman * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
51897Swollman *
61897Swollman * This code is free software; you can redistribute it and/or modify it
71897Swollman * under the terms of the GNU General Public License version 2 only, as
8100441Scharnier * published by the Free Software Foundation.
91897Swollman *
101897Swollman * This code is distributed in the hope that it will be useful, but WITHOUT
111897Swollman * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12100441Scharnier * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
131897Swollman * version 2 for more details (a copy is included in the LICENSE file that
141897Swollman * accompanied this code).
151897Swollman *
16100441Scharnier * You should have received a copy of the GNU General Public License version
171897Swollman * 2 along with this work; if not, write to the Free Software Foundation,
181897Swollman * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
191897Swollman *
20100441Scharnier * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
211897Swollman * or visit www.oracle.com if you need additional information or have any
221897Swollman * questions.
231897Swollman *
24100441Scharnier */
251897Swollman
261897Swollman#ifndef CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP
271897Swollman#define CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP
281897Swollman
2912798Swpaul  void pd_init() { /* nothing to do */ }
30100441Scharnier
311897Swollman public:
32146833Sstefanf   void try_allocate(
3312798Swpaul    Register obj,                      // result: pointer to object after successful allocation
341897Swollman    Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
3527935Scharnier    int      con_size_in_bytes,        // object size in bytes if   known at compile time
361897Swollman    Register t1,                       // temp register
37100441Scharnier    Register t2,                       // temp register
38100441Scharnier    Label&   slow_case                 // continuation point if fast allocation fails
39100441Scharnier  );
401897Swollman
418874Srgrimes  void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2);
428874Srgrimes  void initialize_body(Register base, Register index);
431897Swollman  void initialize_body(Register obj, Register tmp1, Register tmp2, int obj_size_in_bytes, int hdr_size_in_bytes);
4427935Scharnier
451897Swollman  // locking/unlocking
4612798Swpaul  void lock_object  (Register Rmark, Register Roop, Register Rbox, Register Rscratch, Label& slow_case);
4712798Swpaul  void unlock_object(Register Rmark, Register Roop, Register Rbox,                    Label& slow_case);
48149682Sstefanf
491897Swollman  void initialize_object(
501897Swollman    Register obj,                      // result: pointer to object after successful allocation
5192921Simp    Register klass,                    // object klass
5292921Simp    Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
5392921Simp    int      con_size_in_bytes,        // object size in bytes if   known at compile time
5492921Simp    Register t1,                       // temp register
5592921Simp    Register t2                        // temp register
5692921Simp  );
5792921Simp
5892921Simp  // Allocation of fixed-size objects
5992921Simp  // (Can also be used to allocate fixed-size arrays, by setting
6092921Simp  // hdr_size correctly and storing the array length afterwards.)
611897Swollman  void allocate_object(
621897Swollman    Register obj,                      // result: pointer to object after successful allocation
638874Srgrimes    Register t1,                       // temp register
641897Swollman    Register t2,                       // temp register
651897Swollman    Register t3,                       // temp register
66152398Sdwmalone    int      hdr_size,                 // object header size in words
671897Swollman    int      obj_size,                 // object size in words
6812798Swpaul    Register klass,                    // object klass
691897Swollman    Label&   slow_case                 // continuation point if fast allocation fails
701897Swollman  );
7112798Swpaul
7212798Swpaul  enum {
7312798Swpaul    max_array_allocation_length = 0x40000000 // ppc friendly value, requires lis only
7412798Swpaul  };
7512798Swpaul
7612798Swpaul  // Allocation of arrays
7712798Swpaul  void allocate_array(
7812798Swpaul    Register obj,                      // result: pointer to array after successful allocation
7912798Swpaul    Register len,                      // array length
8012798Swpaul    Register t1,                       // temp register
8112798Swpaul    Register t2,                       // temp register
8212798Swpaul    Register t3,                       // temp register
8312798Swpaul    int      hdr_size,                 // object header size in words
84298089Spfg    int      elt_size,                 // element size in bytes
851897Swollman    Register klass,                    // object klass
861897Swollman    Label&   slow_case                 // continuation point if fast allocation fails
871897Swollman  );
881897Swollman
891897Swollman  void null_check(Register r, Label *Lnull = NULL);
901897Swollman
911897Swollman  address call_c_with_frame_resize(address dest, int frame_resize);
921897Swollman
931897Swollman#endif // CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP
941897Swollman