< prev index next >

src/share/vm/opto/lcm.cpp

Print this page




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.inline.hpp"
  27 #include "opto/block.hpp"
  28 #include "opto/c2compiler.hpp"
  29 #include "opto/callnode.hpp"
  30 #include "opto/cfgnode.hpp"
  31 #include "opto/machnode.hpp"
  32 #include "opto/runtime.hpp"
  33 #if defined AD_MD_HPP
  34 # include AD_MD_HPP
  35 #elif defined TARGET_ARCH_MODEL_x86_32
  36 # include "adfiles/ad_x86_32.hpp"
  37 #elif defined TARGET_ARCH_MODEL_x86_64
  38 # include "adfiles/ad_x86_64.hpp"


  39 #elif defined TARGET_ARCH_MODEL_sparc
  40 # include "adfiles/ad_sparc.hpp"
  41 #elif defined TARGET_ARCH_MODEL_zero
  42 # include "adfiles/ad_zero.hpp"
  43 #elif defined TARGET_ARCH_MODEL_ppc_64
  44 # include "adfiles/ad_ppc_64.hpp"
  45 #endif
  46 
  47 // Optimization - Graph Style
  48 
  49 // Check whether val is not-null-decoded compressed oop,
  50 // i.e. will grab into the base of the heap if it represents NULL.
  51 static bool accesses_heap_base_zone(Node *val) {
  52   if (Universe::narrow_oop_base() != NULL) { // Implies UseCompressedOops.
  53     if (val && val->is_Mach()) {
  54       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
  55         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
  56         // decode NULL to point to the heap base (Decode_NN).
  57         if (val->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull) {
  58           return true;


 168     if( !m->is_Mach() ) continue;
 169     MachNode *mach = m->as_Mach();
 170     was_store = false;
 171     int iop = mach->ideal_Opcode();
 172     switch( iop ) {
 173     case Op_LoadB:
 174     case Op_LoadUB:
 175     case Op_LoadUS:
 176     case Op_LoadD:
 177     case Op_LoadF:
 178     case Op_LoadI:
 179     case Op_LoadL:
 180     case Op_LoadP:
 181     case Op_LoadN:
 182     case Op_LoadS:
 183     case Op_LoadKlass:
 184     case Op_LoadNKlass:
 185     case Op_LoadRange:
 186     case Op_LoadD_unaligned:
 187     case Op_LoadL_unaligned:
 188       assert(mach->in(2) == val, "should be address");
 189       break;
 190     case Op_StoreB:
 191     case Op_StoreC:
 192     case Op_StoreCM:
 193     case Op_StoreD:
 194     case Op_StoreF:
 195     case Op_StoreI:
 196     case Op_StoreL:
 197     case Op_StoreP:
 198     case Op_StoreN:
 199     case Op_StoreNKlass:
 200       was_store = true;         // Memory op is a store op
 201       // Stores will have their address in slot 2 (memory in slot 1).
 202       // If the value being nul-checked is in another slot, it means we
 203       // are storing the checked value, which does NOT check the value!
 204       if( mach->in(2) != val ) continue;
 205       break;                    // Found a memory op?
 206     case Op_StrComp:
 207     case Op_StrEquals:
 208     case Op_StrIndexOf:
 209     case Op_AryEq:


 937       }
 938       if( m->is_Phi() ) continue;
 939       if (m->_idx >= max_idx) { // new node, skip it
 940         assert(m->is_MachProj() && n->is_Mach() && n->as_Mach()->has_call(), "unexpected node types");
 941         continue;
 942       }
 943       int m_cnt = ready_cnt.at(m->_idx)-1;
 944       ready_cnt.at_put(m->_idx, m_cnt);
 945       if( m_cnt == 0 )
 946         worklist.push(m);
 947     }
 948   }
 949 
 950   if( phi_cnt != block->end_idx() ) {
 951     // did not schedule all.  Retry, Bailout, or Die
 952     if (C->subsume_loads() == true && !C->failing()) {
 953       // Retry with subsume_loads == false
 954       // If this is the first failure, the sentinel string will "stick"
 955       // to the Compile object, and the C2Compiler will see it and retry.
 956       C->record_failure(C2Compiler::retry_no_subsuming_loads());


 957     }
 958     // assert( phi_cnt == end_idx(), "did not schedule all" );
 959     return false;
 960   }
 961 
 962 #ifndef PRODUCT
 963   if (trace_opto_pipelining()) {
 964     tty->print_cr("#");
 965     tty->print_cr("# after schedule_local");
 966     for (uint i = 0;i < block->number_of_nodes();i++) {
 967       tty->print("# ");
 968       block->get_node(i)->fast_dump();
 969     }
 970     tty->cr();
 971   }
 972 #endif
 973 
 974 
 975   return true;
 976 }




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.inline.hpp"
  27 #include "opto/block.hpp"
  28 #include "opto/c2compiler.hpp"
  29 #include "opto/callnode.hpp"
  30 #include "opto/cfgnode.hpp"
  31 #include "opto/machnode.hpp"
  32 #include "opto/runtime.hpp"
  33 #if defined AD_MD_HPP
  34 # include AD_MD_HPP
  35 #elif defined TARGET_ARCH_MODEL_x86_32
  36 # include "adfiles/ad_x86_32.hpp"
  37 #elif defined TARGET_ARCH_MODEL_x86_64
  38 # include "adfiles/ad_x86_64.hpp"
  39 #elif defined TARGET_ARCH_MODEL_aarch64
  40 # include "adfiles/ad_aarch64.hpp"
  41 #elif defined TARGET_ARCH_MODEL_sparc
  42 # include "adfiles/ad_sparc.hpp"
  43 #elif defined TARGET_ARCH_MODEL_zero
  44 # include "adfiles/ad_zero.hpp"
  45 #elif defined TARGET_ARCH_MODEL_ppc_64
  46 # include "adfiles/ad_ppc_64.hpp"
  47 #endif
  48 
  49 // Optimization - Graph Style
  50 
  51 // Check whether val is not-null-decoded compressed oop,
  52 // i.e. will grab into the base of the heap if it represents NULL.
  53 static bool accesses_heap_base_zone(Node *val) {
  54   if (Universe::narrow_oop_base() != NULL) { // Implies UseCompressedOops.
  55     if (val && val->is_Mach()) {
  56       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
  57         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
  58         // decode NULL to point to the heap base (Decode_NN).
  59         if (val->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull) {
  60           return true;


 170     if( !m->is_Mach() ) continue;
 171     MachNode *mach = m->as_Mach();
 172     was_store = false;
 173     int iop = mach->ideal_Opcode();
 174     switch( iop ) {
 175     case Op_LoadB:
 176     case Op_LoadUB:
 177     case Op_LoadUS:
 178     case Op_LoadD:
 179     case Op_LoadF:
 180     case Op_LoadI:
 181     case Op_LoadL:
 182     case Op_LoadP:
 183     case Op_LoadN:
 184     case Op_LoadS:
 185     case Op_LoadKlass:
 186     case Op_LoadNKlass:
 187     case Op_LoadRange:
 188     case Op_LoadD_unaligned:
 189     case Op_LoadL_unaligned:


 190     case Op_StoreB:
 191     case Op_StoreC:
 192     case Op_StoreCM:
 193     case Op_StoreD:
 194     case Op_StoreF:
 195     case Op_StoreI:
 196     case Op_StoreL:
 197     case Op_StoreP:
 198     case Op_StoreN:
 199     case Op_StoreNKlass:
 200       was_store = true;         // Memory op is a store op
 201       // Stores will have their address in slot 2 (memory in slot 1).
 202       // If the value being nul-checked is in another slot, it means we
 203       // are storing the checked value, which does NOT check the value!
 204       if( mach->in(2) != val ) continue;
 205       break;                    // Found a memory op?
 206     case Op_StrComp:
 207     case Op_StrEquals:
 208     case Op_StrIndexOf:
 209     case Op_AryEq:


 937       }
 938       if( m->is_Phi() ) continue;
 939       if (m->_idx >= max_idx) { // new node, skip it
 940         assert(m->is_MachProj() && n->is_Mach() && n->as_Mach()->has_call(), "unexpected node types");
 941         continue;
 942       }
 943       int m_cnt = ready_cnt.at(m->_idx)-1;
 944       ready_cnt.at_put(m->_idx, m_cnt);
 945       if( m_cnt == 0 )
 946         worklist.push(m);
 947     }
 948   }
 949 
 950   if( phi_cnt != block->end_idx() ) {
 951     // did not schedule all.  Retry, Bailout, or Die
 952     if (C->subsume_loads() == true && !C->failing()) {
 953       // Retry with subsume_loads == false
 954       // If this is the first failure, the sentinel string will "stick"
 955       // to the Compile object, and the C2Compiler will see it and retry.
 956       C->record_failure(C2Compiler::retry_no_subsuming_loads());
 957     } else {
 958       assert(false, "graph should be schedulable");
 959     }
 960     // assert( phi_cnt == end_idx(), "did not schedule all" );
 961     return false;
 962   }
 963 
 964 #ifndef PRODUCT
 965   if (trace_opto_pipelining()) {
 966     tty->print_cr("#");
 967     tty->print_cr("# after schedule_local");
 968     for (uint i = 0;i < block->number_of_nodes();i++) {
 969       tty->print("# ");
 970       block->get_node(i)->fast_dump();
 971     }
 972     tty->cr();
 973   }
 974 #endif
 975 
 976 
 977   return true;
 978 }


< prev index next >