Path: blob/master/src/hotspot/share/ci/ciInstanceKlass.cpp
40930 views
/*1* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "ci/ciField.hpp"26#include "ci/ciInstance.hpp"27#include "ci/ciInstanceKlass.hpp"28#include "ci/ciUtilities.inline.hpp"29#include "classfile/javaClasses.hpp"30#include "classfile/systemDictionary.hpp"31#include "classfile/vmClasses.hpp"32#include "memory/allocation.hpp"33#include "memory/allocation.inline.hpp"34#include "memory/resourceArea.hpp"35#include "oops/instanceKlass.inline.hpp"36#include "oops/klass.inline.hpp"37#include "oops/oop.inline.hpp"38#include "oops/fieldStreams.inline.hpp"39#include "runtime/fieldDescriptor.inline.hpp"40#include "runtime/handles.inline.hpp"41#include "runtime/jniHandles.inline.hpp"4243// ciInstanceKlass44//45// This class represents a Klass* in the HotSpot virtual machine46// whose Klass part in an InstanceKlass.474849// ------------------------------------------------------------------50// ciInstanceKlass::ciInstanceKlass51//52// Loaded instance klass.53ciInstanceKlass::ciInstanceKlass(Klass* k) :54ciKlass(k)55{56assert(get_Klass()->is_instance_klass(), "wrong type");57assert(get_instanceKlass()->is_loaded(), "must be at least loaded");58InstanceKlass* ik = get_instanceKlass();5960AccessFlags access_flags = ik->access_flags();61_flags = ciFlags(access_flags);62_has_finalizer = access_flags.has_finalizer();63_has_subklass = flags().is_final() ? subklass_false : subklass_unknown;64_init_state = ik->init_state();65_nonstatic_field_size = ik->nonstatic_field_size();66_has_nonstatic_fields = ik->has_nonstatic_fields();67_has_nonstatic_concrete_methods = ik->has_nonstatic_concrete_methods();68_is_hidden = ik->is_hidden();69_is_record = ik->is_record();70_nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields:71_has_injected_fields = -1;72_implementor = NULL; // we will fill these lazily7374// Ensure that the metadata wrapped by the ciMetadata is kept alive by GC.75// This is primarily useful for metadata which is considered as weak roots76// by the GC but need to be strong roots if reachable from a current compilation.77// InstanceKlass are created for both weak and strong metadata. Ensuring this metadata78// alive covers the cases where there are weak roots without performance cost.79oop holder = ik->klass_holder();80if (ik->class_loader_data()->has_class_mirror_holder()) {81// Though ciInstanceKlass records class loader oop, it's not enough to keep82// non-strong hidden classes alive (loader == NULL). Klass holder should83// be used instead. It is enough to record a ciObject, since cached elements are never removed84// during ciObjectFactory lifetime. ciObjectFactory itself is created for85// every compilation and lives for the whole duration of the compilation.86assert(holder != NULL, "holder of hidden class is the mirror which is never null");87(void)CURRENT_ENV->get_object(holder);88}8990Thread *thread = Thread::current();91if (ciObjectFactory::is_initialized()) {92_loader = JNIHandles::make_local(thread, ik->class_loader());93_protection_domain = JNIHandles::make_local(thread,94ik->protection_domain());95_is_shared = false;96} else {97Handle h_loader(thread, ik->class_loader());98Handle h_protection_domain(thread, ik->protection_domain());99_loader = JNIHandles::make_global(h_loader);100_protection_domain = JNIHandles::make_global(h_protection_domain);101_is_shared = true;102}103104// Lazy fields get filled in only upon request.105_super = NULL;106_java_mirror = NULL;107108if (is_shared()) {109if (k != vmClasses::Object_klass()) {110super();111}112//compute_nonstatic_fields(); // done outside of constructor113}114115_field_cache = NULL;116}117118// Version for unloaded classes:119ciInstanceKlass::ciInstanceKlass(ciSymbol* name,120jobject loader, jobject protection_domain)121: ciKlass(name, T_OBJECT)122{123assert(name->char_at(0) != JVM_SIGNATURE_ARRAY, "not an instance klass");124_init_state = (InstanceKlass::ClassState)0;125_nonstatic_field_size = -1;126_has_nonstatic_fields = false;127_nonstatic_fields = NULL;128_has_injected_fields = -1;129_is_hidden = false;130_is_record = false;131_loader = loader;132_protection_domain = protection_domain;133_is_shared = false;134_super = NULL;135_java_mirror = NULL;136_field_cache = NULL;137}138139140141// ------------------------------------------------------------------142// ciInstanceKlass::compute_shared_is_initialized143void ciInstanceKlass::compute_shared_init_state() {144GUARDED_VM_ENTRY(145InstanceKlass* ik = get_instanceKlass();146_init_state = ik->init_state();147)148}149150// ------------------------------------------------------------------151// ciInstanceKlass::compute_shared_has_subklass152bool ciInstanceKlass::compute_shared_has_subklass() {153GUARDED_VM_ENTRY(154InstanceKlass* ik = get_instanceKlass();155_has_subklass = ik->subklass() != NULL ? subklass_true : subklass_false;156return _has_subklass == subklass_true;157)158}159160// ------------------------------------------------------------------161// ciInstanceKlass::loader162oop ciInstanceKlass::loader() {163ASSERT_IN_VM;164return JNIHandles::resolve(_loader);165}166167// ------------------------------------------------------------------168// ciInstanceKlass::loader_handle169jobject ciInstanceKlass::loader_handle() {170return _loader;171}172173// ------------------------------------------------------------------174// ciInstanceKlass::protection_domain175oop ciInstanceKlass::protection_domain() {176ASSERT_IN_VM;177return JNIHandles::resolve(_protection_domain);178}179180// ------------------------------------------------------------------181// ciInstanceKlass::protection_domain_handle182jobject ciInstanceKlass::protection_domain_handle() {183return _protection_domain;184}185186// ------------------------------------------------------------------187// ciInstanceKlass::field_cache188//189// Get the field cache associated with this klass.190ciConstantPoolCache* ciInstanceKlass::field_cache() {191if (is_shared()) {192return NULL;193}194if (_field_cache == NULL) {195assert(!is_java_lang_Object(), "Object has no fields");196Arena* arena = CURRENT_ENV->arena();197_field_cache = new (arena) ciConstantPoolCache(arena, 5);198}199return _field_cache;200}201202// ------------------------------------------------------------------203// ciInstanceKlass::get_canonical_holder204//205ciInstanceKlass* ciInstanceKlass::get_canonical_holder(int offset) {206#ifdef ASSERT207if (!(offset >= 0 && offset < layout_helper())) {208tty->print("*** get_canonical_holder(%d) on ", offset);209this->print();210tty->print_cr(" ***");211};212assert(offset >= 0 && offset < layout_helper(), "offset must be tame");213#endif214215if (offset < instanceOopDesc::base_offset_in_bytes()) {216// All header offsets belong properly to java/lang/Object.217return CURRENT_ENV->Object_klass();218}219220ciInstanceKlass* self = this;221assert(self->is_loaded(), "must be loaded to access field info");222ciField* field = self->get_field_by_offset(offset, false);223if (field != NULL) {224return field->holder();225} else {226for (;;) {227assert(self->is_loaded(), "must be loaded to have size");228ciInstanceKlass* super = self->super();229if (super == NULL || super->nof_nonstatic_fields() == 0) {230return self;231} else {232self = super; // return super->get_canonical_holder(offset)233}234}235}236}237238// ------------------------------------------------------------------239// ciInstanceKlass::is_java_lang_Object240//241// Is this klass java.lang.Object?242bool ciInstanceKlass::is_java_lang_Object() const {243return equals(CURRENT_ENV->Object_klass());244}245246// ------------------------------------------------------------------247// ciInstanceKlass::uses_default_loader248bool ciInstanceKlass::uses_default_loader() const {249// Note: We do not need to resolve the handle or enter the VM250// in order to test null-ness.251return _loader == NULL;252}253254// ------------------------------------------------------------------255256/**257* Return basic type of boxed value for box klass or T_OBJECT if not.258*/259BasicType ciInstanceKlass::box_klass_type() const {260if (uses_default_loader() && is_loaded()) {261return vmClasses::box_klass_type(get_Klass());262} else {263return T_OBJECT;264}265}266267/**268* Is this boxing klass?269*/270bool ciInstanceKlass::is_box_klass() const {271return is_java_primitive(box_klass_type());272}273274/**275* Is this boxed value offset?276*/277bool ciInstanceKlass::is_boxed_value_offset(int offset) const {278BasicType bt = box_klass_type();279return is_java_primitive(bt) &&280(offset == java_lang_boxing_object::value_offset(bt));281}282283static bool is_klass_initialized(Symbol* klass_name) {284VM_ENTRY_MARK;285InstanceKlass* ik = SystemDictionary::find_instance_klass(klass_name, Handle(), Handle());286return ik != nullptr && ik->is_initialized();287}288289bool ciInstanceKlass::is_box_cache_valid() const {290BasicType box_type = box_klass_type();291292if (box_type != T_OBJECT) {293switch(box_type) {294case T_INT: return is_klass_initialized(java_lang_Integer_IntegerCache::symbol());295case T_CHAR: return is_klass_initialized(java_lang_Character_CharacterCache::symbol());296case T_SHORT: return is_klass_initialized(java_lang_Short_ShortCache::symbol());297case T_BYTE: return is_klass_initialized(java_lang_Byte_ByteCache::symbol());298case T_LONG: return is_klass_initialized(java_lang_Long_LongCache::symbol());299case T_BOOLEAN:300case T_FLOAT:301case T_DOUBLE: return true;302default:;303}304}305return false;306}307308// ------------------------------------------------------------------309// ciInstanceKlass::is_in_package310//311// Is this klass in the given package?312bool ciInstanceKlass::is_in_package(const char* packagename, int len) {313// To avoid class loader mischief, this test always rejects application classes.314if (!uses_default_loader())315return false;316GUARDED_VM_ENTRY(317return is_in_package_impl(packagename, len);318)319}320321bool ciInstanceKlass::is_in_package_impl(const char* packagename, int len) {322ASSERT_IN_VM;323324// If packagename contains trailing '/' exclude it from the325// prefix-test since we test for it explicitly.326if (packagename[len - 1] == '/')327len--;328329if (!name()->starts_with(packagename, len))330return false;331332// Test if the class name is something like "java/lang".333if ((len + 1) > name()->utf8_length())334return false;335336// Test for trailing '/'337if (name()->char_at(len) != '/')338return false;339340// Make sure it's not actually in a subpackage:341if (name()->index_of_at(len+1, "/", 1) >= 0)342return false;343344return true;345}346347// ------------------------------------------------------------------348// ciInstanceKlass::print_impl349//350// Implementation of the print method.351void ciInstanceKlass::print_impl(outputStream* st) {352ciKlass::print_impl(st);353GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i(loader()));)354if (is_loaded()) {355st->print(" loaded=true initialized=%s finalized=%s subklass=%s size=%d flags=",356bool_to_str(is_initialized()),357bool_to_str(has_finalizer()),358bool_to_str(has_subklass()),359layout_helper());360361_flags.print_klass_flags();362363if (_super) {364st->print(" super=");365_super->print_name();366}367if (_java_mirror) {368st->print(" mirror=PRESENT");369}370} else {371st->print(" loaded=false");372}373}374375// ------------------------------------------------------------------376// ciInstanceKlass::super377//378// Get the superklass of this klass.379ciInstanceKlass* ciInstanceKlass::super() {380assert(is_loaded(), "must be loaded");381if (_super == NULL && !is_java_lang_Object()) {382GUARDED_VM_ENTRY(383Klass* super_klass = get_instanceKlass()->super();384_super = CURRENT_ENV->get_instance_klass(super_klass);385)386}387return _super;388}389390// ------------------------------------------------------------------391// ciInstanceKlass::java_mirror392//393// Get the instance of java.lang.Class corresponding to this klass.394// Cache it on this->_java_mirror.395ciInstance* ciInstanceKlass::java_mirror() {396if (is_shared()) {397return ciKlass::java_mirror();398}399if (_java_mirror == NULL) {400_java_mirror = ciKlass::java_mirror();401}402return _java_mirror;403}404405// ------------------------------------------------------------------406// ciInstanceKlass::unique_concrete_subklass407ciInstanceKlass* ciInstanceKlass::unique_concrete_subklass() {408if (!is_loaded()) return NULL; // No change if class is not loaded409if (!is_abstract()) return NULL; // Only applies to abstract classes.410if (!has_subklass()) return NULL; // Must have at least one subklass.411VM_ENTRY_MARK;412InstanceKlass* ik = get_instanceKlass();413Klass* up = ik->up_cast_abstract();414assert(up->is_instance_klass(), "must be InstanceKlass");415if (ik == up) {416return NULL;417}418return CURRENT_THREAD_ENV->get_instance_klass(up);419}420421// ------------------------------------------------------------------422// ciInstanceKlass::has_finalizable_subclass423bool ciInstanceKlass::has_finalizable_subclass() {424if (!is_loaded()) return true;425VM_ENTRY_MARK;426return Dependencies::find_finalizable_subclass(get_instanceKlass()) != NULL;427}428429// ------------------------------------------------------------------430// ciInstanceKlass::contains_field_offset431bool ciInstanceKlass::contains_field_offset(int offset) {432VM_ENTRY_MARK;433return get_instanceKlass()->contains_field_offset(offset);434}435436// ------------------------------------------------------------------437// ciInstanceKlass::get_field_by_offset438ciField* ciInstanceKlass::get_field_by_offset(int field_offset, bool is_static) {439if (!is_static) {440for (int i = 0, len = nof_nonstatic_fields(); i < len; i++) {441ciField* field = _nonstatic_fields->at(i);442int field_off = field->offset_in_bytes();443if (field_off == field_offset)444return field;445if (field_off > field_offset)446break;447// could do binary search or check bins, but probably not worth it448}449return NULL;450}451VM_ENTRY_MARK;452InstanceKlass* k = get_instanceKlass();453fieldDescriptor fd;454if (!k->find_field_from_offset(field_offset, is_static, &fd)) {455return NULL;456}457ciField* field = new (CURRENT_THREAD_ENV->arena()) ciField(&fd);458return field;459}460461// ------------------------------------------------------------------462// ciInstanceKlass::get_field_by_name463ciField* ciInstanceKlass::get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static) {464VM_ENTRY_MARK;465InstanceKlass* k = get_instanceKlass();466fieldDescriptor fd;467Klass* def = k->find_field(name->get_symbol(), signature->get_symbol(), is_static, &fd);468if (def == NULL) {469return NULL;470}471ciField* field = new (CURRENT_THREAD_ENV->arena()) ciField(&fd);472return field;473}474475476static int sort_field_by_offset(ciField** a, ciField** b) {477return (*a)->offset_in_bytes() - (*b)->offset_in_bytes();478// (no worries about 32-bit overflow...)479}480481// ------------------------------------------------------------------482// ciInstanceKlass::compute_nonstatic_fields483int ciInstanceKlass::compute_nonstatic_fields() {484assert(is_loaded(), "must be loaded");485486if (_nonstatic_fields != NULL)487return _nonstatic_fields->length();488489if (!has_nonstatic_fields()) {490Arena* arena = CURRENT_ENV->arena();491_nonstatic_fields = new (arena) GrowableArray<ciField*>(arena, 0, 0, NULL);492return 0;493}494assert(!is_java_lang_Object(), "bootstrap OK");495496// Size in bytes of my fields, including inherited fields.497int fsize = nonstatic_field_size() * heapOopSize;498499ciInstanceKlass* super = this->super();500GrowableArray<ciField*>* super_fields = NULL;501if (super != NULL && super->has_nonstatic_fields()) {502int super_flen = super->nof_nonstatic_fields();503super_fields = super->_nonstatic_fields;504assert(super_flen == 0 || super_fields != NULL, "first get nof_fields");505}506507GrowableArray<ciField*>* fields = NULL;508GUARDED_VM_ENTRY({509fields = compute_nonstatic_fields_impl(super_fields);510});511512if (fields == NULL) {513// This can happen if this class (java.lang.Class) has invisible fields.514if (super_fields != NULL) {515_nonstatic_fields = super_fields;516return super_fields->length();517} else {518return 0;519}520}521522int flen = fields->length();523524// Now sort them by offset, ascending.525// (In principle, they could mix with superclass fields.)526fields->sort(sort_field_by_offset);527_nonstatic_fields = fields;528return flen;529}530531GrowableArray<ciField*>*532ciInstanceKlass::compute_nonstatic_fields_impl(GrowableArray<ciField*>*533super_fields) {534ASSERT_IN_VM;535Arena* arena = CURRENT_ENV->arena();536int flen = 0;537GrowableArray<ciField*>* fields = NULL;538InstanceKlass* k = get_instanceKlass();539for (JavaFieldStream fs(k); !fs.done(); fs.next()) {540if (fs.access_flags().is_static()) continue;541flen += 1;542}543544// allocate the array:545if (flen == 0) {546return NULL; // return nothing if none are locally declared547}548if (super_fields != NULL) {549flen += super_fields->length();550}551fields = new (arena) GrowableArray<ciField*>(arena, flen, 0, NULL);552if (super_fields != NULL) {553fields->appendAll(super_fields);554}555556for (JavaFieldStream fs(k); !fs.done(); fs.next()) {557if (fs.access_flags().is_static()) continue;558fieldDescriptor& fd = fs.field_descriptor();559ciField* field = new (arena) ciField(&fd);560fields->append(field);561}562assert(fields->length() == flen, "sanity");563return fields;564}565566bool ciInstanceKlass::compute_injected_fields_helper() {567ASSERT_IN_VM;568InstanceKlass* k = get_instanceKlass();569570for (InternalFieldStream fs(k); !fs.done(); fs.next()) {571if (fs.access_flags().is_static()) continue;572return true;573}574return false;575}576577void ciInstanceKlass::compute_injected_fields() {578assert(is_loaded(), "must be loaded");579580int has_injected_fields = 0;581if (super() != NULL && super()->has_injected_fields()) {582has_injected_fields = 1;583} else {584GUARDED_VM_ENTRY({585has_injected_fields = compute_injected_fields_helper() ? 1 : 0;586});587}588// may be concurrently initialized for shared ciInstanceKlass objects589assert(_has_injected_fields == -1 || _has_injected_fields == has_injected_fields, "broken concurrent initialization");590_has_injected_fields = has_injected_fields;591}592593bool ciInstanceKlass::has_object_fields() const {594GUARDED_VM_ENTRY(595return get_instanceKlass()->nonstatic_oop_map_size() > 0;596);597}598599// ------------------------------------------------------------------600// ciInstanceKlass::find_method601//602// Find a method in this klass.603ciMethod* ciInstanceKlass::find_method(ciSymbol* name, ciSymbol* signature) {604VM_ENTRY_MARK;605InstanceKlass* k = get_instanceKlass();606Symbol* name_sym = name->get_symbol();607Symbol* sig_sym= signature->get_symbol();608609Method* m = k->find_method(name_sym, sig_sym);610if (m == NULL) return NULL;611612return CURRENT_THREAD_ENV->get_method(m);613}614615// ------------------------------------------------------------------616// ciInstanceKlass::is_leaf_type617bool ciInstanceKlass::is_leaf_type() {618assert(is_loaded(), "must be loaded");619if (is_shared()) {620return is_final(); // approximately correct621} else {622return !has_subklass() && (nof_implementors() == 0);623}624}625626// ------------------------------------------------------------------627// ciInstanceKlass::implementor628//629// Report an implementor of this interface.630// Note that there are various races here, since my copy631// of _nof_implementors might be out of date with respect632// to results returned by InstanceKlass::implementor.633// This is OK, since any dependencies we decide to assert634// will be checked later under the Compile_lock.635ciInstanceKlass* ciInstanceKlass::implementor() {636ciInstanceKlass* impl = _implementor;637if (impl == NULL) {638// Go into the VM to fetch the implementor.639{640VM_ENTRY_MARK;641MutexLocker ml(Compile_lock);642Klass* k = get_instanceKlass()->implementor();643if (k != NULL) {644if (k == get_instanceKlass()) {645// More than one implementors. Use 'this' in this case.646impl = this;647} else {648impl = CURRENT_THREAD_ENV->get_instance_klass(k);649}650}651}652// Memoize this result.653if (!is_shared()) {654_implementor = impl;655}656}657return impl;658}659660// Utility class for printing of the contents of the static fields for661// use by compilation replay. It only prints out the information that662// could be consumed by the compiler, so for primitive types it prints663// out the actual value. For Strings it's the actual string value.664// For array types it it's first level array size since that's the665// only value which statically unchangeable. For all other reference666// types it simply prints out the dynamic type.667668class StaticFinalFieldPrinter : public FieldClosure {669outputStream* _out;670const char* _holder;671public:672StaticFinalFieldPrinter(outputStream* out, const char* holder) :673_out(out),674_holder(holder) {675}676void do_field(fieldDescriptor* fd) {677if (fd->is_final() && !fd->has_initial_value()) {678ResourceMark rm;679oop mirror = fd->field_holder()->java_mirror();680_out->print("staticfield %s %s %s ", _holder, fd->name()->as_quoted_ascii(), fd->signature()->as_quoted_ascii());681switch (fd->field_type()) {682case T_BYTE: _out->print_cr("%d", mirror->byte_field(fd->offset())); break;683case T_BOOLEAN: _out->print_cr("%d", mirror->bool_field(fd->offset())); break;684case T_SHORT: _out->print_cr("%d", mirror->short_field(fd->offset())); break;685case T_CHAR: _out->print_cr("%d", mirror->char_field(fd->offset())); break;686case T_INT: _out->print_cr("%d", mirror->int_field(fd->offset())); break;687case T_LONG: _out->print_cr(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset()))); break;688case T_FLOAT: {689float f = mirror->float_field(fd->offset());690_out->print_cr("%d", *(int*)&f);691break;692}693case T_DOUBLE: {694double d = mirror->double_field(fd->offset());695_out->print_cr(INT64_FORMAT, *(int64_t*)&d);696break;697}698case T_ARRAY: // fall-through699case T_OBJECT: {700oop value = mirror->obj_field_acquire(fd->offset());701if (value == NULL) {702_out->print_cr("null");703} else if (value->is_instance()) {704assert(fd->field_type() == T_OBJECT, "");705if (value->is_a(vmClasses::String_klass())) {706const char* ascii_value = java_lang_String::as_quoted_ascii(value);707_out->print("\"%s\"", (ascii_value != NULL) ? ascii_value : "");708} else {709const char* klass_name = value->klass()->name()->as_quoted_ascii();710_out->print_cr("%s", klass_name);711}712} else if (value->is_array()) {713typeArrayOop ta = (typeArrayOop)value;714_out->print("%d", ta->length());715if (value->is_objArray()) {716objArrayOop oa = (objArrayOop)value;717const char* klass_name = value->klass()->name()->as_quoted_ascii();718_out->print(" %s", klass_name);719}720_out->cr();721} else {722ShouldNotReachHere();723}724break;725}726default:727ShouldNotReachHere();728}729}730}731};732733734void ciInstanceKlass::dump_replay_data(outputStream* out) {735ResourceMark rm;736737InstanceKlass* ik = get_instanceKlass();738ConstantPool* cp = ik->constants();739740// Try to record related loaded classes741Klass* sub = ik->subklass();742while (sub != NULL) {743if (sub->is_instance_klass() && !sub->is_hidden()) {744out->print_cr("instanceKlass %s", sub->name()->as_quoted_ascii());745}746sub = sub->next_sibling();747}748749// Dump out the state of the constant pool tags. During replay the750// tags will be validated for things which shouldn't change and751// classes will be resolved if the tags indicate that they were752// resolved at compile time.753out->print("ciInstanceKlass %s %d %d %d", ik->name()->as_quoted_ascii(),754is_linked(), is_initialized(), cp->length());755for (int index = 1; index < cp->length(); index++) {756out->print(" %d", cp->tags()->at(index));757}758out->cr();759if (is_initialized()) {760// Dump out the static final fields in case the compilation relies761// on their value for correct replay.762StaticFinalFieldPrinter sffp(out, ik->name()->as_quoted_ascii());763ik->do_local_static_fields(&sffp);764}765}766767#ifdef ASSERT768bool ciInstanceKlass::debug_final_field_at(int offset) {769GUARDED_VM_ENTRY(770InstanceKlass* ik = get_instanceKlass();771fieldDescriptor fd;772if (ik->find_field_from_offset(offset, false, &fd)) {773return fd.is_final();774}775);776return false;777}778779bool ciInstanceKlass::debug_stable_field_at(int offset) {780GUARDED_VM_ENTRY(781InstanceKlass* ik = get_instanceKlass();782fieldDescriptor fd;783if (ik->find_field_from_offset(offset, false, &fd)) {784return fd.is_stable();785}786);787return false;788}789#endif790791792