src/share/vm/opto/matcher.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8136457 Sdiff src/share/vm/opto

src/share/vm/opto/matcher.cpp

Print this page
rev 7539 : 8011858: Use Compile::live_nodes() instead of Compile::unique() in appropriate places
Reviewed-by: kvn, vlivanov
Contributed-by: vlad.ureche@gmail.com


2005     } else if (m->Opcode() == Op_LoadL) {
2006       FusedPatternMatcher<TypeLong> bmil(n, m, Op_ConL);
2007       return bmil.match(Op_AndL, -1, Op_SubL,  1,  0) ||
2008              bmil.match(Op_AndL, -1, Op_AddL, -1, -1) ||
2009              bmil.match(Op_XorL, -1, Op_AddL, -1, -1);
2010     }
2011   }
2012   return false;
2013 }
2014 #endif // X86
2015 
2016 // A method-klass-holder may be passed in the inline_cache_reg
2017 // and then expanded into the inline_cache_reg and a method_oop register
2018 //   defined in ad_<arch>.cpp
2019 
2020 
2021 //------------------------------find_shared------------------------------------
2022 // Set bits if Node is shared or otherwise a root
2023 void Matcher::find_shared( Node *n ) {
2024   // Allocate stack of size C->unique() * 2 to avoid frequent realloc
2025   MStack mstack(C->unique() * 2);
2026   // Mark nodes as address_visited if they are inputs to an address expression
2027   VectorSet address_visited(Thread::current()->resource_area());
2028   mstack.push(n, Visit);     // Don't need to pre-visit root node
2029   while (mstack.is_nonempty()) {
2030     n = mstack.node();       // Leave node on stack
2031     Node_State nstate = mstack.state();
2032     uint nop = n->Opcode();
2033     if (nstate == Pre_Visit) {
2034       if (address_visited.test(n->_idx)) { // Visited in address already?
2035         // Flag as visited and shared now.
2036         set_visited(n);
2037       }
2038       if (is_visited(n)) {   // Visited already?
2039         // Node is shared and has no reason to clone.  Flag it as shared.
2040         // This causes it to match into a register for the sharing.
2041         set_shared(n);       // Flag as shared and
2042         mstack.pop();        // remove node from stack
2043         continue;
2044       }
2045       nstate = Visit; // Not already visited; so visit now




2005     } else if (m->Opcode() == Op_LoadL) {
2006       FusedPatternMatcher<TypeLong> bmil(n, m, Op_ConL);
2007       return bmil.match(Op_AndL, -1, Op_SubL,  1,  0) ||
2008              bmil.match(Op_AndL, -1, Op_AddL, -1, -1) ||
2009              bmil.match(Op_XorL, -1, Op_AddL, -1, -1);
2010     }
2011   }
2012   return false;
2013 }
2014 #endif // X86
2015 
2016 // A method-klass-holder may be passed in the inline_cache_reg
2017 // and then expanded into the inline_cache_reg and a method_oop register
2018 //   defined in ad_<arch>.cpp
2019 
2020 
2021 //------------------------------find_shared------------------------------------
2022 // Set bits if Node is shared or otherwise a root
2023 void Matcher::find_shared( Node *n ) {
2024   // Allocate stack of size C->unique() * 2 to avoid frequent realloc
2025   MStack mstack(C->live_nodes() * 2);
2026   // Mark nodes as address_visited if they are inputs to an address expression
2027   VectorSet address_visited(Thread::current()->resource_area());
2028   mstack.push(n, Visit);     // Don't need to pre-visit root node
2029   while (mstack.is_nonempty()) {
2030     n = mstack.node();       // Leave node on stack
2031     Node_State nstate = mstack.state();
2032     uint nop = n->Opcode();
2033     if (nstate == Pre_Visit) {
2034       if (address_visited.test(n->_idx)) { // Visited in address already?
2035         // Flag as visited and shared now.
2036         set_visited(n);
2037       }
2038       if (is_visited(n)) {   // Visited already?
2039         // Node is shared and has no reason to clone.  Flag it as shared.
2040         // This causes it to match into a register for the sharing.
2041         set_shared(n);       // Flag as shared and
2042         mstack.pop();        // remove node from stack
2043         continue;
2044       }
2045       nstate = Visit; // Not already visited; so visit now


src/share/vm/opto/matcher.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File