src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp
author naoto
Tue, 09 Jul 2019 08:05:38 -0700
changeset 55627 9c1885fb2a42
parent 54440 23a04fe2aca2
permissions -rw-r--r--
8227127: Era designator not displayed correctly using the COMPAT provider Reviewed-by: rriggs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51875
diff changeset
     2
 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
     3
 * Copyright (c) 2014, Red Hat Inc. All rights reserved.
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
     5
 *
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
     8
 * published by the Free Software Foundation.
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
     9
 *
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    14
 * accompanied this code).
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    15
 *
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    19
 *
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    22
 * questions.
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    23
 *
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    24
 */
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    25
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51875
diff changeset
    26
#ifndef CPU_AARCH64_C1_LIRASSEMBLER_AARCH64_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51875
diff changeset
    27
#define CPU_AARCH64_C1_LIRASSEMBLER_AARCH64_HPP
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    28
32086
7590882ae33a 8132875: AArch64: Fix error introduced into AArch64 CodeCache by commit for 8130309
adinn
parents: 29184
diff changeset
    29
// ArrayCopyStub needs access to bailout
7590882ae33a 8132875: AArch64: Fix error introduced into AArch64 CodeCache by commit for 8130309
adinn
parents: 29184
diff changeset
    30
friend class ArrayCopyStub;
7590882ae33a 8132875: AArch64: Fix error introduced into AArch64 CodeCache by commit for 8130309
adinn
parents: 29184
diff changeset
    31
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    32
 private:
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    33
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    34
  int array_element_size(BasicType type) const;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    35
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    36
  void arith_fpu_implementation(LIR_Code code, int left_index, int right_index, int dest_index, bool pop_fpu_stack);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    37
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    38
  // helper functions which checks for overflow and sets bailout if it
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    39
  // occurs.  Always returns a valid embeddable pointer but in the
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    40
  // bailout case the pointer won't be to unique storage.
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    41
  address float_constant(float f);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    42
  address double_constant(double d);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    43
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    44
  address int_constant(jlong n);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    45
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    46
  bool is_literal_address(LIR_Address* addr);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    47
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    48
  // When we need to use something other than rscratch1 use this
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    49
  // method.
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    50
  Address as_Address(LIR_Address* addr, Register tmp);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    51
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    52
  // Record the type of the receiver in ReceiverTypeData
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    53
  void type_profile_helper(Register mdo,
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    54
                           ciMethodData *md, ciProfileData *data,
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    55
                           Register recv, Label* update_done);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    56
  void add_debug_info_for_branch(address adr, CodeEmitInfo* info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    57
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    58
  void casw(Register addr, Register newval, Register cmpval);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    59
  void casl(Register addr, Register newval, Register cmpval);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    60
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    61
  void poll_for_safepoint(relocInfo::relocType rtype, CodeEmitInfo* info = NULL);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    62
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    63
  static const int max_tableswitches = 20;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    64
  struct tableswitch switches[max_tableswitches];
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    65
  int tableswitch_count;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    66
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    67
  void init() { tableswitch_count = 0; }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    68
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    69
  void deoptimize_trap(CodeEmitInfo *info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    70
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 38711
diff changeset
    71
  enum {
54440
23a04fe2aca2 8219993: AArch64: Compiled CI stubs are unsafely modified
aph
parents: 53244
diff changeset
    72
    // call stub: CompiledStaticCall::to_interp_stub_size() +
23a04fe2aca2 8219993: AArch64: Compiled CI stubs are unsafely modified
aph
parents: 53244
diff changeset
    73
    //            CompiledStaticCall::to_trampoline_stub_size()
23a04fe2aca2 8219993: AArch64: Compiled CI stubs are unsafely modified
aph
parents: 53244
diff changeset
    74
    _call_stub_size = 13 * NativeInstruction::instruction_size,
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 38711
diff changeset
    75
    _call_aot_stub_size = 0,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 38711
diff changeset
    76
    _exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175),
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 38711
diff changeset
    77
    _deopt_handler_size = 7 * NativeInstruction::instruction_size
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 38711
diff changeset
    78
  };
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 38711
diff changeset
    79
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    80
public:
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    81
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    82
  void store_parameter(Register r, int offset_from_esp_in_words);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    83
  void store_parameter(jint c,     int offset_from_esp_in_words);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    84
  void store_parameter(jobject c,  int offset_from_esp_in_words);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    85
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51875
diff changeset
    86
#endif // CPU_AARCH64_C1_LIRASSEMBLER_AARCH64_HPP