hotspot/src/share/vm/interpreter/bytecodes.cpp
author stefank
Tue, 23 Nov 2010 13:22:55 -0800
changeset 7397 5b173b4ca846
parent 5882 6b2aecc4f7d8
child 7913 dd096a83bdbb
permissions -rw-r--r--
6989984: Use standard include model for Hospot Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
5702
jrose
parents: 5547 5693
diff changeset
     2
 * Copyright (c) 1997, 2010, 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: 5440
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5440
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: 5440
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: 5882
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    26
#include "interpreter/bytecodes.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    27
#include "memory/resourceArea.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    28
#include "oops/methodOop.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    29
#ifdef TARGET_ARCH_x86
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    30
# include "bytes_x86.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    31
#endif
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    32
#ifdef TARGET_ARCH_sparc
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    33
# include "bytes_sparc.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    34
#endif
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    35
#ifdef TARGET_ARCH_zero
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    36
# include "bytes_zero.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5882
diff changeset
    37
#endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
5439
d4101ea993e5 6953588: hotspot\src\share\vm\interpreter\bytecodes.cpp doesn't compile with VS2010 on AMD64
prr
parents: 4564
diff changeset
    40
#if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600))
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// Windows AMD64 Compiler Hangs compiling this file
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// unless optimization is off
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
#ifdef _M_AMD64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
#pragma optimize ("", off)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
#endif
5439
d4101ea993e5 6953588: hotspot\src\share\vm\interpreter\bytecodes.cpp doesn't compile with VS2010 on AMD64
prr
parents: 4564
diff changeset
    46
#endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
bool            Bytecodes::_is_initialized = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
const char*     Bytecodes::_name          [Bytecodes::number_of_codes];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
BasicType       Bytecodes::_result_type   [Bytecodes::number_of_codes];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
s_char          Bytecodes::_depth         [Bytecodes::number_of_codes];
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
    53
u_char          Bytecodes::_lengths       [Bytecodes::number_of_codes];
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
Bytecodes::Code Bytecodes::_java_code     [Bytecodes::number_of_codes];
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
    55
u_short         Bytecodes::_flags         [(1<<BitsPerByte)*2];
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
Bytecodes::Code Bytecodes::code_at(methodOop method, int bci) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  return code_at(method->bcp_from(bci), method);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
Bytecodes::Code Bytecodes::non_breakpoint_code_at(address bcp, methodOop method) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  if (method == NULL)  method = methodOopDesc::method_from_bcp(bcp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  return method->orig_bytecode_at(method->bci_from(bcp));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
1493
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
    67
int Bytecodes::special_length_at(address bcp, address end) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  Code code = code_at(bcp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  switch (code) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  case _wide:
1493
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
    71
    if (end != NULL && bcp + 1 >= end) {
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
    72
      return -1; // don't read past end of code buffer
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
    73
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
    return wide_length_for(cast(*(bcp + 1)));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  case _tableswitch:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    { address aligned_bcp = (address)round_to((intptr_t)bcp + 1, jintSize);
1493
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
    77
      if (end != NULL && aligned_bcp + 3*jintSize >= end) {
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
    78
        return -1; // don't read past end of code buffer
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
    79
      }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
      jlong lo = (jint)Bytes::get_Java_u4(aligned_bcp + 1*jintSize);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
      jlong hi = (jint)Bytes::get_Java_u4(aligned_bcp + 2*jintSize);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
      jlong len = (aligned_bcp - bcp) + (3 + hi - lo + 1)*jintSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
      // only return len if it can be represented as a positive int;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
      // return -1 otherwise
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
      return (len > 0 && len == (int)len) ? len : -1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  case _lookupswitch:      // fall through
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  case _fast_binaryswitch: // fall through
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  case _fast_linearswitch:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
    { address aligned_bcp = (address)round_to((intptr_t)bcp + 1, jintSize);
1493
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
    92
      if (end != NULL && aligned_bcp + 2*jintSize >= end) {
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
    93
        return -1; // don't read past end of code buffer
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
    94
      }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
      jlong npairs = (jint)Bytes::get_Java_u4(aligned_bcp + jintSize);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
      jlong len = (aligned_bcp - bcp) + (2 + 2*npairs)*jintSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
      // only return len if it can be represented as a positive int;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
      // return -1 otherwise
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
      return (len > 0 && len == (int)len) ? len : -1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  }
5693
3015c564fcbc 6956164: nightly regressions from 6939207
jrose
parents: 5688
diff changeset
   102
  // Note: Length functions must return <=0 for invalid bytecodes.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  return 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
// At a breakpoint instruction, this returns the breakpoint's length,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
// otherwise, it's the same as special_length_at().  This is used by
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
// the RawByteCodeStream, which wants to see the actual bytecode
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
// values (including breakpoint).  RawByteCodeStream is used by the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
// verifier when reading in bytecode to verify.  Other mechanisms that
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
// run at runtime (such as generateOopMaps) need to iterate over the code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
// and don't expect to see breakpoints: they want to see the instruction
1493
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
   113
// which was replaced so that they can get the correct length and find
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
// the next bytecode.
1493
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
   115
//
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
   116
// 'end' indicates the end of the code buffer, which we should not try to read
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
   117
// past.
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
   118
int Bytecodes::raw_special_length_at(address bcp, address end) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  Code code = code_or_bp_at(bcp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  if (code == _breakpoint) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
    return 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  } else {
1493
7d2dc5fbfa8c 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 1
diff changeset
   123
    return special_length_at(bcp, end);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
void Bytecodes::def(Code code, const char* name, const char* format, const char* wide_format, BasicType result_type, int depth, bool can_trap) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  def(code, name, format, wide_format, result_type, depth, can_trap, code);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
void Bytecodes::def(Code code, const char* name, const char* format, const char* wide_format, BasicType result_type, int depth, bool can_trap, Code java_code) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  assert(wide_format == NULL || format != NULL, "short form must exist if there's a wide form");
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   136
  int len  = (format      != NULL ? (int) strlen(format)      : 0);
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   137
  int wlen = (wide_format != NULL ? (int) strlen(wide_format) : 0);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  _name          [code] = name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  _result_type   [code] = result_type;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  _depth         [code] = depth;
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   141
  _lengths       [code] = (wlen << 4) | (len & 0xF);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  _java_code     [code] = java_code;
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   143
  int bc_flags = 0;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   144
  if (can_trap)           bc_flags |= _bc_can_trap;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   145
  if (java_code != code)  bc_flags |= _bc_can_rewrite;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   146
  _flags[(u1)code+0*(1<<BitsPerByte)] = compute_flags(format,      bc_flags);
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   147
  _flags[(u1)code+1*(1<<BitsPerByte)] = compute_flags(wide_format, bc_flags);
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   148
  assert(is_defined(code)      == (format != NULL),      "");
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   149
  assert(wide_is_defined(code) == (wide_format != NULL), "");
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   150
  assert(length_for(code)      == len, "");
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   151
  assert(wide_length_for(code) == wlen, "");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
// Format strings interpretation:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
// b: bytecode
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
// c: signed constant, Java byte-ordering
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   159
// i: unsigned local index, Java byte-ordering (I = native byte ordering)
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   160
// j: unsigned CP cache index, Java byte-ordering (J = native byte ordering)
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   161
// k: unsigned CP index, Java byte-ordering
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   162
// o: branch offset, Java byte-ordering
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
// _: unused/ignored
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
// w: wide bytecode
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
//
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   166
// Note: The format strings are used for 2 purposes:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
//       1. to specify the length of the bytecode
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
//          (= number of characters in format string)
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   169
//       2. to derive bytecode format flags (_fmt_has_k, etc.)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
// Note: For bytecodes with variable length, the format string is the empty string.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   173
int Bytecodes::compute_flags(const char* format, int more_flags) {
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   174
  if (format == NULL)  return 0;  // not even more_flags
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   175
  int flags = more_flags;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   176
  const char* fp = format;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   177
  switch (*fp) {
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   178
  case '\0':
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   179
    flags |= _fmt_not_simple; // but variable
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   180
    break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   181
  case 'b':
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   182
    flags |= _fmt_not_variable;  // but simple
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   183
    ++fp;  // skip 'b'
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   184
    break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   185
  case 'w':
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   186
    flags |= _fmt_not_variable | _fmt_not_simple;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   187
    ++fp;  // skip 'w'
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   188
    guarantee(*fp == 'b', "wide format must start with 'wb'");
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   189
    ++fp;  // skip 'b'
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   190
    break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   191
  }
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   192
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   193
  int has_nbo = 0, has_jbo = 0, has_size = 0;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   194
  for (;;) {
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   195
    int this_flag = 0;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   196
    char fc = *fp++;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   197
    switch (fc) {
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   198
    case '\0':  // end of string
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   199
      assert(flags == (jchar)flags, "change _format_flags");
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   200
      return flags;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   201
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   202
    case '_': continue;         // ignore these
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   203
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   204
    case 'j': this_flag = _fmt_has_j; has_jbo = 1; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   205
    case 'k': this_flag = _fmt_has_k; has_jbo = 1; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   206
    case 'i': this_flag = _fmt_has_i; has_jbo = 1; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   207
    case 'c': this_flag = _fmt_has_c; has_jbo = 1; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   208
    case 'o': this_flag = _fmt_has_o; has_jbo = 1; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   209
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   210
    // uppercase versions mark native byte order (from Rewriter)
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   211
    // actually, only the 'J' case happens currently
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   212
    case 'J': this_flag = _fmt_has_j; has_nbo = 1; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   213
    case 'K': this_flag = _fmt_has_k; has_nbo = 1; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   214
    case 'I': this_flag = _fmt_has_i; has_nbo = 1; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   215
    case 'C': this_flag = _fmt_has_c; has_nbo = 1; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   216
    case 'O': this_flag = _fmt_has_o; has_nbo = 1; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   217
    default:  guarantee(false, "bad char in format");
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   218
    }
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   219
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   220
    flags |= this_flag;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   221
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   222
    guarantee(!(has_jbo && has_nbo), "mixed byte orders in format");
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   223
    if (has_nbo)
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   224
      flags |= _fmt_has_nbo;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   225
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   226
    int this_size = 1;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   227
    if (*fp == fc) {
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   228
      // advance beyond run of the same characters
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   229
      this_size = 2;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   230
      while (*++fp == fc)  this_size++;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   231
      switch (this_size) {
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   232
      case 2: flags |= _fmt_has_u2; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   233
      case 4: flags |= _fmt_has_u4; break;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   234
      default: guarantee(false, "bad rep count in format");
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   235
      }
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   236
    }
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   237
    guarantee(has_size == 0 ||                     // no field yet
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   238
              this_size == has_size ||             // same size
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   239
              this_size < has_size && *fp == '\0', // last field can be short
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   240
              "mixed field sizes in format");
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   241
    has_size = this_size;
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   242
  }
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   243
}
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   244
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
void Bytecodes::initialize() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  if (_is_initialized) return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  assert(number_of_codes <= 256, "too many bytecodes");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
  // initialize bytecode tables - didn't use static array initializers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
  // (such as {}) so we can do additional consistency checks and init-
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
  // code is independent of actual bytecode numbering.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
  // Note 1: NULL for the format string means the bytecode doesn't exist
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
  //         in that form.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  // Note 2: The result type is T_ILLEGAL for bytecodes where the top of stack
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  //         type after execution is not only determined by the bytecode itself.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  //  Java bytecodes
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  //  bytecode               bytecode name           format   wide f.   result tp  stk traps
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
  def(_nop                 , "nop"                 , "b"    , NULL    , T_VOID   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
  def(_aconst_null         , "aconst_null"         , "b"    , NULL    , T_OBJECT ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
  def(_iconst_m1           , "iconst_m1"           , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
  def(_iconst_0            , "iconst_0"            , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
  def(_iconst_1            , "iconst_1"            , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
  def(_iconst_2            , "iconst_2"            , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
  def(_iconst_3            , "iconst_3"            , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
  def(_iconst_4            , "iconst_4"            , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
  def(_iconst_5            , "iconst_5"            , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
  def(_lconst_0            , "lconst_0"            , "b"    , NULL    , T_LONG   ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
  def(_lconst_1            , "lconst_1"            , "b"    , NULL    , T_LONG   ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
  def(_fconst_0            , "fconst_0"            , "b"    , NULL    , T_FLOAT  ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
  def(_fconst_1            , "fconst_1"            , "b"    , NULL    , T_FLOAT  ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
  def(_fconst_2            , "fconst_2"            , "b"    , NULL    , T_FLOAT  ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
  def(_dconst_0            , "dconst_0"            , "b"    , NULL    , T_DOUBLE ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
  def(_dconst_1            , "dconst_1"            , "b"    , NULL    , T_DOUBLE ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
  def(_bipush              , "bipush"              , "bc"   , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
  def(_sipush              , "sipush"              , "bcc"  , NULL    , T_INT    ,  1, false);
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   279
  def(_ldc                 , "ldc"                 , "bk"   , NULL    , T_ILLEGAL,  1, true );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   280
  def(_ldc_w               , "ldc_w"               , "bkk"  , NULL    , T_ILLEGAL,  1, true );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   281
  def(_ldc2_w              , "ldc2_w"              , "bkk"  , NULL    , T_ILLEGAL,  2, true );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
  def(_iload               , "iload"               , "bi"   , "wbii"  , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
  def(_lload               , "lload"               , "bi"   , "wbii"  , T_LONG   ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  def(_fload               , "fload"               , "bi"   , "wbii"  , T_FLOAT  ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
  def(_dload               , "dload"               , "bi"   , "wbii"  , T_DOUBLE ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  def(_aload               , "aload"               , "bi"   , "wbii"  , T_OBJECT ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  def(_iload_0             , "iload_0"             , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
  def(_iload_1             , "iload_1"             , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
  def(_iload_2             , "iload_2"             , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
  def(_iload_3             , "iload_3"             , "b"    , NULL    , T_INT    ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
  def(_lload_0             , "lload_0"             , "b"    , NULL    , T_LONG   ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  def(_lload_1             , "lload_1"             , "b"    , NULL    , T_LONG   ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
  def(_lload_2             , "lload_2"             , "b"    , NULL    , T_LONG   ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  def(_lload_3             , "lload_3"             , "b"    , NULL    , T_LONG   ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
  def(_fload_0             , "fload_0"             , "b"    , NULL    , T_FLOAT  ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
  def(_fload_1             , "fload_1"             , "b"    , NULL    , T_FLOAT  ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  def(_fload_2             , "fload_2"             , "b"    , NULL    , T_FLOAT  ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  def(_fload_3             , "fload_3"             , "b"    , NULL    , T_FLOAT  ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
  def(_dload_0             , "dload_0"             , "b"    , NULL    , T_DOUBLE ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
  def(_dload_1             , "dload_1"             , "b"    , NULL    , T_DOUBLE ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  def(_dload_2             , "dload_2"             , "b"    , NULL    , T_DOUBLE ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
  def(_dload_3             , "dload_3"             , "b"    , NULL    , T_DOUBLE ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  def(_aload_0             , "aload_0"             , "b"    , NULL    , T_OBJECT ,  1, true ); // rewriting in interpreter
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
  def(_aload_1             , "aload_1"             , "b"    , NULL    , T_OBJECT ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  def(_aload_2             , "aload_2"             , "b"    , NULL    , T_OBJECT ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
  def(_aload_3             , "aload_3"             , "b"    , NULL    , T_OBJECT ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
  def(_iaload              , "iaload"              , "b"    , NULL    , T_INT    , -1, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  def(_laload              , "laload"              , "b"    , NULL    , T_LONG   ,  0, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
  def(_faload              , "faload"              , "b"    , NULL    , T_FLOAT  , -1, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
  def(_daload              , "daload"              , "b"    , NULL    , T_DOUBLE ,  0, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
  def(_aaload              , "aaload"              , "b"    , NULL    , T_OBJECT , -1, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
  def(_baload              , "baload"              , "b"    , NULL    , T_INT    , -1, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
  def(_caload              , "caload"              , "b"    , NULL    , T_INT    , -1, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
  def(_saload              , "saload"              , "b"    , NULL    , T_INT    , -1, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
  def(_istore              , "istore"              , "bi"   , "wbii"  , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
  def(_lstore              , "lstore"              , "bi"   , "wbii"  , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
  def(_fstore              , "fstore"              , "bi"   , "wbii"  , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  def(_dstore              , "dstore"              , "bi"   , "wbii"  , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  def(_astore              , "astore"              , "bi"   , "wbii"  , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
  def(_istore_0            , "istore_0"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
  def(_istore_1            , "istore_1"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
  def(_istore_2            , "istore_2"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
  def(_istore_3            , "istore_3"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
  def(_lstore_0            , "lstore_0"            , "b"    , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
  def(_lstore_1            , "lstore_1"            , "b"    , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
  def(_lstore_2            , "lstore_2"            , "b"    , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
  def(_lstore_3            , "lstore_3"            , "b"    , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
  def(_fstore_0            , "fstore_0"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
  def(_fstore_1            , "fstore_1"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
  def(_fstore_2            , "fstore_2"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
  def(_fstore_3            , "fstore_3"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
  def(_dstore_0            , "dstore_0"            , "b"    , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
  def(_dstore_1            , "dstore_1"            , "b"    , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
  def(_dstore_2            , "dstore_2"            , "b"    , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
  def(_dstore_3            , "dstore_3"            , "b"    , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
  def(_astore_0            , "astore_0"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
  def(_astore_1            , "astore_1"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
  def(_astore_2            , "astore_2"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
  def(_astore_3            , "astore_3"            , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
  def(_iastore             , "iastore"             , "b"    , NULL    , T_VOID   , -3, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
  def(_lastore             , "lastore"             , "b"    , NULL    , T_VOID   , -4, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
  def(_fastore             , "fastore"             , "b"    , NULL    , T_VOID   , -3, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
  def(_dastore             , "dastore"             , "b"    , NULL    , T_VOID   , -4, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  def(_aastore             , "aastore"             , "b"    , NULL    , T_VOID   , -3, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
  def(_bastore             , "bastore"             , "b"    , NULL    , T_VOID   , -3, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
  def(_castore             , "castore"             , "b"    , NULL    , T_VOID   , -3, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
  def(_sastore             , "sastore"             , "b"    , NULL    , T_VOID   , -3, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
  def(_pop                 , "pop"                 , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
  def(_pop2                , "pop2"                , "b"    , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
  def(_dup                 , "dup"                 , "b"    , NULL    , T_VOID   ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
  def(_dup_x1              , "dup_x1"              , "b"    , NULL    , T_VOID   ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
  def(_dup_x2              , "dup_x2"              , "b"    , NULL    , T_VOID   ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
  def(_dup2                , "dup2"                , "b"    , NULL    , T_VOID   ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
  def(_dup2_x1             , "dup2_x1"             , "b"    , NULL    , T_VOID   ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
  def(_dup2_x2             , "dup2_x2"             , "b"    , NULL    , T_VOID   ,  2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
  def(_swap                , "swap"                , "b"    , NULL    , T_VOID   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
  def(_iadd                , "iadd"                , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
  def(_ladd                , "ladd"                , "b"    , NULL    , T_LONG   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
  def(_fadd                , "fadd"                , "b"    , NULL    , T_FLOAT  , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
  def(_dadd                , "dadd"                , "b"    , NULL    , T_DOUBLE , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
  def(_isub                , "isub"                , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
  def(_lsub                , "lsub"                , "b"    , NULL    , T_LONG   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
  def(_fsub                , "fsub"                , "b"    , NULL    , T_FLOAT  , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
  def(_dsub                , "dsub"                , "b"    , NULL    , T_DOUBLE , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
  def(_imul                , "imul"                , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
  def(_lmul                , "lmul"                , "b"    , NULL    , T_LONG   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
  def(_fmul                , "fmul"                , "b"    , NULL    , T_FLOAT  , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
  def(_dmul                , "dmul"                , "b"    , NULL    , T_DOUBLE , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
  def(_idiv                , "idiv"                , "b"    , NULL    , T_INT    , -1, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
  def(_ldiv                , "ldiv"                , "b"    , NULL    , T_LONG   , -2, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
  def(_fdiv                , "fdiv"                , "b"    , NULL    , T_FLOAT  , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
  def(_ddiv                , "ddiv"                , "b"    , NULL    , T_DOUBLE , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
  def(_irem                , "irem"                , "b"    , NULL    , T_INT    , -1, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
  def(_lrem                , "lrem"                , "b"    , NULL    , T_LONG   , -2, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
  def(_frem                , "frem"                , "b"    , NULL    , T_FLOAT  , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
  def(_drem                , "drem"                , "b"    , NULL    , T_DOUBLE , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
  def(_ineg                , "ineg"                , "b"    , NULL    , T_INT    ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
  def(_lneg                , "lneg"                , "b"    , NULL    , T_LONG   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
  def(_fneg                , "fneg"                , "b"    , NULL    , T_FLOAT  ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
  def(_dneg                , "dneg"                , "b"    , NULL    , T_DOUBLE ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
  def(_ishl                , "ishl"                , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
  def(_lshl                , "lshl"                , "b"    , NULL    , T_LONG   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
  def(_ishr                , "ishr"                , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
  def(_lshr                , "lshr"                , "b"    , NULL    , T_LONG   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
  def(_iushr               , "iushr"               , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
  def(_lushr               , "lushr"               , "b"    , NULL    , T_LONG   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
  def(_iand                , "iand"                , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
  def(_land                , "land"                , "b"    , NULL    , T_LONG   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
  def(_ior                 , "ior"                 , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
  def(_lor                 , "lor"                 , "b"    , NULL    , T_LONG   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
  def(_ixor                , "ixor"                , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
  def(_lxor                , "lxor"                , "b"    , NULL    , T_LONG   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
  def(_iinc                , "iinc"                , "bic"  , "wbiicc", T_VOID   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
  def(_i2l                 , "i2l"                 , "b"    , NULL    , T_LONG   ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
  def(_i2f                 , "i2f"                 , "b"    , NULL    , T_FLOAT  ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
  def(_i2d                 , "i2d"                 , "b"    , NULL    , T_DOUBLE ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
  def(_l2i                 , "l2i"                 , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
  def(_l2f                 , "l2f"                 , "b"    , NULL    , T_FLOAT  , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
  def(_l2d                 , "l2d"                 , "b"    , NULL    , T_DOUBLE ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
  def(_f2i                 , "f2i"                 , "b"    , NULL    , T_INT    ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
  def(_f2l                 , "f2l"                 , "b"    , NULL    , T_LONG   ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
  def(_f2d                 , "f2d"                 , "b"    , NULL    , T_DOUBLE ,  1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
  def(_d2i                 , "d2i"                 , "b"    , NULL    , T_INT    , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
  def(_d2l                 , "d2l"                 , "b"    , NULL    , T_LONG   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
  def(_d2f                 , "d2f"                 , "b"    , NULL    , T_FLOAT  , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
  def(_i2b                 , "i2b"                 , "b"    , NULL    , T_BYTE   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
  def(_i2c                 , "i2c"                 , "b"    , NULL    , T_CHAR   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
  def(_i2s                 , "i2s"                 , "b"    , NULL    , T_SHORT  ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
  def(_lcmp                , "lcmp"                , "b"    , NULL    , T_VOID   , -3, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
  def(_fcmpl               , "fcmpl"               , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
  def(_fcmpg               , "fcmpg"               , "b"    , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
  def(_dcmpl               , "dcmpl"               , "b"    , NULL    , T_VOID   , -3, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
  def(_dcmpg               , "dcmpg"               , "b"    , NULL    , T_VOID   , -3, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
  def(_ifeq                , "ifeq"                , "boo"  , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
  def(_ifne                , "ifne"                , "boo"  , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
  def(_iflt                , "iflt"                , "boo"  , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
  def(_ifge                , "ifge"                , "boo"  , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
  def(_ifgt                , "ifgt"                , "boo"  , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
  def(_ifle                , "ifle"                , "boo"  , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
  def(_if_icmpeq           , "if_icmpeq"           , "boo"  , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
  def(_if_icmpne           , "if_icmpne"           , "boo"  , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
  def(_if_icmplt           , "if_icmplt"           , "boo"  , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
  def(_if_icmpge           , "if_icmpge"           , "boo"  , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
  def(_if_icmpgt           , "if_icmpgt"           , "boo"  , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
  def(_if_icmple           , "if_icmple"           , "boo"  , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
  def(_if_acmpeq           , "if_acmpeq"           , "boo"  , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
  def(_if_acmpne           , "if_acmpne"           , "boo"  , NULL    , T_VOID   , -2, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
  def(_goto                , "goto"                , "boo"  , NULL    , T_VOID   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
  def(_jsr                 , "jsr"                 , "boo"  , NULL    , T_INT    ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
  def(_ret                 , "ret"                 , "bi"   , "wbii"  , T_VOID   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
  def(_tableswitch         , "tableswitch"         , ""     , NULL    , T_VOID   , -1, false); // may have backward branches
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
  def(_lookupswitch        , "lookupswitch"        , ""     , NULL    , T_VOID   , -1, false); // rewriting in interpreter
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
  def(_ireturn             , "ireturn"             , "b"    , NULL    , T_INT    , -1, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
  def(_lreturn             , "lreturn"             , "b"    , NULL    , T_LONG   , -2, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
  def(_freturn             , "freturn"             , "b"    , NULL    , T_FLOAT  , -1, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
  def(_dreturn             , "dreturn"             , "b"    , NULL    , T_DOUBLE , -2, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
  def(_areturn             , "areturn"             , "b"    , NULL    , T_OBJECT , -1, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
  def(_return              , "return"              , "b"    , NULL    , T_VOID   ,  0, true);
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   439
  def(_getstatic           , "getstatic"           , "bJJ"  , NULL    , T_ILLEGAL,  1, true );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   440
  def(_putstatic           , "putstatic"           , "bJJ"  , NULL    , T_ILLEGAL, -1, true );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   441
  def(_getfield            , "getfield"            , "bJJ"  , NULL    , T_ILLEGAL,  0, true );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   442
  def(_putfield            , "putfield"            , "bJJ"  , NULL    , T_ILLEGAL, -2, true );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   443
  def(_invokevirtual       , "invokevirtual"       , "bJJ"  , NULL    , T_ILLEGAL, -1, true);
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   444
  def(_invokespecial       , "invokespecial"       , "bJJ"  , NULL    , T_ILLEGAL, -1, true);
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   445
  def(_invokestatic        , "invokestatic"        , "bJJ"  , NULL    , T_ILLEGAL,  0, true);
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   446
  def(_invokeinterface     , "invokeinterface"     , "bJJ__", NULL    , T_ILLEGAL, -1, true);
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   447
  def(_invokedynamic       , "invokedynamic"       , "bJJJJ", NULL    , T_ILLEGAL,  0, true );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   448
  def(_new                 , "new"                 , "bkk"  , NULL    , T_OBJECT ,  1, true );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
  def(_newarray            , "newarray"            , "bc"   , NULL    , T_OBJECT ,  0, true );
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   450
  def(_anewarray           , "anewarray"           , "bkk"  , NULL    , T_OBJECT ,  0, true );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
  def(_arraylength         , "arraylength"         , "b"    , NULL    , T_VOID   ,  0, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
  def(_athrow              , "athrow"              , "b"    , NULL    , T_VOID   , -1, true );
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   453
  def(_checkcast           , "checkcast"           , "bkk"  , NULL    , T_OBJECT ,  0, true );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   454
  def(_instanceof          , "instanceof"          , "bkk"  , NULL    , T_INT    ,  0, true );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
  def(_monitorenter        , "monitorenter"        , "b"    , NULL    , T_VOID   , -1, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
  def(_monitorexit         , "monitorexit"         , "b"    , NULL    , T_VOID   , -1, true );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
  def(_wide                , "wide"                , ""     , NULL    , T_VOID   ,  0, false);
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   458
  def(_multianewarray      , "multianewarray"      , "bkkc" , NULL    , T_OBJECT ,  1, true );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
  def(_ifnull              , "ifnull"              , "boo"  , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
  def(_ifnonnull           , "ifnonnull"           , "boo"  , NULL    , T_VOID   , -1, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
  def(_goto_w              , "goto_w"              , "boooo", NULL    , T_VOID   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
  def(_jsr_w               , "jsr_w"               , "boooo", NULL    , T_INT    ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
  def(_breakpoint          , "breakpoint"          , ""     , NULL    , T_VOID   ,  0, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
  //  JVM bytecodes
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
  //  bytecode               bytecode name           format   wide f.   result tp  stk traps  std code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   468
  def(_fast_agetfield      , "fast_agetfield"      , "bJJ"  , NULL    , T_OBJECT ,  0, true , _getfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   469
  def(_fast_bgetfield      , "fast_bgetfield"      , "bJJ"  , NULL    , T_INT    ,  0, true , _getfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   470
  def(_fast_cgetfield      , "fast_cgetfield"      , "bJJ"  , NULL    , T_CHAR   ,  0, true , _getfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   471
  def(_fast_dgetfield      , "fast_dgetfield"      , "bJJ"  , NULL    , T_DOUBLE ,  0, true , _getfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   472
  def(_fast_fgetfield      , "fast_fgetfield"      , "bJJ"  , NULL    , T_FLOAT  ,  0, true , _getfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   473
  def(_fast_igetfield      , "fast_igetfield"      , "bJJ"  , NULL    , T_INT    ,  0, true , _getfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   474
  def(_fast_lgetfield      , "fast_lgetfield"      , "bJJ"  , NULL    , T_LONG   ,  0, true , _getfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   475
  def(_fast_sgetfield      , "fast_sgetfield"      , "bJJ"  , NULL    , T_SHORT  ,  0, true , _getfield       );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   477
  def(_fast_aputfield      , "fast_aputfield"      , "bJJ"  , NULL    , T_OBJECT ,  0, true , _putfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   478
  def(_fast_bputfield      , "fast_bputfield"      , "bJJ"  , NULL    , T_INT    ,  0, true , _putfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   479
  def(_fast_cputfield      , "fast_cputfield"      , "bJJ"  , NULL    , T_CHAR   ,  0, true , _putfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   480
  def(_fast_dputfield      , "fast_dputfield"      , "bJJ"  , NULL    , T_DOUBLE ,  0, true , _putfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   481
  def(_fast_fputfield      , "fast_fputfield"      , "bJJ"  , NULL    , T_FLOAT  ,  0, true , _putfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   482
  def(_fast_iputfield      , "fast_iputfield"      , "bJJ"  , NULL    , T_INT    ,  0, true , _putfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   483
  def(_fast_lputfield      , "fast_lputfield"      , "bJJ"  , NULL    , T_LONG   ,  0, true , _putfield       );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   484
  def(_fast_sputfield      , "fast_sputfield"      , "bJJ"  , NULL    , T_SHORT  ,  0, true , _putfield       );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
  def(_fast_aload_0        , "fast_aload_0"        , "b"    , NULL    , T_OBJECT ,  1, true , _aload_0        );
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   487
  def(_fast_iaccess_0      , "fast_iaccess_0"      , "b_JJ" , NULL    , T_INT    ,  1, true , _aload_0        );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   488
  def(_fast_aaccess_0      , "fast_aaccess_0"      , "b_JJ" , NULL    , T_OBJECT ,  1, true , _aload_0        );
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   489
  def(_fast_faccess_0      , "fast_faccess_0"      , "b_JJ" , NULL    , T_OBJECT ,  1, true , _aload_0        );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
  def(_fast_iload          , "fast_iload"          , "bi"   , NULL    , T_INT    ,  1, false, _iload);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
  def(_fast_iload2         , "fast_iload2"         , "bi_i" , NULL    , T_INT    ,  2, false, _iload);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
  def(_fast_icaload        , "fast_icaload"        , "bi_"  , NULL    , T_INT    ,  0, false, _iload);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
  // Faster method invocation.
5688
9052dc91ea67 6939207: refactor constant pool index processing
jrose
parents: 5403
diff changeset
   496
  def(_fast_invokevfinal   , "fast_invokevfinal"   , "bJJ"  , NULL    , T_ILLEGAL, -1, true, _invokevirtual   );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
  def(_fast_linearswitch   , "fast_linearswitch"   , ""     , NULL    , T_VOID   , -1, false, _lookupswitch   );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
  def(_fast_binaryswitch   , "fast_binaryswitch"   , ""     , NULL    , T_VOID   , -1, false, _lookupswitch   );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
  def(_return_register_finalizer , "return_register_finalizer" , "b"    , NULL    , T_VOID   ,  0, true, _return);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
5882
6b2aecc4f7d8 6939203: JSR 292 needs method handle constants
jrose
parents: 5702
diff changeset
   503
  def(_fast_aldc           , "fast_aldc"           , "bj"   , NULL    , T_OBJECT,   1, true,  _ldc   );
6b2aecc4f7d8 6939203: JSR 292 needs method handle constants
jrose
parents: 5702
diff changeset
   504
  def(_fast_aldc_w         , "fast_aldc_w"         , "bJJ"  , NULL    , T_OBJECT,   1, true,  _ldc_w );
6b2aecc4f7d8 6939203: JSR 292 needs method handle constants
jrose
parents: 5702
diff changeset
   505
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
  def(_shouldnotreachhere  , "_shouldnotreachhere" , "b"    , NULL    , T_VOID   ,  0, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
  // platform specific JVM bytecodes
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
  pd_initialize();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
  // compare can_trap information for each bytecode with the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
  // can_trap information for the corresponding base bytecode
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
  // (if a rewritten bytecode can trap, so must the base bytecode)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
  #ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
    { for (int i = 0; i < number_of_codes; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
        if (is_defined(i)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
          Code code = cast(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
          Code java = java_code(code);
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 4564
diff changeset
   519
          if (can_trap(code) && !can_trap(java))
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 4564
diff changeset
   520
            fatal(err_msg("%s can trap => %s can trap, too", name(code),
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 4564
diff changeset
   521
                          name(java)));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
  #endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
  // initialization successful
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
  _is_initialized = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
void bytecodes_init() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
  Bytecodes::initialize();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   534
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
// Restore optimization
489c9b5090e2 Initial load
duke
parents:
diff changeset
   537
#ifdef _M_AMD64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
#pragma optimize ("", on)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
#endif