Path: blob/master/src/hotspot/share/opto/compile.hpp
64441 views
/*1* Copyright (c) 1997, 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#ifndef SHARE_OPTO_COMPILE_HPP25#define SHARE_OPTO_COMPILE_HPP2627#include "asm/codeBuffer.hpp"28#include "ci/compilerInterface.hpp"29#include "code/debugInfoRec.hpp"30#include "compiler/compiler_globals.hpp"31#include "compiler/compilerOracle.hpp"32#include "compiler/compileBroker.hpp"33#include "compiler/compilerEvent.hpp"34#include "libadt/dict.hpp"35#include "libadt/vectset.hpp"36#include "memory/resourceArea.hpp"37#include "oops/methodData.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/sharedRuntime.hpp"44#include "runtime/timerTrace.hpp"45#include "runtime/vmThread.hpp"46#include "utilities/ticks.hpp"4748class AbstractLockNode;49class AddPNode;50class Block;51class Bundle;52class CallGenerator;53class CloneMap;54class ConnectionGraph;55class IdealGraphPrinter;56class InlineTree;57class Int_Array;58class Matcher;59class MachConstantNode;60class MachConstantBaseNode;61class MachNode;62class MachOper;63class MachSafePointNode;64class Node;65class Node_Array;66class Node_List;67class Node_Notes;68class NodeCloneInfo;69class OptoReg;70class PhaseCFG;71class PhaseGVN;72class PhaseIterGVN;73class PhaseRegAlloc;74class PhaseCCP;75class PhaseOutput;76class RootNode;77class relocInfo;78class Scope;79class StartNode;80class SafePointNode;81class JVMState;82class Type;83class TypeData;84class TypeInt;85class TypeInteger;86class TypePtr;87class TypeOopPtr;88class TypeFunc;89class TypeVect;90class Unique_Node_List;91class nmethod;92class Node_Stack;93struct Final_Reshape_Counts;9495enum LoopOptsMode {96LoopOptsDefault,97LoopOptsNone,98LoopOptsMaxUnroll,99LoopOptsShenandoahExpand,100LoopOptsShenandoahPostExpand,101LoopOptsSkipSplitIf,102LoopOptsVerify103};104105typedef unsigned int node_idx_t;106class NodeCloneInfo {107private:108uint64_t _idx_clone_orig;109public:110111void set_idx(node_idx_t idx) {112_idx_clone_orig = (_idx_clone_orig & CONST64(0xFFFFFFFF00000000)) | idx;113}114node_idx_t idx() const { return (node_idx_t)(_idx_clone_orig & 0xFFFFFFFF); }115116void set_gen(int generation) {117uint64_t g = (uint64_t)generation << 32;118_idx_clone_orig = (_idx_clone_orig & 0xFFFFFFFF) | g;119}120int gen() const { return (int)(_idx_clone_orig >> 32); }121122void set(uint64_t x) { _idx_clone_orig = x; }123void set(node_idx_t x, int g) { set_idx(x); set_gen(g); }124uint64_t get() const { return _idx_clone_orig; }125126NodeCloneInfo(uint64_t idx_clone_orig) : _idx_clone_orig(idx_clone_orig) {}127NodeCloneInfo(node_idx_t x, int g) : _idx_clone_orig(0) { set(x, g); }128129void dump() const;130};131132class CloneMap {133friend class Compile;134private:135bool _debug;136Dict* _dict;137int _clone_idx; // current cloning iteration/generation in loop unroll138public:139void* _2p(node_idx_t key) const { return (void*)(intptr_t)key; } // 2 conversion functions to make gcc happy140node_idx_t _2_node_idx_t(const void* k) const { return (node_idx_t)(intptr_t)k; }141Dict* dict() const { return _dict; }142void insert(node_idx_t key, uint64_t val) { assert(_dict->operator[](_2p(key)) == NULL, "key existed"); _dict->Insert(_2p(key), (void*)val); }143void insert(node_idx_t key, NodeCloneInfo& ci) { insert(key, ci.get()); }144void remove(node_idx_t key) { _dict->Delete(_2p(key)); }145uint64_t value(node_idx_t key) const { return (uint64_t)_dict->operator[](_2p(key)); }146node_idx_t idx(node_idx_t key) const { return NodeCloneInfo(value(key)).idx(); }147int gen(node_idx_t key) const { return NodeCloneInfo(value(key)).gen(); }148int gen(const void* k) const { return gen(_2_node_idx_t(k)); }149int max_gen() const;150void clone(Node* old, Node* nnn, int gen);151void verify_insert_and_clone(Node* old, Node* nnn, int gen);152void dump(node_idx_t key) const;153154int clone_idx() const { return _clone_idx; }155void set_clone_idx(int x) { _clone_idx = x; }156bool is_debug() const { return _debug; }157void set_debug(bool debug) { _debug = debug; }158static const char* debug_option_name;159160bool same_idx(node_idx_t k1, node_idx_t k2) const { return idx(k1) == idx(k2); }161bool same_gen(node_idx_t k1, node_idx_t k2) const { return gen(k1) == gen(k2); }162};163164//------------------------------Compile----------------------------------------165// This class defines a top-level Compiler invocation.166167class Compile : public Phase {168friend class VMStructs;169170public:171// Fixed alias indexes. (See also MergeMemNode.)172enum {173AliasIdxTop = 1, // pseudo-index, aliases to nothing (used as sentinel value)174AliasIdxBot = 2, // pseudo-index, aliases to everything175AliasIdxRaw = 3 // hard-wired index for TypeRawPtr::BOTTOM176};177178// Variant of TraceTime(NULL, &_t_accumulator, CITime);179// Integrated with logging. If logging is turned on, and CITimeVerbose is true,180// then brackets are put into the log, with time stamps and node counts.181// (The time collection itself is always conditionalized on CITime.)182class TracePhase : public TraceTime {183private:184Compile* C;185CompileLog* _log;186const char* _phase_name;187bool _dolog;188public:189TracePhase(const char* name, elapsedTimer* accumulator);190~TracePhase();191};192193// Information per category of alias (memory slice)194class AliasType {195private:196friend class Compile;197198int _index; // unique index, used with MergeMemNode199const TypePtr* _adr_type; // normalized address type200ciField* _field; // relevant instance field, or null if none201const Type* _element; // relevant array element type, or null if none202bool _is_rewritable; // false if the memory is write-once only203int _general_index; // if this is type is an instance, the general204// type that this is an instance of205206void Init(int i, const TypePtr* at);207208public:209int index() const { return _index; }210const TypePtr* adr_type() const { return _adr_type; }211ciField* field() const { return _field; }212const Type* element() const { return _element; }213bool is_rewritable() const { return _is_rewritable; }214bool is_volatile() const { return (_field ? _field->is_volatile() : false); }215int general_index() const { return (_general_index != 0) ? _general_index : _index; }216217void set_rewritable(bool z) { _is_rewritable = z; }218void set_field(ciField* f) {219assert(!_field,"");220_field = f;221if (f->is_final() || f->is_stable()) {222// In the case of @Stable, multiple writes are possible but may be assumed to be no-ops.223_is_rewritable = false;224}225}226void set_element(const Type* e) {227assert(_element == NULL, "");228_element = e;229}230231BasicType basic_type() const;232233void print_on(outputStream* st) PRODUCT_RETURN;234};235236enum {237logAliasCacheSize = 6,238AliasCacheSize = (1<<logAliasCacheSize)239};240struct AliasCacheEntry { const TypePtr* _adr_type; int _index; }; // simple duple type241enum {242trapHistLength = MethodData::_trap_hist_limit243};244245private:246// Fixed parameters to this compilation.247const int _compile_id;248const bool _subsume_loads; // Load can be matched as part of a larger op.249const bool _do_escape_analysis; // Do escape analysis.250const bool _install_code; // Install the code that was compiled251const bool _eliminate_boxing; // Do boxing elimination.252const bool _do_locks_coarsening; // Do locks coarsening253ciMethod* _method; // The method being compiled.254int _entry_bci; // entry bci for osr methods.255const TypeFunc* _tf; // My kind of signature256InlineTree* _ilt; // Ditto (temporary).257address _stub_function; // VM entry for stub being compiled, or NULL258const char* _stub_name; // Name of stub or adapter being compiled, or NULL259address _stub_entry_point; // Compile code entry for generated stub, or NULL260261// Control of this compilation.262int _max_inline_size; // Max inline size for this compilation263int _freq_inline_size; // Max hot method inline size for this compilation264int _fixed_slots; // count of frame slots not allocated by the register265// allocator i.e. locks, original deopt pc, etc.266uintx _max_node_limit; // Max unique node count during a single compilation.267268bool _post_loop_opts_phase; // Loop opts are finished.269270int _major_progress; // Count of something big happening271bool _inlining_progress; // progress doing incremental inlining?272bool _inlining_incrementally;// Are we doing incremental inlining (post parse)273bool _do_cleanup; // Cleanup is needed before proceeding with incremental inlining274bool _has_loops; // True if the method _may_ have some loops275bool _has_split_ifs; // True if the method _may_ have some split-if276bool _has_unsafe_access; // True if the method _may_ produce faults in unsafe loads or stores.277bool _has_stringbuilder; // True StringBuffers or StringBuilders are allocated278bool _has_boxed_value; // True if a boxed object is allocated279bool _has_reserved_stack_access; // True if the method or an inlined method is annotated with ReservedStackAccess280uint _max_vector_size; // Maximum size of generated vectors281bool _clear_upper_avx; // Clear upper bits of ymm registers using vzeroupper282uint _trap_hist[trapHistLength]; // Cumulative traps283bool _trap_can_recompile; // Have we emitted a recompiling trap?284uint _decompile_count; // Cumulative decompilation counts.285bool _do_inlining; // True if we intend to do inlining286bool _do_scheduling; // True if we intend to do scheduling287bool _do_freq_based_layout; // True if we intend to do frequency based block layout288bool _do_vector_loop; // True if allowed to execute loop in parallel iterations289bool _use_cmove; // True if CMove should be used without profitability analysis290bool _age_code; // True if we need to profile code age (decrement the aging counter)291int _AliasLevel; // Locally-adjusted version of AliasLevel flag.292bool _print_assembly; // True if we should dump assembly code for this compilation293bool _print_inlining; // True if we should print inlining for this compilation294bool _print_intrinsics; // True if we should print intrinsics for this compilation295#ifndef PRODUCT296uint _igv_idx; // Counter for IGV node identifiers297bool _trace_opto_output;298bool _print_ideal;299bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing300#endif301bool _has_irreducible_loop; // Found irreducible loops302// JSR 292303bool _has_method_handle_invokes; // True if this method has MethodHandle invokes.304RTMState _rtm_state; // State of Restricted Transactional Memory usage305int _loop_opts_cnt; // loop opts round306bool _clinit_barrier_on_entry; // True if clinit barrier is needed on nmethod entry307uint _stress_seed; // Seed for stress testing308309// Compilation environment.310Arena _comp_arena; // Arena with lifetime equivalent to Compile311void* _barrier_set_state; // Potential GC barrier state for Compile312ciEnv* _env; // CI interface313DirectiveSet* _directive; // Compiler directive314CompileLog* _log; // from CompilerThread315const char* _failure_reason; // for record_failure/failing pattern316GrowableArray<CallGenerator*> _intrinsics; // List of intrinsics.317GrowableArray<Node*> _macro_nodes; // List of nodes which need to be expanded before matching.318GrowableArray<Node*> _predicate_opaqs; // List of Opaque1 nodes for the loop predicates.319GrowableArray<Node*> _skeleton_predicate_opaqs; // List of Opaque4 nodes for the loop skeleton predicates.320GrowableArray<Node*> _expensive_nodes; // List of nodes that are expensive to compute and that we'd better not let the GVN freely common321GrowableArray<Node*> _for_post_loop_igvn; // List of nodes for IGVN after loop opts are over322GrowableArray<Node_List*> _coarsened_locks; // List of coarsened Lock and Unlock nodes323ConnectionGraph* _congraph;324#ifndef PRODUCT325IdealGraphPrinter* _printer;326static IdealGraphPrinter* _debug_file_printer;327static IdealGraphPrinter* _debug_network_printer;328#endif329330331// Node management332uint _unique; // Counter for unique Node indices333VectorSet _dead_node_list; // Set of dead nodes334uint _dead_node_count; // Number of dead nodes; VectorSet::Size() is O(N).335// So use this to keep count and make the call O(1).336DEBUG_ONLY(Unique_Node_List* _modified_nodes;) // List of nodes which inputs were modified337DEBUG_ONLY(bool _phase_optimize_finished;) // Used for live node verification while creating new nodes338339debug_only(static int _debug_idx;) // Monotonic counter (not reset), use -XX:BreakAtNode=<idx>340Arena _node_arena; // Arena for new-space Nodes341Arena _old_arena; // Arena for old-space Nodes, lifetime during xform342RootNode* _root; // Unique root of compilation, or NULL after bail-out.343Node* _top; // Unique top node. (Reset by various phases.)344345Node* _immutable_memory; // Initial memory state346347Node* _recent_alloc_obj;348Node* _recent_alloc_ctl;349350// Constant table351MachConstantBaseNode* _mach_constant_base_node; // Constant table base node singleton.352353354// Blocked array of debugging and profiling information,355// tracked per node.356enum { _log2_node_notes_block_size = 8,357_node_notes_block_size = (1<<_log2_node_notes_block_size)358};359GrowableArray<Node_Notes*>* _node_note_array;360Node_Notes* _default_node_notes; // default notes for new nodes361362// After parsing and every bulk phase we hang onto the Root instruction.363// The RootNode instruction is where the whole program begins. It produces364// the initial Control and BOTTOM for everybody else.365366// Type management367Arena _Compile_types; // Arena for all types368Arena* _type_arena; // Alias for _Compile_types except in Initialize_shared()369Dict* _type_dict; // Intern table370CloneMap _clone_map; // used for recording history of cloned nodes371size_t _type_last_size; // Last allocation size (see Type::operator new/delete)372ciMethod* _last_tf_m; // Cache for373const TypeFunc* _last_tf; // TypeFunc::make374AliasType** _alias_types; // List of alias types seen so far.375int _num_alias_types; // Logical length of _alias_types376int _max_alias_types; // Physical length of _alias_types377AliasCacheEntry _alias_cache[AliasCacheSize]; // Gets aliases w/o data structure walking378379// Parsing, optimization380PhaseGVN* _initial_gvn; // Results of parse-time PhaseGVN381Unique_Node_List* _for_igvn; // Initial work-list for next round of Iterative GVN382383GrowableArray<CallGenerator*> _late_inlines; // List of CallGenerators to be revisited after main parsing has finished.384GrowableArray<CallGenerator*> _string_late_inlines; // same but for string operations385GrowableArray<CallGenerator*> _boxing_late_inlines; // same but for boxing operations386387GrowableArray<CallGenerator*> _vector_reboxing_late_inlines; // same but for vector reboxing operations388389int _late_inlines_pos; // Where in the queue should the next late inlining candidate go (emulate depth first inlining)390uint _number_of_mh_late_inlines; // number of method handle late inlining still pending391392GrowableArray<RuntimeStub*> _native_invokers;393394// Inlining may not happen in parse order which would make395// PrintInlining output confusing. Keep track of PrintInlining396// pieces in order.397class PrintInliningBuffer : public CHeapObj<mtCompiler> {398private:399CallGenerator* _cg;400stringStream _ss;401static const size_t default_stream_buffer_size = 128;402403public:404PrintInliningBuffer()405: _cg(NULL), _ss(default_stream_buffer_size) {}406407stringStream* ss() { return &_ss; }408CallGenerator* cg() { return _cg; }409void set_cg(CallGenerator* cg) { _cg = cg; }410};411412stringStream* _print_inlining_stream;413GrowableArray<PrintInliningBuffer*>* _print_inlining_list;414int _print_inlining_idx;415char* _print_inlining_output;416417// Only keep nodes in the expensive node list that need to be optimized418void cleanup_expensive_nodes(PhaseIterGVN &igvn);419// Use for sorting expensive nodes to bring similar nodes together420static int cmp_expensive_nodes(Node** n1, Node** n2);421// Expensive nodes list already sorted?422bool expensive_nodes_sorted() const;423// Remove the speculative part of types and clean up the graph424void remove_speculative_types(PhaseIterGVN &igvn);425426void* _replay_inline_data; // Pointer to data loaded from file427428void print_inlining_stream_free();429void print_inlining_init();430void print_inlining_reinit();431void print_inlining_commit();432void print_inlining_push();433PrintInliningBuffer* print_inlining_current();434435void log_late_inline_failure(CallGenerator* cg, const char* msg);436DEBUG_ONLY(bool _exception_backedge;)437438public:439440void* barrier_set_state() const { return _barrier_set_state; }441442outputStream* print_inlining_stream() const {443assert(print_inlining() || print_intrinsics(), "PrintInlining off?");444return _print_inlining_stream;445}446447void print_inlining_update(CallGenerator* cg);448void print_inlining_update_delayed(CallGenerator* cg);449void print_inlining_move_to(CallGenerator* cg);450void print_inlining_assert_ready();451void print_inlining_reset();452453void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) {454stringStream ss;455CompileTask::print_inlining_inner(&ss, method, inline_level, bci, msg);456print_inlining_stream()->print("%s", ss.as_string());457}458459#ifndef PRODUCT460IdealGraphPrinter* printer() { return _printer; }461#endif462463void log_late_inline(CallGenerator* cg);464void log_inline_id(CallGenerator* cg);465void log_inline_failure(const char* msg);466467void* replay_inline_data() const { return _replay_inline_data; }468469// Dump inlining replay data to the stream.470void dump_inline_data(outputStream* out);471472private:473// Matching, CFG layout, allocation, code generation474PhaseCFG* _cfg; // Results of CFG finding475int _java_calls; // Number of java calls in the method476int _inner_loops; // Number of inner loops in the method477Matcher* _matcher; // Engine to map ideal to machine instructions478PhaseRegAlloc* _regalloc; // Results of register allocation.479RegMask _FIRST_STACK_mask; // All stack slots usable for spills (depends on frame layout)480Arena* _indexSet_arena; // control IndexSet allocation within PhaseChaitin481void* _indexSet_free_block_list; // free list of IndexSet bit blocks482int _interpreter_frame_size;483484PhaseOutput* _output;485486public:487// Accessors488489// The Compile instance currently active in this (compiler) thread.490static Compile* current() {491return (Compile*) ciEnv::current()->compiler_data();492}493494int interpreter_frame_size() const { return _interpreter_frame_size; }495496PhaseOutput* output() const { return _output; }497void set_output(PhaseOutput* o) { _output = o; }498499// ID for this compilation. Useful for setting breakpoints in the debugger.500int compile_id() const { return _compile_id; }501DirectiveSet* directive() const { return _directive; }502503// Does this compilation allow instructions to subsume loads? User504// instructions that subsume a load may result in an unschedulable505// instruction sequence.506bool subsume_loads() const { return _subsume_loads; }507/** Do escape analysis. */508bool do_escape_analysis() const { return _do_escape_analysis; }509/** Do boxing elimination. */510bool eliminate_boxing() const { return _eliminate_boxing; }511/** Do aggressive boxing elimination. */512bool aggressive_unboxing() const { return _eliminate_boxing && AggressiveUnboxing; }513bool should_install_code() const { return _install_code; }514/** Do locks coarsening. */515bool do_locks_coarsening() const { return _do_locks_coarsening; }516517// Other fixed compilation parameters.518ciMethod* method() const { return _method; }519int entry_bci() const { return _entry_bci; }520bool is_osr_compilation() const { return _entry_bci != InvocationEntryBci; }521bool is_method_compilation() const { return (_method != NULL && !_method->flags().is_native()); }522const TypeFunc* tf() const { assert(_tf!=NULL, ""); return _tf; }523void init_tf(const TypeFunc* tf) { assert(_tf==NULL, ""); _tf = tf; }524InlineTree* ilt() const { return _ilt; }525address stub_function() const { return _stub_function; }526const char* stub_name() const { return _stub_name; }527address stub_entry_point() const { return _stub_entry_point; }528void set_stub_entry_point(address z) { _stub_entry_point = z; }529530// Control of this compilation.531int fixed_slots() const { assert(_fixed_slots >= 0, ""); return _fixed_slots; }532void set_fixed_slots(int n) { _fixed_slots = n; }533int major_progress() const { return _major_progress; }534void set_inlining_progress(bool z) { _inlining_progress = z; }535int inlining_progress() const { return _inlining_progress; }536void set_inlining_incrementally(bool z) { _inlining_incrementally = z; }537int inlining_incrementally() const { return _inlining_incrementally; }538void set_do_cleanup(bool z) { _do_cleanup = z; }539int do_cleanup() const { return _do_cleanup; }540void set_major_progress() { _major_progress++; }541void restore_major_progress(int progress) { _major_progress += progress; }542void clear_major_progress() { _major_progress = 0; }543int max_inline_size() const { return _max_inline_size; }544void set_freq_inline_size(int n) { _freq_inline_size = n; }545int freq_inline_size() const { return _freq_inline_size; }546void set_max_inline_size(int n) { _max_inline_size = n; }547bool has_loops() const { return _has_loops; }548void set_has_loops(bool z) { _has_loops = z; }549bool has_split_ifs() const { return _has_split_ifs; }550void set_has_split_ifs(bool z) { _has_split_ifs = z; }551bool has_unsafe_access() const { return _has_unsafe_access; }552void set_has_unsafe_access(bool z) { _has_unsafe_access = z; }553bool has_stringbuilder() const { return _has_stringbuilder; }554void set_has_stringbuilder(bool z) { _has_stringbuilder = z; }555bool has_boxed_value() const { return _has_boxed_value; }556void set_has_boxed_value(bool z) { _has_boxed_value = z; }557bool has_reserved_stack_access() const { return _has_reserved_stack_access; }558void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; }559uint max_vector_size() const { return _max_vector_size; }560void set_max_vector_size(uint s) { _max_vector_size = s; }561bool clear_upper_avx() const { return _clear_upper_avx; }562void set_clear_upper_avx(bool s) { _clear_upper_avx = s; }563void set_trap_count(uint r, uint c) { assert(r < trapHistLength, "oob"); _trap_hist[r] = c; }564uint trap_count(uint r) const { assert(r < trapHistLength, "oob"); return _trap_hist[r]; }565bool trap_can_recompile() const { return _trap_can_recompile; }566void set_trap_can_recompile(bool z) { _trap_can_recompile = z; }567uint decompile_count() const { return _decompile_count; }568void set_decompile_count(uint c) { _decompile_count = c; }569bool allow_range_check_smearing() const;570bool do_inlining() const { return _do_inlining; }571void set_do_inlining(bool z) { _do_inlining = z; }572bool do_scheduling() const { return _do_scheduling; }573void set_do_scheduling(bool z) { _do_scheduling = z; }574bool do_freq_based_layout() const{ return _do_freq_based_layout; }575void set_do_freq_based_layout(bool z){ _do_freq_based_layout = z; }576bool do_vector_loop() const { return _do_vector_loop; }577void set_do_vector_loop(bool z) { _do_vector_loop = z; }578bool use_cmove() const { return _use_cmove; }579void set_use_cmove(bool z) { _use_cmove = z; }580bool age_code() const { return _age_code; }581void set_age_code(bool z) { _age_code = z; }582int AliasLevel() const { return _AliasLevel; }583bool print_assembly() const { return _print_assembly; }584void set_print_assembly(bool z) { _print_assembly = z; }585bool print_inlining() const { return _print_inlining; }586void set_print_inlining(bool z) { _print_inlining = z; }587bool print_intrinsics() const { return _print_intrinsics; }588void set_print_intrinsics(bool z) { _print_intrinsics = z; }589RTMState rtm_state() const { return _rtm_state; }590void set_rtm_state(RTMState s) { _rtm_state = s; }591bool use_rtm() const { return (_rtm_state & NoRTM) == 0; }592bool profile_rtm() const { return _rtm_state == ProfileRTM; }593uint max_node_limit() const { return (uint)_max_node_limit; }594void set_max_node_limit(uint n) { _max_node_limit = n; }595bool clinit_barrier_on_entry() { return _clinit_barrier_on_entry; }596void set_clinit_barrier_on_entry(bool z) { _clinit_barrier_on_entry = z; }597598// check the CompilerOracle for special behaviours for this compile599bool method_has_option(enum CompileCommand option) {600return method() != NULL && method()->has_option(option);601}602603#ifndef PRODUCT604uint next_igv_idx() { return _igv_idx++; }605bool trace_opto_output() const { return _trace_opto_output; }606bool print_ideal() const { return _print_ideal; }607bool parsed_irreducible_loop() const { return _parsed_irreducible_loop; }608void set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }609int _in_dump_cnt; // Required for dumping ir nodes.610#endif611bool has_irreducible_loop() const { return _has_irreducible_loop; }612void set_has_irreducible_loop(bool z) { _has_irreducible_loop = z; }613614// JSR 292615bool has_method_handle_invokes() const { return _has_method_handle_invokes; }616void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; }617618Ticks _latest_stage_start_counter;619620void begin_method(int level = 1) {621#ifndef PRODUCT622if (_method != NULL && should_print(level)) {623_printer->begin_method();624}625#endif626C->_latest_stage_start_counter.stamp();627}628629bool should_print(int level = 1) {630#ifndef PRODUCT631if (PrintIdealGraphLevel < 0) { // disabled by the user632return false;633}634635bool need = directive()->IGVPrintLevelOption >= level;636if (need && !_printer) {637_printer = IdealGraphPrinter::printer();638assert(_printer != NULL, "_printer is NULL when we need it!");639_printer->set_compile(this);640}641return need;642#else643return false;644#endif645}646647void print_method(CompilerPhaseType cpt, const char *name, int level = 1);648void print_method(CompilerPhaseType cpt, int level = 1, int idx = 0);649void print_method(CompilerPhaseType cpt, Node* n, int level = 3);650651#ifndef PRODUCT652void igv_print_method_to_file(const char* phase_name = "Debug", bool append = false);653void igv_print_method_to_network(const char* phase_name = "Debug");654static IdealGraphPrinter* debug_file_printer() { return _debug_file_printer; }655static IdealGraphPrinter* debug_network_printer() { return _debug_network_printer; }656#endif657658void end_method(int level = 1);659660int macro_count() const { return _macro_nodes.length(); }661int predicate_count() const { return _predicate_opaqs.length(); }662int skeleton_predicate_count() const { return _skeleton_predicate_opaqs.length(); }663int expensive_count() const { return _expensive_nodes.length(); }664int coarsened_count() const { return _coarsened_locks.length(); }665666Node* macro_node(int idx) const { return _macro_nodes.at(idx); }667Node* predicate_opaque1_node(int idx) const { return _predicate_opaqs.at(idx); }668Node* skeleton_predicate_opaque4_node(int idx) const { return _skeleton_predicate_opaqs.at(idx); }669Node* expensive_node(int idx) const { return _expensive_nodes.at(idx); }670671ConnectionGraph* 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 we can only remove it680// if it's still existing.681_macro_nodes.remove_if_existing(n);682// remove from _predicate_opaqs list also if it is there683if (predicate_count() > 0) {684_predicate_opaqs.remove_if_existing(n);685}686// Remove from coarsened locks list if present687if (coarsened_count() > 0) {688remove_coarsened_lock(n);689}690}691void add_expensive_node(Node* n);692void remove_expensive_node(Node* n) {693_expensive_nodes.remove_if_existing(n);694}695void add_predicate_opaq(Node* n) {696assert(!_predicate_opaqs.contains(n), "duplicate entry in predicate opaque1");697assert(_macro_nodes.contains(n), "should have already been in macro list");698_predicate_opaqs.append(n);699}700void add_skeleton_predicate_opaq(Node* n) {701assert(!_skeleton_predicate_opaqs.contains(n), "duplicate entry in skeleton predicate opaque4 list");702_skeleton_predicate_opaqs.append(n);703}704void remove_skeleton_predicate_opaq(Node* n) {705if (skeleton_predicate_count() > 0) {706_skeleton_predicate_opaqs.remove_if_existing(n);707}708}709void add_coarsened_locks(GrowableArray<AbstractLockNode*>& locks);710void remove_coarsened_lock(Node* n);711bool coarsened_locks_consistent();712713bool post_loop_opts_phase() { return _post_loop_opts_phase; }714void set_post_loop_opts_phase() { _post_loop_opts_phase = true; }715void reset_post_loop_opts_phase() { _post_loop_opts_phase = false; }716717void record_for_post_loop_opts_igvn(Node* n);718void remove_from_post_loop_opts_igvn(Node* n);719void process_for_post_loop_opts_igvn(PhaseIterGVN& igvn);720721void sort_macro_nodes();722723// remove the opaque nodes that protect the predicates so that the unused checks and724// uncommon traps will be eliminated from the graph.725void cleanup_loop_predicates(PhaseIterGVN &igvn);726bool is_predicate_opaq(Node* n) {727return _predicate_opaqs.contains(n);728}729730// Are there candidate expensive nodes for optimization?731bool should_optimize_expensive_nodes(PhaseIterGVN &igvn);732// Check whether n1 and n2 are similar733static int cmp_expensive_nodes(Node* n1, Node* n2);734// Sort expensive nodes to locate similar expensive nodes735void sort_expensive_nodes();736737// Compilation environment.738Arena* comp_arena() { return &_comp_arena; }739ciEnv* env() const { return _env; }740CompileLog* log() const { return _log; }741bool failing() const { return _env->failing() || _failure_reason != NULL; }742const char* failure_reason() const { return (_env->failing()) ? _env->failure_reason() : _failure_reason; }743744bool failure_reason_is(const char* r) const {745return (r == _failure_reason) || (r != NULL && _failure_reason != NULL && strcmp(r, _failure_reason) == 0);746}747748void record_failure(const char* reason);749void record_method_not_compilable(const char* reason) {750env()->record_method_not_compilable(reason);751// Record failure reason.752record_failure(reason);753}754bool check_node_count(uint margin, const char* reason) {755if (live_nodes() + margin > max_node_limit()) {756record_method_not_compilable(reason);757return true;758} else {759return false;760}761}762763// Node management764uint unique() const { return _unique; }765uint next_unique() { return _unique++; }766void set_unique(uint i) { _unique = i; }767static int debug_idx() { return debug_only(_debug_idx)+0; }768static void set_debug_idx(int i) { debug_only(_debug_idx = i); }769Arena* node_arena() { return &_node_arena; }770Arena* old_arena() { return &_old_arena; }771RootNode* root() const { return _root; }772void set_root(RootNode* r) { _root = r; }773StartNode* start() const; // (Derived from root.)774void init_start(StartNode* s);775Node* immutable_memory();776777Node* recent_alloc_ctl() const { return _recent_alloc_ctl; }778Node* recent_alloc_obj() const { return _recent_alloc_obj; }779void set_recent_alloc(Node* ctl, Node* obj) {780_recent_alloc_ctl = ctl;781_recent_alloc_obj = obj;782}783void record_dead_node(uint idx) { if (_dead_node_list.test_set(idx)) return;784_dead_node_count++;785}786void reset_dead_node_list() { _dead_node_list.reset();787_dead_node_count = 0;788}789uint live_nodes() const {790int val = _unique - _dead_node_count;791assert (val >= 0, "number of tracked dead nodes %d more than created nodes %d", _unique, _dead_node_count);792return (uint) val;793}794#ifdef ASSERT795void set_phase_optimize_finished() { _phase_optimize_finished = true; }796bool phase_optimize_finished() const { return _phase_optimize_finished; }797uint count_live_nodes_by_graph_walk();798void print_missing_nodes();799#endif800801// Record modified nodes to check that they are put on IGVN worklist802void record_modified_node(Node* n) NOT_DEBUG_RETURN;803void remove_modified_node(Node* n) NOT_DEBUG_RETURN;804DEBUG_ONLY( Unique_Node_List* modified_nodes() const { return _modified_nodes; } )805806MachConstantBaseNode* mach_constant_base_node();807bool has_mach_constant_base_node() const { return _mach_constant_base_node != NULL; }808// Generated by adlc, true if CallNode requires MachConstantBase.809bool needs_deep_clone_jvms();810811// Handy undefined Node812Node* top() const { return _top; }813814// these are used by guys who need to know about creation and transformation of top:815Node* cached_top_node() { return _top; }816void set_cached_top_node(Node* tn);817818GrowableArray<Node_Notes*>* node_note_array() const { return _node_note_array; }819void set_node_note_array(GrowableArray<Node_Notes*>* arr) { _node_note_array = arr; }820Node_Notes* default_node_notes() const { return _default_node_notes; }821void set_default_node_notes(Node_Notes* n) { _default_node_notes = n; }822823Node_Notes* node_notes_at(int idx) {824return locate_node_notes(_node_note_array, idx, false);825}826inline bool set_node_notes_at(int idx, Node_Notes* value);827828// Copy notes from source to dest, if they exist.829// Overwrite dest only if source provides something.830// Return true if information was moved.831bool copy_node_notes_to(Node* dest, Node* source);832833// Workhorse function to sort out the blocked Node_Notes array:834inline Node_Notes* locate_node_notes(GrowableArray<Node_Notes*>* arr,835int idx, bool can_grow = false);836837void grow_node_notes(GrowableArray<Node_Notes*>* arr, int grow_by);838839// Type management840Arena* type_arena() { return _type_arena; }841Dict* type_dict() { return _type_dict; }842size_t type_last_size() { return _type_last_size; }843int num_alias_types() { return _num_alias_types; }844845void init_type_arena() { _type_arena = &_Compile_types; }846void set_type_arena(Arena* a) { _type_arena = a; }847void set_type_dict(Dict* d) { _type_dict = d; }848void set_type_last_size(size_t sz) { _type_last_size = sz; }849850const TypeFunc* last_tf(ciMethod* m) {851return (m == _last_tf_m) ? _last_tf : NULL;852}853void set_last_tf(ciMethod* m, const TypeFunc* tf) {854assert(m != NULL || tf == NULL, "");855_last_tf_m = m;856_last_tf = tf;857}858859AliasType* alias_type(int idx) { assert(idx < num_alias_types(), "oob"); return _alias_types[idx]; }860AliasType* alias_type(const TypePtr* adr_type, ciField* field = NULL) { return find_alias_type(adr_type, false, field); }861bool have_alias_type(const TypePtr* adr_type);862AliasType* alias_type(ciField* field);863864int get_alias_index(const TypePtr* at) { return alias_type(at)->index(); }865const TypePtr* get_adr_type(uint aidx) { return alias_type(aidx)->adr_type(); }866int get_general_index(uint aidx) { return alias_type(aidx)->general_index(); }867868// Building nodes869void rethrow_exceptions(JVMState* jvms);870void return_values(JVMState* jvms);871JVMState* build_start_state(StartNode* start, const TypeFunc* tf);872873// Decide how to build a call.874// The profile factor is a discount to apply to this site's interp. profile.875CallGenerator* call_generator(ciMethod* call_method, int vtable_index, bool call_does_dispatch,876JVMState* jvms, bool allow_inline, float profile_factor, ciKlass* speculative_receiver_type = NULL,877bool allow_intrinsics = true);878bool should_delay_inlining(ciMethod* call_method, JVMState* jvms) {879return should_delay_string_inlining(call_method, jvms) ||880should_delay_boxing_inlining(call_method, jvms) ||881should_delay_vector_inlining(call_method, jvms);882}883bool should_delay_string_inlining(ciMethod* call_method, JVMState* jvms);884bool should_delay_boxing_inlining(ciMethod* call_method, JVMState* jvms);885bool should_delay_vector_inlining(ciMethod* call_method, JVMState* jvms);886bool should_delay_vector_reboxing_inlining(ciMethod* call_method, JVMState* jvms);887888// Helper functions to identify inlining potential at call-site889ciMethod* optimize_virtual_call(ciMethod* caller, ciInstanceKlass* klass,890ciKlass* holder, ciMethod* callee,891const TypeOopPtr* receiver_type, bool is_virtual,892bool &call_does_dispatch, int &vtable_index,893bool check_access = true);894ciMethod* optimize_inlining(ciMethod* caller, ciInstanceKlass* klass, ciKlass* holder,895ciMethod* callee, const TypeOopPtr* receiver_type,896bool check_access = true);897898// Report if there were too many traps at a current method and bci.899// Report if a trap was recorded, and/or PerMethodTrapLimit was exceeded.900// If there is no MDO at all, report no trap unless told to assume it.901bool too_many_traps(ciMethod* method, int bci, Deoptimization::DeoptReason reason);902// This version, unspecific to a particular bci, asks if903// PerMethodTrapLimit was exceeded for all inlined methods seen so far.904bool too_many_traps(Deoptimization::DeoptReason reason,905// Privately used parameter for logging:906ciMethodData* logmd = NULL);907// Report if there were too many recompiles at a method and bci.908bool too_many_recompiles(ciMethod* method, int bci, Deoptimization::DeoptReason reason);909// Report if there were too many traps or recompiles at a method and bci.910bool too_many_traps_or_recompiles(ciMethod* method, int bci, Deoptimization::DeoptReason reason) {911return too_many_traps(method, bci, reason) ||912too_many_recompiles(method, bci, reason);913}914// Return a bitset with the reasons where deoptimization is allowed,915// i.e., where there were not too many uncommon traps.916int _allowed_reasons;917int allowed_deopt_reasons() { return _allowed_reasons; }918void set_allowed_deopt_reasons();919920// Parsing, optimization921PhaseGVN* initial_gvn() { return _initial_gvn; }922Unique_Node_List* for_igvn() { return _for_igvn; }923inline void record_for_igvn(Node* n); // Body is after class Unique_Node_List.924void set_initial_gvn(PhaseGVN *gvn) { _initial_gvn = gvn; }925void set_for_igvn(Unique_Node_List *for_igvn) { _for_igvn = for_igvn; }926927// Replace n by nn using initial_gvn, calling hash_delete and928// record_for_igvn as needed.929void gvn_replace_by(Node* n, Node* nn);930931932void identify_useful_nodes(Unique_Node_List &useful);933void update_dead_node_list(Unique_Node_List &useful);934void remove_useless_nodes (Unique_Node_List &useful);935936void remove_useless_node(Node* dead);937938// Record this CallGenerator for inlining at the end of parsing.939void add_late_inline(CallGenerator* cg) {940_late_inlines.insert_before(_late_inlines_pos, cg);941_late_inlines_pos++;942}943944void prepend_late_inline(CallGenerator* cg) {945_late_inlines.insert_before(0, cg);946}947948void add_string_late_inline(CallGenerator* cg) {949_string_late_inlines.push(cg);950}951952void add_boxing_late_inline(CallGenerator* cg) {953_boxing_late_inlines.push(cg);954}955956void add_vector_reboxing_late_inline(CallGenerator* cg) {957_vector_reboxing_late_inlines.push(cg);958}959960void add_native_invoker(RuntimeStub* stub);961962const GrowableArray<RuntimeStub*> native_invokers() const { return _native_invokers; }963964void remove_useless_nodes (GrowableArray<Node*>& node_list, Unique_Node_List &useful);965966void remove_useless_late_inlines(GrowableArray<CallGenerator*>* inlines, Unique_Node_List &useful);967void remove_useless_late_inlines(GrowableArray<CallGenerator*>* inlines, Node* dead);968969void remove_useless_coarsened_locks(Unique_Node_List& useful);970971void process_print_inlining();972void dump_print_inlining();973974bool over_inlining_cutoff() const {975if (!inlining_incrementally()) {976return unique() > (uint)NodeCountInliningCutoff;977} else {978// Give some room for incremental inlining algorithm to "breathe"979// and avoid thrashing when live node count is close to the limit.980// Keep in mind that live_nodes() isn't accurate during inlining until981// dead node elimination step happens (see Compile::inline_incrementally).982return live_nodes() > (uint)LiveNodeCountInliningCutoff * 11 / 10;983}984}985986void inc_number_of_mh_late_inlines() { _number_of_mh_late_inlines++; }987void dec_number_of_mh_late_inlines() { assert(_number_of_mh_late_inlines > 0, "_number_of_mh_late_inlines < 0 !"); _number_of_mh_late_inlines--; }988bool has_mh_late_inlines() const { return _number_of_mh_late_inlines > 0; }989990bool inline_incrementally_one();991void inline_incrementally_cleanup(PhaseIterGVN& igvn);992void inline_incrementally(PhaseIterGVN& igvn);993void inline_string_calls(bool parse_time);994void inline_boxing_calls(PhaseIterGVN& igvn);995bool optimize_loops(PhaseIterGVN& igvn, LoopOptsMode mode);996void remove_root_to_sfpts_edges(PhaseIterGVN& igvn);997998void inline_vector_reboxing_calls();999bool has_vbox_nodes();10001001void process_late_inline_calls_no_inline(PhaseIterGVN& igvn);10021003// Matching, CFG layout, allocation, code generation1004PhaseCFG* cfg() { return _cfg; }1005bool has_java_calls() const { return _java_calls > 0; }1006int java_calls() const { return _java_calls; }1007int inner_loops() const { return _inner_loops; }1008Matcher* matcher() { return _matcher; }1009PhaseRegAlloc* regalloc() { return _regalloc; }1010RegMask& FIRST_STACK_mask() { return _FIRST_STACK_mask; }1011Arena* indexSet_arena() { return _indexSet_arena; }1012void* indexSet_free_block_list() { return _indexSet_free_block_list; }1013DebugInformationRecorder* debug_info() { return env()->debug_info(); }10141015void update_interpreter_frame_size(int size) {1016if (_interpreter_frame_size < size) {1017_interpreter_frame_size = size;1018}1019}10201021void set_matcher(Matcher* m) { _matcher = m; }1022//void set_regalloc(PhaseRegAlloc* ra) { _regalloc = ra; }1023void set_indexSet_arena(Arena* a) { _indexSet_arena = a; }1024void set_indexSet_free_block_list(void* p) { _indexSet_free_block_list = p; }10251026void set_java_calls(int z) { _java_calls = z; }1027void set_inner_loops(int z) { _inner_loops = z; }10281029Dependencies* dependencies() { return env()->dependencies(); }10301031// Major entry point. Given a Scope, compile the associated method.1032// For normal compilations, entry_bci is InvocationEntryBci. For on stack1033// replacement, entry_bci indicates the bytecode for which to compile a1034// continuation.1035Compile(ciEnv* ci_env, ciMethod* target,1036int entry_bci, bool subsume_loads, bool do_escape_analysis,1037bool eliminate_boxing, bool do_locks_coarsening,1038bool install_code, DirectiveSet* directive);10391040// Second major entry point. From the TypeFunc signature, generate code1041// to pass arguments from the Java calling convention to the C calling1042// convention.1043Compile(ciEnv* ci_env, const TypeFunc *(*gen)(),1044address stub_function, const char *stub_name,1045int is_fancy_jump, bool pass_tls,1046bool return_pc, DirectiveSet* directive);10471048// Are we compiling a method?1049bool has_method() { return method() != NULL; }10501051// Maybe print some information about this compile.1052void print_compile_messages();10531054// Final graph reshaping, a post-pass after the regular optimizer is done.1055bool final_graph_reshaping();10561057// returns true if adr is completely contained in the given alias category1058bool must_alias(const TypePtr* adr, int alias_idx);10591060// returns true if adr overlaps with the given alias category1061bool can_alias(const TypePtr* adr, int alias_idx);10621063// Stack slots that may be unused by the calling convention but must1064// otherwise be preserved. On Intel this includes the return address.1065// On PowerPC it includes the 4 words holding the old TOC & LR glue.1066uint in_preserve_stack_slots() {1067return SharedRuntime::in_preserve_stack_slots();1068}10691070// "Top of Stack" slots that may be unused by the calling convention but must1071// otherwise be preserved.1072// On Intel these are not necessary and the value can be zero.1073static uint out_preserve_stack_slots() {1074return SharedRuntime::out_preserve_stack_slots();1075}10761077// Number of outgoing stack slots killed above the out_preserve_stack_slots1078// for calls to C. Supports the var-args backing area for register parms.1079uint varargs_C_out_slots_killed() const;10801081// Number of Stack Slots consumed by a synchronization entry1082int sync_stack_slots() const;10831084// Compute the name of old_SP. See <arch>.ad for frame layout.1085OptoReg::Name compute_old_SP();10861087private:1088// Phase control:1089void Init(int aliaslevel); // Prepare for a single compilation1090int Inline_Warm(); // Find more inlining work.1091void Finish_Warm(); // Give up on further inlines.1092void Optimize(); // Given a graph, optimize it1093void Code_Gen(); // Generate code from a graph10941095// Management of the AliasType table.1096void grow_alias_types();1097AliasCacheEntry* probe_alias_cache(const TypePtr* adr_type);1098const TypePtr *flatten_alias_type(const TypePtr* adr_type) const;1099AliasType* find_alias_type(const TypePtr* adr_type, bool no_create, ciField* field);11001101void verify_top(Node*) const PRODUCT_RETURN;11021103// Intrinsic setup.1104CallGenerator* make_vm_intrinsic(ciMethod* m, bool is_virtual); // constructor1105int intrinsic_insertion_index(ciMethod* m, bool is_virtual, bool& found); // helper1106CallGenerator* find_intrinsic(ciMethod* m, bool is_virtual); // query fn1107void register_intrinsic(CallGenerator* cg); // update fn11081109#ifndef PRODUCT1110static juint _intrinsic_hist_count[];1111static jubyte _intrinsic_hist_flags[];1112#endif1113// Function calls made by the public function final_graph_reshaping.1114// No need to be made public as they are not called elsewhere.1115void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc);1116void final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& frc, uint nop);1117void final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Reshape_Counts &frc );1118void eliminate_redundant_card_marks(Node* n);11191120// Logic cone optimization.1121void optimize_logic_cones(PhaseIterGVN &igvn);1122void collect_logic_cone_roots(Unique_Node_List& list);1123void process_logic_cone_root(PhaseIterGVN &igvn, Node* n, VectorSet& visited);1124bool compute_logic_cone(Node* n, Unique_Node_List& partition, Unique_Node_List& inputs);1125uint compute_truth_table(Unique_Node_List& partition, Unique_Node_List& inputs);1126uint eval_macro_logic_op(uint func, uint op1, uint op2, uint op3);1127Node* xform_to_MacroLogicV(PhaseIterGVN &igvn, const TypeVect* vt, Unique_Node_List& partitions, Unique_Node_List& inputs);1128void check_no_dead_use() const NOT_DEBUG_RETURN;11291130public:11311132// Note: Histogram array size is about 1 Kb.1133enum { // flag bits:1134_intrinsic_worked = 1, // succeeded at least once1135_intrinsic_failed = 2, // tried it but it failed1136_intrinsic_disabled = 4, // was requested but disabled (e.g., -XX:-InlineUnsafeOps)1137_intrinsic_virtual = 8, // was seen in the virtual form (rare)1138_intrinsic_both = 16 // was seen in the non-virtual form (usual)1139};1140// Update histogram. Return boolean if this is a first-time occurrence.1141static bool gather_intrinsic_statistics(vmIntrinsics::ID id,1142bool is_virtual, int flags) PRODUCT_RETURN0;1143static void print_intrinsic_statistics() PRODUCT_RETURN;11441145// Graph verification code1146// Walk the node list, verifying that there is a one-to-one1147// correspondence between Use-Def edges and Def-Use edges1148// The option no_dead_code enables stronger checks that the1149// graph is strongly connected from root in both directions.1150void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN;11511152// End-of-run dumps.1153static void print_statistics() PRODUCT_RETURN;11541155// Verify ADLC assumptions during startup1156static void adlc_verification() PRODUCT_RETURN;11571158// Definitions of pd methods1159static void pd_compiler2_init();11601161// Static parse-time type checking logic for gen_subtype_check:1162enum { SSC_always_false, SSC_always_true, SSC_easy_test, SSC_full_test };1163int static_subtype_check(ciKlass* superk, ciKlass* subk);11641165static Node* conv_I2X_index(PhaseGVN* phase, Node* offset, const TypeInt* sizetype,1166// Optional control dependency (for example, on range check)1167Node* ctrl = NULL);11681169// Convert integer value to a narrowed long type dependent on ctrl (for example, a range check)1170static Node* constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl, bool carry_dependency = false);11711172// Auxiliary methods for randomized fuzzing/stressing1173int random();1174bool randomized_select(int count);11751176// supporting clone_map1177CloneMap& clone_map();1178void set_clone_map(Dict* d);11791180bool needs_clinit_barrier(ciField* ik, ciMethod* accessing_method);1181bool needs_clinit_barrier(ciMethod* ik, ciMethod* accessing_method);1182bool needs_clinit_barrier(ciInstanceKlass* ik, ciMethod* accessing_method);11831184#ifdef IA321185private:1186bool _select_24_bit_instr; // We selected an instruction with a 24-bit result1187bool _in_24_bit_fp_mode; // We are emitting instructions with 24-bit results11881189// Remember if this compilation changes hardware mode to 24-bit precision.1190void set_24_bit_selection_and_mode(bool selection, bool mode) {1191_select_24_bit_instr = selection;1192_in_24_bit_fp_mode = mode;1193}11941195public:1196bool select_24_bit_instr() const { return _select_24_bit_instr; }1197bool in_24_bit_fp_mode() const { return _in_24_bit_fp_mode; }1198#endif // IA321199#ifdef ASSERT1200bool _type_verify_symmetry;1201void set_exception_backedge() { _exception_backedge = true; }1202bool has_exception_backedge() const { return _exception_backedge; }1203#endif12041205static bool push_thru_add(PhaseGVN* phase, Node* z, const TypeInteger* tz, const TypeInteger*& rx, const TypeInteger*& ry,1206BasicType bt);12071208static Node* narrow_value(BasicType bt, Node* value, const Type* type, PhaseGVN* phase, bool transform_res);1209};12101211#endif // SHARE_OPTO_COMPILE_HPP121212131214