Path: blob/master/src/hotspot/share/ci/ciInstanceKlass.cpp
64441 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_size_in_bytes())) {208tty->print("*** get_canonical_holder(%d) on ", offset);209this->print();210tty->print_cr(" ***");211};212assert(offset >= 0 && offset < layout_helper_size_in_bytes(), "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 ||230super->nof_nonstatic_fields() == 0 ||231super->layout_helper_size_in_bytes() <= offset) {232return self;233} else {234self = super; // return super->get_canonical_holder(offset)235}236}237}238}239240// ------------------------------------------------------------------241// ciInstanceKlass::is_java_lang_Object242//243// Is this klass java.lang.Object?244bool ciInstanceKlass::is_java_lang_Object() const {245return equals(CURRENT_ENV->Object_klass());246}247248// ------------------------------------------------------------------249// ciInstanceKlass::uses_default_loader250bool ciInstanceKlass::uses_default_loader() const {251// Note: We do not need to resolve the handle or enter the VM252// in order to test null-ness.253return _loader == NULL;254}255256// ------------------------------------------------------------------257258/**259* Return basic type of boxed value for box klass or T_OBJECT if not.260*/261BasicType ciInstanceKlass::box_klass_type() const {262if (uses_default_loader() && is_loaded()) {263return vmClasses::box_klass_type(get_Klass());264} else {265return T_OBJECT;266}267}268269/**270* Is this boxing klass?271*/272bool ciInstanceKlass::is_box_klass() const {273return is_java_primitive(box_klass_type());274}275276/**277* Is this boxed value offset?278*/279bool ciInstanceKlass::is_boxed_value_offset(int offset) const {280BasicType bt = box_klass_type();281return is_java_primitive(bt) &&282(offset == java_lang_boxing_object::value_offset(bt));283}284285static bool is_klass_initialized(Symbol* klass_name) {286VM_ENTRY_MARK;287InstanceKlass* ik = SystemDictionary::find_instance_klass(klass_name, Handle(), Handle());288return ik != nullptr && ik->is_initialized();289}290291bool ciInstanceKlass::is_box_cache_valid() const {292BasicType box_type = box_klass_type();293294if (box_type != T_OBJECT) {295switch(box_type) {296case T_INT: return is_klass_initialized(java_lang_Integer_IntegerCache::symbol());297case T_CHAR: return is_klass_initialized(java_lang_Character_CharacterCache::symbol());298case T_SHORT: return is_klass_initialized(java_lang_Short_ShortCache::symbol());299case T_BYTE: return is_klass_initialized(java_lang_Byte_ByteCache::symbol());300case T_LONG: return is_klass_initialized(java_lang_Long_LongCache::symbol());301case T_BOOLEAN:302case T_FLOAT:303case T_DOUBLE: return true;304default:;305}306}307return false;308}309310// ------------------------------------------------------------------311// ciInstanceKlass::is_in_package312//313// Is this klass in the given package?314bool ciInstanceKlass::is_in_package(const char* packagename, int len) {315// To avoid class loader mischief, this test always rejects application classes.316if (!uses_default_loader())317return false;318GUARDED_VM_ENTRY(319return is_in_package_impl(packagename, len);320)321}322323bool ciInstanceKlass::is_in_package_impl(const char* packagename, int len) {324ASSERT_IN_VM;325326// If packagename contains trailing '/' exclude it from the327// prefix-test since we test for it explicitly.328if (packagename[len - 1] == '/')329len--;330331if (!name()->starts_with(packagename, len))332return false;333334// Test if the class name is something like "java/lang".335if ((len + 1) > name()->utf8_length())336return false;337338// Test for trailing '/'339if (name()->char_at(len) != '/')340return false;341342// Make sure it's not actually in a subpackage:343if (name()->index_of_at(len+1, "/", 1) >= 0)344return false;345346return true;347}348349// ------------------------------------------------------------------350// ciInstanceKlass::print_impl351//352// Implementation of the print method.353void ciInstanceKlass::print_impl(outputStream* st) {354ciKlass::print_impl(st);355GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i(loader()));)356if (is_loaded()) {357st->print(" loaded=true initialized=%s finalized=%s subklass=%s size=%d flags=",358bool_to_str(is_initialized()),359bool_to_str(has_finalizer()),360bool_to_str(has_subklass()),361layout_helper());362363_flags.print_klass_flags();364365if (_super) {366st->print(" super=");367_super->print_name();368}369if (_java_mirror) {370st->print(" mirror=PRESENT");371}372} else {373st->print(" loaded=false");374}375}376377// ------------------------------------------------------------------378// ciInstanceKlass::super379//380// Get the superklass of this klass.381ciInstanceKlass* ciInstanceKlass::super() {382assert(is_loaded(), "must be loaded");383if (_super == NULL && !is_java_lang_Object()) {384GUARDED_VM_ENTRY(385Klass* super_klass = get_instanceKlass()->super();386_super = CURRENT_ENV->get_instance_klass(super_klass);387)388}389return _super;390}391392// ------------------------------------------------------------------393// ciInstanceKlass::java_mirror394//395// Get the instance of java.lang.Class corresponding to this klass.396// Cache it on this->_java_mirror.397ciInstance* ciInstanceKlass::java_mirror() {398if (is_shared()) {399return ciKlass::java_mirror();400}401if (_java_mirror == NULL) {402_java_mirror = ciKlass::java_mirror();403}404return _java_mirror;405}406407// ------------------------------------------------------------------408// ciInstanceKlass::unique_concrete_subklass409ciInstanceKlass* ciInstanceKlass::unique_concrete_subklass() {410if (!is_loaded()) return NULL; // No change if class is not loaded411if (!is_abstract()) return NULL; // Only applies to abstract classes.412if (!has_subklass()) return NULL; // Must have at least one subklass.413VM_ENTRY_MARK;414InstanceKlass* ik = get_instanceKlass();415Klass* up = ik->up_cast_abstract();416assert(up->is_instance_klass(), "must be InstanceKlass");417if (ik == up) {418return NULL;419}420return CURRENT_THREAD_ENV->get_instance_klass(up);421}422423// ------------------------------------------------------------------424// ciInstanceKlass::has_finalizable_subclass425bool ciInstanceKlass::has_finalizable_subclass() {426if (!is_loaded()) return true;427VM_ENTRY_MARK;428return Dependencies::find_finalizable_subclass(get_instanceKlass()) != NULL;429}430431// ------------------------------------------------------------------432// ciInstanceKlass::contains_field_offset433bool ciInstanceKlass::contains_field_offset(int offset) {434VM_ENTRY_MARK;435return get_instanceKlass()->contains_field_offset(offset);436}437438// ------------------------------------------------------------------439// ciInstanceKlass::get_field_by_offset440ciField* ciInstanceKlass::get_field_by_offset(int field_offset, bool is_static) {441if (!is_static) {442for (int i = 0, len = nof_nonstatic_fields(); i < len; i++) {443ciField* field = _nonstatic_fields->at(i);444int field_off = field->offset_in_bytes();445if (field_off == field_offset)446return field;447if (field_off > field_offset)448break;449// could do binary search or check bins, but probably not worth it450}451return NULL;452}453VM_ENTRY_MARK;454InstanceKlass* k = get_instanceKlass();455fieldDescriptor fd;456if (!k->find_field_from_offset(field_offset, is_static, &fd)) {457return NULL;458}459ciField* field = new (CURRENT_THREAD_ENV->arena()) ciField(&fd);460return field;461}462463// ------------------------------------------------------------------464// ciInstanceKlass::get_field_by_name465ciField* ciInstanceKlass::get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static) {466VM_ENTRY_MARK;467InstanceKlass* k = get_instanceKlass();468fieldDescriptor fd;469Klass* def = k->find_field(name->get_symbol(), signature->get_symbol(), is_static, &fd);470if (def == NULL) {471return NULL;472}473ciField* field = new (CURRENT_THREAD_ENV->arena()) ciField(&fd);474return field;475}476477478static int sort_field_by_offset(ciField** a, ciField** b) {479return (*a)->offset_in_bytes() - (*b)->offset_in_bytes();480// (no worries about 32-bit overflow...)481}482483// ------------------------------------------------------------------484// ciInstanceKlass::compute_nonstatic_fields485int ciInstanceKlass::compute_nonstatic_fields() {486assert(is_loaded(), "must be loaded");487488if (_nonstatic_fields != NULL)489return _nonstatic_fields->length();490491if (!has_nonstatic_fields()) {492Arena* arena = CURRENT_ENV->arena();493_nonstatic_fields = new (arena) GrowableArray<ciField*>(arena, 0, 0, NULL);494return 0;495}496assert(!is_java_lang_Object(), "bootstrap OK");497498// Size in bytes of my fields, including inherited fields.499int fsize = nonstatic_field_size() * heapOopSize;500501ciInstanceKlass* super = this->super();502GrowableArray<ciField*>* super_fields = NULL;503if (super != NULL && super->has_nonstatic_fields()) {504int super_flen = super->nof_nonstatic_fields();505super_fields = super->_nonstatic_fields;506assert(super_flen == 0 || super_fields != NULL, "first get nof_fields");507}508509GrowableArray<ciField*>* fields = NULL;510GUARDED_VM_ENTRY({511fields = compute_nonstatic_fields_impl(super_fields);512});513514if (fields == NULL) {515// This can happen if this class (java.lang.Class) has invisible fields.516if (super_fields != NULL) {517_nonstatic_fields = super_fields;518return super_fields->length();519} else {520return 0;521}522}523524int flen = fields->length();525526// Now sort them by offset, ascending.527// (In principle, they could mix with superclass fields.)528fields->sort(sort_field_by_offset);529_nonstatic_fields = fields;530return flen;531}532533GrowableArray<ciField*>*534ciInstanceKlass::compute_nonstatic_fields_impl(GrowableArray<ciField*>*535super_fields) {536ASSERT_IN_VM;537Arena* arena = CURRENT_ENV->arena();538int flen = 0;539GrowableArray<ciField*>* fields = NULL;540InstanceKlass* k = get_instanceKlass();541for (JavaFieldStream fs(k); !fs.done(); fs.next()) {542if (fs.access_flags().is_static()) continue;543flen += 1;544}545546// allocate the array:547if (flen == 0) {548return NULL; // return nothing if none are locally declared549}550if (super_fields != NULL) {551flen += super_fields->length();552}553fields = new (arena) GrowableArray<ciField*>(arena, flen, 0, NULL);554if (super_fields != NULL) {555fields->appendAll(super_fields);556}557558for (JavaFieldStream fs(k); !fs.done(); fs.next()) {559if (fs.access_flags().is_static()) continue;560fieldDescriptor& fd = fs.field_descriptor();561ciField* field = new (arena) ciField(&fd);562fields->append(field);563}564assert(fields->length() == flen, "sanity");565return fields;566}567568bool ciInstanceKlass::compute_injected_fields_helper() {569ASSERT_IN_VM;570InstanceKlass* k = get_instanceKlass();571572for (InternalFieldStream fs(k); !fs.done(); fs.next()) {573if (fs.access_flags().is_static()) continue;574return true;575}576return false;577}578579void ciInstanceKlass::compute_injected_fields() {580assert(is_loaded(), "must be loaded");581582int has_injected_fields = 0;583if (super() != NULL && super()->has_injected_fields()) {584has_injected_fields = 1;585} else {586GUARDED_VM_ENTRY({587has_injected_fields = compute_injected_fields_helper() ? 1 : 0;588});589}590// may be concurrently initialized for shared ciInstanceKlass objects591assert(_has_injected_fields == -1 || _has_injected_fields == has_injected_fields, "broken concurrent initialization");592_has_injected_fields = has_injected_fields;593}594595bool ciInstanceKlass::has_object_fields() const {596GUARDED_VM_ENTRY(597return get_instanceKlass()->nonstatic_oop_map_size() > 0;598);599}600601// ------------------------------------------------------------------602// ciInstanceKlass::find_method603//604// Find a method in this klass.605ciMethod* ciInstanceKlass::find_method(ciSymbol* name, ciSymbol* signature) {606VM_ENTRY_MARK;607InstanceKlass* k = get_instanceKlass();608Symbol* name_sym = name->get_symbol();609Symbol* sig_sym= signature->get_symbol();610611Method* m = k->find_method(name_sym, sig_sym);612if (m == NULL) return NULL;613614return CURRENT_THREAD_ENV->get_method(m);615}616617// ------------------------------------------------------------------618// ciInstanceKlass::is_leaf_type619bool ciInstanceKlass::is_leaf_type() {620assert(is_loaded(), "must be loaded");621if (is_shared()) {622return is_final(); // approximately correct623} else {624return !has_subklass() && (nof_implementors() == 0);625}626}627628// ------------------------------------------------------------------629// ciInstanceKlass::implementor630//631// Report an implementor of this interface.632// Note that there are various races here, since my copy633// of _nof_implementors might be out of date with respect634// to results returned by InstanceKlass::implementor.635// This is OK, since any dependencies we decide to assert636// will be checked later under the Compile_lock.637ciInstanceKlass* ciInstanceKlass::implementor() {638ciInstanceKlass* impl = _implementor;639if (impl == NULL) {640if (is_shared()) {641impl = this; // assume a well-known interface never has a unique implementor642} else {643// Go into the VM to fetch the implementor.644VM_ENTRY_MARK;645MutexLocker ml(Compile_lock);646Klass* k = get_instanceKlass()->implementor();647if (k != NULL) {648if (k == get_instanceKlass()) {649// More than one implementors. Use 'this' in this case.650impl = this;651} else {652impl = CURRENT_THREAD_ENV->get_instance_klass(k);653}654}655}656// Memoize this result.657_implementor = impl;658}659return impl;660}661662// Utility class for printing of the contents of the static fields for663// use by compilation replay. It only prints out the information that664// could be consumed by the compiler, so for primitive types it prints665// out the actual value. For Strings it's the actual string value.666// For array types it it's first level array size since that's the667// only value which statically unchangeable. For all other reference668// types it simply prints out the dynamic type.669670class StaticFinalFieldPrinter : public FieldClosure {671outputStream* _out;672const char* _holder;673public:674StaticFinalFieldPrinter(outputStream* out, const char* holder) :675_out(out),676_holder(holder) {677}678void do_field(fieldDescriptor* fd) {679if (fd->is_final() && !fd->has_initial_value()) {680ResourceMark rm;681oop mirror = fd->field_holder()->java_mirror();682_out->print("staticfield %s %s %s ", _holder, fd->name()->as_quoted_ascii(), fd->signature()->as_quoted_ascii());683switch (fd->field_type()) {684case T_BYTE: _out->print_cr("%d", mirror->byte_field(fd->offset())); break;685case T_BOOLEAN: _out->print_cr("%d", mirror->bool_field(fd->offset())); break;686case T_SHORT: _out->print_cr("%d", mirror->short_field(fd->offset())); break;687case T_CHAR: _out->print_cr("%d", mirror->char_field(fd->offset())); break;688case T_INT: _out->print_cr("%d", mirror->int_field(fd->offset())); break;689case T_LONG: _out->print_cr(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset()))); break;690case T_FLOAT: {691float f = mirror->float_field(fd->offset());692_out->print_cr("%d", *(int*)&f);693break;694}695case T_DOUBLE: {696double d = mirror->double_field(fd->offset());697_out->print_cr(INT64_FORMAT, *(int64_t*)&d);698break;699}700case T_ARRAY: // fall-through701case T_OBJECT: {702oop value = mirror->obj_field_acquire(fd->offset());703if (value == NULL) {704_out->print_cr("null");705} else if (value->is_instance()) {706assert(fd->field_type() == T_OBJECT, "");707if (value->is_a(vmClasses::String_klass())) {708const char* ascii_value = java_lang_String::as_quoted_ascii(value);709_out->print("\"%s\"", (ascii_value != NULL) ? ascii_value : "");710} else {711const char* klass_name = value->klass()->name()->as_quoted_ascii();712_out->print_cr("%s", klass_name);713}714} else if (value->is_array()) {715typeArrayOop ta = (typeArrayOop)value;716_out->print("%d", ta->length());717if (value->is_objArray()) {718objArrayOop oa = (objArrayOop)value;719const char* klass_name = value->klass()->name()->as_quoted_ascii();720_out->print(" %s", klass_name);721}722_out->cr();723} else {724ShouldNotReachHere();725}726break;727}728default:729ShouldNotReachHere();730}731}732}733};734735736void ciInstanceKlass::dump_replay_data(outputStream* out) {737ResourceMark rm;738739InstanceKlass* ik = get_instanceKlass();740ConstantPool* cp = ik->constants();741742// Try to record related loaded classes743Klass* sub = ik->subklass();744while (sub != NULL) {745if (sub->is_instance_klass() && !sub->is_hidden()) {746out->print_cr("instanceKlass %s", sub->name()->as_quoted_ascii());747}748sub = sub->next_sibling();749}750751// Dump out the state of the constant pool tags. During replay the752// tags will be validated for things which shouldn't change and753// classes will be resolved if the tags indicate that they were754// resolved at compile time.755out->print("ciInstanceKlass %s %d %d %d", ik->name()->as_quoted_ascii(),756is_linked(), is_initialized(), cp->length());757for (int index = 1; index < cp->length(); index++) {758out->print(" %d", cp->tags()->at(index));759}760out->cr();761if (is_initialized()) {762// Dump out the static final fields in case the compilation relies763// on their value for correct replay.764StaticFinalFieldPrinter sffp(out, ik->name()->as_quoted_ascii());765ik->do_local_static_fields(&sffp);766}767}768769#ifdef ASSERT770bool ciInstanceKlass::debug_final_field_at(int offset) {771GUARDED_VM_ENTRY(772InstanceKlass* ik = get_instanceKlass();773fieldDescriptor fd;774if (ik->find_field_from_offset(offset, false, &fd)) {775return fd.is_final();776}777);778return false;779}780781bool ciInstanceKlass::debug_stable_field_at(int offset) {782GUARDED_VM_ENTRY(783InstanceKlass* ik = get_instanceKlass();784fieldDescriptor fd;785if (ik->find_field_from_offset(offset, false, &fd)) {786return fd.is_stable();787}788);789return false;790}791#endif792793794