src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp
author coleenp
Mon, 04 Jun 2018 10:18:43 -0400
changeset 50380 bec342339138
parent 50094 2f79462aab9b
child 50519 17bde7f98889
permissions -rw-r--r--
8204195: Clean up macroAssembler.inline.hpp and other inline.hpp files included in .hpp files Summary: Moved macroAssembler.inline.hpp out of header file and distributed to .cpp files that included them: ie. c1_MacroAssembler.hpp and interp_masm.hpp. Also freeList.inline.hpp and allocation.inline.hpp. Reviewed-by: jiangli, kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
     1
/*
49347
edb65305d3ac 8195148: Collapse G1SATBCardTableModRefBS and G1SATBCardTableLoggingModRefBS into a single G1BarrierSet
eosterlund
parents: 47216
diff changeset
     2
 * Copyright (c) 1999, 2018, 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
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    26
#include "precompiled.hpp"
50380
bec342339138 8204195: Clean up macroAssembler.inline.hpp and other inline.hpp files included in .hpp files
coleenp
parents: 50094
diff changeset
    27
#include "asm/macroAssembler.inline.hpp"
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    28
#include "c1/c1_CodeStubs.hpp"
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    29
#include "c1/c1_FrameMap.hpp"
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    30
#include "c1/c1_LIRAssembler.hpp"
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    31
#include "c1/c1_MacroAssembler.hpp"
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    32
#include "c1/c1_Runtime1.hpp"
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    33
#include "nativeInst_aarch64.hpp"
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    34
#include "runtime/sharedRuntime.hpp"
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    35
#include "vmreg_aarch64.inline.hpp"
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    36
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    37
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    38
#define __ ce->masm()->
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    39
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    40
void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    41
  __ bind(_entry);
34200
0a24709c3861 8138892: C1: Improve counter overflow checking
mdoerr
parents: 32086
diff changeset
    42
  Metadata *m = _method->as_constant_ptr()->as_metadata();
0a24709c3861 8138892: C1: Improve counter overflow checking
mdoerr
parents: 32086
diff changeset
    43
  __ mov_metadata(rscratch1, m);
0a24709c3861 8138892: C1: Improve counter overflow checking
mdoerr
parents: 32086
diff changeset
    44
  ce->store_parameter(rscratch1, 1);
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    45
  ce->store_parameter(_bci, 0);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    46
  __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id)));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    47
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    48
  ce->verify_oop_map(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    49
  __ b(_continuation);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    50
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    51
50094
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    52
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    53
  : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    54
  assert(info != NULL, "must have info");
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    55
  _info = new CodeEmitInfo(info);
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    56
}
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    57
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    58
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    59
  : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    60
  assert(info != NULL, "must have info");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    61
  _info = new CodeEmitInfo(info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    62
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    63
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    64
void RangeCheckStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    65
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    66
  if (_info->deoptimize_on_exception()) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    67
    address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    68
    __ far_call(RuntimeAddress(a));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    69
    ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    70
    ce->verify_oop_map(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    71
    debug_only(__ should_not_reach_here());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    72
    return;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    73
  }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    74
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    75
  if (_index->is_cpu_register()) {
50094
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    76
    __ mov(r22, _index->as_register());
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    77
  } else {
50094
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    78
    __ mov(r22, _index->as_jint());
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    79
  }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    80
  Runtime1::StubID stub_id;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    81
  if (_throw_index_out_of_bounds_exception) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    82
    stub_id = Runtime1::throw_index_exception_id;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    83
  } else {
50094
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    84
    assert(_array != NULL, "sanity");
2f79462aab9b 8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents: 49906
diff changeset
    85
    __ mov(r23, _array->as_pointer_register());
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    86
    stub_id = Runtime1::throw_range_check_failed_id;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    87
  }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    88
  __ far_call(RuntimeAddress(Runtime1::entry_for(stub_id)), NULL, rscratch2);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    89
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    90
  ce->verify_oop_map(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    91
  debug_only(__ should_not_reach_here());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    92
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    93
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    94
PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    95
  _info = new CodeEmitInfo(info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    96
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    97
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    98
void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
    99
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   100
  address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   101
  __ far_call(RuntimeAddress(a));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   102
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   103
  ce->verify_oop_map(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   104
  debug_only(__ should_not_reach_here());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   105
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   106
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   107
void DivByZeroStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   108
  if (_offset != -1) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   109
    ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   110
  }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   111
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   112
  __ far_call(Address(Runtime1::entry_for(Runtime1::throw_div0_exception_id), relocInfo::runtime_call_type));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   113
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   114
  ce->verify_oop_map(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   115
#ifdef ASSERT
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   116
  __ should_not_reach_here();
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   117
#endif
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   118
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   119
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   120
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   121
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   122
// Implementation of NewInstanceStub
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   123
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   124
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   125
  _result = result;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   126
  _klass = klass;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   127
  _klass_reg = klass_reg;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   128
  _info = new CodeEmitInfo(info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   129
  assert(stub_id == Runtime1::new_instance_id                 ||
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   130
         stub_id == Runtime1::fast_new_instance_id            ||
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   131
         stub_id == Runtime1::fast_new_instance_init_check_id,
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   132
         "need new_instance id");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   133
  _stub_id   = stub_id;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   134
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   135
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   136
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   137
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   138
void NewInstanceStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   139
  assert(__ rsp_offset() == 0, "frame size should be fixed");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   140
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   141
  __ mov(r3, _klass_reg->as_register());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   142
  __ far_call(RuntimeAddress(Runtime1::entry_for(_stub_id)));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   143
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   144
  ce->verify_oop_map(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   145
  assert(_result->as_register() == r0, "result must in r0,");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   146
  __ b(_continuation);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   147
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   148
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   149
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   150
// Implementation of NewTypeArrayStub
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   151
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   152
// Implementation of NewTypeArrayStub
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   153
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   154
NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   155
  _klass_reg = klass_reg;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   156
  _length = length;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   157
  _result = result;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   158
  _info = new CodeEmitInfo(info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   159
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   160
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   161
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   162
void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   163
  assert(__ rsp_offset() == 0, "frame size should be fixed");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   164
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   165
  assert(_length->as_register() == r19, "length must in r19,");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   166
  assert(_klass_reg->as_register() == r3, "klass_reg must in r3");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   167
  __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_type_array_id)));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   168
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   169
  ce->verify_oop_map(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   170
  assert(_result->as_register() == r0, "result must in r0");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   171
  __ b(_continuation);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   172
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   173
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   174
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   175
// Implementation of NewObjectArrayStub
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   176
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   177
NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   178
  _klass_reg = klass_reg;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   179
  _result = result;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   180
  _length = length;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   181
  _info = new CodeEmitInfo(info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   182
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   183
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   185
void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   186
  assert(__ rsp_offset() == 0, "frame size should be fixed");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   187
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   188
  assert(_length->as_register() == r19, "length must in r19,");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   189
  assert(_klass_reg->as_register() == r3, "klass_reg must in r3");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   190
  __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_object_array_id)));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   191
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   192
  ce->verify_oop_map(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   193
  assert(_result->as_register() == r0, "result must in r0");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   194
  __ b(_continuation);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   195
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   196
// Implementation of MonitorAccessStubs
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   197
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   198
MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   199
: MonitorAccessStub(obj_reg, lock_reg)
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   200
{
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   201
  _info = new CodeEmitInfo(info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   202
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   203
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   204
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   205
void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   206
  assert(__ rsp_offset() == 0, "frame size should be fixed");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   207
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   208
  ce->store_parameter(_obj_reg->as_register(),  1);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   209
  ce->store_parameter(_lock_reg->as_register(), 0);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   210
  Runtime1::StubID enter_id;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   211
  if (ce->compilation()->has_fpu_code()) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   212
    enter_id = Runtime1::monitorenter_id;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   213
  } else {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   214
    enter_id = Runtime1::monitorenter_nofpu_id;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   215
  }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   216
  __ far_call(RuntimeAddress(Runtime1::entry_for(enter_id)));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   217
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   218
  ce->verify_oop_map(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   219
  __ b(_continuation);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   220
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   221
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   222
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   223
void MonitorExitStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   224
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   225
  if (_compute_lock) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   226
    // lock_reg was destroyed by fast unlocking attempt => recompute it
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   227
    ce->monitor_address(_monitor_ix, _lock_reg);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   228
  }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   229
  ce->store_parameter(_lock_reg->as_register(), 0);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   230
  // note: non-blocking leaf routine => no call info needed
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   231
  Runtime1::StubID exit_id;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   232
  if (ce->compilation()->has_fpu_code()) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   233
    exit_id = Runtime1::monitorexit_id;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   234
  } else {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   235
    exit_id = Runtime1::monitorexit_nofpu_id;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   236
  }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   237
  __ adr(lr, _continuation);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   238
  __ far_jump(RuntimeAddress(Runtime1::entry_for(exit_id)));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   239
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   240
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   241
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   242
// Implementation of patching:
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   243
// - Copy the code at given offset to an inlined buffer (first the bytes, then the number of bytes)
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   244
// - Replace original code with a call to the stub
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   245
// At Runtime:
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   246
// - call to stub, jump to runtime
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   247
// - in runtime: preserve all registers (rspecially objects, i.e., source and destination object)
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   248
// - in runtime: after initializing class, restore original code, reexecute instruction
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   249
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   250
int PatchingStub::_patch_info_offset = -NativeGeneralJump::instruction_size;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   251
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   252
void PatchingStub::align_patch_site(MacroAssembler* masm) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   253
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   254
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   255
void PatchingStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   256
  assert(false, "AArch64 should not use C1 runtime patching");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   257
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   258
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   259
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   260
void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   261
  __ bind(_entry);
35560
b3fa0a291684 8146891: AArch64 needs patch for 8032463
aph
parents: 34200
diff changeset
   262
  ce->store_parameter(_trap_request, 0);
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   263
  __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::deoptimize_id)));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   264
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   265
  DEBUG_ONLY(__ should_not_reach_here());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   266
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   267
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   268
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   269
void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   270
  address a;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   271
  if (_info->deoptimize_on_exception()) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   272
    // Deoptimize, do not throw the exception, because it is probably wrong to do it here.
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   273
    a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   274
  } else {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   275
    a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   276
  }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   277
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   278
  ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   279
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   280
  __ far_call(RuntimeAddress(a));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   281
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   282
  ce->verify_oop_map(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   283
  debug_only(__ should_not_reach_here());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   284
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   285
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   286
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   287
void SimpleExceptionStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   288
  assert(__ rsp_offset() == 0, "frame size should be fixed");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   289
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   290
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   291
  // pass the object in a scratch register because all other registers
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   292
  // must be preserved
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   293
  if (_obj->is_cpu_register()) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   294
    __ mov(rscratch1, _obj->as_register());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   295
  }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   296
  __ far_call(RuntimeAddress(Runtime1::entry_for(_stub)), NULL, rscratch2);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   297
  ce->add_call_info_here(_info);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   298
  debug_only(__ should_not_reach_here());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   299
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   300
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   301
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   302
void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   303
  //---------------slow case: call to native-----------------
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   304
  __ bind(_entry);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   305
  // Figure out where the args should go
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   306
  // This should really convert the IntrinsicID to the Method* and signature
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   307
  // but I don't know how to do that.
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   308
  //
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   309
  VMRegPair args[5];
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   310
  BasicType signature[5] = { T_OBJECT, T_INT, T_OBJECT, T_INT, T_INT};
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   311
  SharedRuntime::java_calling_convention(signature, args, 5, true);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   312
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   313
  // push parameters
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   314
  // (src, src_pos, dest, destPos, length)
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   315
  Register r[5];
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   316
  r[0] = src()->as_register();
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   317
  r[1] = src_pos()->as_register();
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   318
  r[2] = dst()->as_register();
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   319
  r[3] = dst_pos()->as_register();
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   320
  r[4] = length()->as_register();
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   321
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   322
  // next registers will get stored on the stack
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   323
  for (int i = 0; i < 5 ; i++ ) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   324
    VMReg r_1 = args[i].first();
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   325
    if (r_1->is_stack()) {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   326
      int st_off = r_1->reg2stack() * wordSize;
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   327
      __ str (r[i], Address(sp, st_off));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   328
    } else {
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   329
      assert(r[i] == args[i].first()->as_Register(), "Wrong register for arg ");
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   330
    }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   331
  }
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   332
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   333
  ce->align_call(lir_static_call);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   334
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   335
  ce->emit_static_call_stub();
32082
2a3323e25de1 8130309: Need to bailout cleanly if creation of stubs fails when codecache is out of space
thartmann
parents: 30764
diff changeset
   336
  if (ce->compilation()->bailed_out()) {
2a3323e25de1 8130309: Need to bailout cleanly if creation of stubs fails when codecache is out of space
thartmann
parents: 30764
diff changeset
   337
    return; // CodeCache is full
2a3323e25de1 8130309: Need to bailout cleanly if creation of stubs fails when codecache is out of space
thartmann
parents: 30764
diff changeset
   338
  }
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   339
  Address resolve(SharedRuntime::get_resolve_static_call_stub(),
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   340
                  relocInfo::static_call_type);
32082
2a3323e25de1 8130309: Need to bailout cleanly if creation of stubs fails when codecache is out of space
thartmann
parents: 30764
diff changeset
   341
  address call = __ trampoline_call(resolve);
2a3323e25de1 8130309: Need to bailout cleanly if creation of stubs fails when codecache is out of space
thartmann
parents: 30764
diff changeset
   342
  if (call == NULL) {
32086
7590882ae33a 8132875: AArch64: Fix error introduced into AArch64 CodeCache by commit for 8130309
adinn
parents: 32082
diff changeset
   343
    ce->bailout("trampoline stub overflow");
32082
2a3323e25de1 8130309: Need to bailout cleanly if creation of stubs fails when codecache is out of space
thartmann
parents: 30764
diff changeset
   344
    return;
2a3323e25de1 8130309: Need to bailout cleanly if creation of stubs fails when codecache is out of space
thartmann
parents: 30764
diff changeset
   345
  }
29184
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   346
  ce->add_call_info_here(info());
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   347
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   348
#ifndef PRODUCT
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   349
  __ lea(rscratch2, ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   350
  __ incrementw(Address(rscratch2));
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   351
#endif
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   352
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   353
  __ b(_continuation);
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   354
}
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   355
e234025cafb6 8068053: AARCH64: C1 and C2 compilers
aph
parents:
diff changeset
   356
#undef __