/* * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
class ciBitData; class ciCounterData; class ciJumpData; class ciReceiverTypeData; class ciRetData; class ciBranchData; class ciArrayData; class ciMultiBranchData; class ciArgInfoData; class ciCallTypeData; class ciVirtualCallTypeData; class ciParametersTypeData; class ciSpeculativeTrapData;
typedef ProfileData ciProfileData;
class ciBitData : public BitData { public:
ciBitData(DataLayout* layout) : BitData(layout) {};
};
class ciCounterData : public CounterData { public:
ciCounterData(DataLayout* layout) : CounterData(layout) {};
};
class ciJumpData : public JumpData { public:
ciJumpData(DataLayout* layout) : JumpData(layout) {};
};
class ciTypeEntries { protected: static intptr_t translate_klass(intptr_t k) {
Klass* v = TypeEntries::valid_klass(k); if (v != NULL) {
ciKlass* klass = CURRENT_ENV->get_klass(v); return with_status(klass, k);
} return with_status(NULL, k);
}
// ciMethodData // // This class represents a MethodData* in the HotSpot virtual // machine.
class ciMethodData : public ciMetadata {
CI_PACKAGE_ACCESS friendclass ciReplay;
private: // Size in bytes int _data_size; int _extra_data_size;
// Data entries
intptr_t* _data;
// Cached hint for data_layout_before() int _hint_di;
// Is data attached? And is it mature? enum { empty_state, immature_state, mature_state };
u_char _state;
// Set this true if empty extra_data slots are ever witnessed.
u_char _saw_free_extra_data;
// Support for interprocedural escape analysis
intx _eflags; // flags on escape information
intx _arg_local; // bit set of non-escaping arguments
intx _arg_stack; // bit set of stack-allocatable arguments
intx _arg_returned; // bit set of returned arguments
// These counters hold the age of MDO in tiered. In tiered we can have the same method // running at different compilation levels concurrently. So, in order to precisely measure // its maturity we need separate counters. int _invocation_counter;
// Coherent snapshot of original header.
MethodData::CompilerCounters _orig;
// Area dedicated to parameters. NULL if no parameter profiling for this method.
DataLayout* _parameters; int parameters_size() const { return _parameters == NULL ? 0 : parameters_type_data()->size_in_bytes();
}
int invocation_count() { return _invocation_counter; }
#if INCLUDE_RTM_OPT // return cached value int rtm_state() { if (is_empty()) { return NoRTM;
} else { return get_MethodData()->rtm_state();
}
} #endif
// Transfer information about the method to MethodData*. // would_profile means we would like to profile this method, // meaning it's not trivial. void set_would_profile(bool p); // Also set the number of loops and blocks in the method. // Again, this is used to determine if a method is trivial. void set_compilation_stats(short loops, short blocks); // If the compiler finds a profiled type that is known statically // for sure, set it in the MethodData void set_argument_type(int bci, int i, ciKlass* k); void set_parameter_type(int i, ciKlass* k); void set_return_type(int bci, ciKlass* k);
bool load_data();
// Convert a dp (data pointer) to a di (data index). int dp_to_di(address dp) { return dp - ((address)_data);
}
// Get the data at an arbitrary (sort of) data index.
ciProfileData* data_at(int data_index);
// Walk through the data in order.
ciProfileData* first_data() { return data_at(first_di()); }
ciProfileData* next_data(ciProfileData* current);
DataLayout* next_data_layout(DataLayout* current); bool is_valid(ciProfileData* current) { return current != NULL; } bool is_valid(DataLayout* current) { return current != NULL; }
// Get the data at an arbitrary bci, or NULL if there is none. If m // is not NULL look for a SpeculativeTrapData if any first.
ciProfileData* bci_to_data(int bci, ciMethod* m = NULL);
// Helpful query functions that decode trap_state. int has_trap_at(ciProfileData* data, int reason); int has_trap_at(int bci, ciMethod* m, int reason) {
assert((m != NULL) == Deoptimization::reason_is_speculate(reason), "inconsistent method/reason"); return has_trap_at(bci_to_data(bci, m), reason);
} int trap_recompiled_at(ciProfileData* data); int trap_recompiled_at(int bci, ciMethod* m) { return trap_recompiled_at(bci_to_data(bci, m));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.