annotate src/share/vm/interpreter/bytecodeStream.hpp @ 1721:413ad0331a0c

6977924: Changes for 6975078 produce build error with certain gcc versions Summary: The changes introduced for 6975078 assign badHeapOopVal to the _allocation field in the ResourceObj class. In 32 bit linux builds with certain versions of gcc this assignment will be flagged as an error while compiling allocation.cpp. In 32 bit builds the constant value badHeapOopVal (which is cast to an intptr_t) is negative. The _allocation field is typed as an unsigned intptr_t and gcc catches this as an error. Reviewed-by: jcoomes, ysr, phh
author johnc
date Wed, 18 Aug 2010 10:59:06 -0700
parents e9ff18c4ace7
children f95d63e2154a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1579
jrose
parents: 1552 1570
diff changeset
2 * Copyright (c) 1997, 2010, 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
a61af66fc99e Initial load
duke
parents:
diff changeset
25 // A BytecodeStream is used for fast iteration over the bytecodes
a61af66fc99e Initial load
duke
parents:
diff changeset
26 // of a methodOop.
a61af66fc99e Initial load
duke
parents:
diff changeset
27 //
a61af66fc99e Initial load
duke
parents:
diff changeset
28 // Usage:
a61af66fc99e Initial load
duke
parents:
diff changeset
29 //
a61af66fc99e Initial load
duke
parents:
diff changeset
30 // BytecodeStream s(method);
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // Bytecodes::Code c;
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // while ((c = s.next()) >= 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // ...
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // }
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
35
0
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // A RawBytecodeStream is a simple version of BytecodeStream.
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // It is used ONLY when we know the bytecodes haven't been rewritten
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
38 // yet, such as in the rewriter or the verifier.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
39
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
40 // Here is the common base class for both RawBytecodeStream and BytecodeStream:
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
41 class BaseBytecodeStream: StackObj {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
42 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
43 // stream buffer
a61af66fc99e Initial load
duke
parents:
diff changeset
44 methodHandle _method; // read from method directly
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // reading position
a61af66fc99e Initial load
duke
parents:
diff changeset
47 int _bci; // bci if current bytecode
a61af66fc99e Initial load
duke
parents:
diff changeset
48 int _next_bci; // bci of next bytecode
a61af66fc99e Initial load
duke
parents:
diff changeset
49 int _end_bci; // bci after the current iteration interval
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 // last bytecode read
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
52 Bytecodes::Code _raw_code;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
53 bool _is_wide;
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
54 bool _is_raw; // false in 'cooked' BytecodeStream
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
55
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
56 // Construction
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
57 BaseBytecodeStream(methodHandle method) : _method(method) {
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
58 set_interval(0, _method->code_size());
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
59 _is_raw = false;
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
60 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // Iteration control
a61af66fc99e Initial load
duke
parents:
diff changeset
64 void set_interval(int beg_bci, int end_bci) {
a61af66fc99e Initial load
duke
parents:
diff changeset
65 // iterate over the interval [beg_bci, end_bci)
a61af66fc99e Initial load
duke
parents:
diff changeset
66 assert(0 <= beg_bci && beg_bci <= method()->code_size(), "illegal beg_bci");
a61af66fc99e Initial load
duke
parents:
diff changeset
67 assert(0 <= end_bci && end_bci <= method()->code_size(), "illegal end_bci");
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // setup of iteration pointers
a61af66fc99e Initial load
duke
parents:
diff changeset
69 _bci = beg_bci;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 _next_bci = beg_bci;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 _end_bci = end_bci;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 }
a61af66fc99e Initial load
duke
parents:
diff changeset
73 void set_start (int beg_bci) {
a61af66fc99e Initial load
duke
parents:
diff changeset
74 set_interval(beg_bci, _method->code_size());
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
77 bool is_raw() const { return _is_raw; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
78
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
79 // Stream attributes
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
80 methodHandle method() const { return _method; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
81
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
82 int bci() const { return _bci; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
83 int next_bci() const { return _next_bci; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
84 int end_bci() const { return _end_bci; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
85
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
86 Bytecodes::Code raw_code() const { return _raw_code; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
87 bool is_wide() const { return _is_wide; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
88 int instruction_size() const { return (_next_bci - _bci); }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
89 bool is_last_bytecode() const { return _next_bci >= _end_bci; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
90
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
91 address bcp() const { return method()->code_base() + _bci; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
92 Bytecode* bytecode() const { return Bytecode_at(bcp()); }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
93
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
94 // State changes
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
95 void set_next_bci(int bci) { assert(0 <= bci && bci <= method()->code_size(), "illegal bci"); _next_bci = bci; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
96
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
97 // Bytecode-specific attributes
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
98 int dest() const { return bci() + bytecode()->get_offset_s2(raw_code()); }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
99 int dest_w() const { return bci() + bytecode()->get_offset_s4(raw_code()); }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
100
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
101 // One-byte indices.
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
102 int get_index_u1() const { assert_raw_index_size(1); return *(jubyte*)(bcp()+1); }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
103
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
104 protected:
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
105 void assert_raw_index_size(int size) const NOT_DEBUG_RETURN;
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
106 void assert_raw_stream(bool want_raw) const NOT_DEBUG_RETURN;
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
107 };
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
108
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
109 class RawBytecodeStream: public BaseBytecodeStream {
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
110 public:
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
111 // Construction
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
112 RawBytecodeStream(methodHandle method) : BaseBytecodeStream(method) {
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
113 _is_raw = true;
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
114 }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
115
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
116 public:
0
a61af66fc99e Initial load
duke
parents:
diff changeset
117 // Iteration
a61af66fc99e Initial load
duke
parents:
diff changeset
118 // Use raw_next() rather than next() for faster method reference
a61af66fc99e Initial load
duke
parents:
diff changeset
119 Bytecodes::Code raw_next() {
a61af66fc99e Initial load
duke
parents:
diff changeset
120 Bytecodes::Code code;
a61af66fc99e Initial load
duke
parents:
diff changeset
121 // set reading position
a61af66fc99e Initial load
duke
parents:
diff changeset
122 _bci = _next_bci;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 assert(!is_last_bytecode(), "caller should check is_last_bytecode()");
a61af66fc99e Initial load
duke
parents:
diff changeset
124
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
125 address bcp = this->bcp();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
126 code = Bytecodes::code_or_bp_at(bcp);
a61af66fc99e Initial load
duke
parents:
diff changeset
127
a61af66fc99e Initial load
duke
parents:
diff changeset
128 // set next bytecode position
a61af66fc99e Initial load
duke
parents:
diff changeset
129 int l = Bytecodes::length_for(code);
a61af66fc99e Initial load
duke
parents:
diff changeset
130 if (l > 0 && (_bci + l) <= _end_bci) {
a61af66fc99e Initial load
duke
parents:
diff changeset
131 assert(code != Bytecodes::_wide && code != Bytecodes::_tableswitch
a61af66fc99e Initial load
duke
parents:
diff changeset
132 && code != Bytecodes::_lookupswitch, "can't be special bytecode");
a61af66fc99e Initial load
duke
parents:
diff changeset
133 _is_wide = false;
a61af66fc99e Initial load
duke
parents:
diff changeset
134 _next_bci += l;
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
135 _raw_code = code;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
136 return code;
a61af66fc99e Initial load
duke
parents:
diff changeset
137 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
138 return raw_next_special(code);
a61af66fc99e Initial load
duke
parents:
diff changeset
139 }
a61af66fc99e Initial load
duke
parents:
diff changeset
140 }
a61af66fc99e Initial load
duke
parents:
diff changeset
141 Bytecodes::Code raw_next_special(Bytecodes::Code code);
a61af66fc99e Initial load
duke
parents:
diff changeset
142
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
143 // Unsigned indices, widening, with no swapping of bytes
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
144 int get_index() const { return (is_wide()) ? get_index_u2_raw(bcp() + 2) : get_index_u1(); }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
145 // Get an unsigned 2-byte index, with no swapping of bytes.
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
146 int get_index_u2() const { assert(!is_wide(), ""); return get_index_u2_raw(bcp() + 1); }
726
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 0
diff changeset
147
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 0
diff changeset
148 private:
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
149 int get_index_u2_raw(address p) const {
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
150 assert_raw_index_size(2); assert_raw_stream(true);
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
151 return Bytes::get_Java_u2(p);
726
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 0
diff changeset
152 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
153 };
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 // In BytecodeStream, non-java bytecodes will be translated into the
a61af66fc99e Initial load
duke
parents:
diff changeset
156 // corresponding java bytecodes.
a61af66fc99e Initial load
duke
parents:
diff changeset
157
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
158 class BytecodeStream: public BaseBytecodeStream {
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
159 Bytecodes::Code _code;
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
160
0
a61af66fc99e Initial load
duke
parents:
diff changeset
161 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
162 // Construction
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
163 BytecodeStream(methodHandle method) : BaseBytecodeStream(method) { }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 // Iteration
a61af66fc99e Initial load
duke
parents:
diff changeset
166 Bytecodes::Code next() {
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
167 Bytecodes::Code raw_code, code;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
168 // set reading position
a61af66fc99e Initial load
duke
parents:
diff changeset
169 _bci = _next_bci;
a61af66fc99e Initial load
duke
parents:
diff changeset
170 if (is_last_bytecode()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
171 // indicate end of bytecode stream
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
172 raw_code = code = Bytecodes::_illegal;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
173 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
174 // get bytecode
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
175 address bcp = this->bcp();
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
176 raw_code = Bytecodes::code_at(bcp);
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
177 code = Bytecodes::java_code(raw_code);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
178 // set next bytecode position
a61af66fc99e Initial load
duke
parents:
diff changeset
179 //
a61af66fc99e Initial load
duke
parents:
diff changeset
180 // note that we cannot advance before having the
a61af66fc99e Initial load
duke
parents:
diff changeset
181 // tty bytecode otherwise the stepping is wrong!
a61af66fc99e Initial load
duke
parents:
diff changeset
182 // (carefull: length_for(...) must be used first!)
a61af66fc99e Initial load
duke
parents:
diff changeset
183 int l = Bytecodes::length_for(code);
a61af66fc99e Initial load
duke
parents:
diff changeset
184 if (l == 0) l = Bytecodes::length_at(bcp);
a61af66fc99e Initial load
duke
parents:
diff changeset
185 _next_bci += l;
a61af66fc99e Initial load
duke
parents:
diff changeset
186 assert(_bci < _next_bci, "length must be > 0");
a61af66fc99e Initial load
duke
parents:
diff changeset
187 // set attributes
a61af66fc99e Initial load
duke
parents:
diff changeset
188 _is_wide = false;
a61af66fc99e Initial load
duke
parents:
diff changeset
189 // check for special (uncommon) cases
a61af66fc99e Initial load
duke
parents:
diff changeset
190 if (code == Bytecodes::_wide) {
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
191 raw_code = (Bytecodes::Code)bcp[1];
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
192 code = raw_code; // wide BCs are always Java-normal
0
a61af66fc99e Initial load
duke
parents:
diff changeset
193 _is_wide = true;
a61af66fc99e Initial load
duke
parents:
diff changeset
194 }
a61af66fc99e Initial load
duke
parents:
diff changeset
195 assert(Bytecodes::is_java_code(code), "sanity check");
a61af66fc99e Initial load
duke
parents:
diff changeset
196 }
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
197 _raw_code = raw_code;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
198 _code = code;
a61af66fc99e Initial load
duke
parents:
diff changeset
199 return _code;
a61af66fc99e Initial load
duke
parents:
diff changeset
200 }
a61af66fc99e Initial load
duke
parents:
diff changeset
201
a61af66fc99e Initial load
duke
parents:
diff changeset
202 bool is_active_breakpoint() const { return Bytecodes::is_active_breakpoint_at(bcp()); }
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
203 Bytecodes::Code code() const { return _code; }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
204
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
205 // Unsigned indices, widening
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
206 int get_index() const { return is_wide() ? bytecode()->get_index_u2(raw_code(), true) : get_index_u1(); }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
207 // Get an unsigned 2-byte index, swapping the bytes if necessary.
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
208 int get_index_u2() const { assert_raw_stream(false);
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
209 return bytecode()->get_index_u2(raw_code(), false); }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
210 // Get an unsigned 2-byte index in native order.
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
211 int get_index_u2_cpcache() const { assert_raw_stream(false);
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
212 return bytecode()->get_index_u2_cpcache(raw_code()); }
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
213 int get_index_u4() const { assert_raw_stream(false);
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
214 return bytecode()->get_index_u4(raw_code()); }
1570
de91a2f25c7e 6956164: nightly regressions from 6939207
jrose
parents: 1565
diff changeset
215 bool has_index_u4() const { return bytecode()->has_index_u4(raw_code()); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
216 };