< 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:




  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:


< prev index next >