src/hotspot/cpu/s390/interp_masm_s390.hpp
author coleenp
Tue, 03 Oct 2017 16:42:04 -0400
changeset 47580 96392e113a0a
parent 47216 71c04702a3d5
child 47762 9ccaa4e79030
permissions -rw-r--r--
8186777: Make Klass::_java_mirror an OopHandle Summary: Add indirection for fetching mirror so that GC doesn't have to follow CLD::_klasses Reviewed-by: hseigel, thartmann, eosterlund, stefank Contributed-by: coleen.phillimore@oracle.com, rickard.backman@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     1
/*
46294
345a46524a19 8172020: Internal Error (cpu/arm/vm/frame_arm.cpp:571): assert(obj == __null || Universe::heap()->is_in(obj)) failed: sanity check #
cjplummer
parents: 42065
diff changeset
     2
 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
46427
54713555867e 8171392: Move Klass pointers outside of ConstantPool entries so ConstantPool can be read-only
iklam
parents: 46294
diff changeset
     3
 * Copyright (c) 2016, 2017 SAP SE. All rights reserved.
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     5
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     8
 * published by the Free Software Foundation.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     9
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    14
 * accompanied this code).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    15
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    19
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    22
 * questions.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    23
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    24
 */
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    25
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    26
#ifndef CPU_S390_VM_INTERP_MASM_ZARCH_64_64_HPP
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    27
#define CPU_S390_VM_INTERP_MASM_ZARCH_64_64_HPP
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    28
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    29
#include "asm/macroAssembler.hpp"
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    30
#include "interpreter/invocationCounter.hpp"
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    31
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    32
// This file specializes the assember with interpreter-specific macros.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    33
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    34
class InterpreterMacroAssembler: public MacroAssembler {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    35
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    36
 protected:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    37
  // Interpreter specific version of call_VM_base().
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    38
  virtual void call_VM_leaf_base(address entry_point);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    39
  virtual void call_VM_leaf_base(address entry_point, bool allow_relocation);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    40
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    41
  virtual void call_VM_base(Register oop_result,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    42
                            Register last_java_sp,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    43
                            address  entry_point,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    44
                            bool check_exceptions);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    45
  virtual void call_VM_base(Register oop_result,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    46
                            Register last_java_sp,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    47
                            address  entry_point,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    48
                            bool allow_relocation,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    49
                            bool check_exceptions);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    50
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    51
  // Base routine for all dispatches.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    52
  void dispatch_base(TosState state, address* table);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    53
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    54
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    55
  InterpreterMacroAssembler(CodeBuffer* c)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    56
    : MacroAssembler(c) {}
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    57
46294
345a46524a19 8172020: Internal Error (cpu/arm/vm/frame_arm.cpp:571): assert(obj == __null || Universe::heap()->is_in(obj)) failed: sanity check #
cjplummer
parents: 42065
diff changeset
    58
  virtual void check_and_handle_popframe(Register java_thread);
345a46524a19 8172020: Internal Error (cpu/arm/vm/frame_arm.cpp:571): assert(obj == __null || Universe::heap()->is_in(obj)) failed: sanity check #
cjplummer
parents: 42065
diff changeset
    59
  virtual void check_and_handle_earlyret(Register java_thread);
345a46524a19 8172020: Internal Error (cpu/arm/vm/frame_arm.cpp:571): assert(obj == __null || Universe::heap()->is_in(obj)) failed: sanity check #
cjplummer
parents: 42065
diff changeset
    60
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    61
  void jump_to_entry(address entry, Register Rscratch);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    62
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    63
  virtual void load_earlyret_value(TosState state);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    64
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    65
  static const Address l_tmp;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    66
  static const Address d_tmp;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    67
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    68
  // Handy address generation macros.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    69
#define thread_(field_name) Address(Z_thread, JavaThread::field_name ## _offset())
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    70
#define method_(field_name) Address(Z_method, Method::field_name ## _offset())
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    71
#define method2_(Rmethod, field_name) Address(Rmethod, Method::field_name ## _offset())
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    72
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    73
  // Helper routine for frame allocation/deallocation.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    74
  // Compute the delta by which the caller's SP has to
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    75
  // be adjusted to accomodate for the non-argument locals.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    76
  void compute_extra_locals_size_in_bytes(Register args_size, Register locals_size, Register delta);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    77
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    78
  // dispatch routines
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    79
  void dispatch_prolog(TosState state, int step = 0);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    80
  void dispatch_epilog(TosState state, int step = 0);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    81
  void dispatch_only(TosState state);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    82
  // Dispatch normal table via Z_bytecode (assume Z_bytecode is loaded already).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    83
  void dispatch_only_normal(TosState state);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    84
  void dispatch_normal(TosState state);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    85
  void dispatch_next(TosState state, int step = 0);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    86
  void dispatch_next_noverify_oop(TosState state, int step = 0);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    87
  void dispatch_via(TosState state, address* table);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    88
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    89
  // Jump to an invoked target.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    90
  void prepare_to_jump_from_interpreted(Register method);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    91
  void jump_from_interpreted(Register method, Register temp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    92
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    93
  // Removes the current activation (incl. unlocking of monitors).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    94
  // Additionally this code is used for earlyReturn in which case we
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    95
  // want to skip throwing an exception and installing an exception.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    96
  void remove_activation(TosState state,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    97
                         Register return_pc,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    98
                         bool throw_monitor_exception = true,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    99
                         bool install_monitor_exception = true,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   100
                         bool notify_jvmti = true);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   101
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   102
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   103
  // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   104
  void super_call_VM_leaf(address entry_point, Register arg_1, Register arg_2);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   105
  void super_call_VM(Register thread_cache, Register oop_result, Register last_java_sp,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   106
                     address entry_point, Register arg_1, Register arg_2, bool check_exception = true);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   107
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   108
  // Generate a subtype check: branch to ok_is_subtype if sub_klass is
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   109
  // a subtype of super_klass. Blows registers tmp1, tmp2 and tmp3.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   110
  void gen_subtype_check(Register sub_klass, Register super_klass, Register tmp1, Register tmp2, Label &ok_is_subtype);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   111
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   112
  void get_cache_and_index_at_bcp(Register cache, Register cpe_offset, int bcp_offset, size_t index_size = sizeof(u2));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   113
  void get_cache_and_index_and_bytecode_at_bcp(Register cache, Register cpe_offset, Register bytecode,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   114
                                               int byte_no, int bcp_offset, size_t index_size = sizeof(u2));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   115
  void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   116
  void get_cache_index_at_bcp(Register index, int bcp_offset, size_t index_size = sizeof(u2));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   117
  void load_resolved_reference_at_index(Register result, Register index);
46427
54713555867e 8171392: Move Klass pointers outside of ConstantPool entries so ConstantPool can be read-only
iklam
parents: 46294
diff changeset
   118
  // load cpool->resolved_klass_at(index)
54713555867e 8171392: Move Klass pointers outside of ConstantPool entries so ConstantPool can be read-only
iklam
parents: 46294
diff changeset
   119
  void load_resolved_klass_at_offset(Register cpool, Register offset, Register iklass);
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   120
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   121
  // Pop topmost element from stack. It just disappears. Useful if
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   122
  // consumed previously by access via stackTop().
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   123
  void popx(int len);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   124
  void pop_i()   { popx(1); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   125
  void pop_ptr() { popx(1); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   126
  void pop_l()   { popx(2); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   127
  void pop_f()   { popx(1); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   128
  void pop_d()   { popx(2); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   129
  // Get Address object of stack top. No checks. No pop.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   130
  // Purpose: provide address of stack operand to exploit reg-mem operations.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   131
  // Avoid RISC-like mem2reg - reg-reg-op sequence.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   132
  Address stackTop();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   133
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   134
  // Helpers for expression stack.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   135
  void pop_i(     Register r);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   136
  void pop_ptr(   Register r);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   137
  void pop_l(     Register r);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   138
  void pop_f(FloatRegister f);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   139
  void pop_d(FloatRegister f);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   140
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   141
  void push_i(     Register r = Z_tos);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   142
  void push_ptr(   Register r = Z_tos);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   143
  void push_l(     Register r = Z_tos);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   144
  void push_f(FloatRegister f = Z_ftos);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   145
  void push_d(FloatRegister f = Z_ftos);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   146
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   147
  // Helpers for swap and dup.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   148
  void load_ptr(int n, Register val);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   149
  void store_ptr(int n, Register val);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   150
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   151
  void pop (TosState state);           // transition vtos -> state
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   152
  void push(TosState state);           // transition state -> vtos
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   153
  void empty_expression_stack(void);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   154
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   155
#ifdef ASSERT
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   156
  void verify_sp(Register Rsp, Register Rtemp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   157
  void verify_esp(Register Resp, Register Rtemp); // Verify that Resp points to a word in the operand stack.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   158
#endif // ASSERT
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   159
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   160
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   161
  void if_cmp(Condition cc, bool ptr_compare);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   162
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   163
  // Accessors to the template interpreter state.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   164
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   165
  void asm_assert_ijava_state_magic(Register tmp) PRODUCT_RETURN;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   166
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   167
  void save_bcp();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   168
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   169
  void restore_bcp();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   170
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   171
  void save_esp();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   172
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   173
  void restore_esp();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   174
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   175
  void get_monitors(Register reg);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   176
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   177
  void save_monitors(Register reg);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   178
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   179
  void get_mdp(Register mdp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   180
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   181
  void save_mdp(Register mdp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   182
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   183
  // Values that are only read (besides initialization).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   184
  void restore_locals();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   185
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   186
  void get_method(Register reg);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   187
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   188
  // Load values from bytecode stream:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   189
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   190
  enum signedOrNot { Signed, Unsigned };
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   191
  enum setCCOrNot  { set_CC,  dont_set_CC };
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   192
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   193
  void get_2_byte_integer_at_bcp(Register    Rdst,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   194
                                 int         bcp_offset,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   195
                                 signedOrNot is_signed  );
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   196
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   197
  void get_4_byte_integer_at_bcp(Register   Rdst,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   198
                                 int        bcp_offset,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   199
                                 setCCOrNot should_set_CC = dont_set_CC);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   200
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   201
  // common code
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   202
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   203
  void field_offset_at(int n, Register tmp, Register dest, Register base);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   204
  int  field_offset_at(Register object, address bcp, int offset);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   205
  void fast_iaaccess(int n, address bcp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   206
  void fast_iaputfield(address bcp, bool do_store_check);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   207
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   208
  void index_check(Register array, Register index, int index_shift, Register tmp, Register res);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   209
  void index_check_without_pop(Register array, Register index, int index_shift, Register tmp, Register res);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   210
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   211
  void get_constant_pool(Register Rdst);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   212
  void get_constant_pool_cache(Register Rdst);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   213
  void get_cpool_and_tags(Register Rcpool, Register Rtags);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   214
  void is_a(Label& L);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   215
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   216
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   217
  // --------------------------------------------------
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   218
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   219
  void unlock_if_synchronized_method(TosState state, bool throw_monitor_exception = true, bool install_monitor_exception = true);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   220
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   221
  void add_monitor_to_stack(bool stack_is_empty,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   222
                            Register Rtemp,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   223
                            Register Rtemp2,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   224
                            Register Rtemp3);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   225
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   226
  void access_local_int(Register index, Register dst);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   227
  void access_local_ptr(Register index, Register dst);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   228
  void access_local_long(Register index, Register dst);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   229
  void access_local_float(Register index, FloatRegister dst);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   230
  void access_local_double(Register index, FloatRegister dst);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   231
#ifdef ASSERT
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   232
  void check_for_regarea_stomp(Register Rindex, int offset, Register Rlimit, Register Rscratch, Register Rscratch1);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   233
#endif // ASSERT
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   234
  void store_local_int(Register index, Register src);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   235
  void store_local_ptr(Register index, Register src);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   236
  void store_local_long(Register index, Register src);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   237
  void store_local_float(Register index, FloatRegister src);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   238
  void store_local_double(Register index, FloatRegister src);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   239
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   240
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   241
  Address first_local_in_stack();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   242
  static int top_most_monitor_byte_offset(); // Offset in bytes to top of monitor block.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   243
  Address top_most_monitor();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   244
  void compute_stack_base(Register Rdest);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   245
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   246
  enum LoadOrStore { load, store };
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   247
  void static_iload_or_store(int which_local, LoadOrStore direction, Register Rtmp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   248
  void static_aload_or_store(int which_local, LoadOrStore direction, Register Rtmp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   249
  void static_dload_or_store(int which_local, LoadOrStore direction);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   250
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   251
  void static_iinc(          int which_local, jint increment, Register Rtmp, Register Rtmp2);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   252
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   253
  void get_method_counters(Register Rmethod, Register Rcounters, Label& skip);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   254
  void increment_invocation_counter(Register Rcounters, Register RctrSum);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   255
  void increment_backedge_counter(Register Rcounters, Register RctrSum);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   256
  void test_backedge_count_for_osr(Register backedge_count, Register branch_bcp, Register Rtmp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   257
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   258
  void record_static_call_in_profile(Register Rentry, Register Rtmp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   259
  void record_receiver_call_in_profile(Register Rklass, Register Rentry, Register Rtmp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   260
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   261
  // Object locking
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   262
  void lock_object  (Register lock_reg, Register obj_reg);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   263
  void unlock_object(Register lock_reg, Register obj_reg=noreg);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   264
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   265
  // Interpreter profiling operations
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   266
  void set_method_data_pointer_for_bcp();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   267
  void test_method_data_pointer(Register mdp, Label& zero_continue);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   268
  void verify_method_data_pointer();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   269
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   270
  void set_mdp_data_at(Register mdp_in, int constant, Register value);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   271
  void increment_mdp_data_at(Register mdp_in, int constant,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   272
                             Register tmp = Z_R1_scratch, bool decrement = false);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   273
  void increment_mask_and_jump(Address counter_addr,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   274
                               int increment, Address mask,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   275
                               Register scratch, bool preloaded,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   276
                               branch_condition cond, Label* where);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   277
  void set_mdp_flag_at(Register mdp_in, int flag_constant);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   278
  void test_mdp_data_at(Register mdp_in, int offset, Register value,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   279
                        Register test_value_out,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   280
                        Label& not_equal_continue);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   281
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   282
  void record_klass_in_profile(Register receiver, Register mdp,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   283
                               Register reg2, bool is_virtual_call);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   284
  void record_klass_in_profile_helper(Register receiver, Register mdp,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   285
                                      Register reg2, int start_row,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   286
                                      Label& done, bool is_virtual_call);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   287
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   288
  void update_mdp_by_offset(Register mdp_in, int offset_of_offset);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   289
  void update_mdp_by_offset(Register mdp_in, Register dataidx, int offset_of_disp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   290
  void update_mdp_by_constant(Register mdp_in, int constant);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   291
  void update_mdp_for_ret(Register return_bci);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   292
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   293
  void profile_taken_branch(Register mdp, Register bumped_count);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   294
  void profile_not_taken_branch(Register mdp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   295
  void profile_call(Register mdp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   296
  void profile_final_call(Register mdp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   297
  void profile_virtual_call(Register receiver, Register mdp,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   298
                            Register scratch2,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   299
                            bool receiver_can_be_null = false);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   300
  void profile_ret(Register return_bci, Register mdp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   301
  void profile_null_seen(Register mdp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   302
  void profile_typecheck(Register mdp, Register klass, Register scratch);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   303
  void profile_typecheck_failed(Register mdp, Register tmp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   304
  void profile_switch_default(Register mdp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   305
  void profile_switch_case(Register index_in_scratch, Register mdp,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   306
                           Register scratch1, Register scratch2);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   307
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   308
  void profile_obj_type(Register obj, Address mdo_addr, Register klass, bool cmp_done = false);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   309
  void profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   310
  void profile_return_type(Register mdp, Register ret, Register tmp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   311
  void profile_parameters_type(Register mdp, Register tmp1, Register tmp2);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   312
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   313
  // Debugging
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   314
  void verify_oop(Register reg, TosState state = atos);    // Only if +VerifyOops && state == atos.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   315
  void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   316
  void verify_FPU(int stack_depth, TosState state = ftos);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   317
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   318
  // JVMTI helpers
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   319
  void skip_if_jvmti_mode(Label &Lskip, Register Rscratch = Z_R0);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   320
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   321
  // support for JVMTI/Dtrace
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   322
  typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   323
  void notify_method_entry();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   324
  void notify_method_exit(bool native_method, TosState state, NotifyMethodExitMode mode);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   325
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   326
  // Pop the topmost TOP_IJAVA_FRAME and set it's sender_sp as new Z_SP.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   327
  // The return pc is loaded into the Register return_pc.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   328
  void pop_interpreter_frame(Register return_pc, Register tmp1, Register tmp2);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   329
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   330
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   331
#endif // CPU_S390_VM_INTERP_MASM_ZARCH_64_64_HPP