Path: blob/master/src/hotspot/share/opto/compile.hpp
40930 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 AddPNode;49class Block;50class Bundle;51class CallGenerator;52class CloneMap;53class ConnectionGraph;54class IdealGraphPrinter;55class InlineTree;56class Int_Array;57class Matcher;58class MachConstantNode;59class MachConstantBaseNode;60class MachNode;61class MachOper;62class MachSafePointNode;63class Node;64class Node_Array;65class Node_Notes;66class NodeCloneInfo;67class OptoReg;68class PhaseCFG;69class PhaseGVN;70class PhaseIterGVN;71class PhaseRegAlloc;72class PhaseCCP;73class PhaseOutput;74class RootNode;75class relocInfo;76class Scope;77class StartNode;78class SafePointNode;79class JVMState;80class Type;81class TypeData;82class TypeInt;83class TypeInteger;84class TypePtr;85class TypeOopPtr;86class TypeFunc;87class TypeVect;88class Unique_Node_List;89class nmethod;90class Node_Stack;91struct Final_Reshape_Counts;9293enum LoopOptsMode {94LoopOptsDefault,95LoopOptsNone,96LoopOptsMaxUnroll,97LoopOptsShenandoahExpand,98LoopOptsShenandoahPostExpand,99LoopOptsSkipSplitIf,100LoopOptsVerify101};102103typedef unsigned int node_idx_t;104class NodeCloneInfo {105private:106uint64_t _idx_clone_orig;107public:108109void set_idx(node_idx_t idx) {110_idx_clone_orig = (_idx_clone_orig & CONST64(0xFFFFFFFF00000000)) | idx;111}112node_idx_t idx() const { return (node_idx_t)(_idx_clone_orig & 0xFFFFFFFF); }113114void set_gen(int generation) {115uint64_t g = (uint64_t)generation << 32;116_idx_clone_orig = (_idx_clone_orig & 0xFFFFFFFF) | g;117}118int gen() const { return (int)(_idx_clone_orig >> 32); }119120void set(uint64_t x) { _idx_clone_orig = x; }121void set(node_idx_t x, int g) { set_idx(x); set_gen(g); }122uint64_t get() const { return _idx_clone_orig; }123124NodeCloneInfo(uint64_t idx_clone_orig) : _idx_clone_orig(idx_clone_orig) {}125NodeCloneInfo(node_idx_t x, int g) : _idx_clone_orig(0) { set(x, g); }126127void dump() const;128};129130class CloneMap {131friend class Compile;132private:133bool _debug;134Dict* _dict;135int _clone_idx; // current cloning iteration/generation in loop unroll136public:137void* _2p(node_idx_t key) const { return (void*)(intptr_t)key; } // 2 conversion functions to make gcc happy138node_idx_t _2_node_idx_t(const void* k) const { return (node_idx_t)(intptr_t)k; }139Dict* dict() const { return _dict; }140void insert(node_idx_t key, uint64_t val) { assert(_dict->operator[](_2p(key)) == NULL, "key existed"); _dict->Insert(_2p(key), (void*)val); }141void insert(node_idx_t key, NodeCloneInfo& ci) { insert(key, ci.get()); }142void remove(node_idx_t key) { _dict->Delete(_2p(key)); }143uint64_t value(node_idx_t key) const { return (uint64_t)_dict->operator[](_2p(key)); }144node_idx_t idx(node_idx_t key) const { return NodeCloneInfo(value(key)).idx(); }145int gen(node_idx_t key) const { return NodeCloneInfo(value(key)).gen(); }146int gen(const void* k) const { return gen(_2_node_idx_t(k)); }147int max_gen() const;148void clone(Node* old, Node* nnn, int gen);149void verify_insert_and_clone(Node* old, Node* nnn, int gen);150void dump(node_idx_t key) const;151152int clone_idx() const { return _clone_idx; }153void set_clone_idx(int x) { _clone_idx = x; }154bool is_debug() const { return _debug; }155void set_debug(bool debug) { _debug = debug; }156static const char* debug_option_name;157158bool same_idx(node_idx_t k1, node_idx_t k2) const { return idx(k1) == idx(k2); }159bool same_gen(node_idx_t k1, node_idx_t k2) const { return gen(k1) == gen(k2); }160};161162//------------------------------Compile----------------------------------------163// This class defines a top-level Compiler invocation.164165class Compile : public Phase {166friend class VMStructs;167168public:169// Fixed alias indexes. (See also MergeMemNode.)170enum {171AliasIdxTop = 1, // pseudo-index, aliases to nothing (used as sentinel value)172AliasIdxBot = 2, // pseudo-index, aliases to everything173AliasIdxRaw = 3 // hard-wired index for TypeRawPtr::BOTTOM174};175176// Variant of TraceTime(NULL, &_t_accumulator, CITime);177// Integrated with logging. If logging is turned on, and CITimeVerbose is true,178// then brackets are put into the log, with time stamps and node counts.179// (The time collection itself is always conditionalized on CITime.)180class TracePhase : public TraceTime {181private:182Compile* C;183CompileLog* _log;184const char* _phase_name;185bool _dolog;186public:187TracePhase(const char* name, elapsedTimer* accumulator);188~TracePhase();189};190191// Information per category of alias (memory slice)192class AliasType {193private:194friend class Compile;195196int _index; // unique index, used with MergeMemNode197const TypePtr* _adr_type; // normalized address type198ciField* _field; // relevant instance field, or null if none199const Type* _element; // relevant array element type, or null if none200bool _is_rewritable; // false if the memory is write-once only201int _general_index; // if this is type is an instance, the general202// type that this is an instance of203204void Init(int i, const TypePtr* at);205206public:207int index() const { return _index; }208const TypePtr* adr_type() const { return _adr_type; }209ciField* field() const { return _field; }210const Type* element() const { return _element; }211bool is_rewritable() const { return _is_rewritable; }212bool is_volatile() const { return (_field ? _field->is_volatile() : false); }213int general_index() const { return (_general_index != 0) ? _general_index : _index; }214215void set_rewritable(bool z) { _is_rewritable = z; }216void set_field(ciField* f) {217assert(!_field,"");218_field = f;219if (f->is_final() || f->is_stable()) {220// In the case of @Stable, multiple writes are possible but may be assumed to be no-ops.221_is_rewritable = false;222}223}224void set_element(const Type* e) {225assert(_element == NULL, "");226_element = e;227}228229BasicType basic_type() const;230231void print_on(outputStream* st) PRODUCT_RETURN;232};233234enum {235logAliasCacheSize = 6,236AliasCacheSize = (1<<logAliasCacheSize)237};238struct AliasCacheEntry { const TypePtr* _adr_type; int _index; }; // simple duple type239enum {240trapHistLength = MethodData::_trap_hist_limit241};242243private:244// Fixed parameters to this compilation.245const int _compile_id;246const bool _subsume_loads; // Load can be matched as part of a larger op.247const bool _do_escape_analysis; // Do escape analysis.248const bool _install_code; // Install the code that was compiled249const bool _eliminate_boxing; // Do boxing elimination.250ciMethod* _method; // The method being compiled.251int _entry_bci; // entry bci for osr methods.252const TypeFunc* _tf; // My kind of signature253InlineTree* _ilt; // Ditto (temporary).254address _stub_function; // VM entry for stub being compiled, or NULL255const char* _stub_name; // Name of stub or adapter being compiled, or NULL256address _stub_entry_point; // Compile code entry for generated stub, or NULL257258// Control of this compilation.259int _max_inline_size; // Max inline size for this compilation260int _freq_inline_size; // Max hot method inline size for this compilation261int _fixed_slots; // count of frame slots not allocated by the register262// allocator i.e. locks, original deopt pc, etc.263uintx _max_node_limit; // Max unique node count during a single compilation.264265bool _post_loop_opts_phase; // Loop opts are finished.266267int _major_progress; // Count of something big happening268bool _inlining_progress; // progress doing incremental inlining?269bool _inlining_incrementally;// Are we doing incremental inlining (post parse)270bool _do_cleanup; // Cleanup is needed before proceeding with incremental inlining271bool _has_loops; // True if the method _may_ have some loops272bool _has_split_ifs; // True if the method _may_ have some split-if273bool _has_unsafe_access; // True if the method _may_ produce faults in unsafe loads or stores.274bool _has_stringbuilder; // True StringBuffers or StringBuilders are allocated275bool _has_boxed_value; // True if a boxed object is allocated276bool _has_reserved_stack_access; // True if the method or an inlined method is annotated with ReservedStackAccess277uint _max_vector_size; // Maximum size of generated vectors278bool _clear_upper_avx; // Clear upper bits of ymm registers using vzeroupper279uint _trap_hist[trapHistLength]; // Cumulative traps280bool _trap_can_recompile; // Have we emitted a recompiling trap?281uint _decompile_count; // Cumulative decompilation counts.282bool _do_inlining; // True if we intend to do inlining283bool _do_scheduling; // True if we intend to do scheduling284bool _do_freq_based_layout; // True if we intend to do frequency based block layout285bool _do_vector_loop; // True if allowed to execute loop in parallel iterations286bool _use_cmove; // True if CMove should be used without profitability analysis287bool _age_code; // True if we need to profile code age (decrement the aging counter)288int _AliasLevel; // Locally-adjusted version of AliasLevel flag.289bool _print_assembly; // True if we should dump assembly code for this compilation290bool _print_inlining; // True if we should print inlining for this compilation291bool _print_intrinsics; // True if we should print intrinsics for this compilation292#ifndef PRODUCT293uint _igv_idx; // Counter for IGV node identifiers294bool _trace_opto_output;295bool _print_ideal;296bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing297#endif298bool _has_irreducible_loop; // Found irreducible loops299// JSR 292300bool _has_method_handle_invokes; // True if this method has MethodHandle invokes.301RTMState _rtm_state; // State of Restricted Transactional Memory usage302int _loop_opts_cnt; // loop opts round303bool _clinit_barrier_on_entry; // True if clinit barrier is needed on nmethod entry304uint _stress_seed; // Seed for stress testing305306// Compilation environment.307Arena _comp_arena; // Arena with lifetime equivalent to Compile308void* _barrier_set_state; // Potential GC barrier state for Compile309ciEnv* _env; // CI interface310DirectiveSet* _directive; // Compiler directive311CompileLog* _log; // from CompilerThread312const char* _failure_reason; // for record_failure/failing pattern313GrowableArray<CallGenerator*> _intrinsics; // List of intrinsics.314GrowableArray<Node*> _macro_nodes; // List of nodes which need to be expanded before matching.315GrowableArray<Node*> _predicate_opaqs; // List of Opaque1 nodes for the loop predicates.316GrowableArray<Node*> _skeleton_predicate_opaqs; // List of Opaque4 nodes for the loop skeleton predicates.317GrowableArray<Node*> _expensive_nodes; // List of nodes that are expensive to compute and that we'd better not let the GVN freely common318GrowableArray<Node*> _for_post_loop_igvn; // List of nodes for IGVN after loop opts are over319ConnectionGraph* _congraph;320#ifndef PRODUCT321IdealGraphPrinter* _printer;322static IdealGraphPrinter* _debug_file_printer;323static IdealGraphPrinter* _debug_network_printer;324#endif325326327// Node management328uint _unique; // Counter for unique Node indices329VectorSet _dead_node_list; // Set of dead nodes330uint _dead_node_count; // Number of dead nodes; VectorSet::Size() is O(N).331// So use this to keep count and make the call O(1).332DEBUG_ONLY(Unique_Node_List* _modified_nodes;) // List of nodes which inputs were modified333DEBUG_ONLY(bool _phase_optimize_finished;) // Used for live node verification while creating new nodes334335debug_only(static int _debug_idx;) // Monotonic counter (not reset), use -XX:BreakAtNode=<idx>336Arena _node_arena; // Arena for new-space Nodes337Arena _old_arena; // Arena for old-space Nodes, lifetime during xform338RootNode* _root; // Unique root of compilation, or NULL after bail-out.339Node* _top; // Unique top node. (Reset by various phases.)340341Node* _immutable_memory; // Initial memory state342343Node* _recent_alloc_obj;344Node* _recent_alloc_ctl;345346// Constant table347MachConstantBaseNode* _mach_constant_base_node; // Constant table base node singleton.348349350// Blocked array of debugging and profiling information,351// tracked per node.352enum { _log2_node_notes_block_size = 8,353_node_notes_block_size = (1<<_log2_node_notes_block_size)354};355GrowableArray<Node_Notes*>* _node_note_array;356Node_Notes* _default_node_notes; // default notes for new nodes357358// After parsing and every bulk phase we hang onto the Root instruction.359// The RootNode instruction is where the whole program begins. It produces360// the initial Control and BOTTOM for everybody else.361362// Type management363Arena _Compile_types; // Arena for all types364Arena* _type_arena; // Alias for _Compile_types except in Initialize_shared()365Dict* _type_dict; // Intern table366CloneMap _clone_map; // used for recording history of cloned nodes367size_t _type_last_size; // Last allocation size (see Type::operator new/delete)368ciMethod* _last_tf_m; // Cache for369const TypeFunc* _last_tf; // TypeFunc::make370AliasType** _alias_types; // List of alias types seen so far.371int _num_alias_types; // Logical length of _alias_types372int _max_alias_types; // Physical length of _alias_types373AliasCacheEntry _alias_cache[AliasCacheSize]; // Gets aliases w/o data structure walking374375// Parsing, optimization376PhaseGVN* _initial_gvn; // Results of parse-time PhaseGVN377Unique_Node_List* _for_igvn; // Initial work-list for next round of Iterative GVN378379GrowableArray<CallGenerator*> _late_inlines; // List of CallGenerators to be revisited after main parsing has finished.380GrowableArray<CallGenerator*> _string_late_inlines; // same but for string operations381GrowableArray<CallGenerator*> _boxing_late_inlines; // same but for boxing operations382383GrowableArray<CallGenerator*> _vector_reboxing_late_inlines; // same but for vector reboxing operations384385int _late_inlines_pos; // Where in the queue should the next late inlining candidate go (emulate depth first inlining)386uint _number_of_mh_late_inlines; // number of method handle late inlining still pending387388GrowableArray<RuntimeStub*> _native_invokers;389390// Inlining may not happen in parse order which would make391// PrintInlining output confusing. Keep track of PrintInlining392// pieces in order.393class PrintInliningBuffer : public CHeapObj<mtCompiler> {394private:395CallGenerator* _cg;396stringStream _ss;397static const size_t default_stream_buffer_size = 128;398399public:400PrintInliningBuffer()401: _cg(NULL), _ss(default_stream_buffer_size) {}402403stringStream* ss() { return &_ss; }404CallGenerator* cg() { return _cg; }405void set_cg(CallGenerator* cg) { _cg = cg; }406};407408stringStream* _print_inlining_stream;409GrowableArray<PrintInliningBuffer*>* _print_inlining_list;410int _print_inlining_idx;411char* _print_inlining_output;412413// Only keep nodes in the expensive node list that need to be optimized414void cleanup_expensive_nodes(PhaseIterGVN &igvn);415// Use for sorting expensive nodes to bring similar nodes together416static int cmp_expensive_nodes(Node** n1, Node** n2);417// Expensive nodes list already sorted?418bool expensive_nodes_sorted() const;419// Remove the speculative part of types and clean up the graph420void remove_speculative_types(PhaseIterGVN &igvn);421422void* _replay_inline_data; // Pointer to data loaded from file423424void print_inlining_stream_free();425void print_inlining_init();426void print_inlining_reinit();427void print_inlining_commit();428void print_inlining_push();429PrintInliningBuffer* print_inlining_current();430431void log_late_inline_failure(CallGenerator* cg, const char* msg);432DEBUG_ONLY(bool _exception_backedge;)433434public:435436void* barrier_set_state() const { return _barrier_set_state; }437438outputStream* print_inlining_stream() const {439assert(print_inlining() || print_intrinsics(), "PrintInlining off?");440return _print_inlining_stream;441}442443void print_inlining_update(CallGenerator* cg);444void print_inlining_update_delayed(CallGenerator* cg);445void print_inlining_move_to(CallGenerator* cg);446void print_inlining_assert_ready();447void print_inlining_reset();448449void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) {450stringStream ss;451CompileTask::print_inlining_inner(&ss, method, inline_level, bci, msg);452print_inlining_stream()->print("%s", ss.as_string());453}454455#ifndef PRODUCT456IdealGraphPrinter* printer() { return _printer; }457#endif458459void log_late_inline(CallGenerator* cg);460void log_inline_id(CallGenerator* cg);461void log_inline_failure(const char* msg);462463void* replay_inline_data() const { return _replay_inline_data; }464465// Dump inlining replay data to the stream.466void dump_inline_data(outputStream* out);467468private:469// Matching, CFG layout, allocation, code generation470PhaseCFG* _cfg; // Results of CFG finding471int _java_calls; // Number of java calls in the method472int _inner_loops; // Number of inner loops in the method473Matcher* _matcher; // Engine to map ideal to machine instructions474PhaseRegAlloc* _regalloc; // Results of register allocation.475RegMask _FIRST_STACK_mask; // All stack slots usable for spills (depends on frame layout)476Arena* _indexSet_arena; // control IndexSet allocation within PhaseChaitin477void* _indexSet_free_block_list; // free list of IndexSet bit blocks478int _interpreter_frame_size;479480PhaseOutput* _output;481482public:483// Accessors484485// The Compile instance currently active in this (compiler) thread.486static Compile* current() {487return (Compile*) ciEnv::current()->compiler_data();488}489490int interpreter_frame_size() const { return _interpreter_frame_size; }491492PhaseOutput* output() const { return _output; }493void set_output(PhaseOutput* o) { _output = o; }494495// ID for this compilation. Useful for setting breakpoints in the debugger.496int compile_id() const { return _compile_id; }497DirectiveSet* directive() const { return _directive; }498499// Does this compilation allow instructions to subsume loads? User500// instructions that subsume a load may result in an unschedulable501// instruction sequence.502bool subsume_loads() const { return _subsume_loads; }503/** Do escape analysis. */504bool do_escape_analysis() const { return _do_escape_analysis; }505/** Do boxing elimination. */506bool eliminate_boxing() const { return _eliminate_boxing; }507/** Do aggressive boxing elimination. */508bool aggressive_unboxing() const { return _eliminate_boxing && AggressiveUnboxing; }509bool should_install_code() const { return _install_code; }510511// Other fixed compilation parameters.512ciMethod* method() const { return _method; }513int entry_bci() const { return _entry_bci; }514bool is_osr_compilation() const { return _entry_bci != InvocationEntryBci; }515bool is_method_compilation() const { return (_method != NULL && !_method->flags().is_native()); }516const TypeFunc* tf() const { assert(_tf!=NULL, ""); return _tf; }517void init_tf(const TypeFunc* tf) { assert(_tf==NULL, ""); _tf = tf; }518InlineTree* ilt() const { return _ilt; }519address stub_function() const { return _stub_function; }520const char* stub_name() const { return _stub_name; }521address stub_entry_point() const { return _stub_entry_point; }522void set_stub_entry_point(address z) { _stub_entry_point = z; }523524// Control of this compilation.525int fixed_slots() const { assert(_fixed_slots >= 0, ""); return _fixed_slots; }526void set_fixed_slots(int n) { _fixed_slots = n; }527int major_progress() const { return _major_progress; }528void set_inlining_progress(bool z) { _inlining_progress = z; }529int inlining_progress() const { return _inlining_progress; }530void set_inlining_incrementally(bool z) { _inlining_incrementally = z; }531int inlining_incrementally() const { return _inlining_incrementally; }532void set_do_cleanup(bool z) { _do_cleanup = z; }533int do_cleanup() const { return _do_cleanup; }534void set_major_progress() { _major_progress++; }535void restore_major_progress(int progress) { _major_progress += progress; }536void clear_major_progress() { _major_progress = 0; }537int max_inline_size() const { return _max_inline_size; }538void set_freq_inline_size(int n) { _freq_inline_size = n; }539int freq_inline_size() const { return _freq_inline_size; }540void set_max_inline_size(int n) { _max_inline_size = n; }541bool has_loops() const { return _has_loops; }542void set_has_loops(bool z) { _has_loops = z; }543bool has_split_ifs() const { return _has_split_ifs; }544void set_has_split_ifs(bool z) { _has_split_ifs = z; }545bool has_unsafe_access() const { return _has_unsafe_access; }546void set_has_unsafe_access(bool z) { _has_unsafe_access = z; }547bool has_stringbuilder() const { return _has_stringbuilder; }548void set_has_stringbuilder(bool z) { _has_stringbuilder = z; }549bool has_boxed_value() const { return _has_boxed_value; }550void set_has_boxed_value(bool z) { _has_boxed_value = z; }551bool has_reserved_stack_access() const { return _has_reserved_stack_access; }552void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; }553uint max_vector_size() const { return _max_vector_size; }554void set_max_vector_size(uint s) { _max_vector_size = s; }555bool clear_upper_avx() const { return _clear_upper_avx; }556void set_clear_upper_avx(bool s) { _clear_upper_avx = s; }557void set_trap_count(uint r, uint c) { assert(r < trapHistLength, "oob"); _trap_hist[r] = c; }558uint trap_count(uint r) const { assert(r < trapHistLength, "oob"); return _trap_hist[r]; }559bool trap_can_recompile() const { return _trap_can_recompile; }560void set_trap_can_recompile(bool z) { _trap_can_recompile = z; }561uint decompile_count() const { return _decompile_count; }562void set_decompile_count(uint c) { _decompile_count = c; }563bool allow_range_check_smearing() const;564bool do_inlining() const { return _do_inlining; }565void set_do_inlining(bool z) { _do_inlining = z; }566bool do_scheduling() const { return _do_scheduling; }567void set_do_scheduling(bool z) { _do_scheduling = z; }568bool do_freq_based_layout() const{ return _do_freq_based_layout; }569void set_do_freq_based_layout(bool z){ _do_freq_based_layout = z; }570bool do_vector_loop() const { return _do_vector_loop; }571void set_do_vector_loop(bool z) { _do_vector_loop = z; }572bool use_cmove() const { return _use_cmove; }573void set_use_cmove(bool z) { _use_cmove = z; }574bool age_code() const { return _age_code; }575void set_age_code(bool z) { _age_code = z; }576int AliasLevel() const { return _AliasLevel; }577bool print_assembly() const { return _print_assembly; }578void set_print_assembly(bool z) { _print_assembly = z; }579bool print_inlining() const { return _print_inlining; }580void set_print_inlining(bool z) { _print_inlining = z; }581bool print_intrinsics() const { return _print_intrinsics; }582void set_print_intrinsics(bool z) { _print_intrinsics = z; }583RTMState rtm_state() const { return _rtm_state; }584void set_rtm_state(RTMState s) { _rtm_state = s; }585bool use_rtm() const { return (_rtm_state & NoRTM) == 0; }586bool profile_rtm() const { return _rtm_state == ProfileRTM; }587uint max_node_limit() const { return (uint)_max_node_limit; }588void set_max_node_limit(uint n) { _max_node_limit = n; }589bool clinit_barrier_on_entry() { return _clinit_barrier_on_entry; }590void set_clinit_barrier_on_entry(bool z) { _clinit_barrier_on_entry = z; }591592// check the CompilerOracle for special behaviours for this compile593bool method_has_option(enum CompileCommand option) {594return method() != NULL && method()->has_option(option);595}596597#ifndef PRODUCT598uint next_igv_idx() { return _igv_idx++; }599bool trace_opto_output() const { return _trace_opto_output; }600bool print_ideal() const { return _print_ideal; }601bool parsed_irreducible_loop() const { return _parsed_irreducible_loop; }602void set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }603int _in_dump_cnt; // Required for dumping ir nodes.604#endif605bool has_irreducible_loop() const { return _has_irreducible_loop; }606void set_has_irreducible_loop(bool z) { _has_irreducible_loop = z; }607608// JSR 292609bool has_method_handle_invokes() const { return _has_method_handle_invokes; }610void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; }611612Ticks _latest_stage_start_counter;613614void begin_method(int level = 1) {615#ifndef PRODUCT616if (_method != NULL && should_print(level)) {617_printer->begin_method();618}619#endif620C->_latest_stage_start_counter.stamp();621}622623bool should_print(int level = 1) {624#ifndef PRODUCT625if (PrintIdealGraphLevel < 0) { // disabled by the user626return false;627}628629bool need = directive()->IGVPrintLevelOption >= level;630if (need && !_printer) {631_printer = IdealGraphPrinter::printer();632assert(_printer != NULL, "_printer is NULL when we need it!");633_printer->set_compile(this);634}635return need;636#else637return false;638#endif639}640641void print_method(CompilerPhaseType cpt, const char *name, int level = 1);642void print_method(CompilerPhaseType cpt, int level = 1, int idx = 0);643void print_method(CompilerPhaseType cpt, Node* n, int level = 3);644645#ifndef PRODUCT646void igv_print_method_to_file(const char* phase_name = "Debug", bool append = false);647void igv_print_method_to_network(const char* phase_name = "Debug");648static IdealGraphPrinter* debug_file_printer() { return _debug_file_printer; }649static IdealGraphPrinter* debug_network_printer() { return _debug_network_printer; }650#endif651652void end_method(int level = 1);653654int macro_count() const { return _macro_nodes.length(); }655int predicate_count() const { return _predicate_opaqs.length(); }656int skeleton_predicate_count() const { return _skeleton_predicate_opaqs.length(); }657int expensive_count() const { return _expensive_nodes.length(); }658659Node* macro_node(int idx) const { return _macro_nodes.at(idx); }660Node* predicate_opaque1_node(int idx) const { return _predicate_opaqs.at(idx); }661Node* skeleton_predicate_opaque4_node(int idx) const { return _skeleton_predicate_opaqs.at(idx); }662Node* expensive_node(int idx) const { return _expensive_nodes.at(idx); }663664ConnectionGraph* congraph() { return _congraph;}665void set_congraph(ConnectionGraph* congraph) { _congraph = congraph;}666void add_macro_node(Node * n) {667//assert(n->is_macro(), "must be a macro node");668assert(!_macro_nodes.contains(n), "duplicate entry in expand list");669_macro_nodes.append(n);670}671void remove_macro_node(Node* n) {672// this function may be called twice for a node so we can only remove it673// if it's still existing.674_macro_nodes.remove_if_existing(n);675// remove from _predicate_opaqs list also if it is there676if (predicate_count() > 0) {677_predicate_opaqs.remove_if_existing(n);678}679}680void add_expensive_node(Node* n);681void remove_expensive_node(Node* n) {682_expensive_nodes.remove_if_existing(n);683}684void add_predicate_opaq(Node* n) {685assert(!_predicate_opaqs.contains(n), "duplicate entry in predicate opaque1");686assert(_macro_nodes.contains(n), "should have already been in macro list");687_predicate_opaqs.append(n);688}689void add_skeleton_predicate_opaq(Node* n) {690assert(!_skeleton_predicate_opaqs.contains(n), "duplicate entry in skeleton predicate opaque4 list");691_skeleton_predicate_opaqs.append(n);692}693void remove_skeleton_predicate_opaq(Node* n) {694if (skeleton_predicate_count() > 0) {695_skeleton_predicate_opaqs.remove_if_existing(n);696}697}698bool post_loop_opts_phase() { return _post_loop_opts_phase; }699void set_post_loop_opts_phase() { _post_loop_opts_phase = true; }700void reset_post_loop_opts_phase() { _post_loop_opts_phase = false; }701702void record_for_post_loop_opts_igvn(Node* n);703void remove_from_post_loop_opts_igvn(Node* n);704void process_for_post_loop_opts_igvn(PhaseIterGVN& igvn);705706void sort_macro_nodes();707708// remove the opaque nodes that protect the predicates so that the unused checks and709// uncommon traps will be eliminated from the graph.710void cleanup_loop_predicates(PhaseIterGVN &igvn);711bool is_predicate_opaq(Node* n) {712return _predicate_opaqs.contains(n);713}714715// Are there candidate expensive nodes for optimization?716bool should_optimize_expensive_nodes(PhaseIterGVN &igvn);717// Check whether n1 and n2 are similar718static int cmp_expensive_nodes(Node* n1, Node* n2);719// Sort expensive nodes to locate similar expensive nodes720void sort_expensive_nodes();721722// Compilation environment.723Arena* comp_arena() { return &_comp_arena; }724ciEnv* env() const { return _env; }725CompileLog* log() const { return _log; }726bool failing() const { return _env->failing() || _failure_reason != NULL; }727const char* failure_reason() const { return (_env->failing()) ? _env->failure_reason() : _failure_reason; }728729bool failure_reason_is(const char* r) const {730return (r == _failure_reason) || (r != NULL && _failure_reason != NULL && strcmp(r, _failure_reason) == 0);731}732733void record_failure(const char* reason);734void record_method_not_compilable(const char* reason) {735env()->record_method_not_compilable(reason);736// Record failure reason.737record_failure(reason);738}739bool check_node_count(uint margin, const char* reason) {740if (live_nodes() + margin > max_node_limit()) {741record_method_not_compilable(reason);742return true;743} else {744return false;745}746}747748// Node management749uint unique() const { return _unique; }750uint next_unique() { return _unique++; }751void set_unique(uint i) { _unique = i; }752static int debug_idx() { return debug_only(_debug_idx)+0; }753static void set_debug_idx(int i) { debug_only(_debug_idx = i); }754Arena* node_arena() { return &_node_arena; }755Arena* old_arena() { return &_old_arena; }756RootNode* root() const { return _root; }757void set_root(RootNode* r) { _root = r; }758StartNode* start() const; // (Derived from root.)759void init_start(StartNode* s);760Node* immutable_memory();761762Node* recent_alloc_ctl() const { return _recent_alloc_ctl; }763Node* recent_alloc_obj() const { return _recent_alloc_obj; }764void set_recent_alloc(Node* ctl, Node* obj) {765_recent_alloc_ctl = ctl;766_recent_alloc_obj = obj;767}768void record_dead_node(uint idx) { if (_dead_node_list.test_set(idx)) return;769_dead_node_count++;770}771void reset_dead_node_list() { _dead_node_list.reset();772_dead_node_count = 0;773}774uint live_nodes() const {775int val = _unique - _dead_node_count;776assert (val >= 0, "number of tracked dead nodes %d more than created nodes %d", _unique, _dead_node_count);777return (uint) val;778}779#ifdef ASSERT780void set_phase_optimize_finished() { _phase_optimize_finished = true; }781bool phase_optimize_finished() const { return _phase_optimize_finished; }782uint count_live_nodes_by_graph_walk();783void print_missing_nodes();784#endif785786// Record modified nodes to check that they are put on IGVN worklist787void record_modified_node(Node* n) NOT_DEBUG_RETURN;788void remove_modified_node(Node* n) NOT_DEBUG_RETURN;789DEBUG_ONLY( Unique_Node_List* modified_nodes() const { return _modified_nodes; } )790791MachConstantBaseNode* mach_constant_base_node();792bool has_mach_constant_base_node() const { return _mach_constant_base_node != NULL; }793// Generated by adlc, true if CallNode requires MachConstantBase.794bool needs_deep_clone_jvms();795796// Handy undefined Node797Node* top() const { return _top; }798799// these are used by guys who need to know about creation and transformation of top:800Node* cached_top_node() { return _top; }801void set_cached_top_node(Node* tn);802803GrowableArray<Node_Notes*>* node_note_array() const { return _node_note_array; }804void set_node_note_array(GrowableArray<Node_Notes*>* arr) { _node_note_array = arr; }805Node_Notes* default_node_notes() const { return _default_node_notes; }806void set_default_node_notes(Node_Notes* n) { _default_node_notes = n; }807808Node_Notes* node_notes_at(int idx) {809return locate_node_notes(_node_note_array, idx, false);810}811inline bool set_node_notes_at(int idx, Node_Notes* value);812813// Copy notes from source to dest, if they exist.814// Overwrite dest only if source provides something.815// Return true if information was moved.816bool copy_node_notes_to(Node* dest, Node* source);817818// Workhorse function to sort out the blocked Node_Notes array:819inline Node_Notes* locate_node_notes(GrowableArray<Node_Notes*>* arr,820int idx, bool can_grow = false);821822void grow_node_notes(GrowableArray<Node_Notes*>* arr, int grow_by);823824// Type management825Arena* type_arena() { return _type_arena; }826Dict* type_dict() { return _type_dict; }827size_t type_last_size() { return _type_last_size; }828int num_alias_types() { return _num_alias_types; }829830void init_type_arena() { _type_arena = &_Compile_types; }831void set_type_arena(Arena* a) { _type_arena = a; }832void set_type_dict(Dict* d) { _type_dict = d; }833void set_type_last_size(size_t sz) { _type_last_size = sz; }834835const TypeFunc* last_tf(ciMethod* m) {836return (m == _last_tf_m) ? _last_tf : NULL;837}838void set_last_tf(ciMethod* m, const TypeFunc* tf) {839assert(m != NULL || tf == NULL, "");840_last_tf_m = m;841_last_tf = tf;842}843844AliasType* alias_type(int idx) { assert(idx < num_alias_types(), "oob"); return _alias_types[idx]; }845AliasType* alias_type(const TypePtr* adr_type, ciField* field = NULL) { return find_alias_type(adr_type, false, field); }846bool have_alias_type(const TypePtr* adr_type);847AliasType* alias_type(ciField* field);848849int get_alias_index(const TypePtr* at) { return alias_type(at)->index(); }850const TypePtr* get_adr_type(uint aidx) { return alias_type(aidx)->adr_type(); }851int get_general_index(uint aidx) { return alias_type(aidx)->general_index(); }852853// Building nodes854void rethrow_exceptions(JVMState* jvms);855void return_values(JVMState* jvms);856JVMState* build_start_state(StartNode* start, const TypeFunc* tf);857858// Decide how to build a call.859// The profile factor is a discount to apply to this site's interp. profile.860CallGenerator* call_generator(ciMethod* call_method, int vtable_index, bool call_does_dispatch,861JVMState* jvms, bool allow_inline, float profile_factor, ciKlass* speculative_receiver_type = NULL,862bool allow_intrinsics = true);863bool should_delay_inlining(ciMethod* call_method, JVMState* jvms) {864return should_delay_string_inlining(call_method, jvms) ||865should_delay_boxing_inlining(call_method, jvms) ||866should_delay_vector_inlining(call_method, jvms);867}868bool should_delay_string_inlining(ciMethod* call_method, JVMState* jvms);869bool should_delay_boxing_inlining(ciMethod* call_method, JVMState* jvms);870bool should_delay_vector_inlining(ciMethod* call_method, JVMState* jvms);871bool should_delay_vector_reboxing_inlining(ciMethod* call_method, JVMState* jvms);872873// Helper functions to identify inlining potential at call-site874ciMethod* optimize_virtual_call(ciMethod* caller, ciInstanceKlass* klass,875ciKlass* holder, ciMethod* callee,876const TypeOopPtr* receiver_type, bool is_virtual,877bool &call_does_dispatch, int &vtable_index,878bool check_access = true);879ciMethod* optimize_inlining(ciMethod* caller, ciInstanceKlass* klass, ciKlass* holder,880ciMethod* callee, const TypeOopPtr* receiver_type,881bool check_access = true);882883// Report if there were too many traps at a current method and bci.884// Report if a trap was recorded, and/or PerMethodTrapLimit was exceeded.885// If there is no MDO at all, report no trap unless told to assume it.886bool too_many_traps(ciMethod* method, int bci, Deoptimization::DeoptReason reason);887// This version, unspecific to a particular bci, asks if888// PerMethodTrapLimit was exceeded for all inlined methods seen so far.889bool too_many_traps(Deoptimization::DeoptReason reason,890// Privately used parameter for logging:891ciMethodData* logmd = NULL);892// Report if there were too many recompiles at a method and bci.893bool too_many_recompiles(ciMethod* method, int bci, Deoptimization::DeoptReason reason);894// Report if there were too many traps or recompiles at a method and bci.895bool too_many_traps_or_recompiles(ciMethod* method, int bci, Deoptimization::DeoptReason reason) {896return too_many_traps(method, bci, reason) ||897too_many_recompiles(method, bci, reason);898}899// Return a bitset with the reasons where deoptimization is allowed,900// i.e., where there were not too many uncommon traps.901int _allowed_reasons;902int allowed_deopt_reasons() { return _allowed_reasons; }903void set_allowed_deopt_reasons();904905// Parsing, optimization906PhaseGVN* initial_gvn() { return _initial_gvn; }907Unique_Node_List* for_igvn() { return _for_igvn; }908inline void record_for_igvn(Node* n); // Body is after class Unique_Node_List.909void set_initial_gvn(PhaseGVN *gvn) { _initial_gvn = gvn; }910void set_for_igvn(Unique_Node_List *for_igvn) { _for_igvn = for_igvn; }911912// Replace n by nn using initial_gvn, calling hash_delete and913// record_for_igvn as needed.914void gvn_replace_by(Node* n, Node* nn);915916917void identify_useful_nodes(Unique_Node_List &useful);918void update_dead_node_list(Unique_Node_List &useful);919void remove_useless_nodes (Unique_Node_List &useful);920921void remove_useless_node(Node* dead);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 add_vector_reboxing_late_inline(CallGenerator* cg) {942_vector_reboxing_late_inlines.push(cg);943}944945void add_native_invoker(RuntimeStub* stub);946947const GrowableArray<RuntimeStub*> native_invokers() const { return _native_invokers; }948949void remove_useless_nodes (GrowableArray<Node*>& node_list, Unique_Node_List &useful);950951void remove_useless_late_inlines(GrowableArray<CallGenerator*>* inlines, Unique_Node_List &useful);952void remove_useless_late_inlines(GrowableArray<CallGenerator*>* inlines, Node* dead);953954void process_print_inlining();955void dump_print_inlining();956957bool over_inlining_cutoff() const {958if (!inlining_incrementally()) {959return unique() > (uint)NodeCountInliningCutoff;960} else {961// Give some room for incremental inlining algorithm to "breathe"962// and avoid thrashing when live node count is close to the limit.963// Keep in mind that live_nodes() isn't accurate during inlining until964// dead node elimination step happens (see Compile::inline_incrementally).965return live_nodes() > (uint)LiveNodeCountInliningCutoff * 11 / 10;966}967}968969void inc_number_of_mh_late_inlines() { _number_of_mh_late_inlines++; }970void dec_number_of_mh_late_inlines() { assert(_number_of_mh_late_inlines > 0, "_number_of_mh_late_inlines < 0 !"); _number_of_mh_late_inlines--; }971bool has_mh_late_inlines() const { return _number_of_mh_late_inlines > 0; }972973bool inline_incrementally_one();974void inline_incrementally_cleanup(PhaseIterGVN& igvn);975void inline_incrementally(PhaseIterGVN& igvn);976void inline_string_calls(bool parse_time);977void inline_boxing_calls(PhaseIterGVN& igvn);978bool optimize_loops(PhaseIterGVN& igvn, LoopOptsMode mode);979void remove_root_to_sfpts_edges(PhaseIterGVN& igvn);980981void inline_vector_reboxing_calls();982bool has_vbox_nodes();983984void process_late_inline_calls_no_inline(PhaseIterGVN& igvn);985986// Matching, CFG layout, allocation, code generation987PhaseCFG* cfg() { return _cfg; }988bool has_java_calls() const { return _java_calls > 0; }989int java_calls() const { return _java_calls; }990int inner_loops() const { return _inner_loops; }991Matcher* matcher() { return _matcher; }992PhaseRegAlloc* regalloc() { return _regalloc; }993RegMask& FIRST_STACK_mask() { return _FIRST_STACK_mask; }994Arena* indexSet_arena() { return _indexSet_arena; }995void* indexSet_free_block_list() { return _indexSet_free_block_list; }996DebugInformationRecorder* debug_info() { return env()->debug_info(); }997998void update_interpreter_frame_size(int size) {999if (_interpreter_frame_size < size) {1000_interpreter_frame_size = size;1001}1002}10031004void set_matcher(Matcher* m) { _matcher = m; }1005//void set_regalloc(PhaseRegAlloc* ra) { _regalloc = ra; }1006void set_indexSet_arena(Arena* a) { _indexSet_arena = a; }1007void set_indexSet_free_block_list(void* p) { _indexSet_free_block_list = p; }10081009void set_java_calls(int z) { _java_calls = z; }1010void set_inner_loops(int z) { _inner_loops = z; }10111012Dependencies* dependencies() { return env()->dependencies(); }10131014// Major entry point. Given a Scope, compile the associated method.1015// For normal compilations, entry_bci is InvocationEntryBci. For on stack1016// replacement, entry_bci indicates the bytecode for which to compile a1017// continuation.1018Compile(ciEnv* ci_env, ciMethod* target,1019int entry_bci, bool subsume_loads, bool do_escape_analysis,1020bool eliminate_boxing, bool install_code, DirectiveSet* directive);10211022// Second major entry point. From the TypeFunc signature, generate code1023// to pass arguments from the Java calling convention to the C calling1024// convention.1025Compile(ciEnv* ci_env, const TypeFunc *(*gen)(),1026address stub_function, const char *stub_name,1027int is_fancy_jump, bool pass_tls,1028bool return_pc, DirectiveSet* directive);10291030// Are we compiling a method?1031bool has_method() { return method() != NULL; }10321033// Maybe print some information about this compile.1034void print_compile_messages();10351036// Final graph reshaping, a post-pass after the regular optimizer is done.1037bool final_graph_reshaping();10381039// returns true if adr is completely contained in the given alias category1040bool must_alias(const TypePtr* adr, int alias_idx);10411042// returns true if adr overlaps with the given alias category1043bool can_alias(const TypePtr* adr, int alias_idx);10441045// Stack slots that may be unused by the calling convention but must1046// otherwise be preserved. On Intel this includes the return address.1047// On PowerPC it includes the 4 words holding the old TOC & LR glue.1048uint in_preserve_stack_slots() {1049return SharedRuntime::in_preserve_stack_slots();1050}10511052// "Top of Stack" slots that may be unused by the calling convention but must1053// otherwise be preserved.1054// On Intel these are not necessary and the value can be zero.1055static uint out_preserve_stack_slots() {1056return SharedRuntime::out_preserve_stack_slots();1057}10581059// Number of outgoing stack slots killed above the out_preserve_stack_slots1060// for calls to C. Supports the var-args backing area for register parms.1061uint varargs_C_out_slots_killed() const;10621063// Number of Stack Slots consumed by a synchronization entry1064int sync_stack_slots() const;10651066// Compute the name of old_SP. See <arch>.ad for frame layout.1067OptoReg::Name compute_old_SP();10681069private:1070// Phase control:1071void Init(int aliaslevel); // Prepare for a single compilation1072int Inline_Warm(); // Find more inlining work.1073void Finish_Warm(); // Give up on further inlines.1074void Optimize(); // Given a graph, optimize it1075void Code_Gen(); // Generate code from a graph10761077// Management of the AliasType table.1078void grow_alias_types();1079AliasCacheEntry* probe_alias_cache(const TypePtr* adr_type);1080const TypePtr *flatten_alias_type(const TypePtr* adr_type) const;1081AliasType* find_alias_type(const TypePtr* adr_type, bool no_create, ciField* field);10821083void verify_top(Node*) const PRODUCT_RETURN;10841085// Intrinsic setup.1086CallGenerator* make_vm_intrinsic(ciMethod* m, bool is_virtual); // constructor1087int intrinsic_insertion_index(ciMethod* m, bool is_virtual, bool& found); // helper1088CallGenerator* find_intrinsic(ciMethod* m, bool is_virtual); // query fn1089void register_intrinsic(CallGenerator* cg); // update fn10901091#ifndef PRODUCT1092static juint _intrinsic_hist_count[];1093static jubyte _intrinsic_hist_flags[];1094#endif1095// Function calls made by the public function final_graph_reshaping.1096// No need to be made public as they are not called elsewhere.1097void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc);1098void final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& frc, uint nop);1099void final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Reshape_Counts &frc );1100void eliminate_redundant_card_marks(Node* n);11011102// Logic cone optimization.1103void optimize_logic_cones(PhaseIterGVN &igvn);1104void collect_logic_cone_roots(Unique_Node_List& list);1105void process_logic_cone_root(PhaseIterGVN &igvn, Node* n, VectorSet& visited);1106bool compute_logic_cone(Node* n, Unique_Node_List& partition, Unique_Node_List& inputs);1107uint compute_truth_table(Unique_Node_List& partition, Unique_Node_List& inputs);1108uint eval_macro_logic_op(uint func, uint op1, uint op2, uint op3);1109Node* xform_to_MacroLogicV(PhaseIterGVN &igvn, const TypeVect* vt, Unique_Node_List& partitions, Unique_Node_List& inputs);1110void check_no_dead_use() const NOT_DEBUG_RETURN;11111112public:11131114// Note: Histogram array size is about 1 Kb.1115enum { // flag bits:1116_intrinsic_worked = 1, // succeeded at least once1117_intrinsic_failed = 2, // tried it but it failed1118_intrinsic_disabled = 4, // was requested but disabled (e.g., -XX:-InlineUnsafeOps)1119_intrinsic_virtual = 8, // was seen in the virtual form (rare)1120_intrinsic_both = 16 // was seen in the non-virtual form (usual)1121};1122// Update histogram. Return boolean if this is a first-time occurrence.1123static bool gather_intrinsic_statistics(vmIntrinsics::ID id,1124bool is_virtual, int flags) PRODUCT_RETURN0;1125static void print_intrinsic_statistics() PRODUCT_RETURN;11261127// Graph verification code1128// Walk the node list, verifying that there is a one-to-one1129// correspondence between Use-Def edges and Def-Use edges1130// The option no_dead_code enables stronger checks that the1131// graph is strongly connected from root in both directions.1132void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN;11331134// End-of-run dumps.1135static void print_statistics() PRODUCT_RETURN;11361137// Verify ADLC assumptions during startup1138static void adlc_verification() PRODUCT_RETURN;11391140// Definitions of pd methods1141static void pd_compiler2_init();11421143// Static parse-time type checking logic for gen_subtype_check:1144enum { SSC_always_false, SSC_always_true, SSC_easy_test, SSC_full_test };1145int static_subtype_check(ciKlass* superk, ciKlass* subk);11461147static Node* conv_I2X_index(PhaseGVN* phase, Node* offset, const TypeInt* sizetype,1148// Optional control dependency (for example, on range check)1149Node* ctrl = NULL);11501151// Convert integer value to a narrowed long type dependent on ctrl (for example, a range check)1152static Node* constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl, bool carry_dependency = false);11531154// Auxiliary methods for randomized fuzzing/stressing1155int random();1156bool randomized_select(int count);11571158// supporting clone_map1159CloneMap& clone_map();1160void set_clone_map(Dict* d);11611162bool needs_clinit_barrier(ciField* ik, ciMethod* accessing_method);1163bool needs_clinit_barrier(ciMethod* ik, ciMethod* accessing_method);1164bool needs_clinit_barrier(ciInstanceKlass* ik, ciMethod* accessing_method);11651166#ifdef IA321167private:1168bool _select_24_bit_instr; // We selected an instruction with a 24-bit result1169bool _in_24_bit_fp_mode; // We are emitting instructions with 24-bit results11701171// Remember if this compilation changes hardware mode to 24-bit precision.1172void set_24_bit_selection_and_mode(bool selection, bool mode) {1173_select_24_bit_instr = selection;1174_in_24_bit_fp_mode = mode;1175}11761177public:1178bool select_24_bit_instr() const { return _select_24_bit_instr; }1179bool in_24_bit_fp_mode() const { return _in_24_bit_fp_mode; }1180#endif // IA321181#ifdef ASSERT1182bool _type_verify_symmetry;1183void set_exception_backedge() { _exception_backedge = true; }1184bool has_exception_backedge() const { return _exception_backedge; }1185#endif11861187static bool push_thru_add(PhaseGVN* phase, Node* z, const TypeInteger* tz, const TypeInteger*& rx, const TypeInteger*& ry,1188BasicType bt);11891190static Node* narrow_value(BasicType bt, Node* value, const Type* type, PhaseGVN* phase, bool transform_res);1191};11921193#endif // SHARE_OPTO_COMPILE_HPP119411951196