hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp
author simonis
Wed, 23 Aug 2017 18:24:47 +0200
changeset 46960 b498e2123d2f
parent 35594 cc13089c6327
permissions -rw-r--r--
8186667: InterpreterCodeSize overflows on AIX Reviewed-by: goetz
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35085
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     1
/*
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     2
 * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
35594
cc13089c6327 8147937: Adapt SAP copyrights to new company name.
goetz
parents: 35085
diff changeset
     3
 * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
35085
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     5
 *
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     8
 * published by the Free Software Foundation.
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     9
 *
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    14
 * accompanied this code).
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    15
 *
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    19
 *
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    22
 * questions.
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    23
 *
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    24
 */
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    25
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    26
#ifndef CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    27
#define CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    28
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    29
  void pd_init() { /* nothing to do */ }
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    30
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    31
 public:
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    32
   void try_allocate(
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    33
    Register obj,                      // result: pointer to object after successful allocation
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    34
    Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    35
    int      con_size_in_bytes,        // object size in bytes if   known at compile time
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    36
    Register t1,                       // temp register
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    37
    Register t2,                       // temp register
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    38
    Label&   slow_case                 // continuation point if fast allocation fails
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    39
  );
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    40
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    41
  void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2);
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    42
  void initialize_body(Register base, Register index);
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    43
  void initialize_body(Register obj, Register tmp1, Register tmp2, int obj_size_in_bytes, int hdr_size_in_bytes);
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    44
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    45
  // locking/unlocking
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    46
  void lock_object  (Register Rmark, Register Roop, Register Rbox, Register Rscratch, Label& slow_case);
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    47
  void unlock_object(Register Rmark, Register Roop, Register Rbox,                    Label& slow_case);
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    48
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    49
  void initialize_object(
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    50
    Register obj,                      // result: pointer to object after successful allocation
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    51
    Register klass,                    // object klass
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    52
    Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    53
    int      con_size_in_bytes,        // object size in bytes if   known at compile time
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    54
    Register t1,                       // temp register
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    55
    Register t2                        // temp register
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    56
  );
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    57
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    58
  // Allocation of fixed-size objects
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    59
  // (Can also be used to allocate fixed-size arrays, by setting
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    60
  // hdr_size correctly and storing the array length afterwards.)
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    61
  void allocate_object(
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    62
    Register obj,                      // result: pointer to object after successful allocation
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    63
    Register t1,                       // temp register
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    64
    Register t2,                       // temp register
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    65
    Register t3,                       // temp register
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    66
    int      hdr_size,                 // object header size in words
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    67
    int      obj_size,                 // object size in words
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    68
    Register klass,                    // object klass
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    69
    Label&   slow_case                 // continuation point if fast allocation fails
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    70
  );
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    71
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    72
  enum {
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    73
    max_array_allocation_length = 0x40000000 // ppc friendly value, requires lis only
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    74
  };
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    75
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    76
  // Allocation of arrays
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    77
  void allocate_array(
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    78
    Register obj,                      // result: pointer to array after successful allocation
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    79
    Register len,                      // array length
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    80
    Register t1,                       // temp register
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    81
    Register t2,                       // temp register
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    82
    Register t3,                       // temp register
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    83
    int      hdr_size,                 // object header size in words
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    84
    int      elt_size,                 // element size in bytes
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    85
    Register klass,                    // object klass
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    86
    Label&   slow_case                 // continuation point if fast allocation fails
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    87
  );
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    88
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    89
  void null_check(Register r, Label *Lnull = NULL);
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    90
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    91
  address call_c_with_frame_resize(address dest, int frame_resize);
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    92
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    93
#endif // CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP