Path: blob/jdk8u272-b10-aarch32-20201026/hotspot/src/share/vm/opto/compile.hpp
83404 views
/*1* Copyright (c) 1997, 2014, 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#ifndef SHARE_VM_OPTO_COMPILE_HPP25#define SHARE_VM_OPTO_COMPILE_HPP2627#include "asm/codeBuffer.hpp"28#include "ci/compilerInterface.hpp"29#include "code/debugInfoRec.hpp"30#include "code/exceptionHandlerTable.hpp"31#include "compiler/compilerOracle.hpp"32#include "compiler/compileBroker.hpp"33#include "jfr/jfrEvents.hpp"34#include "libadt/dict.hpp"35#include "libadt/port.hpp"36#include "libadt/vectset.hpp"37#include "memory/resourceArea.hpp"38#include "opto/idealGraphPrinter.hpp"39#include "opto/phasetype.hpp"40#include "opto/phase.hpp"41#include "opto/regmask.hpp"42#include "runtime/deoptimization.hpp"43#include "runtime/vmThread.hpp"44#include "utilities/ticks.hpp"4546class Block;47class Bundle;48class C2Compiler;49class CallGenerator;50class ConnectionGraph;51class InlineTree;52class Int_Array;53class Matcher;54class MachConstantNode;55class MachConstantBaseNode;56class MachNode;57class MachOper;58class MachSafePointNode;59class Node;60class Node_Array;61class Node_Notes;62class OptoReg;63class PhaseCFG;64class PhaseGVN;65class PhaseIterGVN;66class PhaseRegAlloc;67class PhaseCCP;68class PhaseCCP_DCE;69class RootNode;70class relocInfo;71class Scope;72class StartNode;73class SafePointNode;74class JVMState;75class Type;76class TypeData;77class TypeInt;78class TypePtr;79class TypeOopPtr;80class TypeFunc;81class Unique_Node_List;82class nmethod;83class WarmCallInfo;84class Node_Stack;85struct Final_Reshape_Counts;8687//------------------------------Compile----------------------------------------88// This class defines a top-level Compiler invocation.8990class Compile : public Phase {91friend class VMStructs;9293public:94// Fixed alias indexes. (See also MergeMemNode.)95enum {96AliasIdxTop = 1, // pseudo-index, aliases to nothing (used as sentinel value)97AliasIdxBot = 2, // pseudo-index, aliases to everything98AliasIdxRaw = 3 // hard-wired index for TypeRawPtr::BOTTOM99};100101// Variant of TraceTime(NULL, &_t_accumulator, TimeCompiler);102// Integrated with logging. If logging is turned on, and dolog is true,103// then brackets are put into the log, with time stamps and node counts.104// (The time collection itself is always conditionalized on TimeCompiler.)105class TracePhase : public TraceTime {106private:107Compile* C;108CompileLog* _log;109const char* _phase_name;110bool _dolog;111public:112TracePhase(const char* name, elapsedTimer* accumulator, bool dolog);113~TracePhase();114};115116// Information per category of alias (memory slice)117class AliasType {118private:119friend class Compile;120121int _index; // unique index, used with MergeMemNode122const TypePtr* _adr_type; // normalized address type123ciField* _field; // relevant instance field, or null if none124const Type* _element; // relevant array element type, or null if none125bool _is_rewritable; // false if the memory is write-once only126int _general_index; // if this is type is an instance, the general127// type that this is an instance of128129void Init(int i, const TypePtr* at);130131public:132int index() const { return _index; }133const TypePtr* adr_type() const { return _adr_type; }134ciField* field() const { return _field; }135const Type* element() const { return _element; }136bool is_rewritable() const { return _is_rewritable; }137bool is_volatile() const { return (_field ? _field->is_volatile() : false); }138int general_index() const { return (_general_index != 0) ? _general_index : _index; }139140void set_rewritable(bool z) { _is_rewritable = z; }141void set_field(ciField* f) {142assert(!_field,"");143_field = f;144if (f->is_final() || f->is_stable()) {145// In the case of @Stable, multiple writes are possible but may be assumed to be no-ops.146_is_rewritable = false;147}148}149void set_element(const Type* e) {150assert(_element == NULL, "");151_element = e;152}153154BasicType basic_type() const;155156void print_on(outputStream* st) PRODUCT_RETURN;157};158159enum {160logAliasCacheSize = 6,161AliasCacheSize = (1<<logAliasCacheSize)162};163struct AliasCacheEntry { const TypePtr* _adr_type; int _index; }; // simple duple type164enum {165trapHistLength = MethodData::_trap_hist_limit166};167168// Constant entry of the constant table.169class Constant {170private:171BasicType _type;172union {173jvalue _value;174Metadata* _metadata;175} _v;176int _offset; // offset of this constant (in bytes) relative to the constant table base.177float _freq;178bool _can_be_reused; // true (default) if the value can be shared with other users.179180public:181Constant() : _type(T_ILLEGAL), _offset(-1), _freq(0.0f), _can_be_reused(true) { _v._value.l = 0; }182Constant(BasicType type, jvalue value, float freq = 0.0f, bool can_be_reused = true) :183_type(type),184_offset(-1),185_freq(freq),186_can_be_reused(can_be_reused)187{188assert(type != T_METADATA, "wrong constructor");189_v._value = value;190}191Constant(Metadata* metadata, bool can_be_reused = true) :192_type(T_METADATA),193_offset(-1),194_freq(0.0f),195_can_be_reused(can_be_reused)196{197_v._metadata = metadata;198}199200bool operator==(const Constant& other);201202BasicType type() const { return _type; }203204jlong get_jlong() const { return _v._value.j; }205jfloat get_jfloat() const { return _v._value.f; }206jdouble get_jdouble() const { return _v._value.d; }207jobject get_jobject() const { return _v._value.l; }208209Metadata* get_metadata() const { return _v._metadata; }210211int offset() const { return _offset; }212void set_offset(int offset) { _offset = offset; }213214float freq() const { return _freq; }215void inc_freq(float freq) { _freq += freq; }216217bool can_be_reused() const { return _can_be_reused; }218};219220// Constant table.221class ConstantTable {222private:223GrowableArray<Constant> _constants; // Constants of this table.224int _size; // Size in bytes the emitted constant table takes (including padding).225int _table_base_offset; // Offset of the table base that gets added to the constant offsets.226int _nof_jump_tables; // Number of jump-tables in this constant table.227228static int qsort_comparator(Constant* a, Constant* b);229230// We use negative frequencies to keep the order of the231// jump-tables in which they were added. Otherwise we get into232// trouble with relocation.233float next_jump_table_freq() { return -1.0f * (++_nof_jump_tables); }234235public:236ConstantTable() :237_size(-1),238_table_base_offset(-1), // We can use -1 here since the constant table is always bigger than 2 bytes (-(size / 2), see MachConstantBaseNode::emit).239_nof_jump_tables(0)240{}241242int size() const { assert(_size != -1, "not calculated yet"); return _size; }243244int calculate_table_base_offset() const; // AD specific245void set_table_base_offset(int x) { assert(_table_base_offset == -1 || x == _table_base_offset, "can't change"); _table_base_offset = x; }246int table_base_offset() const { assert(_table_base_offset != -1, "not set yet"); return _table_base_offset; }247248void emit(CodeBuffer& cb);249250// Returns the offset of the last entry (the top) of the constant table.251int top_offset() const { assert(_constants.top().offset() != -1, "not bound yet"); return _constants.top().offset(); }252253void calculate_offsets_and_size();254int find_offset(Constant& con) const;255256void add(Constant& con);257Constant add(MachConstantNode* n, BasicType type, jvalue value);258Constant add(Metadata* metadata);259Constant add(MachConstantNode* n, MachOper* oper);260Constant add(MachConstantNode* n, jfloat f) {261jvalue value; value.f = f;262return add(n, T_FLOAT, value);263}264Constant add(MachConstantNode* n, jdouble d) {265jvalue value; value.d = d;266return add(n, T_DOUBLE, value);267}268269// Jump-table270Constant add_jump_table(MachConstantNode* n);271void fill_jump_table(CodeBuffer& cb, MachConstantNode* n, GrowableArray<Label*> labels) const;272};273274private:275// Fixed parameters to this compilation.276const int _compile_id;277const bool _save_argument_registers; // save/restore arg regs for trampolines278const bool _subsume_loads; // Load can be matched as part of a larger op.279const bool _do_escape_analysis; // Do escape analysis.280const bool _eliminate_boxing; // Do boxing elimination.281ciMethod* _method; // The method being compiled.282int _entry_bci; // entry bci for osr methods.283const TypeFunc* _tf; // My kind of signature284InlineTree* _ilt; // Ditto (temporary).285address _stub_function; // VM entry for stub being compiled, or NULL286const char* _stub_name; // Name of stub or adapter being compiled, or NULL287address _stub_entry_point; // Compile code entry for generated stub, or NULL288289// Control of this compilation.290int _num_loop_opts; // Number of iterations for doing loop optimiztions291int _max_inline_size; // Max inline size for this compilation292int _freq_inline_size; // Max hot method inline size for this compilation293int _fixed_slots; // count of frame slots not allocated by the register294// allocator i.e. locks, original deopt pc, etc.295uintx _max_node_limit; // Max unique node count during a single compilation.296// For deopt297int _orig_pc_slot;298int _orig_pc_slot_offset_in_bytes;299300int _major_progress; // Count of something big happening301bool _inlining_progress; // progress doing incremental inlining?302bool _inlining_incrementally;// Are we doing incremental inlining (post parse)303bool _has_loops; // True if the method _may_ have some loops304bool _has_split_ifs; // True if the method _may_ have some split-if305bool _has_unsafe_access; // True if the method _may_ produce faults in unsafe loads or stores.306bool _has_stringbuilder; // True StringBuffers or StringBuilders are allocated307bool _has_boxed_value; // True if a boxed object is allocated308int _max_vector_size; // Maximum size of generated vectors309uint _trap_hist[trapHistLength]; // Cumulative traps310bool _trap_can_recompile; // Have we emitted a recompiling trap?311uint _decompile_count; // Cumulative decompilation counts.312bool _do_inlining; // True if we intend to do inlining313bool _do_scheduling; // True if we intend to do scheduling314bool _do_freq_based_layout; // True if we intend to do frequency based block layout315bool _do_count_invocations; // True if we generate code to count invocations316bool _do_method_data_update; // True if we generate code to update MethodData*s317int _AliasLevel; // Locally-adjusted version of AliasLevel flag.318bool _print_assembly; // True if we should dump assembly code for this compilation319bool _print_inlining; // True if we should print inlining for this compilation320bool _print_intrinsics; // True if we should print intrinsics for this compilation321#ifndef PRODUCT322bool _trace_opto_output;323bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing324#endif325bool _has_irreducible_loop; // Found irreducible loops326// JSR 292327bool _has_method_handle_invokes; // True if this method has MethodHandle invokes.328RTMState _rtm_state; // State of Restricted Transactional Memory usage329330// Compilation environment.331Arena _comp_arena; // Arena with lifetime equivalent to Compile332ciEnv* _env; // CI interface333CompileLog* _log; // from CompilerThread334const char* _failure_reason; // for record_failure/failing pattern335GrowableArray<CallGenerator*>* _intrinsics; // List of intrinsics.336GrowableArray<Node*>* _macro_nodes; // List of nodes which need to be expanded before matching.337GrowableArray<Node*>* _predicate_opaqs; // List of Opaque1 nodes for the loop predicates.338GrowableArray<Node*>* _expensive_nodes; // List of nodes that are expensive to compute and that we'd better not let the GVN freely common339GrowableArray<Node*>* _range_check_casts; // List of CastII nodes with a range check dependency340ConnectionGraph* _congraph;341#ifndef PRODUCT342IdealGraphPrinter* _printer;343#endif344345346// Node management347uint _unique; // Counter for unique Node indices348VectorSet _dead_node_list; // Set of dead nodes349uint _dead_node_count; // Number of dead nodes; VectorSet::Size() is O(N).350// So use this to keep count and make the call O(1).351debug_only(static int _debug_idx;) // Monotonic counter (not reset), use -XX:BreakAtNode=<idx>352Arena _node_arena; // Arena for new-space Nodes353Arena _old_arena; // Arena for old-space Nodes, lifetime during xform354RootNode* _root; // Unique root of compilation, or NULL after bail-out.355Node* _top; // Unique top node. (Reset by various phases.)356357Node* _immutable_memory; // Initial memory state358359Node* _recent_alloc_obj;360Node* _recent_alloc_ctl;361362// Constant table363ConstantTable _constant_table; // The constant table for this compile.364MachConstantBaseNode* _mach_constant_base_node; // Constant table base node singleton.365366367// Blocked array of debugging and profiling information,368// tracked per node.369enum { _log2_node_notes_block_size = 8,370_node_notes_block_size = (1<<_log2_node_notes_block_size)371};372GrowableArray<Node_Notes*>* _node_note_array;373Node_Notes* _default_node_notes; // default notes for new nodes374375// After parsing and every bulk phase we hang onto the Root instruction.376// The RootNode instruction is where the whole program begins. It produces377// the initial Control and BOTTOM for everybody else.378379// Type management380Arena _Compile_types; // Arena for all types381Arena* _type_arena; // Alias for _Compile_types except in Initialize_shared()382Dict* _type_dict; // Intern table383void* _type_hwm; // Last allocation (see Type::operator new/delete)384size_t _type_last_size; // Last allocation size (see Type::operator new/delete)385ciMethod* _last_tf_m; // Cache for386const TypeFunc* _last_tf; // TypeFunc::make387AliasType** _alias_types; // List of alias types seen so far.388int _num_alias_types; // Logical length of _alias_types389int _max_alias_types; // Physical length of _alias_types390AliasCacheEntry _alias_cache[AliasCacheSize]; // Gets aliases w/o data structure walking391392// Parsing, optimization393PhaseGVN* _initial_gvn; // Results of parse-time PhaseGVN394Unique_Node_List* _for_igvn; // Initial work-list for next round of Iterative GVN395WarmCallInfo* _warm_calls; // Sorted work-list for heat-based inlining.396397GrowableArray<CallGenerator*> _late_inlines; // List of CallGenerators to be revisited after398// main parsing has finished.399GrowableArray<CallGenerator*> _string_late_inlines; // same but for string operations400401GrowableArray<CallGenerator*> _boxing_late_inlines; // same but for boxing operations402403int _late_inlines_pos; // Where in the queue should the next late inlining candidate go (emulate depth first inlining)404uint _number_of_mh_late_inlines; // number of method handle late inlining still pending405406407// Inlining may not happen in parse order which would make408// PrintInlining output confusing. Keep track of PrintInlining409// pieces in order.410class PrintInliningBuffer : public ResourceObj {411private:412CallGenerator* _cg;413stringStream* _ss;414415public:416PrintInliningBuffer()417: _cg(NULL) { _ss = new stringStream(); }418419stringStream* ss() const { return _ss; }420CallGenerator* cg() const { return _cg; }421void set_cg(CallGenerator* cg) { _cg = cg; }422};423424GrowableArray<PrintInliningBuffer>* _print_inlining_list;425int _print_inlining_idx;426427// Only keep nodes in the expensive node list that need to be optimized428void cleanup_expensive_nodes(PhaseIterGVN &igvn);429// Use for sorting expensive nodes to bring similar nodes together430static int cmp_expensive_nodes(Node** n1, Node** n2);431// Expensive nodes list already sorted?432bool expensive_nodes_sorted() const;433// Remove the speculative part of types and clean up the graph434void remove_speculative_types(PhaseIterGVN &igvn);435436void* _replay_inline_data; // Pointer to data loaded from file437438public:439440outputStream* print_inlining_stream() const {441return _print_inlining_list->adr_at(_print_inlining_idx)->ss();442}443444void print_inlining_skip(CallGenerator* cg) {445if (_print_inlining) {446_print_inlining_list->adr_at(_print_inlining_idx)->set_cg(cg);447_print_inlining_idx++;448_print_inlining_list->insert_before(_print_inlining_idx, PrintInliningBuffer());449}450}451452void print_inlining_insert(CallGenerator* cg) {453if (_print_inlining) {454for (int i = 0; i < _print_inlining_list->length(); i++) {455if (_print_inlining_list->adr_at(i)->cg() == cg) {456_print_inlining_list->insert_before(i+1, PrintInliningBuffer());457_print_inlining_idx = i+1;458_print_inlining_list->adr_at(i)->set_cg(NULL);459return;460}461}462ShouldNotReachHere();463}464}465466void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) {467stringStream ss;468CompileTask::print_inlining(&ss, method, inline_level, bci, msg);469print_inlining_stream()->print("%s", ss.as_string());470}471472void* replay_inline_data() const { return _replay_inline_data; }473474// Dump inlining replay data to the stream.475void dump_inline_data(outputStream* out);476477private:478// Matching, CFG layout, allocation, code generation479PhaseCFG* _cfg; // Results of CFG finding480bool _select_24_bit_instr; // We selected an instruction with a 24-bit result481bool _in_24_bit_fp_mode; // We are emitting instructions with 24-bit results482int _java_calls; // Number of java calls in the method483int _inner_loops; // Number of inner loops in the method484Matcher* _matcher; // Engine to map ideal to machine instructions485PhaseRegAlloc* _regalloc; // Results of register allocation.486int _frame_slots; // Size of total frame in stack slots487CodeOffsets _code_offsets; // Offsets into the code for various interesting entries488RegMask _FIRST_STACK_mask; // All stack slots usable for spills (depends on frame layout)489Arena* _indexSet_arena; // control IndexSet allocation within PhaseChaitin490void* _indexSet_free_block_list; // free list of IndexSet bit blocks491int _interpreter_frame_size;492493uint _node_bundling_limit;494Bundle* _node_bundling_base; // Information for instruction bundling495496// Instruction bits passed off to the VM497int _method_size; // Size of nmethod code segment in bytes498CodeBuffer _code_buffer; // Where the code is assembled499int _first_block_size; // Size of unvalidated entry point code / OSR poison code500ExceptionHandlerTable _handler_table; // Table of native-code exception handlers501ImplicitExceptionTable _inc_table; // Table of implicit null checks in native code502OopMapSet* _oop_map_set; // Table of oop maps (one for each safepoint location)503static int _CompiledZap_count; // counter compared against CompileZap[First/Last]504BufferBlob* _scratch_buffer_blob; // For temporary code buffers.505relocInfo* _scratch_locs_memory; // For temporary code buffers.506int _scratch_const_size; // For temporary code buffers.507bool _in_scratch_emit_size; // true when in scratch_emit_size.508509public:510// Accessors511512// The Compile instance currently active in this (compiler) thread.513static Compile* current() {514return (Compile*) ciEnv::current()->compiler_data();515}516517// ID for this compilation. Useful for setting breakpoints in the debugger.518int compile_id() const { return _compile_id; }519520// Does this compilation allow instructions to subsume loads? User521// instructions that subsume a load may result in an unschedulable522// instruction sequence.523bool subsume_loads() const { return _subsume_loads; }524/** Do escape analysis. */525bool do_escape_analysis() const { return _do_escape_analysis; }526/** Do boxing elimination. */527bool eliminate_boxing() const { return _eliminate_boxing; }528/** Do aggressive boxing elimination. */529bool aggressive_unboxing() const { return _eliminate_boxing && AggressiveUnboxing; }530bool save_argument_registers() const { return _save_argument_registers; }531532533// Other fixed compilation parameters.534ciMethod* method() const { return _method; }535int entry_bci() const { return _entry_bci; }536bool is_osr_compilation() const { return _entry_bci != InvocationEntryBci; }537bool is_method_compilation() const { return (_method != NULL && !_method->flags().is_native()); }538const TypeFunc* tf() const { assert(_tf!=NULL, ""); return _tf; }539void init_tf(const TypeFunc* tf) { assert(_tf==NULL, ""); _tf = tf; }540InlineTree* ilt() const { return _ilt; }541address stub_function() const { return _stub_function; }542const char* stub_name() const { return _stub_name; }543address stub_entry_point() const { return _stub_entry_point; }544545// Control of this compilation.546int fixed_slots() const { assert(_fixed_slots >= 0, ""); return _fixed_slots; }547void set_fixed_slots(int n) { _fixed_slots = n; }548int major_progress() const { return _major_progress; }549void set_inlining_progress(bool z) { _inlining_progress = z; }550int inlining_progress() const { return _inlining_progress; }551void set_inlining_incrementally(bool z) { _inlining_incrementally = z; }552int inlining_incrementally() const { return _inlining_incrementally; }553void set_major_progress() { _major_progress++; }554void clear_major_progress() { _major_progress = 0; }555int num_loop_opts() const { return _num_loop_opts; }556void set_num_loop_opts(int n) { _num_loop_opts = n; }557int max_inline_size() const { return _max_inline_size; }558void set_freq_inline_size(int n) { _freq_inline_size = n; }559int freq_inline_size() const { return _freq_inline_size; }560void set_max_inline_size(int n) { _max_inline_size = n; }561bool has_loops() const { return _has_loops; }562void set_has_loops(bool z) { _has_loops = z; }563bool has_split_ifs() const { return _has_split_ifs; }564void set_has_split_ifs(bool z) { _has_split_ifs = z; }565bool has_unsafe_access() const { return _has_unsafe_access; }566void set_has_unsafe_access(bool z) { _has_unsafe_access = z; }567bool has_stringbuilder() const { return _has_stringbuilder; }568void set_has_stringbuilder(bool z) { _has_stringbuilder = z; }569bool has_boxed_value() const { return _has_boxed_value; }570void set_has_boxed_value(bool z) { _has_boxed_value = z; }571int max_vector_size() const { return _max_vector_size; }572void set_max_vector_size(int s) { _max_vector_size = s; }573void set_trap_count(uint r, uint c) { assert(r < trapHistLength, "oob"); _trap_hist[r] = c; }574uint trap_count(uint r) const { assert(r < trapHistLength, "oob"); return _trap_hist[r]; }575bool trap_can_recompile() const { return _trap_can_recompile; }576void set_trap_can_recompile(bool z) { _trap_can_recompile = z; }577uint decompile_count() const { return _decompile_count; }578void set_decompile_count(uint c) { _decompile_count = c; }579bool allow_range_check_smearing() const;580bool do_inlining() const { return _do_inlining; }581void set_do_inlining(bool z) { _do_inlining = z; }582bool do_scheduling() const { return _do_scheduling; }583void set_do_scheduling(bool z) { _do_scheduling = z; }584bool do_freq_based_layout() const{ return _do_freq_based_layout; }585void set_do_freq_based_layout(bool z){ _do_freq_based_layout = z; }586bool do_count_invocations() const{ return _do_count_invocations; }587void set_do_count_invocations(bool z){ _do_count_invocations = z; }588bool do_method_data_update() const { return _do_method_data_update; }589void set_do_method_data_update(bool z) { _do_method_data_update = z; }590int AliasLevel() const { return _AliasLevel; }591bool print_assembly() const { return _print_assembly; }592void set_print_assembly(bool z) { _print_assembly = z; }593bool print_inlining() const { return _print_inlining; }594void set_print_inlining(bool z) { _print_inlining = z; }595bool print_intrinsics() const { return _print_intrinsics; }596void set_print_intrinsics(bool z) { _print_intrinsics = z; }597RTMState rtm_state() const { return _rtm_state; }598void set_rtm_state(RTMState s) { _rtm_state = s; }599bool use_rtm() const { return (_rtm_state & NoRTM) == 0; }600bool profile_rtm() const { return _rtm_state == ProfileRTM; }601uint max_node_limit() const { return (uint)_max_node_limit; }602void set_max_node_limit(uint n) { _max_node_limit = n; }603604// check the CompilerOracle for special behaviours for this compile605bool method_has_option(const char * option) {606return method() != NULL && method()->has_option(option);607}608template<typename T>609bool method_has_option_value(const char * option, T& value) {610return method() != NULL && method()->has_option_value(option, value);611}612#ifndef PRODUCT613bool trace_opto_output() const { return _trace_opto_output; }614bool parsed_irreducible_loop() const { return _parsed_irreducible_loop; }615void set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }616int _in_dump_cnt; // Required for dumping ir nodes.617#endif618bool has_irreducible_loop() const { return _has_irreducible_loop; }619void set_has_irreducible_loop(bool z) { _has_irreducible_loop = z; }620621// JSR 292622bool has_method_handle_invokes() const { return _has_method_handle_invokes; }623void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; }624625Ticks _latest_stage_start_counter;626627void begin_method() {628#ifndef PRODUCT629if (_printer) _printer->begin_method(this);630#endif631C->_latest_stage_start_counter.stamp();632}633634void print_method(CompilerPhaseType cpt, int level = 1) {635EventCompilerPhase event;636if (event.should_commit()) {637event.set_starttime(C->_latest_stage_start_counter);638event.set_phase((u1) cpt);639event.set_compileId(C->_compile_id);640event.set_phaseLevel(level);641event.commit();642}643644645#ifndef PRODUCT646if (_printer) _printer->print_method(this, CompilerPhaseTypeHelper::to_string(cpt), level);647#endif648C->_latest_stage_start_counter.stamp();649}650651void end_method(int level = 1) {652EventCompilerPhase event;653if (event.should_commit()) {654event.set_starttime(C->_latest_stage_start_counter);655event.set_phase((u1) PHASE_END);656event.set_compileId(C->_compile_id);657event.set_phaseLevel(level);658event.commit();659}660#ifndef PRODUCT661if (_printer) _printer->end_method();662#endif663}664665int macro_count() const { return _macro_nodes->length(); }666int predicate_count() const { return _predicate_opaqs->length();}667int expensive_count() const { return _expensive_nodes->length(); }668Node* macro_node(int idx) const { return _macro_nodes->at(idx); }669Node* predicate_opaque1_node(int idx) const { return _predicate_opaqs->at(idx);}670Node* expensive_node(int idx) const { return _expensive_nodes->at(idx); }671ConnectionGraph* congraph() { return _congraph;}672void set_congraph(ConnectionGraph* congraph) { _congraph = congraph;}673void add_macro_node(Node * n) {674//assert(n->is_macro(), "must be a macro node");675assert(!_macro_nodes->contains(n), "duplicate entry in expand list");676_macro_nodes->append(n);677}678void remove_macro_node(Node * n) {679// this function may be called twice for a node so check680// that the node is in the array before attempting to remove it681if (_macro_nodes->contains(n))682_macro_nodes->remove(n);683// remove from _predicate_opaqs list also if it is there684if (predicate_count() > 0 && _predicate_opaqs->contains(n)){685_predicate_opaqs->remove(n);686}687}688void add_expensive_node(Node * n);689void remove_expensive_node(Node * n) {690if (_expensive_nodes->contains(n)) {691_expensive_nodes->remove(n);692}693}694void add_predicate_opaq(Node * n) {695assert(!_predicate_opaqs->contains(n), "duplicate entry in predicate opaque1");696assert(_macro_nodes->contains(n), "should have already been in macro list");697_predicate_opaqs->append(n);698}699700// Range check dependent CastII nodes that can be removed after loop optimizations701void add_range_check_cast(Node* n);702void remove_range_check_cast(Node* n) {703if (_range_check_casts->contains(n)) {704_range_check_casts->remove(n);705}706}707Node* range_check_cast_node(int idx) const { return _range_check_casts->at(idx); }708int range_check_cast_count() const { return _range_check_casts->length(); }709// Remove all range check dependent CastIINodes.710void remove_range_check_casts(PhaseIterGVN &igvn);711712// remove the opaque nodes that protect the predicates so that the unused checks and713// uncommon traps will be eliminated from the graph.714void cleanup_loop_predicates(PhaseIterGVN &igvn);715bool is_predicate_opaq(Node * n) {716return _predicate_opaqs->contains(n);717}718719// Are there candidate expensive nodes for optimization?720bool should_optimize_expensive_nodes(PhaseIterGVN &igvn);721// Check whether n1 and n2 are similar722static int cmp_expensive_nodes(Node* n1, Node* n2);723// Sort expensive nodes to locate similar expensive nodes724void sort_expensive_nodes();725726// Compilation environment.727Arena* comp_arena() { return &_comp_arena; }728ciEnv* env() const { return _env; }729CompileLog* log() const { return _log; }730bool failing() const { return _env->failing() || _failure_reason != NULL; }731const char* failure_reason() { return _failure_reason; }732bool failure_reason_is(const char* r) { return (r==_failure_reason) || (r!=NULL && _failure_reason!=NULL && strcmp(r, _failure_reason)==0); }733734void record_failure(const char* reason);735void record_method_not_compilable(const char* reason, bool all_tiers = false) {736// All bailouts cover "all_tiers" when TieredCompilation is off.737if (!TieredCompilation) all_tiers = true;738env()->record_method_not_compilable(reason, all_tiers);739// Record failure reason.740record_failure(reason);741}742void record_method_not_compilable_all_tiers(const char* reason) {743record_method_not_compilable(reason, true);744}745bool check_node_count(uint margin, const char* reason) {746if (live_nodes() + margin > max_node_limit()) {747record_method_not_compilable(reason);748return true;749} else {750return false;751}752}753754// Node management755uint unique() const { return _unique; }756uint next_unique() { return _unique++; }757void set_unique(uint i) { _unique = i; }758static int debug_idx() { return debug_only(_debug_idx)+0; }759static void set_debug_idx(int i) { debug_only(_debug_idx = i); }760Arena* node_arena() { return &_node_arena; }761Arena* old_arena() { return &_old_arena; }762RootNode* root() const { return _root; }763void set_root(RootNode* r) { _root = r; }764StartNode* start() const; // (Derived from root.)765void init_start(StartNode* s);766Node* immutable_memory();767768Node* recent_alloc_ctl() const { return _recent_alloc_ctl; }769Node* recent_alloc_obj() const { return _recent_alloc_obj; }770void set_recent_alloc(Node* ctl, Node* obj) {771_recent_alloc_ctl = ctl;772_recent_alloc_obj = obj;773}774void record_dead_node(uint idx) { if (_dead_node_list.test_set(idx)) return;775_dead_node_count++;776}777bool is_dead_node(uint idx) { return _dead_node_list.test(idx) != 0; }778uint dead_node_count() { return _dead_node_count; }779void reset_dead_node_list() { _dead_node_list.Reset();780_dead_node_count = 0;781}782uint live_nodes() const {783int val = _unique - _dead_node_count;784assert (val >= 0, err_msg_res("number of tracked dead nodes %d more than created nodes %d", _unique, _dead_node_count));785return (uint) val;786}787#ifdef ASSERT788uint count_live_nodes_by_graph_walk();789void print_missing_nodes();790#endif791792// Constant table793ConstantTable& constant_table() { return _constant_table; }794795MachConstantBaseNode* mach_constant_base_node();796bool has_mach_constant_base_node() const { return _mach_constant_base_node != NULL; }797// Generated by adlc, true if CallNode requires MachConstantBase.798bool needs_clone_jvms();799800// Handy undefined Node801Node* top() const { return _top; }802803// these are used by guys who need to know about creation and transformation of top:804Node* cached_top_node() { return _top; }805void set_cached_top_node(Node* tn);806807GrowableArray<Node_Notes*>* node_note_array() const { return _node_note_array; }808void set_node_note_array(GrowableArray<Node_Notes*>* arr) { _node_note_array = arr; }809Node_Notes* default_node_notes() const { return _default_node_notes; }810void set_default_node_notes(Node_Notes* n) { _default_node_notes = n; }811812Node_Notes* node_notes_at(int idx) {813return locate_node_notes(_node_note_array, idx, false);814}815inline bool set_node_notes_at(int idx, Node_Notes* value);816817// Copy notes from source to dest, if they exist.818// Overwrite dest only if source provides something.819// Return true if information was moved.820bool copy_node_notes_to(Node* dest, Node* source);821822// Workhorse function to sort out the blocked Node_Notes array:823inline Node_Notes* locate_node_notes(GrowableArray<Node_Notes*>* arr,824int idx, bool can_grow = false);825826void grow_node_notes(GrowableArray<Node_Notes*>* arr, int grow_by);827828// Type management829Arena* type_arena() { return _type_arena; }830Dict* type_dict() { return _type_dict; }831void* type_hwm() { return _type_hwm; }832size_t type_last_size() { return _type_last_size; }833int num_alias_types() { return _num_alias_types; }834835void init_type_arena() { _type_arena = &_Compile_types; }836void set_type_arena(Arena* a) { _type_arena = a; }837void set_type_dict(Dict* d) { _type_dict = d; }838void set_type_hwm(void* p) { _type_hwm = p; }839void set_type_last_size(size_t sz) { _type_last_size = sz; }840841const TypeFunc* last_tf(ciMethod* m) {842return (m == _last_tf_m) ? _last_tf : NULL;843}844void set_last_tf(ciMethod* m, const TypeFunc* tf) {845assert(m != NULL || tf == NULL, "");846_last_tf_m = m;847_last_tf = tf;848}849850AliasType* alias_type(int idx) { assert(idx < num_alias_types(), "oob"); return _alias_types[idx]; }851AliasType* alias_type(const TypePtr* adr_type, ciField* field = NULL) { return find_alias_type(adr_type, false, field); }852bool have_alias_type(const TypePtr* adr_type);853AliasType* alias_type(ciField* field);854855int get_alias_index(const TypePtr* at) { return alias_type(at)->index(); }856const TypePtr* get_adr_type(uint aidx) { return alias_type(aidx)->adr_type(); }857int get_general_index(uint aidx) { return alias_type(aidx)->general_index(); }858859// Building nodes860void rethrow_exceptions(JVMState* jvms);861void return_values(JVMState* jvms);862JVMState* build_start_state(StartNode* start, const TypeFunc* tf);863864// Decide how to build a call.865// The profile factor is a discount to apply to this site's interp. profile.866CallGenerator* call_generator(ciMethod* call_method, int vtable_index, bool call_does_dispatch,867JVMState* jvms, bool allow_inline, float profile_factor, ciKlass* speculative_receiver_type = NULL,868bool allow_intrinsics = true, bool delayed_forbidden = false);869bool should_delay_inlining(ciMethod* call_method, JVMState* jvms) {870return should_delay_string_inlining(call_method, jvms) ||871should_delay_boxing_inlining(call_method, jvms);872}873bool should_delay_string_inlining(ciMethod* call_method, JVMState* jvms);874bool should_delay_boxing_inlining(ciMethod* call_method, JVMState* jvms);875876// Helper functions to identify inlining potential at call-site877ciMethod* optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass,878ciKlass* holder, ciMethod* callee,879const TypeOopPtr* receiver_type, bool is_virtual,880bool &call_does_dispatch, int &vtable_index,881bool check_access = true);882ciMethod* optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass,883ciMethod* callee, const TypeOopPtr* receiver_type,884bool check_access = true);885886// Report if there were too many traps at a current method and bci.887// Report if a trap was recorded, and/or PerMethodTrapLimit was exceeded.888// If there is no MDO at all, report no trap unless told to assume it.889bool too_many_traps(ciMethod* method, int bci, Deoptimization::DeoptReason reason);890// This version, unspecific to a particular bci, asks if891// PerMethodTrapLimit was exceeded for all inlined methods seen so far.892bool too_many_traps(Deoptimization::DeoptReason reason,893// Privately used parameter for logging:894ciMethodData* logmd = NULL);895// Report if there were too many recompiles at a method and bci.896bool too_many_recompiles(ciMethod* method, int bci, Deoptimization::DeoptReason reason);897// Return a bitset with the reasons where deoptimization is allowed,898// i.e., where there were not too many uncommon traps.899int _allowed_reasons;900int allowed_deopt_reasons() { return _allowed_reasons; }901void set_allowed_deopt_reasons();902903// Parsing, optimization904PhaseGVN* initial_gvn() { return _initial_gvn; }905Unique_Node_List* for_igvn() { return _for_igvn; }906inline void record_for_igvn(Node* n); // Body is after class Unique_Node_List.907void set_initial_gvn(PhaseGVN *gvn) { _initial_gvn = gvn; }908void set_for_igvn(Unique_Node_List *for_igvn) { _for_igvn = for_igvn; }909910// Replace n by nn using initial_gvn, calling hash_delete and911// record_for_igvn as needed.912void gvn_replace_by(Node* n, Node* nn);913914915void identify_useful_nodes(Unique_Node_List &useful);916void update_dead_node_list(Unique_Node_List &useful);917void remove_useless_nodes (Unique_Node_List &useful);918919WarmCallInfo* warm_calls() const { return _warm_calls; }920void set_warm_calls(WarmCallInfo* l) { _warm_calls = l; }921WarmCallInfo* pop_warm_call();922923// Record this CallGenerator for inlining at the end of parsing.924void add_late_inline(CallGenerator* cg) {925_late_inlines.insert_before(_late_inlines_pos, cg);926_late_inlines_pos++;927}928929void prepend_late_inline(CallGenerator* cg) {930_late_inlines.insert_before(0, cg);931}932933void add_string_late_inline(CallGenerator* cg) {934_string_late_inlines.push(cg);935}936937void add_boxing_late_inline(CallGenerator* cg) {938_boxing_late_inlines.push(cg);939}940941void remove_useless_late_inlines(GrowableArray<CallGenerator*>* inlines, Unique_Node_List &useful);942943void dump_inlining();944945bool over_inlining_cutoff() const {946if (!inlining_incrementally()) {947return unique() > (uint)NodeCountInliningCutoff;948} else {949return live_nodes() > (uint)LiveNodeCountInliningCutoff;950}951}952953void inc_number_of_mh_late_inlines() { _number_of_mh_late_inlines++; }954void dec_number_of_mh_late_inlines() { assert(_number_of_mh_late_inlines > 0, "_number_of_mh_late_inlines < 0 !"); _number_of_mh_late_inlines--; }955bool has_mh_late_inlines() const { return _number_of_mh_late_inlines > 0; }956957void inline_incrementally_one(PhaseIterGVN& igvn);958void inline_incrementally(PhaseIterGVN& igvn);959void inline_string_calls(bool parse_time);960void inline_boxing_calls(PhaseIterGVN& igvn);961void remove_root_to_sfpts_edges();962963// Matching, CFG layout, allocation, code generation964PhaseCFG* cfg() { return _cfg; }965bool select_24_bit_instr() const { return _select_24_bit_instr; }966bool in_24_bit_fp_mode() const { return _in_24_bit_fp_mode; }967bool has_java_calls() const { return _java_calls > 0; }968int java_calls() const { return _java_calls; }969int inner_loops() const { return _inner_loops; }970Matcher* matcher() { return _matcher; }971PhaseRegAlloc* regalloc() { return _regalloc; }972int frame_slots() const { return _frame_slots; }973int frame_size_in_words() const; // frame_slots in units of the polymorphic 'words'974int frame_size_in_bytes() const { return _frame_slots << LogBytesPerInt; }975RegMask& FIRST_STACK_mask() { return _FIRST_STACK_mask; }976Arena* indexSet_arena() { return _indexSet_arena; }977void* indexSet_free_block_list() { return _indexSet_free_block_list; }978uint node_bundling_limit() { return _node_bundling_limit; }979Bundle* node_bundling_base() { return _node_bundling_base; }980void set_node_bundling_limit(uint n) { _node_bundling_limit = n; }981void set_node_bundling_base(Bundle* b) { _node_bundling_base = b; }982bool starts_bundle(const Node *n) const;983bool need_stack_bang(int frame_size_in_bytes) const;984bool need_register_stack_bang() const;985986void update_interpreter_frame_size(int size) {987if (_interpreter_frame_size < size) {988_interpreter_frame_size = size;989}990}991int bang_size_in_bytes() const;992993void set_matcher(Matcher* m) { _matcher = m; }994//void set_regalloc(PhaseRegAlloc* ra) { _regalloc = ra; }995void set_indexSet_arena(Arena* a) { _indexSet_arena = a; }996void set_indexSet_free_block_list(void* p) { _indexSet_free_block_list = p; }997998// Remember if this compilation changes hardware mode to 24-bit precision999void set_24_bit_selection_and_mode(bool selection, bool mode) {1000_select_24_bit_instr = selection;1001_in_24_bit_fp_mode = mode;1002}10031004void set_java_calls(int z) { _java_calls = z; }1005void set_inner_loops(int z) { _inner_loops = z; }10061007// Instruction bits passed off to the VM1008int code_size() { return _method_size; }1009CodeBuffer* code_buffer() { return &_code_buffer; }1010int first_block_size() { return _first_block_size; }1011void set_frame_complete(int off) { _code_offsets.set_value(CodeOffsets::Frame_Complete, off); }1012ExceptionHandlerTable* handler_table() { return &_handler_table; }1013ImplicitExceptionTable* inc_table() { return &_inc_table; }1014OopMapSet* oop_map_set() { return _oop_map_set; }1015DebugInformationRecorder* debug_info() { return env()->debug_info(); }1016Dependencies* dependencies() { return env()->dependencies(); }1017static int CompiledZap_count() { return _CompiledZap_count; }1018BufferBlob* scratch_buffer_blob() { return _scratch_buffer_blob; }1019void init_scratch_buffer_blob(int const_size);1020void clear_scratch_buffer_blob();1021void set_scratch_buffer_blob(BufferBlob* b) { _scratch_buffer_blob = b; }1022relocInfo* scratch_locs_memory() { return _scratch_locs_memory; }1023void set_scratch_locs_memory(relocInfo* b) { _scratch_locs_memory = b; }10241025// emit to scratch blob, report resulting size1026uint scratch_emit_size(const Node* n);1027void set_in_scratch_emit_size(bool x) { _in_scratch_emit_size = x; }1028bool in_scratch_emit_size() const { return _in_scratch_emit_size; }10291030enum ScratchBufferBlob {1031MAX_inst_size = 1024,1032MAX_locs_size = 128, // number of relocInfo elements1033MAX_const_size = 128,1034MAX_stubs_size = 1281035};10361037// Major entry point. Given a Scope, compile the associated method.1038// For normal compilations, entry_bci is InvocationEntryBci. For on stack1039// replacement, entry_bci indicates the bytecode for which to compile a1040// continuation.1041Compile(ciEnv* ci_env, C2Compiler* compiler, ciMethod* target,1042int entry_bci, bool subsume_loads, bool do_escape_analysis,1043bool eliminate_boxing);10441045// Second major entry point. From the TypeFunc signature, generate code1046// to pass arguments from the Java calling convention to the C calling1047// convention.1048Compile(ciEnv* ci_env, const TypeFunc *(*gen)(),1049address stub_function, const char *stub_name,1050int is_fancy_jump, bool pass_tls,1051bool save_arg_registers, bool return_pc);10521053// From the TypeFunc signature, generate code to pass arguments1054// from Compiled calling convention to Interpreter's calling convention1055void Generate_Compiled_To_Interpreter_Graph(const TypeFunc *tf, address interpreter_entry);10561057// From the TypeFunc signature, generate code to pass arguments1058// from Interpreter's calling convention to Compiler's calling convention1059void Generate_Interpreter_To_Compiled_Graph(const TypeFunc *tf);10601061// Are we compiling a method?1062bool has_method() { return method() != NULL; }10631064// Maybe print some information about this compile.1065void print_compile_messages();10661067// Final graph reshaping, a post-pass after the regular optimizer is done.1068bool final_graph_reshaping();10691070// returns true if adr is completely contained in the given alias category1071bool must_alias(const TypePtr* adr, int alias_idx);10721073// returns true if adr overlaps with the given alias category1074bool can_alias(const TypePtr* adr, int alias_idx);10751076// Driver for converting compiler's IR into machine code bits1077void Output();10781079// Accessors for node bundling info.1080Bundle* node_bundling(const Node *n);1081bool valid_bundle_info(const Node *n);10821083// Schedule and Bundle the instructions1084void ScheduleAndBundle();10851086// Build OopMaps for each GC point1087void BuildOopMaps();10881089// Append debug info for the node "local" at safepoint node "sfpt" to the1090// "array", May also consult and add to "objs", which describes the1091// scalar-replaced objects.1092void FillLocArray( int idx, MachSafePointNode* sfpt,1093Node *local, GrowableArray<ScopeValue*> *array,1094GrowableArray<ScopeValue*> *objs );10951096// If "objs" contains an ObjectValue whose id is "id", returns it, else NULL.1097static ObjectValue* sv_for_node_id(GrowableArray<ScopeValue*> *objs, int id);1098// Requres that "objs" does not contains an ObjectValue whose id matches1099// that of "sv. Appends "sv".1100static void set_sv_for_object_node(GrowableArray<ScopeValue*> *objs,1101ObjectValue* sv );11021103// Process an OopMap Element while emitting nodes1104void Process_OopMap_Node(MachNode *mach, int code_offset);11051106// Initialize code buffer1107CodeBuffer* init_buffer(uint* blk_starts);11081109// Write out basic block data to code buffer1110void fill_buffer(CodeBuffer* cb, uint* blk_starts);11111112// Determine which variable sized branches can be shortened1113void shorten_branches(uint* blk_starts, int& code_size, int& reloc_size, int& stub_size);11141115// Compute the size of first NumberOfLoopInstrToAlign instructions1116// at the head of a loop.1117void compute_loop_first_inst_sizes();11181119// Compute the information for the exception tables1120void FillExceptionTables(uint cnt, uint *call_returns, uint *inct_starts, Label *blk_labels);11211122// Stack slots that may be unused by the calling convention but must1123// otherwise be preserved. On Intel this includes the return address.1124// On PowerPC it includes the 4 words holding the old TOC & LR glue.1125uint in_preserve_stack_slots();11261127// "Top of Stack" slots that may be unused by the calling convention but must1128// otherwise be preserved.1129// On Intel these are not necessary and the value can be zero.1130// On Sparc this describes the words reserved for storing a register window1131// when an interrupt occurs.1132static uint out_preserve_stack_slots();11331134// Number of outgoing stack slots killed above the out_preserve_stack_slots1135// for calls to C. Supports the var-args backing area for register parms.1136uint varargs_C_out_slots_killed() const;11371138// Number of Stack Slots consumed by a synchronization entry1139int sync_stack_slots() const;11401141// Compute the name of old_SP. See <arch>.ad for frame layout.1142OptoReg::Name compute_old_SP();11431144#ifdef ENABLE_ZAP_DEAD_LOCALS1145static bool is_node_getting_a_safepoint(Node*);1146void Insert_zap_nodes();1147Node* call_zap_node(MachSafePointNode* n, int block_no);1148#endif11491150private:1151// Phase control:1152void Init(int aliaslevel); // Prepare for a single compilation1153int Inline_Warm(); // Find more inlining work.1154void Finish_Warm(); // Give up on further inlines.1155void Optimize(); // Given a graph, optimize it1156void Code_Gen(); // Generate code from a graph11571158// Management of the AliasType table.1159void grow_alias_types();1160AliasCacheEntry* probe_alias_cache(const TypePtr* adr_type);1161const TypePtr *flatten_alias_type(const TypePtr* adr_type) const;1162AliasType* find_alias_type(const TypePtr* adr_type, bool no_create, ciField* field);11631164void verify_top(Node*) const PRODUCT_RETURN;11651166// Intrinsic setup.1167void register_library_intrinsics(); // initializer1168CallGenerator* make_vm_intrinsic(ciMethod* m, bool is_virtual); // constructor1169int intrinsic_insertion_index(ciMethod* m, bool is_virtual); // helper1170CallGenerator* find_intrinsic(ciMethod* m, bool is_virtual); // query fn1171void register_intrinsic(CallGenerator* cg); // update fn11721173#ifndef PRODUCT1174static juint _intrinsic_hist_count[vmIntrinsics::ID_LIMIT];1175static jubyte _intrinsic_hist_flags[vmIntrinsics::ID_LIMIT];1176#endif1177// Function calls made by the public function final_graph_reshaping.1178// No need to be made public as they are not called elsewhere.1179void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc);1180void final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Reshape_Counts &frc );1181void eliminate_redundant_card_marks(Node* n);11821183public:11841185// Note: Histogram array size is about 1 Kb.1186enum { // flag bits:1187_intrinsic_worked = 1, // succeeded at least once1188_intrinsic_failed = 2, // tried it but it failed1189_intrinsic_disabled = 4, // was requested but disabled (e.g., -XX:-InlineUnsafeOps)1190_intrinsic_virtual = 8, // was seen in the virtual form (rare)1191_intrinsic_both = 16 // was seen in the non-virtual form (usual)1192};1193// Update histogram. Return boolean if this is a first-time occurrence.1194static bool gather_intrinsic_statistics(vmIntrinsics::ID id,1195bool is_virtual, int flags) PRODUCT_RETURN0;1196static void print_intrinsic_statistics() PRODUCT_RETURN;11971198// Graph verification code1199// Walk the node list, verifying that there is a one-to-one1200// correspondence between Use-Def edges and Def-Use edges1201// The option no_dead_code enables stronger checks that the1202// graph is strongly connected from root in both directions.1203void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN;12041205// Verify GC barrier patterns1206void verify_barriers() PRODUCT_RETURN;12071208// End-of-run dumps.1209static void print_statistics() PRODUCT_RETURN;12101211// Dump formatted assembly1212void dump_asm(int *pcs = NULL, uint pc_limit = 0) PRODUCT_RETURN;1213void dump_pc(int *pcs, int pc_limit, Node *n);12141215// Verify ADLC assumptions during startup1216static void adlc_verification() PRODUCT_RETURN;12171218// Definitions of pd methods1219static void pd_compiler2_init();12201221// Convert integer value to a narrowed long type dependent on ctrl (for example, a range check)1222static Node* constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl);12231224// Auxiliary method for randomized fuzzing/stressing1225static bool randomized_select(int count);1226#ifdef ASSERT1227bool _type_verify_symmetry;1228#endif1229};12301231#endif // SHARE_VM_OPTO_COMPILE_HPP123212331234