equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
222 } |
222 } |
223 return index; |
223 return index; |
224 } |
224 } |
225 |
225 |
226 // ------------------------------------------------------------------ |
226 // ------------------------------------------------------------------ |
227 // ciBytecodeStream::get_constant_cache_index |
|
228 // Return the CP cache index, or -1 if there isn't any. |
|
229 int ciBytecodeStream::get_constant_cache_index() const { |
|
230 // work-alike for Bytecode_loadconstant::cache_index() |
|
231 return has_cache_index() ? get_constant_raw_index() : -1; |
|
232 } |
|
233 |
|
234 // ------------------------------------------------------------------ |
|
235 // ciBytecodeStream::get_constant |
227 // ciBytecodeStream::get_constant |
236 // |
228 // |
237 // If this bytecode is one of the ldc variants, get the referenced |
229 // If this bytecode is one of the ldc variants, get the referenced |
238 // constant. |
230 // constant. |
239 ciConstant ciBytecodeStream::get_constant() { |
231 ciConstant ciBytecodeStream::get_constant() { |
313 int ciBytecodeStream::get_field_holder_index() { |
305 int ciBytecodeStream::get_field_holder_index() { |
314 GUARDED_VM_ENTRY( |
306 GUARDED_VM_ENTRY( |
315 ConstantPool* cpool = _holder->get_instanceKlass()->constants(); |
307 ConstantPool* cpool = _holder->get_instanceKlass()->constants(); |
316 return cpool->klass_ref_index_at(get_field_index()); |
308 return cpool->klass_ref_index_at(get_field_index()); |
317 ) |
309 ) |
318 } |
|
319 |
|
320 // ------------------------------------------------------------------ |
|
321 // ciBytecodeStream::get_field_signature_index |
|
322 // |
|
323 // Get the constant pool index of the signature of the field |
|
324 // referenced by the current bytecode. Used for generating |
|
325 // deoptimization information. |
|
326 int ciBytecodeStream::get_field_signature_index() { |
|
327 VM_ENTRY_MARK; |
|
328 ConstantPool* cpool = _holder->get_instanceKlass()->constants(); |
|
329 int nt_index = cpool->name_and_type_ref_index_at(get_field_index()); |
|
330 return cpool->signature_ref_index_at(nt_index); |
|
331 } |
310 } |
332 |
311 |
333 // ------------------------------------------------------------------ |
312 // ------------------------------------------------------------------ |
334 // ciBytecodeStream::get_method_index |
313 // ciBytecodeStream::get_method_index |
335 // |
314 // |
472 const int name_and_type_index = cpool->name_and_type_ref_index_at(method_index); |
451 const int name_and_type_index = cpool->name_and_type_ref_index_at(method_index); |
473 return cpool->signature_ref_index_at(name_and_type_index); |
452 return cpool->signature_ref_index_at(name_and_type_index); |
474 ) |
453 ) |
475 } |
454 } |
476 |
455 |
477 // ------------------------------------------------------------------ |
|
478 // ciBytecodeStream::get_resolved_references |
|
479 ciObjArray* ciBytecodeStream::get_resolved_references() { |
|
480 VM_ENTRY_MARK; |
|
481 // Get the constant pool. |
|
482 ConstantPool* cpool = _holder->get_instanceKlass()->constants(); |
|
483 |
|
484 // Create a resolved references array and return it. |
|
485 return CURRENT_ENV->get_object(cpool->resolved_references())->as_obj_array(); |
|
486 } |
|