annotate src/share/vm/interpreter/bytecodes.hpp @ 3992:d1bdeef3e3e2

7098282: G1: assert(interval >= 0) failed: Sanity check, referencePolicy.cpp: 76 Summary: There is a race between one thread successfully forwarding and copying the klass mirror for the SoftReference class (including the static master clock) and another thread attempting to use the master clock while attempting to discover a soft reference object. Maintain a shadow copy of the soft reference master clock and use the shadow during reference discovery and reference processing. Reviewed-by: tonyp, brutisso, ysr
author johnc
date Wed, 12 Oct 2011 10:25:51 -0700
parents de847cac9235
children 1d7922586cf6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
2142
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
25 #ifndef SHARE_VM_INTERPRETER_BYTECODES_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
26 #define SHARE_VM_INTERPRETER_BYTECODES_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
28 #include "memory/allocation.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
29 #include "utilities/top.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
30
0
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // Bytecodes specifies all bytecodes used in the VM and
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // provides utility functions to get bytecode attributes.
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/interpreter/Bytecodes.java
a61af66fc99e Initial load
duke
parents:
diff changeset
35 class Bytecodes: AllStatic {
a61af66fc99e Initial load
duke
parents:
diff changeset
36 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
37 enum Code {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 _illegal = -1,
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // Java bytecodes
a61af66fc99e Initial load
duke
parents:
diff changeset
41 _nop = 0, // 0x00
a61af66fc99e Initial load
duke
parents:
diff changeset
42 _aconst_null = 1, // 0x01
a61af66fc99e Initial load
duke
parents:
diff changeset
43 _iconst_m1 = 2, // 0x02
a61af66fc99e Initial load
duke
parents:
diff changeset
44 _iconst_0 = 3, // 0x03
a61af66fc99e Initial load
duke
parents:
diff changeset
45 _iconst_1 = 4, // 0x04
a61af66fc99e Initial load
duke
parents:
diff changeset
46 _iconst_2 = 5, // 0x05
a61af66fc99e Initial load
duke
parents:
diff changeset
47 _iconst_3 = 6, // 0x06
a61af66fc99e Initial load
duke
parents:
diff changeset
48 _iconst_4 = 7, // 0x07
a61af66fc99e Initial load
duke
parents:
diff changeset
49 _iconst_5 = 8, // 0x08
a61af66fc99e Initial load
duke
parents:
diff changeset
50 _lconst_0 = 9, // 0x09
a61af66fc99e Initial load
duke
parents:
diff changeset
51 _lconst_1 = 10, // 0x0a
a61af66fc99e Initial load
duke
parents:
diff changeset
52 _fconst_0 = 11, // 0x0b
a61af66fc99e Initial load
duke
parents:
diff changeset
53 _fconst_1 = 12, // 0x0c
a61af66fc99e Initial load
duke
parents:
diff changeset
54 _fconst_2 = 13, // 0x0d
a61af66fc99e Initial load
duke
parents:
diff changeset
55 _dconst_0 = 14, // 0x0e
a61af66fc99e Initial load
duke
parents:
diff changeset
56 _dconst_1 = 15, // 0x0f
a61af66fc99e Initial load
duke
parents:
diff changeset
57 _bipush = 16, // 0x10
a61af66fc99e Initial load
duke
parents:
diff changeset
58 _sipush = 17, // 0x11
a61af66fc99e Initial load
duke
parents:
diff changeset
59 _ldc = 18, // 0x12
a61af66fc99e Initial load
duke
parents:
diff changeset
60 _ldc_w = 19, // 0x13
a61af66fc99e Initial load
duke
parents:
diff changeset
61 _ldc2_w = 20, // 0x14
a61af66fc99e Initial load
duke
parents:
diff changeset
62 _iload = 21, // 0x15
a61af66fc99e Initial load
duke
parents:
diff changeset
63 _lload = 22, // 0x16
a61af66fc99e Initial load
duke
parents:
diff changeset
64 _fload = 23, // 0x17
a61af66fc99e Initial load
duke
parents:
diff changeset
65 _dload = 24, // 0x18
a61af66fc99e Initial load
duke
parents:
diff changeset
66 _aload = 25, // 0x19
a61af66fc99e Initial load
duke
parents:
diff changeset
67 _iload_0 = 26, // 0x1a
a61af66fc99e Initial load
duke
parents:
diff changeset
68 _iload_1 = 27, // 0x1b
a61af66fc99e Initial load
duke
parents:
diff changeset
69 _iload_2 = 28, // 0x1c
a61af66fc99e Initial load
duke
parents:
diff changeset
70 _iload_3 = 29, // 0x1d
a61af66fc99e Initial load
duke
parents:
diff changeset
71 _lload_0 = 30, // 0x1e
a61af66fc99e Initial load
duke
parents:
diff changeset
72 _lload_1 = 31, // 0x1f
a61af66fc99e Initial load
duke
parents:
diff changeset
73 _lload_2 = 32, // 0x20
a61af66fc99e Initial load
duke
parents:
diff changeset
74 _lload_3 = 33, // 0x21
a61af66fc99e Initial load
duke
parents:
diff changeset
75 _fload_0 = 34, // 0x22
a61af66fc99e Initial load
duke
parents:
diff changeset
76 _fload_1 = 35, // 0x23
a61af66fc99e Initial load
duke
parents:
diff changeset
77 _fload_2 = 36, // 0x24
a61af66fc99e Initial load
duke
parents:
diff changeset
78 _fload_3 = 37, // 0x25
a61af66fc99e Initial load
duke
parents:
diff changeset
79 _dload_0 = 38, // 0x26
a61af66fc99e Initial load
duke
parents:
diff changeset
80 _dload_1 = 39, // 0x27
a61af66fc99e Initial load
duke
parents:
diff changeset
81 _dload_2 = 40, // 0x28
a61af66fc99e Initial load
duke
parents:
diff changeset
82 _dload_3 = 41, // 0x29
a61af66fc99e Initial load
duke
parents:
diff changeset
83 _aload_0 = 42, // 0x2a
a61af66fc99e Initial load
duke
parents:
diff changeset
84 _aload_1 = 43, // 0x2b
a61af66fc99e Initial load
duke
parents:
diff changeset
85 _aload_2 = 44, // 0x2c
a61af66fc99e Initial load
duke
parents:
diff changeset
86 _aload_3 = 45, // 0x2d
a61af66fc99e Initial load
duke
parents:
diff changeset
87 _iaload = 46, // 0x2e
a61af66fc99e Initial load
duke
parents:
diff changeset
88 _laload = 47, // 0x2f
a61af66fc99e Initial load
duke
parents:
diff changeset
89 _faload = 48, // 0x30
a61af66fc99e Initial load
duke
parents:
diff changeset
90 _daload = 49, // 0x31
a61af66fc99e Initial load
duke
parents:
diff changeset
91 _aaload = 50, // 0x32
a61af66fc99e Initial load
duke
parents:
diff changeset
92 _baload = 51, // 0x33
a61af66fc99e Initial load
duke
parents:
diff changeset
93 _caload = 52, // 0x34
a61af66fc99e Initial load
duke
parents:
diff changeset
94 _saload = 53, // 0x35
a61af66fc99e Initial load
duke
parents:
diff changeset
95 _istore = 54, // 0x36
a61af66fc99e Initial load
duke
parents:
diff changeset
96 _lstore = 55, // 0x37
a61af66fc99e Initial load
duke
parents:
diff changeset
97 _fstore = 56, // 0x38
a61af66fc99e Initial load
duke
parents:
diff changeset
98 _dstore = 57, // 0x39
a61af66fc99e Initial load
duke
parents:
diff changeset
99 _astore = 58, // 0x3a
a61af66fc99e Initial load
duke
parents:
diff changeset
100 _istore_0 = 59, // 0x3b
a61af66fc99e Initial load
duke
parents:
diff changeset
101 _istore_1 = 60, // 0x3c
a61af66fc99e Initial load
duke
parents:
diff changeset
102 _istore_2 = 61, // 0x3d
a61af66fc99e Initial load
duke
parents:
diff changeset
103 _istore_3 = 62, // 0x3e
a61af66fc99e Initial load
duke
parents:
diff changeset
104 _lstore_0 = 63, // 0x3f
a61af66fc99e Initial load
duke
parents:
diff changeset
105 _lstore_1 = 64, // 0x40
a61af66fc99e Initial load
duke
parents:
diff changeset
106 _lstore_2 = 65, // 0x41
a61af66fc99e Initial load
duke
parents:
diff changeset
107 _lstore_3 = 66, // 0x42
a61af66fc99e Initial load
duke
parents:
diff changeset
108 _fstore_0 = 67, // 0x43
a61af66fc99e Initial load
duke
parents:
diff changeset
109 _fstore_1 = 68, // 0x44
a61af66fc99e Initial load
duke
parents:
diff changeset
110 _fstore_2 = 69, // 0x45
a61af66fc99e Initial load
duke
parents:
diff changeset
111 _fstore_3 = 70, // 0x46
a61af66fc99e Initial load
duke
parents:
diff changeset
112 _dstore_0 = 71, // 0x47
a61af66fc99e Initial load
duke
parents:
diff changeset
113 _dstore_1 = 72, // 0x48
a61af66fc99e Initial load
duke
parents:
diff changeset
114 _dstore_2 = 73, // 0x49
a61af66fc99e Initial load
duke
parents:
diff changeset
115 _dstore_3 = 74, // 0x4a
a61af66fc99e Initial load
duke
parents:
diff changeset
116 _astore_0 = 75, // 0x4b
a61af66fc99e Initial load
duke
parents:
diff changeset
117 _astore_1 = 76, // 0x4c
a61af66fc99e Initial load
duke
parents:
diff changeset
118 _astore_2 = 77, // 0x4d
a61af66fc99e Initial load
duke
parents:
diff changeset
119 _astore_3 = 78, // 0x4e
a61af66fc99e Initial load
duke
parents:
diff changeset
120 _iastore = 79, // 0x4f
a61af66fc99e Initial load
duke
parents:
diff changeset
121 _lastore = 80, // 0x50
a61af66fc99e Initial load
duke
parents:
diff changeset
122 _fastore = 81, // 0x51
a61af66fc99e Initial load
duke
parents:
diff changeset
123 _dastore = 82, // 0x52
a61af66fc99e Initial load
duke
parents:
diff changeset
124 _aastore = 83, // 0x53
a61af66fc99e Initial load
duke
parents:
diff changeset
125 _bastore = 84, // 0x54
a61af66fc99e Initial load
duke
parents:
diff changeset
126 _castore = 85, // 0x55
a61af66fc99e Initial load
duke
parents:
diff changeset
127 _sastore = 86, // 0x56
a61af66fc99e Initial load
duke
parents:
diff changeset
128 _pop = 87, // 0x57
a61af66fc99e Initial load
duke
parents:
diff changeset
129 _pop2 = 88, // 0x58
a61af66fc99e Initial load
duke
parents:
diff changeset
130 _dup = 89, // 0x59
a61af66fc99e Initial load
duke
parents:
diff changeset
131 _dup_x1 = 90, // 0x5a
a61af66fc99e Initial load
duke
parents:
diff changeset
132 _dup_x2 = 91, // 0x5b
a61af66fc99e Initial load
duke
parents:
diff changeset
133 _dup2 = 92, // 0x5c
a61af66fc99e Initial load
duke
parents:
diff changeset
134 _dup2_x1 = 93, // 0x5d
a61af66fc99e Initial load
duke
parents:
diff changeset
135 _dup2_x2 = 94, // 0x5e
a61af66fc99e Initial load
duke
parents:
diff changeset
136 _swap = 95, // 0x5f
a61af66fc99e Initial load
duke
parents:
diff changeset
137 _iadd = 96, // 0x60
a61af66fc99e Initial load
duke
parents:
diff changeset
138 _ladd = 97, // 0x61
a61af66fc99e Initial load
duke
parents:
diff changeset
139 _fadd = 98, // 0x62
a61af66fc99e Initial load
duke
parents:
diff changeset
140 _dadd = 99, // 0x63
a61af66fc99e Initial load
duke
parents:
diff changeset
141 _isub = 100, // 0x64
a61af66fc99e Initial load
duke
parents:
diff changeset
142 _lsub = 101, // 0x65
a61af66fc99e Initial load
duke
parents:
diff changeset
143 _fsub = 102, // 0x66
a61af66fc99e Initial load
duke
parents:
diff changeset
144 _dsub = 103, // 0x67
a61af66fc99e Initial load
duke
parents:
diff changeset
145 _imul = 104, // 0x68
a61af66fc99e Initial load
duke
parents:
diff changeset
146 _lmul = 105, // 0x69
a61af66fc99e Initial load
duke
parents:
diff changeset
147 _fmul = 106, // 0x6a
a61af66fc99e Initial load
duke
parents:
diff changeset
148 _dmul = 107, // 0x6b
a61af66fc99e Initial load
duke
parents:
diff changeset
149 _idiv = 108, // 0x6c
a61af66fc99e Initial load
duke
parents:
diff changeset
150 _ldiv = 109, // 0x6d
a61af66fc99e Initial load
duke
parents:
diff changeset
151 _fdiv = 110, // 0x6e
a61af66fc99e Initial load
duke
parents:
diff changeset
152 _ddiv = 111, // 0x6f
a61af66fc99e Initial load
duke
parents:
diff changeset
153 _irem = 112, // 0x70
a61af66fc99e Initial load
duke
parents:
diff changeset
154 _lrem = 113, // 0x71
a61af66fc99e Initial load
duke
parents:
diff changeset
155 _frem = 114, // 0x72
a61af66fc99e Initial load
duke
parents:
diff changeset
156 _drem = 115, // 0x73
a61af66fc99e Initial load
duke
parents:
diff changeset
157 _ineg = 116, // 0x74
a61af66fc99e Initial load
duke
parents:
diff changeset
158 _lneg = 117, // 0x75
a61af66fc99e Initial load
duke
parents:
diff changeset
159 _fneg = 118, // 0x76
a61af66fc99e Initial load
duke
parents:
diff changeset
160 _dneg = 119, // 0x77
a61af66fc99e Initial load
duke
parents:
diff changeset
161 _ishl = 120, // 0x78
a61af66fc99e Initial load
duke
parents:
diff changeset
162 _lshl = 121, // 0x79
a61af66fc99e Initial load
duke
parents:
diff changeset
163 _ishr = 122, // 0x7a
a61af66fc99e Initial load
duke
parents:
diff changeset
164 _lshr = 123, // 0x7b
a61af66fc99e Initial load
duke
parents:
diff changeset
165 _iushr = 124, // 0x7c
a61af66fc99e Initial load
duke
parents:
diff changeset
166 _lushr = 125, // 0x7d
a61af66fc99e Initial load
duke
parents:
diff changeset
167 _iand = 126, // 0x7e
a61af66fc99e Initial load
duke
parents:
diff changeset
168 _land = 127, // 0x7f
a61af66fc99e Initial load
duke
parents:
diff changeset
169 _ior = 128, // 0x80
a61af66fc99e Initial load
duke
parents:
diff changeset
170 _lor = 129, // 0x81
a61af66fc99e Initial load
duke
parents:
diff changeset
171 _ixor = 130, // 0x82
a61af66fc99e Initial load
duke
parents:
diff changeset
172 _lxor = 131, // 0x83
a61af66fc99e Initial load
duke
parents:
diff changeset
173 _iinc = 132, // 0x84
a61af66fc99e Initial load
duke
parents:
diff changeset
174 _i2l = 133, // 0x85
a61af66fc99e Initial load
duke
parents:
diff changeset
175 _i2f = 134, // 0x86
a61af66fc99e Initial load
duke
parents:
diff changeset
176 _i2d = 135, // 0x87
a61af66fc99e Initial load
duke
parents:
diff changeset
177 _l2i = 136, // 0x88
a61af66fc99e Initial load
duke
parents:
diff changeset
178 _l2f = 137, // 0x89
a61af66fc99e Initial load
duke
parents:
diff changeset
179 _l2d = 138, // 0x8a
a61af66fc99e Initial load
duke
parents:
diff changeset
180 _f2i = 139, // 0x8b
a61af66fc99e Initial load
duke
parents:
diff changeset
181 _f2l = 140, // 0x8c
a61af66fc99e Initial load
duke
parents:
diff changeset
182 _f2d = 141, // 0x8d
a61af66fc99e Initial load
duke
parents:
diff changeset
183 _d2i = 142, // 0x8e
a61af66fc99e Initial load
duke
parents:
diff changeset
184 _d2l = 143, // 0x8f
a61af66fc99e Initial load
duke
parents:
diff changeset
185 _d2f = 144, // 0x90
a61af66fc99e Initial load
duke
parents:
diff changeset
186 _i2b = 145, // 0x91
a61af66fc99e Initial load
duke
parents:
diff changeset
187 _i2c = 146, // 0x92
a61af66fc99e Initial load
duke
parents:
diff changeset
188 _i2s = 147, // 0x93
a61af66fc99e Initial load
duke
parents:
diff changeset
189 _lcmp = 148, // 0x94
a61af66fc99e Initial load
duke
parents:
diff changeset
190 _fcmpl = 149, // 0x95
a61af66fc99e Initial load
duke
parents:
diff changeset
191 _fcmpg = 150, // 0x96
a61af66fc99e Initial load
duke
parents:
diff changeset
192 _dcmpl = 151, // 0x97
a61af66fc99e Initial load
duke
parents:
diff changeset
193 _dcmpg = 152, // 0x98
a61af66fc99e Initial load
duke
parents:
diff changeset
194 _ifeq = 153, // 0x99
a61af66fc99e Initial load
duke
parents:
diff changeset
195 _ifne = 154, // 0x9a
a61af66fc99e Initial load
duke
parents:
diff changeset
196 _iflt = 155, // 0x9b
a61af66fc99e Initial load
duke
parents:
diff changeset
197 _ifge = 156, // 0x9c
a61af66fc99e Initial load
duke
parents:
diff changeset
198 _ifgt = 157, // 0x9d
a61af66fc99e Initial load
duke
parents:
diff changeset
199 _ifle = 158, // 0x9e
a61af66fc99e Initial load
duke
parents:
diff changeset
200 _if_icmpeq = 159, // 0x9f
a61af66fc99e Initial load
duke
parents:
diff changeset
201 _if_icmpne = 160, // 0xa0
a61af66fc99e Initial load
duke
parents:
diff changeset
202 _if_icmplt = 161, // 0xa1
a61af66fc99e Initial load
duke
parents:
diff changeset
203 _if_icmpge = 162, // 0xa2
a61af66fc99e Initial load
duke
parents:
diff changeset
204 _if_icmpgt = 163, // 0xa3
a61af66fc99e Initial load
duke
parents:
diff changeset
205 _if_icmple = 164, // 0xa4
a61af66fc99e Initial load
duke
parents:
diff changeset
206 _if_acmpeq = 165, // 0xa5
a61af66fc99e Initial load
duke
parents:
diff changeset
207 _if_acmpne = 166, // 0xa6
a61af66fc99e Initial load
duke
parents:
diff changeset
208 _goto = 167, // 0xa7
a61af66fc99e Initial load
duke
parents:
diff changeset
209 _jsr = 168, // 0xa8
a61af66fc99e Initial load
duke
parents:
diff changeset
210 _ret = 169, // 0xa9
a61af66fc99e Initial load
duke
parents:
diff changeset
211 _tableswitch = 170, // 0xaa
a61af66fc99e Initial load
duke
parents:
diff changeset
212 _lookupswitch = 171, // 0xab
a61af66fc99e Initial load
duke
parents:
diff changeset
213 _ireturn = 172, // 0xac
a61af66fc99e Initial load
duke
parents:
diff changeset
214 _lreturn = 173, // 0xad
a61af66fc99e Initial load
duke
parents:
diff changeset
215 _freturn = 174, // 0xae
a61af66fc99e Initial load
duke
parents:
diff changeset
216 _dreturn = 175, // 0xaf
a61af66fc99e Initial load
duke
parents:
diff changeset
217 _areturn = 176, // 0xb0
a61af66fc99e Initial load
duke
parents:
diff changeset
218 _return = 177, // 0xb1
a61af66fc99e Initial load
duke
parents:
diff changeset
219 _getstatic = 178, // 0xb2
a61af66fc99e Initial load
duke
parents:
diff changeset
220 _putstatic = 179, // 0xb3
a61af66fc99e Initial load
duke
parents:
diff changeset
221 _getfield = 180, // 0xb4
a61af66fc99e Initial load
duke
parents:
diff changeset
222 _putfield = 181, // 0xb5
a61af66fc99e Initial load
duke
parents:
diff changeset
223 _invokevirtual = 182, // 0xb6
a61af66fc99e Initial load
duke
parents:
diff changeset
224 _invokespecial = 183, // 0xb7
a61af66fc99e Initial load
duke
parents:
diff changeset
225 _invokestatic = 184, // 0xb8
a61af66fc99e Initial load
duke
parents:
diff changeset
226 _invokeinterface = 185, // 0xb9
726
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 470
diff changeset
227 _invokedynamic = 186, // 0xba // if EnableInvokeDynamic
0
a61af66fc99e Initial load
duke
parents:
diff changeset
228 _new = 187, // 0xbb
a61af66fc99e Initial load
duke
parents:
diff changeset
229 _newarray = 188, // 0xbc
a61af66fc99e Initial load
duke
parents:
diff changeset
230 _anewarray = 189, // 0xbd
a61af66fc99e Initial load
duke
parents:
diff changeset
231 _arraylength = 190, // 0xbe
a61af66fc99e Initial load
duke
parents:
diff changeset
232 _athrow = 191, // 0xbf
a61af66fc99e Initial load
duke
parents:
diff changeset
233 _checkcast = 192, // 0xc0
a61af66fc99e Initial load
duke
parents:
diff changeset
234 _instanceof = 193, // 0xc1
a61af66fc99e Initial load
duke
parents:
diff changeset
235 _monitorenter = 194, // 0xc2
a61af66fc99e Initial load
duke
parents:
diff changeset
236 _monitorexit = 195, // 0xc3
a61af66fc99e Initial load
duke
parents:
diff changeset
237 _wide = 196, // 0xc4
a61af66fc99e Initial load
duke
parents:
diff changeset
238 _multianewarray = 197, // 0xc5
a61af66fc99e Initial load
duke
parents:
diff changeset
239 _ifnull = 198, // 0xc6
a61af66fc99e Initial load
duke
parents:
diff changeset
240 _ifnonnull = 199, // 0xc7
a61af66fc99e Initial load
duke
parents:
diff changeset
241 _goto_w = 200, // 0xc8
a61af66fc99e Initial load
duke
parents:
diff changeset
242 _jsr_w = 201, // 0xc9
a61af66fc99e Initial load
duke
parents:
diff changeset
243 _breakpoint = 202, // 0xca
a61af66fc99e Initial load
duke
parents:
diff changeset
244
a61af66fc99e Initial load
duke
parents:
diff changeset
245 number_of_java_codes,
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 // JVM bytecodes
a61af66fc99e Initial load
duke
parents:
diff changeset
248 _fast_agetfield = number_of_java_codes,
a61af66fc99e Initial load
duke
parents:
diff changeset
249 _fast_bgetfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
250 _fast_cgetfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
251 _fast_dgetfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
252 _fast_fgetfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
253 _fast_igetfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
254 _fast_lgetfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
255 _fast_sgetfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
256
a61af66fc99e Initial load
duke
parents:
diff changeset
257 _fast_aputfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
258 _fast_bputfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
259 _fast_cputfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
260 _fast_dputfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
261 _fast_fputfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
262 _fast_iputfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
263 _fast_lputfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
264 _fast_sputfield ,
a61af66fc99e Initial load
duke
parents:
diff changeset
265
a61af66fc99e Initial load
duke
parents:
diff changeset
266 _fast_aload_0 ,
a61af66fc99e Initial load
duke
parents:
diff changeset
267 _fast_iaccess_0 ,
a61af66fc99e Initial load
duke
parents:
diff changeset
268 _fast_aaccess_0 ,
a61af66fc99e Initial load
duke
parents:
diff changeset
269 _fast_faccess_0 ,
a61af66fc99e Initial load
duke
parents:
diff changeset
270
a61af66fc99e Initial load
duke
parents:
diff changeset
271 _fast_iload ,
a61af66fc99e Initial load
duke
parents:
diff changeset
272 _fast_iload2 ,
a61af66fc99e Initial load
duke
parents:
diff changeset
273 _fast_icaload ,
a61af66fc99e Initial load
duke
parents:
diff changeset
274
a61af66fc99e Initial load
duke
parents:
diff changeset
275 _fast_invokevfinal ,
a61af66fc99e Initial load
duke
parents:
diff changeset
276 _fast_linearswitch ,
a61af66fc99e Initial load
duke
parents:
diff changeset
277 _fast_binaryswitch ,
a61af66fc99e Initial load
duke
parents:
diff changeset
278
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
279 // special handling of oop constants:
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
280 _fast_aldc ,
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
281 _fast_aldc_w ,
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
282
0
a61af66fc99e Initial load
duke
parents:
diff changeset
283 _return_register_finalizer ,
a61af66fc99e Initial load
duke
parents:
diff changeset
284
a61af66fc99e Initial load
duke
parents:
diff changeset
285 _shouldnotreachhere, // For debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
286
a61af66fc99e Initial load
duke
parents:
diff changeset
287 // Platform specific JVM bytecodes
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
288 #ifdef TARGET_ARCH_x86
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
289 # include "bytecodes_x86.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
290 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
291 #ifdef TARGET_ARCH_sparc
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
292 # include "bytecodes_sparc.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
293 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
294 #ifdef TARGET_ARCH_zero
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
295 # include "bytecodes_zero.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
296 #endif
2192
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2142
diff changeset
297 #ifdef TARGET_ARCH_arm
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2142
diff changeset
298 # include "bytecodes_arm.hpp"
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2142
diff changeset
299 #endif
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2142
diff changeset
300 #ifdef TARGET_ARCH_ppc
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2142
diff changeset
301 # include "bytecodes_ppc.hpp"
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2142
diff changeset
302 #endif
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
303
0
a61af66fc99e Initial load
duke
parents:
diff changeset
304
a61af66fc99e Initial load
duke
parents:
diff changeset
305 number_of_codes
a61af66fc99e Initial load
duke
parents:
diff changeset
306 };
a61af66fc99e Initial load
duke
parents:
diff changeset
307
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
308 // Flag bits derived from format strings, can_trap, can_rewrite, etc.:
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
309 enum Flags {
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
310 // semantic flags:
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
311 _bc_can_trap = 1<<0, // bytecode execution can trap or block
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
312 _bc_can_rewrite = 1<<1, // bytecode execution has an alternate form
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
313
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
314 // format bits (determined only by the format string):
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
315 _fmt_has_c = 1<<2, // constant, such as sipush "bcc"
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
316 _fmt_has_j = 1<<3, // constant pool cache index, such as getfield "bjj"
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
317 _fmt_has_k = 1<<4, // constant pool index, such as ldc "bk"
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
318 _fmt_has_i = 1<<5, // local index, such as iload
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
319 _fmt_has_o = 1<<6, // offset, such as ifeq
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
320 _fmt_has_nbo = 1<<7, // contains native-order field(s)
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
321 _fmt_has_u2 = 1<<8, // contains double-byte field(s)
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
322 _fmt_has_u4 = 1<<9, // contains quad-byte field
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
323 _fmt_not_variable = 1<<10, // not of variable length (simple or wide)
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
324 _fmt_not_simple = 1<<11, // either wide or variable length
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
325 _all_fmt_bits = (_fmt_not_simple*2 - _fmt_has_c),
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
326
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
327 // Example derived format syndromes:
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
328 _fmt_b = _fmt_not_variable,
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
329 _fmt_bc = _fmt_b | _fmt_has_c,
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
330 _fmt_bi = _fmt_b | _fmt_has_i,
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
331 _fmt_bkk = _fmt_b | _fmt_has_k | _fmt_has_u2,
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
332 _fmt_bJJ = _fmt_b | _fmt_has_j | _fmt_has_u2 | _fmt_has_nbo,
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
333 _fmt_bo2 = _fmt_b | _fmt_has_o | _fmt_has_u2,
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
334 _fmt_bo4 = _fmt_b | _fmt_has_o | _fmt_has_u4
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
335 };
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
336
0
a61af66fc99e Initial load
duke
parents:
diff changeset
337 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
338 static bool _is_initialized;
a61af66fc99e Initial load
duke
parents:
diff changeset
339 static const char* _name [number_of_codes];
a61af66fc99e Initial load
duke
parents:
diff changeset
340 static BasicType _result_type [number_of_codes];
a61af66fc99e Initial load
duke
parents:
diff changeset
341 static s_char _depth [number_of_codes];
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
342 static u_char _lengths [number_of_codes];
0
a61af66fc99e Initial load
duke
parents:
diff changeset
343 static Code _java_code [number_of_codes];
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
344 static jchar _flags [(1<<BitsPerByte)*2]; // all second page for wide formats
0
a61af66fc99e Initial load
duke
parents:
diff changeset
345
a61af66fc99e Initial load
duke
parents:
diff changeset
346 static void def(Code code, const char* name, const char* format, const char* wide_format, BasicType result_type, int depth, bool can_trap);
a61af66fc99e Initial load
duke
parents:
diff changeset
347 static void def(Code code, const char* name, const char* format, const char* wide_format, BasicType result_type, int depth, bool can_trap, Code java_code);
a61af66fc99e Initial load
duke
parents:
diff changeset
348 static void pd_initialize(); // platform specific initialization
a61af66fc99e Initial load
duke
parents:
diff changeset
349 static Code pd_base_code_for(Code code); // platform specific base_code_for implementation
a61af66fc99e Initial load
duke
parents:
diff changeset
350
2142
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
351 // Verify that bcp points into method
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
352 #ifdef ASSERT
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
353 static bool check_method(const methodOopDesc* method, address bcp);
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
354 #endif
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
355 static bool check_must_rewrite(Bytecodes::Code bc);
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
356
0
a61af66fc99e Initial load
duke
parents:
diff changeset
357 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
358 // Conversion
a61af66fc99e Initial load
duke
parents:
diff changeset
359 static void check (Code code) { assert(is_defined(code), "illegal code"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
360 static void wide_check (Code code) { assert(wide_is_defined(code), "illegal code"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
361 static Code cast (int code) { return (Code)code; }
a61af66fc99e Initial load
duke
parents:
diff changeset
362
a61af66fc99e Initial load
duke
parents:
diff changeset
363
2142
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
364 // Fetch a bytecode, hiding breakpoints as necessary. The method
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
365 // argument is used for conversion of breakpoints into the original
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
366 // bytecode. The CI uses these methods but guarantees that
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
367 // breakpoints are hidden so the method argument should be passed as
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
368 // NULL since in that case the bcp and methodOop are unrelated
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
369 // memory.
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
370 static Code code_at(const methodOopDesc* method, address bcp) {
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
371 assert(method == NULL || check_method(method, bcp), "bcp must point into method");
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
372 Code code = cast(*bcp);
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
373 assert(code != _breakpoint || method != NULL, "need methodOop to decode breakpoint");
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
374 return (code != _breakpoint) ? code : non_breakpoint_code_at(method, bcp);
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
375 }
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
376 static Code java_code_at(const methodOopDesc* method, address bcp) {
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
377 return java_code(code_at(method, bcp));
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
378 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
379
2142
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
380 // Fetch a bytecode or a breakpoint:
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
381 static Code code_or_bp_at(address bcp) { return (Code)cast(*bcp); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
382
2142
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
383 static Code code_at(methodOop method, int bci);
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
384 static bool is_active_breakpoint_at(address bcp) { return (Code)*bcp == _breakpoint; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
385
2142
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
386 // find a bytecode, behind a breakpoint if necessary:
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
387 static Code non_breakpoint_code_at(const methodOopDesc* method, address bcp);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
388
a61af66fc99e Initial load
duke
parents:
diff changeset
389 // Bytecode attributes
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
390 static bool is_defined (int code) { return 0 <= code && code < number_of_codes && flags(code, false) != 0; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
391 static bool wide_is_defined(int code) { return is_defined(code) && flags(code, true) != 0; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
392 static const char* name (Code code) { check(code); return _name [code]; }
a61af66fc99e Initial load
duke
parents:
diff changeset
393 static BasicType result_type (Code code) { check(code); return _result_type [code]; }
a61af66fc99e Initial load
duke
parents:
diff changeset
394 static int depth (Code code) { check(code); return _depth [code]; }
1570
de91a2f25c7e 6956164: nightly regressions from 6939207
jrose
parents: 1565
diff changeset
395 // Note: Length functions must return <=0 for invalid bytecodes.
de91a2f25c7e 6956164: nightly regressions from 6939207
jrose
parents: 1565
diff changeset
396 // Calling check(code) in length functions would throw an unwanted assert.
de91a2f25c7e 6956164: nightly regressions from 6939207
jrose
parents: 1565
diff changeset
397 static int length_for (Code code) { /*no check*/ return _lengths [code] & 0xF; }
de91a2f25c7e 6956164: nightly regressions from 6939207
jrose
parents: 1565
diff changeset
398 static int wide_length_for(Code code) { /*no check*/ return _lengths [code] >> 4; }
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
399 static bool can_trap (Code code) { check(code); return has_all_flags(code, _bc_can_trap, false); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
400 static Code java_code (Code code) { check(code); return _java_code [code]; }
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
401 static bool can_rewrite (Code code) { check(code); return has_all_flags(code, _bc_can_rewrite, false); }
2142
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
402 static bool must_rewrite(Bytecodes::Code code) { return can_rewrite(code) && check_must_rewrite(code); }
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
403 static bool native_byte_order(Code code) { check(code); return has_all_flags(code, _fmt_has_nbo, false); }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
404 static bool uses_cp_cache (Code code) { check(code); return has_all_flags(code, _fmt_has_j, false); }
413
c7ec737733a6 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 0
diff changeset
405 // if 'end' is provided, it indicates the end of the code buffer which
c7ec737733a6 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 0
diff changeset
406 // should not be read past when parsing.
2142
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
407 static int special_length_at(Bytecodes::Code code, address bcp, address end = NULL);
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
408 static int special_length_at(methodOop method, address bcp, address end = NULL) { return special_length_at(code_at(method, bcp), bcp, end); }
413
c7ec737733a6 6756528: Bytecodes::special_length_at reads past end of code buffer
kamg
parents: 0
diff changeset
409 static int raw_special_length_at(address bcp, address end = NULL);
2142
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
410 static int length_for_code_at(Bytecodes::Code code, address bcp) { int l = length_for(code); return l > 0 ? l : special_length_at(code, bcp); }
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
411 static int length_at (methodOop method, address bcp) { return length_for_code_at(code_at(method, bcp), bcp); }
8012aa3ccede 4926272: methodOopDesc::method_from_bcp is unsafe
never
parents: 1972
diff changeset
412 static int java_length_at (methodOop method, address bcp) { return length_for_code_at(java_code_at(method, bcp), bcp); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
413 static bool is_java_code (Code code) { return 0 <= code && code < number_of_java_codes; }
a61af66fc99e Initial load
duke
parents:
diff changeset
414
a61af66fc99e Initial load
duke
parents:
diff changeset
415 static bool is_aload (Code code) { return (code == _aload || code == _aload_0 || code == _aload_1
a61af66fc99e Initial load
duke
parents:
diff changeset
416 || code == _aload_2 || code == _aload_3); }
a61af66fc99e Initial load
duke
parents:
diff changeset
417 static bool is_astore (Code code) { return (code == _astore || code == _astore_0 || code == _astore_1
a61af66fc99e Initial load
duke
parents:
diff changeset
418 || code == _astore_2 || code == _astore_3); }
a61af66fc99e Initial load
duke
parents:
diff changeset
419
a61af66fc99e Initial load
duke
parents:
diff changeset
420 static bool is_zero_const (Code code) { return (code == _aconst_null || code == _iconst_0
a61af66fc99e Initial load
duke
parents:
diff changeset
421 || code == _fconst_0 || code == _dconst_0); }
3897
de847cac9235 7078382: JSR 292: don't count method handle adapters against inlining budgets
twisti
parents: 2192
diff changeset
422 static bool is_invoke (Code code) { return (_invokevirtual <= code && code <= _invokedynamic); }
de847cac9235 7078382: JSR 292: don't count method handle adapters against inlining budgets
twisti
parents: 2192
diff changeset
423
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
424 static int compute_flags (const char* format, int more_flags = 0); // compute the flags
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
425 static int flags (int code, bool is_wide) {
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
426 assert(code == (u_char)code, "must be a byte");
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
427 return _flags[code + (is_wide ? (1<<BitsPerByte) : 0)];
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
428 }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
429 static int format_bits (Code code, bool is_wide) { return flags(code, is_wide) & _all_fmt_bits; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
430 static bool has_all_flags (Code code, int test_flags, bool is_wide) {
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
431 return (flags(code, is_wide) & test_flags) == test_flags;
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
432 }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
433
0
a61af66fc99e Initial load
duke
parents:
diff changeset
434 // Initialization
a61af66fc99e Initial load
duke
parents:
diff changeset
435 static void initialize ();
a61af66fc99e Initial load
duke
parents:
diff changeset
436 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
437
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
438 #endif // SHARE_VM_INTERPRETER_BYTECODES_HPP