204
205 // For a lookup or switch table, return target destination
206 jint get_int_table( int index ) const {
207 return (jint)Bytes::get_Java_u4((address)&_table_base[index]);
208 }
209
210 int get_dest_table( int index ) const {
211 return cur_bci() + get_int_table(index);
212 }
213
214 // --- Constant pool access ---
215 int get_constant_raw_index() const;
216 int get_constant_pool_index() const;
217 int get_field_index();
218 int get_method_index();
219
220 // If this bytecode is a new, newarray, multianewarray, instanceof,
221 // or checkcast, get the referenced klass.
222 ciKlass* get_klass(bool& will_link);
223 int get_klass_index() const;
224
225 // If this bytecode is one of the ldc variants, get the referenced
226 // constant. Do not attempt to resolve it, since that would require
227 // execution of Java code. If it is not resolved, return an unloaded
228 // object (ciConstant.as_object()->is_loaded() == false).
229 ciConstant get_constant();
230 constantTag get_constant_pool_tag(int index) const;
231 BasicType get_basic_type_for_constant_at(int index) const;
232
233 constantTag get_raw_pool_tag(int index) const;
234
235 // True if the klass-using bytecode points to an unresolved klass
236 bool is_unresolved_klass() const {
237 constantTag tag = get_constant_pool_tag(get_klass_index());
238 return tag.is_unresolved_klass();
239 }
240
241 bool is_dynamic_constant() const {
242 assert(cur_bc() == Bytecodes::_ldc ||
243 cur_bc() == Bytecodes::_ldc_w ||
297 }
298
299 bool at_return_type() { return _pos == _sig->count(); }
300
301 bool is_done() { return _pos > _sig->count(); }
302
303 void next() {
304 if (_pos <= _sig->count()) {
305 _pos++;
306 }
307 }
308
309 ciType* type() {
310 if (at_return_type()) {
311 return _sig->return_type();
312 } else {
313 return _sig->type_at(_pos);
314 }
315 }
316
317 // next klass in the signature
318 ciKlass* next_klass() {
319 ciKlass* sig_k;
320 if (_holder != NULL) {
321 sig_k = _holder;
322 _holder = NULL;
323 } else {
324 while (!type()->is_klass()) {
325 next();
326 }
327 assert(!at_return_type(), "passed end of signature");
328 sig_k = type()->as_klass();
329 next();
330 }
331 return sig_k;
332 }
333 };
334
335
336 // ciExceptionHandlerStream
|
204
205 // For a lookup or switch table, return target destination
206 jint get_int_table( int index ) const {
207 return (jint)Bytes::get_Java_u4((address)&_table_base[index]);
208 }
209
210 int get_dest_table( int index ) const {
211 return cur_bci() + get_int_table(index);
212 }
213
214 // --- Constant pool access ---
215 int get_constant_raw_index() const;
216 int get_constant_pool_index() const;
217 int get_field_index();
218 int get_method_index();
219
220 // If this bytecode is a new, newarray, multianewarray, instanceof,
221 // or checkcast, get the referenced klass.
222 ciKlass* get_klass(bool& will_link);
223 int get_klass_index() const;
224 bool has_Q_signature() const;
225
226 // If this bytecode is one of the ldc variants, get the referenced
227 // constant. Do not attempt to resolve it, since that would require
228 // execution of Java code. If it is not resolved, return an unloaded
229 // object (ciConstant.as_object()->is_loaded() == false).
230 ciConstant get_constant();
231 constantTag get_constant_pool_tag(int index) const;
232 BasicType get_basic_type_for_constant_at(int index) const;
233
234 constantTag get_raw_pool_tag(int index) const;
235
236 // True if the klass-using bytecode points to an unresolved klass
237 bool is_unresolved_klass() const {
238 constantTag tag = get_constant_pool_tag(get_klass_index());
239 return tag.is_unresolved_klass();
240 }
241
242 bool is_dynamic_constant() const {
243 assert(cur_bc() == Bytecodes::_ldc ||
244 cur_bc() == Bytecodes::_ldc_w ||
298 }
299
300 bool at_return_type() { return _pos == _sig->count(); }
301
302 bool is_done() { return _pos > _sig->count(); }
303
304 void next() {
305 if (_pos <= _sig->count()) {
306 _pos++;
307 }
308 }
309
310 ciType* type() {
311 if (at_return_type()) {
312 return _sig->return_type();
313 } else {
314 return _sig->type_at(_pos);
315 }
316 }
317
318 bool is_null_free() {
319 if (at_return_type()) {
320 return _sig->returns_null_free_inline_type();
321 } else {
322 return _sig->is_null_free_at(_pos);
323 }
324 }
325
326 // next klass in the signature
327 ciKlass* next_klass() {
328 ciKlass* sig_k;
329 if (_holder != NULL) {
330 sig_k = _holder;
331 _holder = NULL;
332 } else {
333 while (!type()->is_klass()) {
334 next();
335 }
336 assert(!at_return_type(), "passed end of signature");
337 sig_k = type()->as_klass();
338 next();
339 }
340 return sig_k;
341 }
342 };
343
344
345 // ciExceptionHandlerStream
|