src/hotspot/share/interpreter/templateTable.hpp
author coleenp
Thu, 10 Jan 2019 15:13:51 -0500
changeset 53244 9807daeb47c4
parent 52058 3e5687d7d6b5
permissions -rw-r--r--
8216167: Update include guards to reflect correct directories Summary: Use script and some manual fixup to fix directores names in include guards. Reviewed-by: lfoltan, eosterlund, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52058
diff changeset
     2
 * Copyright (c) 1997, 2019, 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: 3261
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
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: 3261
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
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52058
diff changeset
    25
#ifndef SHARE_INTERPRETER_TEMPLATETABLE_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52058
diff changeset
    26
#define SHARE_INTERPRETER_TEMPLATETABLE_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    28
#include "interpreter/bytecodes.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    29
#include "memory/allocation.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    30
#include "runtime/frame.hpp"
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 35214
diff changeset
    31
#include "utilities/macros.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    32
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
#ifndef CC_INTERP
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// All the necessary definitions used for (bytecode) template generation. Instead of
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
// spreading the implementation functionality for each bytecode in the interpreter
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// and the snippet generator, a template is assigned to each bytecode which can be
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// used to generate the bytecode's implementation if needed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
52058
3e5687d7d6b5 8211792: Fix misplaced BarrierSet forward declarations
rkennke
parents: 49364
diff changeset
    39
class BarrierSet;
25715
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 23221
diff changeset
    40
class InterpreterMacroAssembler;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// A Template describes the properties of a code template for a given bytecode
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
// and provides a generator to generate the code template.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
49364
601146c66cad 8173070: Remove ValueObj class for allocation subclassing for runtime code
coleenp
parents: 48826
diff changeset
    45
class Template {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  enum Flags {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
    uses_bcp_bit,                                // set if template needs the bcp pointing to bytecode
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    does_dispatch_bit,                           // set if template dispatches on its own
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    calls_vm_bit,                                // set if template calls the vm
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
    wide_bit                                     // set if template belongs to a wide instruction
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  typedef void (*generator)(int arg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  int       _flags;                              // describes interpreter template properties (bcp unknown)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  TosState  _tos_in;                             // tos cache state before template execution
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  TosState  _tos_out;                            // tos cache state after  template execution
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  generator _gen;                                // template code generator
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  int       _arg;                                // argument for template code generator
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  void      initialize(int flags, TosState tos_in, TosState tos_out, generator gen, int arg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  friend class TemplateTable;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  Bytecodes::Code bytecode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  bool      is_valid() const                     { return _gen != NULL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  bool      uses_bcp() const                     { return (_flags & (1 << uses_bcp_bit     )) != 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  bool      does_dispatch() const                { return (_flags & (1 << does_dispatch_bit)) != 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  bool      calls_vm() const                     { return (_flags & (1 << calls_vm_bit     )) != 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  bool      is_wide() const                      { return (_flags & (1 << wide_bit         )) != 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  TosState  tos_in() const                       { return _tos_in; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  TosState  tos_out() const                      { return _tos_out; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  void      generate(InterpreterMacroAssembler* masm);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
// The TemplateTable defines all Templates and provides accessor functions
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
// to get the template for a given bytecode.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
class TemplateTable: AllStatic {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  enum Operation { add, sub, mul, div, rem, _and, _or, _xor, shl, shr, ushr };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  enum Condition { equal, not_equal, less, less_equal, greater, greater_equal };
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13391
diff changeset
    86
  enum CacheByte { f1_byte = 1, f2_byte = 2 };  // byte_no codes
30117
cce2cdac56dc 8074345: Enable RewriteBytecodes when VM runs with CDS
minqi
parents: 29474
diff changeset
    87
  enum RewriteControl { may_rewrite, may_not_rewrite };  // control for fast code under CDS
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  static bool            _is_initialized;        // true if TemplateTable has been initialized
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  static Template        _template_table     [Bytecodes::number_of_codes];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  static Template        _template_table_wide[Bytecodes::number_of_codes];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  static Template*       _desc;                  // the current template to be generated
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  static Bytecodes::Code bytecode()              { return _desc->bytecode(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
    97
  static BarrierSet*     _bs;                    // Cache the barrier set.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  //%note templates_1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  static InterpreterMacroAssembler* _masm;       // the assembler used when generating templates
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  // special registers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  static inline Address at_bcp(int offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  // helpers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  static void unimplemented_bc();
10265
4c869854aebd 7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents: 8921
diff changeset
   109
  static void patch_bytecode(Bytecodes::Code bc, Register bc_reg,
4c869854aebd 7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents: 8921
diff changeset
   110
                             Register temp_reg, bool load_bc_into_bc_reg = true, int byte_no = -1);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  // C calls
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  static void call_VM(Register oop_result, address entry_point);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  static void call_VM(Register oop_result, address entry_point, Register arg_1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  static void call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  static void call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  // these overloadings are not presently used on SPARC:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  static void call_VM(Register oop_result, Register last_java_sp, address entry_point);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  static void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  static void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, Register arg_2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  static void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, Register arg_2, Register arg_3);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  // bytecodes
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  static void nop();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  static void aconst_null();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  static void iconst(int value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  static void lconst(int value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  static void fconst(int value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  static void dconst(int value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  static void bipush();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  static void sipush();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  static void ldc(bool wide);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  static void ldc2_w();
5882
6b2aecc4f7d8 6939203: JSR 292 needs method handle constants
jrose
parents: 5702
diff changeset
   137
  static void fast_aldc(bool wide);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  static void locals_index(Register reg, int offset = 1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  static void iload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  static void fast_iload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  static void fast_iload2();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  static void fast_icaload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  static void lload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  static void fload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  static void dload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  static void aload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  static void locals_index_wide(Register reg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  static void wide_iload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  static void wide_lload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  static void wide_fload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  static void wide_dload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  static void wide_aload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  static void iaload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  static void laload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  static void faload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  static void daload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  static void aaload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  static void baload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  static void caload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  static void saload();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  static void iload(int n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  static void lload(int n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  static void fload(int n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  static void dload(int n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  static void aload(int n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  static void aload_0();
30117
cce2cdac56dc 8074345: Enable RewriteBytecodes when VM runs with CDS
minqi
parents: 29474
diff changeset
   171
  static void nofast_aload_0();
cce2cdac56dc 8074345: Enable RewriteBytecodes when VM runs with CDS
minqi
parents: 29474
diff changeset
   172
  static void nofast_iload();
cce2cdac56dc 8074345: Enable RewriteBytecodes when VM runs with CDS
minqi
parents: 29474
diff changeset
   173
  static void iload_internal(RewriteControl rc = may_rewrite);
cce2cdac56dc 8074345: Enable RewriteBytecodes when VM runs with CDS
minqi
parents: 29474
diff changeset
   174
  static void aload_0_internal(RewriteControl rc = may_rewrite);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  static void istore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  static void lstore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  static void fstore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  static void dstore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  static void astore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  static void wide_istore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  static void wide_lstore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  static void wide_fstore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  static void wide_dstore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  static void wide_astore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  static void iastore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  static void lastore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  static void fastore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  static void dastore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  static void aastore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  static void bastore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  static void castore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  static void sastore();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  static void istore(int n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
  static void lstore(int n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  static void fstore(int n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  static void dstore(int n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  static void astore(int n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
  static void pop();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  static void pop2();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  static void dup();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  static void dup_x1();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  static void dup_x2();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  static void dup2();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  static void dup2_x1();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  static void dup2_x2();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  static void swap();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  static void iop2(Operation op);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  static void lop2(Operation op);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  static void fop2(Operation op);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  static void dop2(Operation op);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  static void idiv();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  static void irem();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  static void lmul();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  static void ldiv();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  static void lrem();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
  static void lshl();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  static void lshr();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  static void lushr();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  static void ineg();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  static void lneg();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  static void fneg();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
  static void dneg();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  static void iinc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  static void wide_iinc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  static void convert();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  static void lcmp();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  static void float_cmp (bool is_float, int unordered_result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  static void float_cmp (int unordered_result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
  static void double_cmp(int unordered_result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  static void count_calls(Register method, Register temp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  static void branch(bool is_jsr, bool is_wide);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  static void if_0cmp   (Condition cc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  static void if_icmp   (Condition cc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  static void if_nullcmp(Condition cc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  static void if_acmp   (Condition cc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
  static void _goto();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
  static void jsr();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
  static void ret();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  static void wide_ret();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
  static void goto_w();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
  static void jsr_w();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  static void tableswitch();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  static void lookupswitch();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  static void fast_linearswitch();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  static void fast_binaryswitch();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
  static void _return(TosState state);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 3261
diff changeset
   264
  static void resolve_cache_and_index(int byte_no,       // one of 1,2,11
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 3261
diff changeset
   265
                                      Register cache,    // output for CP cache
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 3261
diff changeset
   266
                                      Register index,    // output for CP index
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 3261
diff changeset
   267
                                      size_t index_size); // one of 1,2,4
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
  static void load_invoke_cp_cache_entry(int byte_no,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
                                         Register method,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
                                         Register itable_index,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
                                         Register flags,
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 3261
diff changeset
   272
                                         bool is_invokevirtual,
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 3261
diff changeset
   273
                                         bool is_virtual_final,
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 3261
diff changeset
   274
                                         bool is_invokedynamic);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
  static void load_field_cp_cache_entry(Register obj,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
                                        Register cache,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
                                        Register index,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
                                        Register offset,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
                                        Register flags,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
                                        bool is_static);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
  static void invokevirtual(int byte_no);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
  static void invokespecial(int byte_no);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
  static void invokestatic(int byte_no);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  static void invokeinterface(int byte_no);
2570
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 1374
diff changeset
   285
  static void invokedynamic(int byte_no);
13391
30245956af37 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 10265
diff changeset
   286
  static void invokehandle(int byte_no);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  static void fast_invokevfinal(int byte_no);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
30117
cce2cdac56dc 8074345: Enable RewriteBytecodes when VM runs with CDS
minqi
parents: 29474
diff changeset
   289
  static void getfield_or_static(int byte_no, bool is_static, RewriteControl rc = may_rewrite);
cce2cdac56dc 8074345: Enable RewriteBytecodes when VM runs with CDS
minqi
parents: 29474
diff changeset
   290
  static void putfield_or_static(int byte_no, bool is_static, RewriteControl rc = may_rewrite);
cce2cdac56dc 8074345: Enable RewriteBytecodes when VM runs with CDS
minqi
parents: 29474
diff changeset
   291
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  static void getfield(int byte_no);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
  static void putfield(int byte_no);
30117
cce2cdac56dc 8074345: Enable RewriteBytecodes when VM runs with CDS
minqi
parents: 29474
diff changeset
   294
  static void nofast_getfield(int byte_no);
cce2cdac56dc 8074345: Enable RewriteBytecodes when VM runs with CDS
minqi
parents: 29474
diff changeset
   295
  static void nofast_putfield(int byte_no);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
  static void getstatic(int byte_no);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  static void putstatic(int byte_no);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  static void pop_and_check_object(Register obj);
48826
c4d9d1b08e2e 8186209: Tool support for ConstantDynamic
psandoz
parents: 47216
diff changeset
   299
  static void condy_helper(Label& Done);  // shared by ldc instances
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  static void _new();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
  static void newarray();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  static void anewarray();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
  static void arraylength();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  static void checkcast();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
  static void instanceof();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  static void athrow();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
  static void monitorenter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
  static void monitorexit();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
  static void wide();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
  static void multianewarray();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
  static void fast_xaccess(TosState state);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
  static void fast_accessfield(TosState state);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  static void fast_storefield(TosState state);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
  static void _breakpoint();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
  static void shouldnotreachhere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
  // jvmti support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
  static void jvmti_post_field_access(Register cache, Register index, bool is_static, bool has_tos);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
  static void jvmti_post_field_mod(Register cache, Register index, bool is_static);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
  static void jvmti_post_fast_field_mod();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
  // debugging of TemplateGenerator
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
  static void transition(TosState tos_in, TosState tos_out);// checks if in/out states expected by template generator correspond to table entries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
  // initialization helpers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
  static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(            ), char filler );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
  static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(int arg     ), int arg     );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(bool arg    ), bool arg    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
  static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(TosState tos), TosState tos);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
  static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Operation op), Operation op);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
  static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Condition cc), Condition cc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
  friend class Template;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
  // InterpreterMacroAssembler::is_a(), etc., need TemplateTable::call_VM().
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
  friend class InterpreterMacroAssembler;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
  // Initialization
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
  static void initialize();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
  static void pd_initialize();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
  // Templates
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
  static Template* template_for     (Bytecodes::Code code)  { Bytecodes::check     (code); return &_template_table     [code]; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
  static Template* template_for_wide(Bytecodes::Code code)  { Bytecodes::wide_check(code); return &_template_table_wide[code]; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
  // Platform specifics
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 35214
diff changeset
   355
#include CPU_HEADER(templateTable)
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
   356
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
#endif /* !CC_INTERP */
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
   359
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52058
diff changeset
   360
#endif // SHARE_INTERPRETER_TEMPLATETABLE_HPP