28 #include "asm/codeBuffer.hpp"
29 #include "ci/compilerInterface.hpp"
30 #include "code/debugInfoRec.hpp"
31 #include "compiler/cHeapStringHolder.hpp"
32 #include "compiler/compileBroker.hpp"
33 #include "compiler/compiler_globals.hpp"
34 #include "compiler/compilerEvent.hpp"
35 #include "libadt/dict.hpp"
36 #include "libadt/vectset.hpp"
37 #include "memory/resourceArea.hpp"
38 #include "oops/methodData.hpp"
39 #include "opto/idealGraphPrinter.hpp"
40 #include "opto/phase.hpp"
41 #include "opto/phasetype.hpp"
42 #include "opto/printinlining.hpp"
43 #include "opto/regmask.hpp"
44 #include "runtime/deoptimization.hpp"
45 #include "runtime/sharedRuntime.hpp"
46 #include "runtime/timerTrace.hpp"
47 #include "runtime/vmThread.hpp"
48 #include "utilities/ticks.hpp"
49 #include "utilities/vmEnums.hpp"
50
51 class AbstractLockNode;
52 class AddPNode;
53 class Block;
54 class Bundle;
55 class CallGenerator;
56 class CallStaticJavaNode;
57 class CloneMap;
58 class CompilationFailureInfo;
59 class ConnectionGraph;
60 class IdealGraphPrinter;
61 class InlineTree;
62 class Matcher;
63 class MachConstantNode;
64 class MachConstantBaseNode;
65 class MachNode;
66 class MachOper;
67 class MachSafePointNode;
68 class Node;
69 class Node_Array;
70 class Node_List;
71 class Node_Notes;
72 class NodeHash;
73 class NodeCloneInfo;
74 class OpaqueTemplateAssertionPredicateNode;
75 class OptoReg;
80 class PhaseRegAlloc;
81 class PhaseCCP;
82 class PhaseOutput;
83 class ReachabilityFenceNode;
84 class RootNode;
85 class relocInfo;
86 class StartNode;
87 class SafePointNode;
88 class JVMState;
89 class Type;
90 class TypeInt;
91 class TypeInteger;
92 class TypeKlassPtr;
93 class TypePtr;
94 class TypeOopPtr;
95 class TypeFunc;
96 class TypeVect;
97 class Type_Array;
98 class Unique_Node_List;
99 class UnstableIfTrap;
100 class nmethod;
101 class Node_Stack;
102 struct Final_Reshape_Counts;
103 class VerifyMeetResult;
104
105 enum LoopOptsMode {
106 LoopOptsDefault,
107 LoopOptsNone,
108 LoopOptsMaxUnroll,
109 LoopOptsShenandoahExpand,
110 LoopOptsSkipSplitIf,
111 LoopOptsVerify,
112 PostLoopOptsExpandReachabilityFences
113 };
114
115 // The type of all node counts and indexes.
116 // It must hold at least 16 bits, but must also be fast to load and store.
117 // This type, if less than 32 bits, could limit the number of possible nodes.
118 // (To make this type platform-specific, move to globalDefinitions_xxx.hpp.)
119 typedef unsigned int node_idx_t;
320 // allocator i.e. locks, original deopt pc, etc.
321 uintx _max_node_limit; // Max unique node count during a single compilation.
322 uint _node_count_inlining_cutoff; // Number of nodes in the graph above which inlining is denied
323
324 bool _post_loop_opts_phase; // Loop opts are finished.
325 bool _merge_stores_phase; // Phase for merging stores, after post loop opts phase.
326 bool _allow_macro_nodes; // True if we allow creation of macro nodes.
327
328 /* If major progress is set:
329 * Marks that the loop tree information (get_ctrl, idom, get_loop, etc.) could be invalid, and we need to rebuild the loop tree.
330 * It also indicates that the graph was changed in a way that is promising to be able to apply more loop optimization.
331 * If major progress is not set:
332 * Loop tree information is valid.
333 * If major progress is not set at the end of a loop opts phase, then we can stop loop opts, because we do not expect any further progress if we did more loop opts phases.
334 *
335 * This is not 100% accurate, the semantics of major progress has become less clear over time, but this is the general idea.
336 */
337 bool _major_progress;
338 bool _inlining_progress; // progress doing incremental inlining?
339 bool _inlining_incrementally;// Are we doing incremental inlining (post parse)
340 bool _do_cleanup; // Cleanup is needed before proceeding with incremental inlining
341 bool _has_loops; // True if the method _may_ have some loops
342 bool _has_split_ifs; // True if the method _may_ have some split-if
343 bool _has_unsafe_access; // True if the method _may_ produce faults in unsafe loads or stores.
344 bool _has_stringbuilder; // True StringBuffers or StringBuilders are allocated
345 bool _has_boxed_value; // True if a boxed object is allocated
346 bool _has_reserved_stack_access; // True if the method or an inlined method is annotated with ReservedStackAccess
347 uint _max_vector_size; // Maximum size of generated vectors
348 bool _clear_upper_avx; // Clear upper bits of ymm registers using vzeroupper
349 uint _trap_hist[trapHistLength]; // Cumulative traps
350 bool _trap_can_recompile; // Have we emitted a recompiling trap?
351 uint _decompile_count; // Cumulative decompilation counts.
352 bool _do_inlining; // True if we intend to do inlining
353 bool _do_scheduling; // True if we intend to do scheduling
354 bool _do_freq_based_layout; // True if we intend to do frequency based block layout
355 bool _do_vector_loop; // True if allowed to execute loop in parallel iterations
356 bool _use_cmove; // True if CMove should be used without profitability analysis
357 bool _do_aliasing; // True if we intend to do aliasing
358 bool _print_assembly; // True if we should dump assembly code for this compilation
359 bool _print_inlining; // True if we should print inlining for this compilation
360 bool _print_intrinsics; // True if we should print intrinsics for this compilation
361 bool _print_phase_loop_opts; // True if we should print before and after loop opts phase
362 #ifndef PRODUCT
363 uint _phase_counter; // Counter for the number of already printed phases
364 uint _igv_idx; // Counter for IGV node identifiers
365 uint _igv_phase_iter[PHASE_NUM_TYPES]; // Counters for IGV phase iterations
366 bool _trace_opto_output;
367 bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing
368 #endif
369 bool _has_irreducible_loop; // Found irreducible loops
370 bool _has_monitors; // Metadata transfered to nmethod to enable Continuations lock-detection fastpath
371 bool _has_scoped_access; // For shared scope closure
372 bool _clinit_barrier_on_entry; // True if clinit barrier is needed on nmethod entry
373 int _loop_opts_cnt; // loop opts round
374 uint _stress_seed; // Seed for stress testing
375
376 // Compilation environment.
377 Arena _comp_arena; // Arena with lifetime equivalent to Compile
378 void* _barrier_set_state; // Potential GC barrier state for Compile
379 ciEnv* _env; // CI interface
380 DirectiveSet* _directive; // Compiler directive
381 CompileLog* _log; // from CompilerThread
382 CHeapStringHolder _failure_reason; // for record_failure/failing pattern
383 CompilationFailureInfo* _first_failure_details; // Details for the first failure happening during compilation
384 GrowableArray<CallGenerator*> _intrinsics; // List of intrinsics.
385 GrowableArray<Node*> _macro_nodes; // List of nodes which need to be expanded before matching.
386 GrowableArray<ParsePredicateNode*> _parse_predicates; // List of Parse Predicates.
387 // List of OpaqueTemplateAssertionPredicateNode nodes for Template Assertion Predicates which can be seen as list
388 // of Template Assertion Predicates themselves.
389 GrowableArray<OpaqueTemplateAssertionPredicateNode*> _template_assertion_predicate_opaques;
390 GrowableArray<Node*> _expensive_nodes; // List of nodes that are expensive to compute and that we'd better not let the GVN freely common
391 GrowableArray<ReachabilityFenceNode*> _reachability_fences; // List of reachability fences
392 GrowableArray<Node*> _for_post_loop_igvn; // List of nodes for IGVN after loop opts are over
393 GrowableArray<Node*> _for_merge_stores_igvn; // List of nodes for IGVN merge stores
394 GrowableArray<UnstableIfTrap*> _unstable_if_traps; // List of ifnodes after IGVN
395 GrowableArray<Node_List*> _coarsened_locks; // List of coarsened Lock and Unlock nodes
396 ConnectionGraph* _congraph;
397 #ifndef PRODUCT
398 IdealGraphPrinter* _igv_printer;
399 static IdealGraphPrinter* _debug_file_printer;
400 static IdealGraphPrinter* _debug_network_printer;
401 #endif
402
403
404 // Node management
405 uint _unique; // Counter for unique Node indices
406 uint _dead_node_count; // Number of dead nodes; VectorSet::Size() is O(N).
407 // So use this to keep count and make the call O(1).
408 VectorSet _dead_node_list; // Set of dead nodes
409 DEBUG_ONLY(Unique_Node_List* _modified_nodes;) // List of nodes which inputs were modified
410 DEBUG_ONLY(bool _phase_optimize_finished;) // Used for live node verification while creating new nodes
411
412 DEBUG_ONLY(bool _phase_verify_ideal_loop;) // Are we in PhaseIdealLoop verification?
586 ciMethod* method() const { return _method; }
587 int entry_bci() const { return _entry_bci; }
588 bool is_osr_compilation() const { return _entry_bci != InvocationEntryBci; }
589 bool is_method_compilation() const { return (_method != nullptr && !_method->flags().is_native()); }
590 const TypeFunc* tf() const { assert(_tf!=nullptr, ""); return _tf; }
591 void init_tf(const TypeFunc* tf) { assert(_tf==nullptr, ""); _tf = tf; }
592 InlineTree* ilt() const { return _ilt; }
593 address stub_function() const { return _stub_function; }
594 const char* stub_name() const { return _stub_name; }
595 StubId stub_id() const { return _stub_id; }
596 address stub_entry_point() const { return _stub_entry_point; }
597 void set_stub_entry_point(address z) { _stub_entry_point = z; }
598
599 // Control of this compilation.
600 int fixed_slots() const { assert(_fixed_slots >= 0, ""); return _fixed_slots; }
601 void set_fixed_slots(int n) { _fixed_slots = n; }
602 void set_inlining_progress(bool z) { _inlining_progress = z; }
603 int inlining_progress() const { return _inlining_progress; }
604 void set_inlining_incrementally(bool z) { _inlining_incrementally = z; }
605 int inlining_incrementally() const { return _inlining_incrementally; }
606 void set_do_cleanup(bool z) { _do_cleanup = z; }
607 int do_cleanup() const { return _do_cleanup; }
608 bool major_progress() const { return _major_progress; }
609 void set_major_progress() { _major_progress = true; }
610 void restore_major_progress(bool progress) { _major_progress = _major_progress || progress; }
611 void clear_major_progress() { _major_progress = false; }
612 int max_inline_size() const { return _max_inline_size; }
613 void set_freq_inline_size(int n) { _freq_inline_size = n; }
614 int freq_inline_size() const { return _freq_inline_size; }
615 void set_max_inline_size(int n) { _max_inline_size = n; }
616 bool has_loops() const { return _has_loops; }
617 void set_has_loops(bool z) { _has_loops = z; }
618 bool has_split_ifs() const { return _has_split_ifs; }
619 void set_has_split_ifs(bool z) { _has_split_ifs = z; }
620 bool has_unsafe_access() const { return _has_unsafe_access; }
621 void set_has_unsafe_access(bool z) { _has_unsafe_access = z; }
622 bool has_stringbuilder() const { return _has_stringbuilder; }
623 void set_has_stringbuilder(bool z) { _has_stringbuilder = z; }
624 bool has_boxed_value() const { return _has_boxed_value; }
625 void set_has_boxed_value(bool z) { _has_boxed_value = z; }
626 bool has_reserved_stack_access() const { return _has_reserved_stack_access; }
627 void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; }
628 uint max_vector_size() const { return _max_vector_size; }
629 void set_max_vector_size(uint s) { _max_vector_size = s; }
630 bool clear_upper_avx() const { return _clear_upper_avx; }
631 void set_clear_upper_avx(bool s) { _clear_upper_avx = s; }
632 void set_trap_count(uint r, uint c) { assert(r < trapHistLength, "oob"); _trap_hist[r] = c; }
633 uint trap_count(uint r) const { assert(r < trapHistLength, "oob"); return _trap_hist[r]; }
634 bool trap_can_recompile() const { return _trap_can_recompile; }
635 void set_trap_can_recompile(bool z) { _trap_can_recompile = z; }
636 uint decompile_count() const { return _decompile_count; }
637 void set_decompile_count(uint c) { _decompile_count = c; }
638 bool allow_range_check_smearing() const;
639 bool do_inlining() const { return _do_inlining; }
640 void set_do_inlining(bool z) { _do_inlining = z; }
641 bool do_scheduling() const { return _do_scheduling; }
642 void set_do_scheduling(bool z) { _do_scheduling = z; }
643 bool do_freq_based_layout() const{ return _do_freq_based_layout; }
644 void set_do_freq_based_layout(bool z){ _do_freq_based_layout = z; }
645 bool do_vector_loop() const { return _do_vector_loop; }
646 void set_do_vector_loop(bool z) { _do_vector_loop = z; }
647 bool use_cmove() const { return _use_cmove; }
648 void set_use_cmove(bool z) { _use_cmove = z; }
649 bool do_aliasing() const { return _do_aliasing; }
650 bool print_assembly() const { return _print_assembly; }
651 void set_print_assembly(bool z) { _print_assembly = z; }
652 bool print_inlining() const { return _print_inlining; }
653 void set_print_inlining(bool z) { _print_inlining = z; }
654 bool print_intrinsics() const { return _print_intrinsics; }
655 void set_print_intrinsics(bool z) { _print_intrinsics = z; }
656 uint max_node_limit() const { return (uint)_max_node_limit; }
657 void set_max_node_limit(uint n) { _max_node_limit = n; }
658 uint node_count_inlining_cutoff() const { return _node_count_inlining_cutoff; }
659 void set_node_count_inlining_cutoff(uint n) { _node_count_inlining_cutoff = n; }
660 bool clinit_barrier_on_entry() { return _clinit_barrier_on_entry; }
661 void set_clinit_barrier_on_entry(bool z) { _clinit_barrier_on_entry = z; }
662 bool has_monitors() const { return _has_monitors; }
663 void set_has_monitors(bool v) { _has_monitors = v; }
664 bool has_scoped_access() const { return _has_scoped_access; }
665 void set_has_scoped_access(bool v) { _has_scoped_access = v; }
666
667 // check the CompilerOracle for special behaviours for this compile
668 bool method_has_option(CompileCommandEnum option) const {
669 return method() != nullptr && method()->has_option(option);
670 }
671
672 #ifndef PRODUCT
673 uint next_igv_idx() { return _igv_idx++; }
674 bool trace_opto_output() const { return _trace_opto_output; }
675 void print_phase(const char* phase_name);
676 void print_ideal_ir(const char* compile_phase_name) const;
677 bool should_print_ideal() const { return _directive->PrintIdealOption; }
678 bool parsed_irreducible_loop() const { return _parsed_irreducible_loop; }
679 void set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }
680 int _in_dump_cnt; // Required for dumping ir nodes.
681 #endif
783 bool coarsened_locks_consistent();
784 void mark_unbalanced_boxes() const;
785
786 bool post_loop_opts_phase() { return _post_loop_opts_phase; }
787 void set_post_loop_opts_phase() { _post_loop_opts_phase = true; }
788 void reset_post_loop_opts_phase() { _post_loop_opts_phase = false; }
789
790 #ifdef ASSERT
791 bool phase_verify_ideal_loop() const { return _phase_verify_ideal_loop; }
792 void set_phase_verify_ideal_loop() { _phase_verify_ideal_loop = true; }
793 void reset_phase_verify_ideal_loop() { _phase_verify_ideal_loop = false; }
794 #endif
795
796 bool allow_macro_nodes() { return _allow_macro_nodes; }
797 void reset_allow_macro_nodes() { _allow_macro_nodes = false; }
798
799 void record_for_post_loop_opts_igvn(Node* n);
800 void remove_from_post_loop_opts_igvn(Node* n);
801 void process_for_post_loop_opts_igvn(PhaseIterGVN& igvn);
802
803 void record_unstable_if_trap(UnstableIfTrap* trap);
804 bool remove_unstable_if_trap(CallStaticJavaNode* unc, bool yield);
805 void remove_useless_unstable_if_traps(Unique_Node_List &useful);
806 void process_for_unstable_if_traps(PhaseIterGVN& igvn);
807
808 bool merge_stores_phase() { return _merge_stores_phase; }
809 void set_merge_stores_phase() { _merge_stores_phase = true; }
810 void record_for_merge_stores_igvn(Node* n);
811 void remove_from_merge_stores_igvn(Node* n);
812 void process_for_merge_stores_igvn(PhaseIterGVN& igvn);
813
814 void shuffle_late_inlines();
815 void shuffle_macro_nodes();
816 void sort_macro_nodes();
817
818 void mark_parse_predicate_nodes_useless(PhaseIterGVN& igvn);
819
820 // Are there candidate expensive nodes for optimization?
821 bool should_optimize_expensive_nodes(PhaseIterGVN &igvn);
822 // Check whether n1 and n2 are similar
966 Arena* type_arena() { return _type_arena; }
967 Dict* type_dict() { return _type_dict; }
968 size_t type_last_size() { return _type_last_size; }
969 int num_alias_types() { return _num_alias_types; }
970
971 void init_type_arena() { _type_arena = &_Compile_types; }
972 void set_type_arena(Arena* a) { _type_arena = a; }
973 void set_type_dict(Dict* d) { _type_dict = d; }
974 void set_type_last_size(size_t sz) { _type_last_size = sz; }
975
976 const TypeFunc* last_tf(ciMethod* m) {
977 return (m == _last_tf_m) ? _last_tf : nullptr;
978 }
979 void set_last_tf(ciMethod* m, const TypeFunc* tf) {
980 assert(m != nullptr || tf == nullptr, "");
981 _last_tf_m = m;
982 _last_tf = tf;
983 }
984
985 AliasType* alias_type(int idx) { assert(idx < num_alias_types(), "oob"); return _alias_types[idx]; }
986 AliasType* alias_type(const TypePtr* adr_type, ciField* field = nullptr) { return find_alias_type(adr_type, false, field); }
987 bool have_alias_type(const TypePtr* adr_type);
988 AliasType* alias_type(ciField* field);
989
990 int get_alias_index(const TypePtr* at) { return alias_type(at)->index(); }
991 const TypePtr* get_adr_type(uint aidx) { return alias_type(aidx)->adr_type(); }
992 int get_general_index(uint aidx) { return alias_type(aidx)->general_index(); }
993
994 // Building nodes
995 void rethrow_exceptions(JVMState* jvms);
996 void return_values(JVMState* jvms);
997 JVMState* build_start_state(StartNode* start, const TypeFunc* tf);
998
999 // Decide how to build a call.
1000 // The profile factor is a discount to apply to this site's interp. profile.
1001 CallGenerator* call_generator(ciMethod* call_method, int vtable_index, bool call_does_dispatch,
1002 JVMState* jvms, bool allow_inline, float profile_factor, ciKlass* speculative_receiver_type = nullptr,
1003 bool allow_intrinsics = true);
1004 bool should_delay_inlining(ciMethod* call_method, JVMState* jvms) {
1005 return C->directive()->should_delay_inline(call_method) ||
1006 should_delay_string_inlining(call_method, jvms) ||
1007 should_delay_boxing_inlining(call_method, jvms) ||
1008 should_delay_vector_inlining(call_method, jvms);
1009 }
1010 bool should_delay_after_inlining_cutoff(ciMethod* callee, ciMethod* caller);
1221 // Number of outgoing stack slots killed above the out_preserve_stack_slots
1222 // for calls to C. Supports the var-args backing area for register parms.
1223 uint varargs_C_out_slots_killed() const;
1224
1225 // Number of Stack Slots consumed by a synchronization entry
1226 int sync_stack_slots() const;
1227
1228 // Compute the name of old_SP. See <arch>.ad for frame layout.
1229 OptoReg::Name compute_old_SP();
1230
1231 private:
1232 // Phase control:
1233 void Init(bool aliasing); // Prepare for a single compilation
1234 void Optimize(); // Given a graph, optimize it
1235 void Code_Gen(); // Generate code from a graph
1236
1237 // Management of the AliasType table.
1238 void grow_alias_types();
1239 AliasCacheEntry* probe_alias_cache(const TypePtr* adr_type);
1240 const TypePtr *flatten_alias_type(const TypePtr* adr_type) const;
1241 AliasType* find_alias_type(const TypePtr* adr_type, bool no_create, ciField* field);
1242
1243 void verify_top(Node*) const PRODUCT_RETURN;
1244
1245 // Intrinsic setup.
1246 CallGenerator* make_vm_intrinsic(ciMethod* m, bool is_virtual); // constructor
1247 int intrinsic_insertion_index(ciMethod* m, bool is_virtual, bool& found); // helper
1248 CallGenerator* find_intrinsic(ciMethod* m, bool is_virtual); // query fn
1249 void register_intrinsic(CallGenerator* cg); // update fn
1250
1251 #ifndef PRODUCT
1252 static juint _intrinsic_hist_count[];
1253 static jubyte _intrinsic_hist_flags[];
1254 #endif
1255 // Function calls made by the public function final_graph_reshaping.
1256 // No need to be made public as they are not called elsewhere.
1257 void final_graph_reshaping_impl(Node *n, Final_Reshape_Counts& frc, Unique_Node_List& dead_nodes);
1258 void final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& frc, uint nop, Unique_Node_List& dead_nodes);
1259 void final_graph_reshaping_walk(Node_Stack& nstack, Node* root, Final_Reshape_Counts& frc, Unique_Node_List& dead_nodes);
1260 void handle_div_mod_op(Node* n, BasicType bt, bool is_unsigned);
1261
1314 // Verify ADLC assumptions during startup
1315 static void adlc_verification() PRODUCT_RETURN;
1316
1317 // Definitions of pd methods
1318 static void pd_compiler2_init();
1319
1320 // Materialize reachability fences from reachability edges on safepoints.
1321 void expand_reachability_edges(Unique_Node_List& safepoints);
1322
1323 // Static parse-time type checking logic for gen_subtype_check:
1324 enum SubTypeCheckResult { SSC_always_false, SSC_always_true, SSC_easy_test, SSC_full_test };
1325 SubTypeCheckResult static_subtype_check(const TypeKlassPtr* superk, const TypeKlassPtr* subk, bool skip = StressReflectiveCode);
1326
1327 static Node* conv_I2X_index(PhaseGVN* phase, Node* offset, const TypeInt* sizetype,
1328 // Optional control dependency (for example, on range check)
1329 Node* ctrl = nullptr);
1330
1331 // Convert integer value to a narrowed long type dependent on ctrl (for example, a range check)
1332 static Node* constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl, bool carry_dependency = false);
1333
1334 // Auxiliary methods for randomized fuzzing/stressing
1335 int random();
1336 bool randomized_select(int count);
1337
1338 // seed random number generation and log the seed for repeatability.
1339 void initialize_stress_seed(const DirectiveSet* directive);
1340
1341 // supporting clone_map
1342 CloneMap& clone_map();
1343 void set_clone_map(Dict* d);
1344
1345 bool needs_clinit_barrier(ciField* ik, ciMethod* accessing_method);
1346 bool needs_clinit_barrier(ciMethod* ik, ciMethod* accessing_method);
1347 bool needs_clinit_barrier(ciInstanceKlass* ik, ciMethod* accessing_method);
1348
1349 #ifdef ASSERT
1350 VerifyMeetResult* _type_verify;
1351 void set_exception_backedge() { _exception_backedge = true; }
1352 bool has_exception_backedge() const { return _exception_backedge; }
1353 #endif
1354
|
28 #include "asm/codeBuffer.hpp"
29 #include "ci/compilerInterface.hpp"
30 #include "code/debugInfoRec.hpp"
31 #include "compiler/cHeapStringHolder.hpp"
32 #include "compiler/compileBroker.hpp"
33 #include "compiler/compiler_globals.hpp"
34 #include "compiler/compilerEvent.hpp"
35 #include "libadt/dict.hpp"
36 #include "libadt/vectset.hpp"
37 #include "memory/resourceArea.hpp"
38 #include "oops/methodData.hpp"
39 #include "opto/idealGraphPrinter.hpp"
40 #include "opto/phase.hpp"
41 #include "opto/phasetype.hpp"
42 #include "opto/printinlining.hpp"
43 #include "opto/regmask.hpp"
44 #include "runtime/deoptimization.hpp"
45 #include "runtime/sharedRuntime.hpp"
46 #include "runtime/timerTrace.hpp"
47 #include "runtime/vmThread.hpp"
48 #include "utilities/growableArray.hpp"
49 #include "utilities/ticks.hpp"
50 #include "utilities/vmEnums.hpp"
51
52 class AbstractLockNode;
53 class AddPNode;
54 class Block;
55 class Bundle;
56 class CallGenerator;
57 class CallNode;
58 class CallStaticJavaNode;
59 class CloneMap;
60 class CompilationFailureInfo;
61 class ConnectionGraph;
62 class IdealGraphPrinter;
63 class InlineTree;
64 class Matcher;
65 class MachConstantNode;
66 class MachConstantBaseNode;
67 class MachNode;
68 class MachOper;
69 class MachSafePointNode;
70 class Node;
71 class Node_Array;
72 class Node_List;
73 class Node_Notes;
74 class NodeHash;
75 class NodeCloneInfo;
76 class OpaqueTemplateAssertionPredicateNode;
77 class OptoReg;
82 class PhaseRegAlloc;
83 class PhaseCCP;
84 class PhaseOutput;
85 class ReachabilityFenceNode;
86 class RootNode;
87 class relocInfo;
88 class StartNode;
89 class SafePointNode;
90 class JVMState;
91 class Type;
92 class TypeInt;
93 class TypeInteger;
94 class TypeKlassPtr;
95 class TypePtr;
96 class TypeOopPtr;
97 class TypeFunc;
98 class TypeVect;
99 class Type_Array;
100 class Unique_Node_List;
101 class UnstableIfTrap;
102 class InlineTypeNode;
103 class nmethod;
104 class Node_Stack;
105 struct Final_Reshape_Counts;
106 class VerifyMeetResult;
107
108 enum LoopOptsMode {
109 LoopOptsDefault,
110 LoopOptsNone,
111 LoopOptsMaxUnroll,
112 LoopOptsShenandoahExpand,
113 LoopOptsSkipSplitIf,
114 LoopOptsVerify,
115 PostLoopOptsExpandReachabilityFences
116 };
117
118 // The type of all node counts and indexes.
119 // It must hold at least 16 bits, but must also be fast to load and store.
120 // This type, if less than 32 bits, could limit the number of possible nodes.
121 // (To make this type platform-specific, move to globalDefinitions_xxx.hpp.)
122 typedef unsigned int node_idx_t;
323 // allocator i.e. locks, original deopt pc, etc.
324 uintx _max_node_limit; // Max unique node count during a single compilation.
325 uint _node_count_inlining_cutoff; // Number of nodes in the graph above which inlining is denied
326
327 bool _post_loop_opts_phase; // Loop opts are finished.
328 bool _merge_stores_phase; // Phase for merging stores, after post loop opts phase.
329 bool _allow_macro_nodes; // True if we allow creation of macro nodes.
330
331 /* If major progress is set:
332 * Marks that the loop tree information (get_ctrl, idom, get_loop, etc.) could be invalid, and we need to rebuild the loop tree.
333 * It also indicates that the graph was changed in a way that is promising to be able to apply more loop optimization.
334 * If major progress is not set:
335 * Loop tree information is valid.
336 * If major progress is not set at the end of a loop opts phase, then we can stop loop opts, because we do not expect any further progress if we did more loop opts phases.
337 *
338 * This is not 100% accurate, the semantics of major progress has become less clear over time, but this is the general idea.
339 */
340 bool _major_progress;
341 bool _inlining_progress; // progress doing incremental inlining?
342 bool _inlining_incrementally;// Are we doing incremental inlining (post parse)
343 bool _strength_reduction; // Are we doing strength reduction to direct call
344 bool _do_cleanup; // Cleanup is needed before proceeding with incremental inlining
345 bool _has_loops; // True if the method _may_ have some loops
346 bool _has_split_ifs; // True if the method _may_ have some split-if
347 bool _has_unsafe_access; // True if the method _may_ produce faults in unsafe loads or stores.
348 bool _has_stringbuilder; // True StringBuffers or StringBuilders are allocated
349 bool _has_boxed_value; // True if a boxed object is allocated
350 bool _has_reserved_stack_access; // True if the method or an inlined method is annotated with ReservedStackAccess
351 bool _has_circular_inline_type; // True if method loads an inline type with a circular, non-flat field
352 bool _needs_nm_slot; // True if an extra stack slot is needed to hold the null marker at scalarized returns
353 uint _max_vector_size; // Maximum size of generated vectors
354 bool _clear_upper_avx; // Clear upper bits of ymm registers using vzeroupper
355 uint _trap_hist[trapHistLength]; // Cumulative traps
356 bool _trap_can_recompile; // Have we emitted a recompiling trap?
357 uint _decompile_count; // Cumulative decompilation counts.
358 bool _do_inlining; // True if we intend to do inlining
359 bool _do_scheduling; // True if we intend to do scheduling
360 bool _do_freq_based_layout; // True if we intend to do frequency based block layout
361 bool _do_vector_loop; // True if allowed to execute loop in parallel iterations
362 bool _use_cmove; // True if CMove should be used without profitability analysis
363 bool _do_aliasing; // True if we intend to do aliasing
364 bool _print_assembly; // True if we should dump assembly code for this compilation
365 bool _print_inlining; // True if we should print inlining for this compilation
366 bool _print_intrinsics; // True if we should print intrinsics for this compilation
367 bool _print_phase_loop_opts; // True if we should print before and after loop opts phase
368 #ifndef PRODUCT
369 uint _phase_counter; // Counter for the number of already printed phases
370 uint _igv_idx; // Counter for IGV node identifiers
371 uint _igv_phase_iter[PHASE_NUM_TYPES]; // Counters for IGV phase iterations
372 bool _trace_opto_output;
373 bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing
374 #endif
375 bool _has_irreducible_loop; // Found irreducible loops
376 bool _has_monitors; // Metadata transfered to nmethod to enable Continuations lock-detection fastpath
377 bool _has_scoped_access; // For shared scope closure
378 bool _clinit_barrier_on_entry; // True if clinit barrier is needed on nmethod entry
379 int _loop_opts_cnt; // loop opts round
380 bool _has_flat_accesses; // Any known flat array accesses?
381 bool _flat_accesses_share_alias; // Initially all flat array share a single slice
382 bool _scalarize_in_safepoints; // Scalarize inline types in safepoint debug info
383 uint _stress_seed; // Seed for stress testing
384
385 // Compilation environment.
386 Arena _comp_arena; // Arena with lifetime equivalent to Compile
387 void* _barrier_set_state; // Potential GC barrier state for Compile
388 ciEnv* _env; // CI interface
389 DirectiveSet* _directive; // Compiler directive
390 CompileLog* _log; // from CompilerThread
391 CHeapStringHolder _failure_reason; // for record_failure/failing pattern
392 CompilationFailureInfo* _first_failure_details; // Details for the first failure happening during compilation
393 GrowableArray<CallGenerator*> _intrinsics; // List of intrinsics.
394 GrowableArray<Node*> _macro_nodes; // List of nodes which need to be expanded before matching.
395 GrowableArray<ParsePredicateNode*> _parse_predicates; // List of Parse Predicates.
396 // List of OpaqueTemplateAssertionPredicateNode nodes for Template Assertion Predicates which can be seen as list
397 // of Template Assertion Predicates themselves.
398 GrowableArray<OpaqueTemplateAssertionPredicateNode*> _template_assertion_predicate_opaques;
399 GrowableArray<Node*> _expensive_nodes; // List of nodes that are expensive to compute and that we'd better not let the GVN freely common
400 GrowableArray<ReachabilityFenceNode*> _reachability_fences; // List of reachability fences
401 GrowableArray<Node*> _for_post_loop_igvn; // List of nodes for IGVN after loop opts are over
402 GrowableArray<Node*> _inline_type_nodes; // List of InlineType nodes
403 GrowableArray<Node*> _flat_access_nodes; // List of LoadFlat and StoreFlat nodes
404 GrowableArray<Node*> _for_merge_stores_igvn; // List of nodes for IGVN merge stores
405 GrowableArray<UnstableIfTrap*> _unstable_if_traps; // List of ifnodes after IGVN
406 GrowableArray<Node_List*> _coarsened_locks; // List of coarsened Lock and Unlock nodes
407 ConnectionGraph* _congraph;
408 #ifndef PRODUCT
409 IdealGraphPrinter* _igv_printer;
410 static IdealGraphPrinter* _debug_file_printer;
411 static IdealGraphPrinter* _debug_network_printer;
412 #endif
413
414
415 // Node management
416 uint _unique; // Counter for unique Node indices
417 uint _dead_node_count; // Number of dead nodes; VectorSet::Size() is O(N).
418 // So use this to keep count and make the call O(1).
419 VectorSet _dead_node_list; // Set of dead nodes
420 DEBUG_ONLY(Unique_Node_List* _modified_nodes;) // List of nodes which inputs were modified
421 DEBUG_ONLY(bool _phase_optimize_finished;) // Used for live node verification while creating new nodes
422
423 DEBUG_ONLY(bool _phase_verify_ideal_loop;) // Are we in PhaseIdealLoop verification?
597 ciMethod* method() const { return _method; }
598 int entry_bci() const { return _entry_bci; }
599 bool is_osr_compilation() const { return _entry_bci != InvocationEntryBci; }
600 bool is_method_compilation() const { return (_method != nullptr && !_method->flags().is_native()); }
601 const TypeFunc* tf() const { assert(_tf!=nullptr, ""); return _tf; }
602 void init_tf(const TypeFunc* tf) { assert(_tf==nullptr, ""); _tf = tf; }
603 InlineTree* ilt() const { return _ilt; }
604 address stub_function() const { return _stub_function; }
605 const char* stub_name() const { return _stub_name; }
606 StubId stub_id() const { return _stub_id; }
607 address stub_entry_point() const { return _stub_entry_point; }
608 void set_stub_entry_point(address z) { _stub_entry_point = z; }
609
610 // Control of this compilation.
611 int fixed_slots() const { assert(_fixed_slots >= 0, ""); return _fixed_slots; }
612 void set_fixed_slots(int n) { _fixed_slots = n; }
613 void set_inlining_progress(bool z) { _inlining_progress = z; }
614 int inlining_progress() const { return _inlining_progress; }
615 void set_inlining_incrementally(bool z) { _inlining_incrementally = z; }
616 int inlining_incrementally() const { return _inlining_incrementally; }
617 void set_strength_reduction(bool z) { _strength_reduction = z; }
618 bool strength_reduction() const { return _strength_reduction; }
619 void set_do_cleanup(bool z) { _do_cleanup = z; }
620 int do_cleanup() const { return _do_cleanup; }
621 bool major_progress() const { return _major_progress; }
622 void set_major_progress() { _major_progress = true; }
623 void restore_major_progress(bool progress) { _major_progress = _major_progress || progress; }
624 void clear_major_progress() { _major_progress = false; }
625 int max_inline_size() const { return _max_inline_size; }
626 void set_freq_inline_size(int n) { _freq_inline_size = n; }
627 int freq_inline_size() const { return _freq_inline_size; }
628 void set_max_inline_size(int n) { _max_inline_size = n; }
629 bool has_loops() const { return _has_loops; }
630 void set_has_loops(bool z) { _has_loops = z; }
631 bool has_split_ifs() const { return _has_split_ifs; }
632 void set_has_split_ifs(bool z) { _has_split_ifs = z; }
633 bool has_unsafe_access() const { return _has_unsafe_access; }
634 void set_has_unsafe_access(bool z) { _has_unsafe_access = z; }
635 bool has_stringbuilder() const { return _has_stringbuilder; }
636 void set_has_stringbuilder(bool z) { _has_stringbuilder = z; }
637 bool has_boxed_value() const { return _has_boxed_value; }
638 void set_has_boxed_value(bool z) { _has_boxed_value = z; }
639 bool has_reserved_stack_access() const { return _has_reserved_stack_access; }
640 void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; }
641 bool has_circular_inline_type() const { return _has_circular_inline_type; }
642 void set_has_circular_inline_type(bool z) { _has_circular_inline_type = z; }
643 uint max_vector_size() const { return _max_vector_size; }
644 void set_max_vector_size(uint s) { _max_vector_size = s; }
645 bool clear_upper_avx() const { return _clear_upper_avx; }
646 void set_clear_upper_avx(bool s) { _clear_upper_avx = s; }
647 void set_trap_count(uint r, uint c) { assert(r < trapHistLength, "oob"); _trap_hist[r] = c; }
648 uint trap_count(uint r) const { assert(r < trapHistLength, "oob"); return _trap_hist[r]; }
649 bool trap_can_recompile() const { return _trap_can_recompile; }
650 void set_trap_can_recompile(bool z) { _trap_can_recompile = z; }
651 uint decompile_count() const { return _decompile_count; }
652 void set_decompile_count(uint c) { _decompile_count = c; }
653 bool allow_range_check_smearing() const;
654 bool do_inlining() const { return _do_inlining; }
655 void set_do_inlining(bool z) { _do_inlining = z; }
656 bool do_scheduling() const { return _do_scheduling; }
657 void set_do_scheduling(bool z) { _do_scheduling = z; }
658 bool do_freq_based_layout() const{ return _do_freq_based_layout; }
659 void set_do_freq_based_layout(bool z){ _do_freq_based_layout = z; }
660 bool do_vector_loop() const { return _do_vector_loop; }
661 void set_do_vector_loop(bool z) { _do_vector_loop = z; }
662 bool use_cmove() const { return _use_cmove; }
663 void set_use_cmove(bool z) { _use_cmove = z; }
664 bool do_aliasing() const { return _do_aliasing; }
665 bool print_assembly() const { return _print_assembly; }
666 void set_print_assembly(bool z) { _print_assembly = z; }
667 bool print_inlining() const { return _print_inlining; }
668 void set_print_inlining(bool z) { _print_inlining = z; }
669 bool print_intrinsics() const { return _print_intrinsics; }
670 void set_print_intrinsics(bool z) { _print_intrinsics = z; }
671 uint max_node_limit() const { return (uint)_max_node_limit; }
672 void set_max_node_limit(uint n) { _max_node_limit = n; }
673 uint node_count_inlining_cutoff() const { return _node_count_inlining_cutoff; }
674 void set_node_count_inlining_cutoff(uint n) { _node_count_inlining_cutoff = n; }
675 bool clinit_barrier_on_entry() { return _clinit_barrier_on_entry; }
676 void set_clinit_barrier_on_entry(bool z) { _clinit_barrier_on_entry = z; }
677 void set_flat_accesses() { _has_flat_accesses = true; }
678 bool flat_accesses_share_alias() const { return _flat_accesses_share_alias; }
679 void set_flat_accesses_share_alias(bool z) { _flat_accesses_share_alias = z; }
680 bool scalarize_in_safepoints() const { return _scalarize_in_safepoints; }
681 void set_scalarize_in_safepoints(bool z) { _scalarize_in_safepoints = z; }
682
683 // Support for scalarized inline type calling convention
684 bool has_scalarized_args() const { return _method != nullptr && _method->has_scalarized_args(); }
685 bool needs_stack_repair() const { return _method != nullptr && _method->c2_needs_stack_repair(); }
686 bool needs_nm_slot() const { return _needs_nm_slot; }
687 void set_needs_nm_slot(bool v) { _needs_nm_slot = v; }
688
689 bool has_monitors() const { return _has_monitors; }
690 void set_has_monitors(bool v) { _has_monitors = v; }
691 bool has_scoped_access() const { return _has_scoped_access; }
692 void set_has_scoped_access(bool v) { _has_scoped_access = v; }
693
694 // check the CompilerOracle for special behaviours for this compile
695 bool method_has_option(CompileCommandEnum option) const {
696 return method() != nullptr && method()->has_option(option);
697 }
698
699 #ifndef PRODUCT
700 uint next_igv_idx() { return _igv_idx++; }
701 bool trace_opto_output() const { return _trace_opto_output; }
702 void print_phase(const char* phase_name);
703 void print_ideal_ir(const char* compile_phase_name) const;
704 bool should_print_ideal() const { return _directive->PrintIdealOption; }
705 bool parsed_irreducible_loop() const { return _parsed_irreducible_loop; }
706 void set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }
707 int _in_dump_cnt; // Required for dumping ir nodes.
708 #endif
810 bool coarsened_locks_consistent();
811 void mark_unbalanced_boxes() const;
812
813 bool post_loop_opts_phase() { return _post_loop_opts_phase; }
814 void set_post_loop_opts_phase() { _post_loop_opts_phase = true; }
815 void reset_post_loop_opts_phase() { _post_loop_opts_phase = false; }
816
817 #ifdef ASSERT
818 bool phase_verify_ideal_loop() const { return _phase_verify_ideal_loop; }
819 void set_phase_verify_ideal_loop() { _phase_verify_ideal_loop = true; }
820 void reset_phase_verify_ideal_loop() { _phase_verify_ideal_loop = false; }
821 #endif
822
823 bool allow_macro_nodes() { return _allow_macro_nodes; }
824 void reset_allow_macro_nodes() { _allow_macro_nodes = false; }
825
826 void record_for_post_loop_opts_igvn(Node* n);
827 void remove_from_post_loop_opts_igvn(Node* n);
828 void process_for_post_loop_opts_igvn(PhaseIterGVN& igvn);
829
830 // Keep track of inline type nodes for later processing
831 void add_inline_type(Node* n);
832 void remove_inline_type(Node* n);
833
834 bool clear_argument_if_only_used_as_buffer_at_calls(Node* result_cast, PhaseIterGVN& igvn);
835
836 void process_inline_types(PhaseIterGVN &igvn, bool remove = false);
837
838 void add_flat_access(Node* n);
839 void remove_flat_access(Node* n);
840 void process_flat_accesses(PhaseIterGVN& igvn);
841
842 template <class F>
843 void for_each_flat_access(F consumer) {
844 for (int i = _flat_access_nodes.length() - 1; i >= 0; i--) {
845 consumer(_flat_access_nodes.at(i));
846 }
847 }
848
849 void adjust_flat_array_access_aliases(PhaseIterGVN& igvn);
850
851 void record_unstable_if_trap(UnstableIfTrap* trap);
852 bool remove_unstable_if_trap(CallStaticJavaNode* unc, bool yield);
853 void remove_useless_unstable_if_traps(Unique_Node_List &useful);
854 void process_for_unstable_if_traps(PhaseIterGVN& igvn);
855
856 bool merge_stores_phase() { return _merge_stores_phase; }
857 void set_merge_stores_phase() { _merge_stores_phase = true; }
858 void record_for_merge_stores_igvn(Node* n);
859 void remove_from_merge_stores_igvn(Node* n);
860 void process_for_merge_stores_igvn(PhaseIterGVN& igvn);
861
862 void shuffle_late_inlines();
863 void shuffle_macro_nodes();
864 void sort_macro_nodes();
865
866 void mark_parse_predicate_nodes_useless(PhaseIterGVN& igvn);
867
868 // Are there candidate expensive nodes for optimization?
869 bool should_optimize_expensive_nodes(PhaseIterGVN &igvn);
870 // Check whether n1 and n2 are similar
1014 Arena* type_arena() { return _type_arena; }
1015 Dict* type_dict() { return _type_dict; }
1016 size_t type_last_size() { return _type_last_size; }
1017 int num_alias_types() { return _num_alias_types; }
1018
1019 void init_type_arena() { _type_arena = &_Compile_types; }
1020 void set_type_arena(Arena* a) { _type_arena = a; }
1021 void set_type_dict(Dict* d) { _type_dict = d; }
1022 void set_type_last_size(size_t sz) { _type_last_size = sz; }
1023
1024 const TypeFunc* last_tf(ciMethod* m) {
1025 return (m == _last_tf_m) ? _last_tf : nullptr;
1026 }
1027 void set_last_tf(ciMethod* m, const TypeFunc* tf) {
1028 assert(m != nullptr || tf == nullptr, "");
1029 _last_tf_m = m;
1030 _last_tf = tf;
1031 }
1032
1033 AliasType* alias_type(int idx) { assert(idx < num_alias_types(), "oob"); return _alias_types[idx]; }
1034 AliasType* alias_type(const TypePtr* adr_type, ciField* field = nullptr, bool uncached = false) { return find_alias_type(adr_type, false, field, uncached); }
1035 bool have_alias_type(const TypePtr* adr_type);
1036 AliasType* alias_type(ciField* field);
1037
1038 int get_alias_index(const TypePtr* at, bool uncached = false) { return alias_type(at, nullptr, uncached)->index(); }
1039 const TypePtr* get_adr_type(uint aidx) { return alias_type(aidx)->adr_type(); }
1040 int get_general_index(uint aidx) { return alias_type(aidx)->general_index(); }
1041
1042 // Building nodes
1043 void rethrow_exceptions(JVMState* jvms);
1044 void return_values(JVMState* jvms);
1045 JVMState* build_start_state(StartNode* start, const TypeFunc* tf);
1046
1047 // Decide how to build a call.
1048 // The profile factor is a discount to apply to this site's interp. profile.
1049 CallGenerator* call_generator(ciMethod* call_method, int vtable_index, bool call_does_dispatch,
1050 JVMState* jvms, bool allow_inline, float profile_factor, ciKlass* speculative_receiver_type = nullptr,
1051 bool allow_intrinsics = true);
1052 bool should_delay_inlining(ciMethod* call_method, JVMState* jvms) {
1053 return C->directive()->should_delay_inline(call_method) ||
1054 should_delay_string_inlining(call_method, jvms) ||
1055 should_delay_boxing_inlining(call_method, jvms) ||
1056 should_delay_vector_inlining(call_method, jvms);
1057 }
1058 bool should_delay_after_inlining_cutoff(ciMethod* callee, ciMethod* caller);
1269 // Number of outgoing stack slots killed above the out_preserve_stack_slots
1270 // for calls to C. Supports the var-args backing area for register parms.
1271 uint varargs_C_out_slots_killed() const;
1272
1273 // Number of Stack Slots consumed by a synchronization entry
1274 int sync_stack_slots() const;
1275
1276 // Compute the name of old_SP. See <arch>.ad for frame layout.
1277 OptoReg::Name compute_old_SP();
1278
1279 private:
1280 // Phase control:
1281 void Init(bool aliasing); // Prepare for a single compilation
1282 void Optimize(); // Given a graph, optimize it
1283 void Code_Gen(); // Generate code from a graph
1284
1285 // Management of the AliasType table.
1286 void grow_alias_types();
1287 AliasCacheEntry* probe_alias_cache(const TypePtr* adr_type);
1288 const TypePtr *flatten_alias_type(const TypePtr* adr_type) const;
1289 AliasType* find_alias_type(const TypePtr* adr_type, bool no_create, ciField* field, bool uncached = false);
1290
1291 void verify_top(Node*) const PRODUCT_RETURN;
1292
1293 // Intrinsic setup.
1294 CallGenerator* make_vm_intrinsic(ciMethod* m, bool is_virtual); // constructor
1295 int intrinsic_insertion_index(ciMethod* m, bool is_virtual, bool& found); // helper
1296 CallGenerator* find_intrinsic(ciMethod* m, bool is_virtual); // query fn
1297 void register_intrinsic(CallGenerator* cg); // update fn
1298
1299 #ifndef PRODUCT
1300 static juint _intrinsic_hist_count[];
1301 static jubyte _intrinsic_hist_flags[];
1302 #endif
1303 // Function calls made by the public function final_graph_reshaping.
1304 // No need to be made public as they are not called elsewhere.
1305 void final_graph_reshaping_impl(Node *n, Final_Reshape_Counts& frc, Unique_Node_List& dead_nodes);
1306 void final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& frc, uint nop, Unique_Node_List& dead_nodes);
1307 void final_graph_reshaping_walk(Node_Stack& nstack, Node* root, Final_Reshape_Counts& frc, Unique_Node_List& dead_nodes);
1308 void handle_div_mod_op(Node* n, BasicType bt, bool is_unsigned);
1309
1362 // Verify ADLC assumptions during startup
1363 static void adlc_verification() PRODUCT_RETURN;
1364
1365 // Definitions of pd methods
1366 static void pd_compiler2_init();
1367
1368 // Materialize reachability fences from reachability edges on safepoints.
1369 void expand_reachability_edges(Unique_Node_List& safepoints);
1370
1371 // Static parse-time type checking logic for gen_subtype_check:
1372 enum SubTypeCheckResult { SSC_always_false, SSC_always_true, SSC_easy_test, SSC_full_test };
1373 SubTypeCheckResult static_subtype_check(const TypeKlassPtr* superk, const TypeKlassPtr* subk, bool skip = StressReflectiveCode);
1374
1375 static Node* conv_I2X_index(PhaseGVN* phase, Node* offset, const TypeInt* sizetype,
1376 // Optional control dependency (for example, on range check)
1377 Node* ctrl = nullptr);
1378
1379 // Convert integer value to a narrowed long type dependent on ctrl (for example, a range check)
1380 static Node* constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl, bool carry_dependency = false);
1381
1382 // Auxiliary method for randomized fuzzing/stressing
1383 int random();
1384 bool randomized_select(int count);
1385
1386 // seed random number generation and log the seed for repeatability.
1387 void initialize_stress_seed(const DirectiveSet* directive);
1388
1389 // supporting clone_map
1390 CloneMap& clone_map();
1391 void set_clone_map(Dict* d);
1392
1393 bool needs_clinit_barrier(ciField* ik, ciMethod* accessing_method);
1394 bool needs_clinit_barrier(ciMethod* ik, ciMethod* accessing_method);
1395 bool needs_clinit_barrier(ciInstanceKlass* ik, ciMethod* accessing_method);
1396
1397 #ifdef ASSERT
1398 VerifyMeetResult* _type_verify;
1399 void set_exception_backedge() { _exception_backedge = true; }
1400 bool has_exception_backedge() const { return _exception_backedge; }
1401 #endif
1402
|