comparison src/share/vm/opto/parse.hpp @ 2383:9dc311b8473e

7008866: Missing loop predicate for loop with multiple entries Summary: Add predicates when loop head bytecode is parsed instead of when back branch bytecode is parsed. Reviewed-by: never
author kvn
date Mon, 21 Mar 2011 11:28:14 -0700
parents f95d63e2154a
children 0e3ed5a14f73
comparison
equal deleted inserted replaced
2382:3ef1a1866a60 2383:9dc311b8473e
134 int _pred_count; // how many predecessors in CFG? 134 int _pred_count; // how many predecessors in CFG?
135 int _preds_parsed; // how many of these have been parsed? 135 int _preds_parsed; // how many of these have been parsed?
136 uint _count; // how many times executed? Currently only set by _goto's 136 uint _count; // how many times executed? Currently only set by _goto's
137 bool _is_parsed; // has this block been parsed yet? 137 bool _is_parsed; // has this block been parsed yet?
138 bool _is_handler; // is this block an exception handler? 138 bool _is_handler; // is this block an exception handler?
139 bool _has_merged_backedge; // does this block have merged backedge?
139 SafePointNode* _start_map; // all values flowing into this block 140 SafePointNode* _start_map; // all values flowing into this block
140 MethodLivenessResult _live_locals; // lazily initialized liveness bitmap 141 MethodLivenessResult _live_locals; // lazily initialized liveness bitmap
141 142
142 int _num_successors; // Includes only normal control flow. 143 int _num_successors; // Includes only normal control flow.
143 int _all_successors; // Include exception paths also. 144 int _all_successors; // Include exception paths also.
165 SafePointNode* start_map() const { assert(is_merged(),""); return _start_map; } 166 SafePointNode* start_map() const { assert(is_merged(),""); return _start_map; }
166 void set_start_map(SafePointNode* m) { assert(!is_merged(), ""); _start_map = m; } 167 void set_start_map(SafePointNode* m) { assert(!is_merged(), ""); _start_map = m; }
167 168
168 // True after any predecessor flows control into this block 169 // True after any predecessor flows control into this block
169 bool is_merged() const { return _start_map != NULL; } 170 bool is_merged() const { return _start_map != NULL; }
171
172 #ifdef ASSERT
173 // True after backedge predecessor flows control into this block
174 bool has_merged_backedge() const { return _has_merged_backedge; }
175 void mark_merged_backedge(Block* pred) {
176 assert(is_SEL_head(), "should be loop head");
177 if (pred != NULL && is_SEL_backedge(pred)) {
178 assert(is_parsed(), "block should be parsed before merging backedges");
179 _has_merged_backedge = true;
180 }
181 }
182 #endif
170 183
171 // True when all non-exception predecessors have been parsed. 184 // True when all non-exception predecessors have been parsed.
172 bool is_ready() const { return preds_parsed() == pred_count(); } 185 bool is_ready() const { return preds_parsed() == pred_count(); }
173 186
174 int num_successors() const { return _num_successors; } 187 int num_successors() const { return _num_successors; }
439 if (UseLoopSafepoints && target_bci <= bci()) { 452 if (UseLoopSafepoints && target_bci <= bci()) {
440 add_safepoint(); 453 add_safepoint();
441 } 454 }
442 } 455 }
443 456
444 // Return true if the parser should add a loop predicate
445 bool should_add_predicate(int target_bci);
446 // Insert a loop predicate into the graph
447 void add_predicate();
448
449 // Note: Intrinsic generation routines may be found in library_call.cpp. 457 // Note: Intrinsic generation routines may be found in library_call.cpp.
450 458
451 // Helper function to setup Ideal Call nodes 459 // Helper function to setup Ideal Call nodes
452 void do_call(); 460 void do_call();
453 461