src/hotspot/cpu/sparc/interp_masm_sparc.hpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 46427 hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp@54713555867e
child 47881 0ce0ac68ace7
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
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: 37480
diff changeset
     2
 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5419
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5419
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5419
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    25
#ifndef CPU_SPARC_VM_INTERP_MASM_SPARC_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    26
#define CPU_SPARC_VM_INTERP_MASM_SPARC_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    27
14631
526804361522 8003250: SPARC: move MacroAssembler into separate file
twisti
parents: 13728
diff changeset
    28
#include "asm/macroAssembler.inline.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    29
#include "interpreter/invocationCounter.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    30
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
// This file specializes the assember with interpreter-specific macros
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 33070
diff changeset
    33
typedef ByteSize (*OffsetFunction)(uint);
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 33070
diff changeset
    34
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
REGISTER_DECLARATION(     Register, Otos_i , O0); // tos for ints, etc
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
REGISTER_DECLARATION(     Register, Otos_l , O0); // for longs
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
REGISTER_DECLARATION(     Register, Otos_l1, O0); // for 1st part of longs
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
REGISTER_DECLARATION(     Register, Otos_l2, O1); // for 2nd part of longs
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
REGISTER_DECLARATION(FloatRegister, Ftos_f , F0); // for floats
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
REGISTER_DECLARATION(FloatRegister, Ftos_d , F0); // for doubles
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
REGISTER_DECLARATION(FloatRegister, Ftos_d1, F0); // for 1st part of double
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
REGISTER_DECLARATION(FloatRegister, Ftos_d2, F1); // for 2nd part of double
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
#ifndef DONT_USE_REGISTER_DEFINES
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
#define Otos_i  O0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
#define Otos_l  O0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
#define Otos_l1 O0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
#define Otos_l2 O1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
#define Ftos_f  F0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
#define Ftos_d  F0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
#define Ftos_d1 F0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
#define Ftos_d2 F1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
#endif // DONT_USE_REGISTER_DEFINES
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
class InterpreterMacroAssembler: public MacroAssembler {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  // Interpreter specific version of call_VM_base
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    virtual void call_VM_leaf_base(
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    Register java_thread,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    address  entry_point,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    int      number_of_arguments
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  virtual void call_VM_base(
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
    Register        oop_result,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
    Register        java_thread,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    Register        last_java_sp,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
    address         entry_point,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
    int             number_of_arguments,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
    bool            check_exception=true
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  // base routine for all dispatches
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  void dispatch_base(TosState state, address* table);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  InterpreterMacroAssembler(CodeBuffer* c)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    : MacroAssembler(c) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
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: 37480
diff changeset
    80
 virtual void check_and_handle_popframe(Register scratch_reg);
345a46524a19 8172020: Internal Error (cpu/arm/vm/frame_arm.cpp:571): assert(obj == __null || Universe::heap()->is_in(obj)) failed: sanity check #
cjplummer
parents: 37480
diff changeset
    81
 virtual void check_and_handle_earlyret(Register scratch_reg);
345a46524a19 8172020: Internal Error (cpu/arm/vm/frame_arm.cpp:571): assert(obj == __null || Universe::heap()->is_in(obj)) failed: sanity check #
cjplummer
parents: 37480
diff changeset
    82
33070
54f3f085b165 8136525: Generate interpreter entries only once and avoid unnecessary jump to jump
mdoerr
parents: 31046
diff changeset
    83
  void jump_to_entry(address entry);
54f3f085b165 8136525: Generate interpreter entries only once and avoid unnecessary jump to jump
mdoerr
parents: 31046
diff changeset
    84
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  virtual void load_earlyret_value(TosState state);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  static const Address l_tmp ;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  static const Address d_tmp ;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  // helper routine for frame allocation/deallocation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  // compute the delta by which the caller's SP has to
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  // be adjusted to accomodate for the non-argument
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  // locals
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  void compute_extra_locals_size_in_bytes(Register args_size, Register locals_size, Register delta);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  // dispatch routines
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  void dispatch_prolog(TosState state, int step = 0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  void dispatch_epilog(TosState state, int step = 0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  void dispatch_only(TosState state);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  void dispatch_normal(TosState state);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  void dispatch_next(TosState state, int step = 0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  void dispatch_next_noverify_oop(TosState state, int step = 0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  void dispatch_via (TosState state, address* table);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 35214
diff changeset
   106
  void narrow(Register result);
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 35214
diff changeset
   107
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  // Removes the current activation (incl. unlocking of monitors).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  // Additionally this code is used for earlyReturn in which case we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  // want to skip throwing an exception and installing an exception.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  void remove_activation(TosState state,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
                         bool throw_monitor_exception = true,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
                         bool install_monitor_exception = true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  void dispatch_Lbyte_code(TosState state, address* table, int bcp_incr = 0, bool verify = true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  void super_call_VM(Register thread_cache,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
                     Register oop_result,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
                     Register last_java_sp,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
                     address entry_point,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
                     Register arg_1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
                     Register arg_2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
                     bool check_exception = true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
5046
27e801a857cb 6919934: JSR 292 needs to support x86 C1
twisti
parents: 4754
diff changeset
   128
  void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1, Register arg_2);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  // Generate a subtype check: branch to ok_is_subtype if sub_klass is
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  // a subtype of super_klass.  Blows registers tmp1, tmp2 and tmp3.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  void gen_subtype_check( Register sub_klass, Register super_klass, Register tmp1, Register tmp2, Register tmp3, Label &ok_is_subtype );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  // helpers for tossing exceptions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  void throw_if_not_1_icc( Condition ok_condition, Label& ok );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  void throw_if_not_1_xcc( Condition ok_condition, Label& ok );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  void throw_if_not_1_x  ( Condition ok_condition, Label& ok ); // chooses icc or xcc based on _LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  void throw_if_not_2( address throw_entry_point, Register Rscratch, Label& ok);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  void throw_if_not_icc( Condition ok_condition, address throw_entry_point, Register Rscratch );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  void throw_if_not_xcc( Condition ok_condition, address throw_entry_point, Register Rscratch );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  void throw_if_not_x  ( Condition ok_condition, address throw_entry_point, Register Rscratch );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  // helpers for expression stack
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  void pop_i(     Register r = Otos_i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  void pop_ptr(   Register r = Otos_i, Register scratch = O4);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  void pop_l(     Register r = Otos_l1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  // G4_scratch and Lscratch are used at call sites!!
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  void pop_f(FloatRegister f = Ftos_f,  Register scratch = G1_scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  void pop_d(FloatRegister f = Ftos_d1, Register scratch = G1_scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  void push_i(     Register r = Otos_i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  void push_ptr(   Register r = Otos_i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  void push_l(     Register r = Otos_l1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  void push_f(FloatRegister f = Ftos_f);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  void push_d(FloatRegister f = Ftos_d1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  void pop (TosState state);           // transition vtos -> state
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  void push(TosState state);           // transition state -> vtos
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  void empty_expression_stack();       // resets both Lesp and SP
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  void verify_sp(Register Rsp, Register Rtemp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  void verify_esp(Register Resp);      // verify that Lesp points to a word in the temp stack
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
#endif // ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  void if_cmp(Condition cc, bool ptr_compare);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  // Load values from bytecode stream:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  enum signedOrNot { Signed, Unsigned };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  enum setCCOrNot  { set_CC,  dont_set_CC };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  void get_2_byte_integer_at_bcp( int         bcp_offset,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
                                  Register    Rtmp,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
                                  Register    Rdst,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
                                  signedOrNot is_signed,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
                                  setCCOrNot  should_set_CC = dont_set_CC );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  void get_4_byte_integer_at_bcp( int        bcp_offset,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
                                  Register   Rtmp,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
                                  Register   Rdst,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
                                  setCCOrNot should_set_CC = dont_set_CC );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   189
  // Note: "get_cache_and_index" really means "get the index, use it to get the cache entry, and throw away the index".
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5419
diff changeset
   190
  void get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
10265
4c869854aebd 7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents: 7889
diff changeset
   191
  void get_cache_and_index_and_bytecode_at_bcp(Register cache, Register temp, Register bytecode, int byte_no, int bcp_offset, size_t index_size = sizeof(u2));
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5419
diff changeset
   192
  void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   193
  // Note: This one does not fetch the cache.  The first argument is a temp which may be killed.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   194
  void get_cache_index_at_bcp(Register temp, Register index, int bcp_offset, size_t index_size = sizeof(u2));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   196
  // load cpool->resolved_references(index);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   197
  void load_resolved_reference_at_index(Register result, Register index);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
46427
54713555867e 8171392: Move Klass pointers outside of ConstantPool entries so ConstantPool can be read-only
iklam
parents: 46294
diff changeset
   199
  // 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
   200
  void load_resolved_klass_at_offset(Register Rcpool, Register Roffset, Register Rklass);
54713555867e 8171392: Move Klass pointers outside of ConstantPool entries so ConstantPool can be read-only
iklam
parents: 46294
diff changeset
   201
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  // common code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  void field_offset_at(int n, Register tmp, Register dest, Register base);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  int  field_offset_at(Register object, address bcp, int offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  void fast_iaaccess(int n, address bcp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  void fast_iaputfield(address bcp, bool do_store_check );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  void index_check(Register array, Register index, int index_shift, Register tmp, Register res);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  void index_check_without_pop(Register array, Register index, int index_shift, Register tmp, Register res);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
12937
0032fb2caff6 7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents: 10265
diff changeset
   212
  void get_const(Register Rdst);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  void get_constant_pool(Register Rdst);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  void get_constant_pool_cache(Register Rdst);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  void get_cpool_and_tags(Register Rcpool, Register Rtags);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  void is_a(Label& L);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  // Load compiled (i2c) or interpreter entry and call from interpreted
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  void call_from_interpreter(Register target, Register scratch, Register Rret);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  // --------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  void unlock_if_synchronized_method(TosState state, bool throw_monitor_exception = true, bool install_monitor_exception = true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  void add_monitor_to_stack( bool stack_is_empty,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
                             Register Rtemp,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
                             Register Rtemp2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  // Load/store aligned in _LP64 but unaligned otherwise
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  // These only apply to the Interpreter expression stack and locals!
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
  void  load_unaligned_double(Register r1, int offset,  FloatRegister d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  void store_unaligned_double(FloatRegister d, Register r1, int offset );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  // Load/store aligned in _LP64 but unaligned otherwise
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  void  load_unaligned_long(Register r1, int offset,  Register d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  void store_unaligned_long(Register d, Register r1, int offset );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  void access_local_int( Register index, Register dst );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  void access_local_ptr( Register index, Register dst );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
  void access_local_returnAddress( Register index, Register dst );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  void access_local_long( Register index, Register dst );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  void access_local_float( Register index, FloatRegister dst );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  void access_local_double( Register index, FloatRegister dst );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  void check_for_regarea_stomp( Register Rindex, int offset, Register Rlimit, Register Rscratch, Register Rscratch1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
#endif // ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  void store_local_int( Register index, Register src );
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 5416
diff changeset
   248
  void store_local_ptr( Register index, Register src );
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 5416
diff changeset
   249
  void store_local_ptr( int n, Register src );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
  void store_local_long( Register index, Register src );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
  void store_local_float( Register index, FloatRegister src );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  void store_local_double( Register index, FloatRegister src );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 5416
diff changeset
   254
  // Helpers for swap and dup
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 5416
diff changeset
   255
  void load_ptr(int n, Register val);
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 5416
diff changeset
   256
  void store_ptr(int n, Register val);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 5416
diff changeset
   258
  // Helper for getting receiver in register.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  void load_receiver(Register param_count, Register recv);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
  static int top_most_monitor_byte_offset(); // offset in bytes to top of monitor block
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
  Address top_most_monitor();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
  void compute_stack_base( Register Rdest );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
17000
11bf92e571a2 8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents: 14631
diff changeset
   265
  void get_method_counters(Register method, Register Rcounters, Label& skip);
11bf92e571a2 8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents: 14631
diff changeset
   266
  void increment_invocation_counter( Register Rcounters, Register Rtmp, Register Rtmp2 );
11bf92e571a2 8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents: 14631
diff changeset
   267
  void increment_backedge_counter( Register Rcounters, Register Rtmp, Register Rtmp2 );
28650
772aaab2582f 8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents: 22504
diff changeset
   268
  void test_backedge_count_for_osr(Register backedge_count, Register method_counters, Register branch_bcp, Register Rtmp );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
  // Object locking
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
  void lock_object  (Register lock_reg, Register obj_reg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
  void unlock_object(Register lock_reg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
  // Interpreter profiling operations
7889
02144432d0e1 4930919: race condition in MDO creation at back branch locations
iveresov
parents: 7397
diff changeset
   275
  void set_method_data_pointer();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
  void set_method_data_pointer_for_bcp();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
  void test_method_data_pointer(Label& zero_continue);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
  void verify_method_data_pointer();
28650
772aaab2582f 8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents: 22504
diff changeset
   279
  void test_invocation_counter_for_mdp(Register invocation_count, Register method_counters, Register Rtmp, Label &profile_continue);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
  void set_mdp_data_at(int constant, Register value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
  void increment_mdp_data_at(Address counter, Register bumped_count,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
                             bool decrement = false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  void increment_mdp_data_at(int constant, Register bumped_count,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
                             bool decrement = false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  void increment_mdp_data_at(Register reg, int constant,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
                             Register bumped_count, Register scratch2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
                             bool decrement = false);
6453
970dc585ab63 6953144: Tiered compilation
iveresov
parents: 5702
diff changeset
   289
  void increment_mask_and_jump(Address counter_addr,
28650
772aaab2582f 8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents: 22504
diff changeset
   290
                               int increment, Address mask_addr,
6453
970dc585ab63 6953144: Tiered compilation
iveresov
parents: 5702
diff changeset
   291
                               Register scratch1, Register scratch2,
970dc585ab63 6953144: Tiered compilation
iveresov
parents: 5702
diff changeset
   292
                               Condition cond, Label *where);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
  void set_mdp_flag_at(int flag_constant, Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  void test_mdp_data_at(int offset, Register value, Label& not_equal_continue,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
                        Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
4754
8aef16f24e16 6614597: Performance variability in jvm2008 xml.validation
kvn
parents: 1
diff changeset
   297
  void record_klass_in_profile(Register receiver, Register scratch, bool is_virtual_call);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  void record_klass_in_profile_helper(Register receiver, Register scratch,
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 33070
diff changeset
   299
                                      Label& done, bool is_virtual_call);
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 33070
diff changeset
   300
  void record_item_in_profile_helper(Register item,
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 33070
diff changeset
   301
                                     Register scratch, int start_row, Label& done, int total_rows,
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 33070
diff changeset
   302
                                     OffsetFunction item_offset_fn, OffsetFunction item_count_offset_fn,
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 33070
diff changeset
   303
                                     int non_profiled_offset);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  void update_mdp_by_offset(int offset_of_disp, Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
  void update_mdp_by_offset(Register reg, int offset_of_disp,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
                            Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  void update_mdp_by_constant(int constant);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
  void update_mdp_for_ret(TosState state, Register return_bci);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
  void profile_taken_branch(Register scratch, Register bumped_count);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
  void profile_not_taken_branch(Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
  void profile_call(Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
  void profile_final_call(Register scratch);
5416
5f6377fcfd3e 6829193: JSR 292 needs to support SPARC
twisti
parents: 5046
diff changeset
   315
  void profile_virtual_call(Register receiver, Register scratch, bool receiver_can_be_null = false);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 33070
diff changeset
   316
  void profile_called_method(Register method, Register scratch) NOT_JVMCI_RETURN;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
  void profile_ret(TosState state, Register return_bci, Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  void profile_null_seen(Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  void profile_typecheck(Register klass, Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
  void profile_typecheck_failed(Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
  void profile_switch_default(Register scratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
  void profile_switch_case(Register index,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
                           Register scratch1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
                           Register scratch2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
                           Register scratch3);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
22504
b1837533ba65 8026253: New type profiling points: sparc support
roland
parents: 17000
diff changeset
   327
  void profile_obj_type(Register obj, const Address& mdo_addr, Register tmp);
b1837533ba65 8026253: New type profiling points: sparc support
roland
parents: 17000
diff changeset
   328
  void profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual);
b1837533ba65 8026253: New type profiling points: sparc support
roland
parents: 17000
diff changeset
   329
  void profile_return_type(Register ret, Register tmp1, Register tmp2);
b1837533ba65 8026253: New type profiling points: sparc support
roland
parents: 17000
diff changeset
   330
  void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
b1837533ba65 8026253: New type profiling points: sparc support
roland
parents: 17000
diff changeset
   331
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
  // Debugging
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
  void interp_verify_oop(Register reg, TosState state, const char * file, int line);    // only if +VerifyOops && state == atos
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
  void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
  void verify_FPU(int stack_depth, TosState state = ftos); // only if +VerifyFPU  && (state == ftos || state == dtos)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
  // support for JVMTI/Dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
  typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
  void notify_method_entry();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
  void notify_method_exit(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
    bool save_result, TosState state, NotifyMethodExitMode mode);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
  void save_return_value(TosState state, bool is_native_call);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  void restore_return_value(TosState state, bool is_native_call);
6453
970dc585ab63 6953144: Tiered compilation
iveresov
parents: 5702
diff changeset
   345
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
   347
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
   348
#endif // CPU_SPARC_VM_INTERP_MASM_SPARC_HPP