< prev index next >

src/hotspot/share/opto/ifnode.cpp

Print this page

        

*** 33,42 **** --- 33,46 ---- #include "opto/loopnode.hpp" #include "opto/phaseX.hpp" #include "opto/runtime.hpp" #include "opto/rootnode.hpp" #include "opto/subnode.hpp" + #include "utilities/macros.hpp" + #if INCLUDE_SHENANDOAHGC + #include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp" + #endif // Portions of code courtesy of Clifford Click // Optimization - Graph Style
*** 1458,1467 **** --- 1462,1475 ---- cmp->in(2)->bottom_type() == TypePtr::NULL_PTR ) { dist = 64; // Limit for null-pointer scans } else { dist = 4; // Do not bother for random pointer tests } + #if INCLUDE_SHENANDOAHGC + } else if (ShenandoahWriteBarrierNode::is_heap_stable_test(this)) { + dist = 16; + #endif } else { dist = 4; // Limit for random junky scans } Node* prev_dom = search_identical(dist);
*** 1546,1559 **** Node* IfNode::search_identical(int dist) { // Setup to scan up the CFG looking for a dominating test Node* dom = in(0); Node* prev_dom = this; int op = Opcode(); // Search up the dominator tree for an If with an identical test while (dom->Opcode() != op || // Not same opcode? ! dom->in(1) != in(1) || // Not same input 1? ! (req() == 3 && dom->in(2) != in(2)) || // Not same input 2? prev_dom->in(0) != dom) { // One path of test does not dominate? if (dist < 0) return NULL; dist--; prev_dom = dom; --- 1554,1569 ---- Node* IfNode::search_identical(int dist) { // Setup to scan up the CFG looking for a dominating test Node* dom = in(0); Node* prev_dom = this; int op = Opcode(); + #if INCLUDE_SHENANDOAHGC + bool heap_stable = ShenandoahWriteBarrierNode::is_heap_stable_test(this); + #endif // Search up the dominator tree for an If with an identical test while (dom->Opcode() != op || // Not same opcode? ! (dom->in(1) != in(1) SHENANDOAHGC_ONLY(&& (!heap_stable || !ShenandoahWriteBarrierNode::is_heap_stable_test(dom->as_If())))) || // Not same input 1? prev_dom->in(0) != dom) { // One path of test does not dominate? if (dist < 0) return NULL; dist--; prev_dom = dom;
< prev index next >