Mercurial > hg > truffle
comparison src/share/vm/oops/constantPoolOop.hpp @ 1910:d1896d1dda3e
6981788: GC map generator sometimes picks up the wrong kind of instruction operand
Summary: Distinguish pool indexes from cache indexes in recently changed code.
Reviewed-by: never
author | jrose |
---|---|
date | Sat, 30 Oct 2010 11:45:35 -0700 |
parents | 083fde3b838e |
children | 3b2dea75431e |
comparison
equal
deleted
inserted
replaced
1909:d2e35ffae982 | 1910:d1896d1dda3e |
---|---|
412 return extract_high_short_from_int(ref_index); | 412 return extract_high_short_from_int(ref_index); |
413 } | 413 } |
414 | 414 |
415 // The following methods (name/signature/klass_ref_at, klass_ref_at_noresolve, | 415 // The following methods (name/signature/klass_ref_at, klass_ref_at_noresolve, |
416 // name_and_type_ref_index_at) all expect to be passed indices obtained | 416 // name_and_type_ref_index_at) all expect to be passed indices obtained |
417 // directly from the bytecode, and extracted according to java byte order. | 417 // directly from the bytecode. |
418 // If the indices are meant to refer to fields or methods, they are | 418 // If the indices are meant to refer to fields or methods, they are |
419 // actually potentially byte-swapped, rewritten constant pool cache indices. | 419 // actually rewritten constant pool cache indices. |
420 // The routine remap_instruction_operand_from_cache manages the adjustment | 420 // The routine remap_instruction_operand_from_cache manages the adjustment |
421 // of these values back to constant pool indices. | 421 // of these values back to constant pool indices. |
422 | 422 |
423 // There are also "uncached" versions which do not adjust the operand index; see below. | 423 // There are also "uncached" versions which do not adjust the operand index; see below. |
424 | |
425 // FIXME: Consider renaming these with a prefix "cached_" to make the distinction clear. | |
426 // In a few cases (the verifier) there are uses before a cpcache has been built, | |
427 // which are handled by a dynamic check in remap_instruction_operand_from_cache. | |
428 // FIXME: Remove the dynamic check, and adjust all callers to specify the correct mode. | |
424 | 429 |
425 // Lookup for entries consisting of (klass_index, name_and_type index) | 430 // Lookup for entries consisting of (klass_index, name_and_type index) |
426 klassOop klass_ref_at(int which, TRAPS); | 431 klassOop klass_ref_at(int which, TRAPS); |
427 symbolOop klass_ref_at_noresolve(int which); | 432 symbolOop klass_ref_at_noresolve(int which); |
428 symbolOop name_ref_at(int which) { return impl_name_ref_at(which, false); } | 433 symbolOop name_ref_at(int which) { return impl_name_ref_at(which, false); } |
482 static klassOop klass_ref_at_if_loaded (constantPoolHandle this_oop, int which); | 487 static klassOop klass_ref_at_if_loaded (constantPoolHandle this_oop, int which); |
483 // Same as above - but does LinkResolving. | 488 // Same as above - but does LinkResolving. |
484 static klassOop klass_ref_at_if_loaded_check(constantPoolHandle this_oop, int which, TRAPS); | 489 static klassOop klass_ref_at_if_loaded_check(constantPoolHandle this_oop, int which, TRAPS); |
485 | 490 |
486 // Routines currently used for annotations (only called by jvm.cpp) but which might be used in the | 491 // Routines currently used for annotations (only called by jvm.cpp) but which might be used in the |
487 // future by other Java code. These take constant pool indices rather than possibly-byte-swapped | 492 // future by other Java code. These take constant pool indices rather than |
488 // constant pool cache indices as do the peer methods above. | 493 // constant pool cache indices as do the peer methods above. |
489 symbolOop uncached_klass_ref_at_noresolve(int which); | 494 symbolOop uncached_klass_ref_at_noresolve(int which); |
490 symbolOop uncached_name_ref_at(int which) { return impl_name_ref_at(which, true); } | 495 symbolOop uncached_name_ref_at(int which) { return impl_name_ref_at(which, true); } |
491 symbolOop uncached_signature_ref_at(int which) { return impl_signature_ref_at(which, true); } | 496 symbolOop uncached_signature_ref_at(int which) { return impl_signature_ref_at(which, true); } |
492 int uncached_klass_ref_index_at(int which) { return impl_klass_ref_index_at(which, true); } | 497 int uncached_klass_ref_index_at(int which) { return impl_klass_ref_index_at(which, true); } |