< prev index next >

src/share/vm/opto/parse2.cpp

Print this page




  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/ciMethodData.hpp"
  27 #include "classfile/systemDictionary.hpp"
  28 #include "classfile/vmSymbols.hpp"
  29 #include "compiler/compileLog.hpp"
  30 #include "interpreter/linkResolver.hpp"
  31 #include "memory/universe.inline.hpp"
  32 #include "opto/addnode.hpp"
  33 #include "opto/divnode.hpp"
  34 #include "opto/idealGraphPrinter.hpp"
  35 #include "opto/matcher.hpp"
  36 #include "opto/memnode.hpp"
  37 #include "opto/mulnode.hpp"
  38 #include "opto/parse.hpp"
  39 #include "opto/runtime.hpp"
  40 #include "runtime/deoptimization.hpp"
  41 #include "runtime/sharedRuntime.hpp"
  42 




  43 extern int explicit_null_checks_inserted,
  44            explicit_null_checks_elided;
  45 
  46 //---------------------------------array_load----------------------------------
  47 void Parse::array_load(BasicType elem_type) {
  48   const Type* elem = Type::TOP;
  49   Node* adr = array_addressing(elem_type, 0, &elem);
  50   if (stopped())  return;     // guaranteed null or range check
  51   dec_sp(2);                  // Pop array and index
  52   const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type);
  53   Node* ld = make_load(control(), adr, elem, elem_type, adr_type, MemNode::unordered);





  54   push(ld);
  55 }
  56 
  57 
  58 //--------------------------------array_store----------------------------------
  59 void Parse::array_store(BasicType elem_type) {
  60   const Type* elem = Type::TOP;
  61   Node* adr = array_addressing(elem_type, 1, &elem);
  62   if (stopped())  return;     // guaranteed null or range check
  63   Node* val = pop();
  64   dec_sp(2);                  // Pop array and index
  65   const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type);
  66   if (elem == TypeInt::BOOL) {
  67     elem_type = T_BOOLEAN;
  68   }
  69   store_to_memory(control(), adr, val, elem_type, adr_type, StoreNode::release_if_reference(elem_type));
  70 }
  71 
  72 
  73 //------------------------------array_addressing-------------------------------


2256   }
2257 
2258   case Bytecodes::_ifnull:    btest = BoolTest::eq; goto handle_if_null;
2259   case Bytecodes::_ifnonnull: btest = BoolTest::ne; goto handle_if_null;
2260   handle_if_null:
2261     // If this is a backwards branch in the bytecodes, add Safepoint
2262     maybe_add_safepoint(iter().get_dest());
2263     a = null();
2264     b = pop();
2265     c = _gvn.transform( new (C) CmpPNode(b, a) );
2266     do_ifnull(btest, c);
2267     break;
2268 
2269   case Bytecodes::_if_acmpeq: btest = BoolTest::eq; goto handle_if_acmp;
2270   case Bytecodes::_if_acmpne: btest = BoolTest::ne; goto handle_if_acmp;
2271   handle_if_acmp:
2272     // If this is a backwards branch in the bytecodes, add Safepoint
2273     maybe_add_safepoint(iter().get_dest());
2274     a = pop();
2275     b = pop();
2276     c = _gvn.transform( new (C) CmpPNode(b, a) );
2277     c = optimize_cmp_with_klass(c);
2278     do_if(btest, c);
2279     break;
2280 
2281   case Bytecodes::_ifeq: btest = BoolTest::eq; goto handle_ifxx;
2282   case Bytecodes::_ifne: btest = BoolTest::ne; goto handle_ifxx;
2283   case Bytecodes::_iflt: btest = BoolTest::lt; goto handle_ifxx;
2284   case Bytecodes::_ifle: btest = BoolTest::le; goto handle_ifxx;
2285   case Bytecodes::_ifgt: btest = BoolTest::gt; goto handle_ifxx;
2286   case Bytecodes::_ifge: btest = BoolTest::ge; goto handle_ifxx;
2287   handle_ifxx:
2288     // If this is a backwards branch in the bytecodes, add Safepoint
2289     maybe_add_safepoint(iter().get_dest());
2290     a = _gvn.intcon(0);
2291     b = pop();
2292     c = _gvn.transform( new (C) CmpINode(b, a) );
2293     do_if(btest, c);
2294     break;
2295 
2296   case Bytecodes::_if_icmpeq: btest = BoolTest::eq; goto handle_if_icmp;




  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/ciMethodData.hpp"
  27 #include "classfile/systemDictionary.hpp"
  28 #include "classfile/vmSymbols.hpp"
  29 #include "compiler/compileLog.hpp"
  30 #include "interpreter/linkResolver.hpp"
  31 #include "memory/universe.inline.hpp"
  32 #include "opto/addnode.hpp"
  33 #include "opto/divnode.hpp"
  34 #include "opto/idealGraphPrinter.hpp"
  35 #include "opto/matcher.hpp"
  36 #include "opto/memnode.hpp"
  37 #include "opto/mulnode.hpp"
  38 #include "opto/parse.hpp"
  39 #include "opto/runtime.hpp"
  40 #include "runtime/deoptimization.hpp"
  41 #include "runtime/sharedRuntime.hpp"
  42 
  43 #if INCLUDE_ALL_GCS
  44 #include "gc_implementation/shenandoah/shenandoahBarrierSetC2.hpp"
  45 #endif
  46 
  47 extern int explicit_null_checks_inserted,
  48            explicit_null_checks_elided;
  49 
  50 //---------------------------------array_load----------------------------------
  51 void Parse::array_load(BasicType elem_type) {
  52   const Type* elem = Type::TOP;
  53   Node* adr = array_addressing(elem_type, 0, &elem);
  54   if (stopped())  return;     // guaranteed null or range check
  55   dec_sp(2);                  // Pop array and index
  56   const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type);
  57   Node* ld = make_load(control(), adr, elem, elem_type, adr_type, MemNode::unordered);
  58 #if INCLUDE_ALL_GCS
  59   if (UseShenandoahGC && (elem_type == T_OBJECT || elem_type == T_ARRAY)) {
  60     ld = ShenandoahBarrierSetC2::bsc2()->load_reference_barrier(this, ld);
  61   }
  62 #endif
  63   push(ld);
  64 }
  65 
  66 
  67 //--------------------------------array_store----------------------------------
  68 void Parse::array_store(BasicType elem_type) {
  69   const Type* elem = Type::TOP;
  70   Node* adr = array_addressing(elem_type, 1, &elem);
  71   if (stopped())  return;     // guaranteed null or range check
  72   Node* val = pop();
  73   dec_sp(2);                  // Pop array and index
  74   const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type);
  75   if (elem == TypeInt::BOOL) {
  76     elem_type = T_BOOLEAN;
  77   }
  78   store_to_memory(control(), adr, val, elem_type, adr_type, StoreNode::release_if_reference(elem_type));
  79 }
  80 
  81 
  82 //------------------------------array_addressing-------------------------------


2265   }
2266 
2267   case Bytecodes::_ifnull:    btest = BoolTest::eq; goto handle_if_null;
2268   case Bytecodes::_ifnonnull: btest = BoolTest::ne; goto handle_if_null;
2269   handle_if_null:
2270     // If this is a backwards branch in the bytecodes, add Safepoint
2271     maybe_add_safepoint(iter().get_dest());
2272     a = null();
2273     b = pop();
2274     c = _gvn.transform( new (C) CmpPNode(b, a) );
2275     do_ifnull(btest, c);
2276     break;
2277 
2278   case Bytecodes::_if_acmpeq: btest = BoolTest::eq; goto handle_if_acmp;
2279   case Bytecodes::_if_acmpne: btest = BoolTest::ne; goto handle_if_acmp;
2280   handle_if_acmp:
2281     // If this is a backwards branch in the bytecodes, add Safepoint
2282     maybe_add_safepoint(iter().get_dest());
2283     a = pop();
2284     b = pop();
2285     c = _gvn.transform(new (C) CmpPNode(b, a) );
2286     c = optimize_cmp_with_klass(c);
2287     do_if(btest, c);
2288     break;
2289 
2290   case Bytecodes::_ifeq: btest = BoolTest::eq; goto handle_ifxx;
2291   case Bytecodes::_ifne: btest = BoolTest::ne; goto handle_ifxx;
2292   case Bytecodes::_iflt: btest = BoolTest::lt; goto handle_ifxx;
2293   case Bytecodes::_ifle: btest = BoolTest::le; goto handle_ifxx;
2294   case Bytecodes::_ifgt: btest = BoolTest::gt; goto handle_ifxx;
2295   case Bytecodes::_ifge: btest = BoolTest::ge; goto handle_ifxx;
2296   handle_ifxx:
2297     // If this is a backwards branch in the bytecodes, add Safepoint
2298     maybe_add_safepoint(iter().get_dest());
2299     a = _gvn.intcon(0);
2300     b = pop();
2301     c = _gvn.transform( new (C) CmpINode(b, a) );
2302     do_if(btest, c);
2303     break;
2304 
2305   case Bytecodes::_if_icmpeq: btest = BoolTest::eq; goto handle_if_icmp;


< prev index next >