< prev index next >

src/hotspot/share/opto/parse2.cpp

Print this page




  45 #include "opto/valuetypenode.hpp"
  46 #include "runtime/deoptimization.hpp"
  47 #include "runtime/sharedRuntime.hpp"
  48 
  49 #ifndef PRODUCT
  50 extern int explicit_null_checks_inserted,
  51            explicit_null_checks_elided;
  52 #endif
  53 
  54 //---------------------------------array_load----------------------------------
  55 void Parse::array_load(BasicType elem_type) {
  56   const Type* elem = Type::TOP;
  57   Node* adr = array_addressing(elem_type, 0, &elem);
  58   if (stopped())  return;     // guaranteed null or range check
  59   Node* idx   = pop();   // Get from stack without popping
  60   Node* ary   = pop();   // in case of exception
  61   //dec_sp(2);                  // Pop array and index
  62   const TypeAryPtr* arytype = _gvn.type(ary)->is_aryptr();
  63   if (arytype->klass()->is_value_array_klass()) {
  64     ciValueArrayKlass* vak = arytype->klass()->as_value_array_klass();
  65     Node* vt = ValueTypeNode::make(this, vak->element_klass()->as_value_klass(), ary, adr);
  66     push(vt);
  67     return;
  68   }
  69   const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type);
  70   Node* ld = make_load(control(), adr, elem, elem_type, adr_type, MemNode::unordered);
  71   push(ld);
  72 }
  73 
  74 
  75 //--------------------------------array_store----------------------------------
  76 void Parse::array_store(BasicType elem_type) {
  77   const Type* elem = Type::TOP;
  78   Node* adr = array_addressing(elem_type, 1, &elem);
  79   if (stopped())  return;     // guaranteed null or range check
  80   Node* val = pop();
  81   dec_sp(2);                  // Pop array and index
  82   const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type);
  83   if (elem == TypeInt::BOOL) {
  84     elem_type = T_BOOLEAN;
  85   }




  45 #include "opto/valuetypenode.hpp"
  46 #include "runtime/deoptimization.hpp"
  47 #include "runtime/sharedRuntime.hpp"
  48 
  49 #ifndef PRODUCT
  50 extern int explicit_null_checks_inserted,
  51            explicit_null_checks_elided;
  52 #endif
  53 
  54 //---------------------------------array_load----------------------------------
  55 void Parse::array_load(BasicType elem_type) {
  56   const Type* elem = Type::TOP;
  57   Node* adr = array_addressing(elem_type, 0, &elem);
  58   if (stopped())  return;     // guaranteed null or range check
  59   Node* idx   = pop();   // Get from stack without popping
  60   Node* ary   = pop();   // in case of exception
  61   //dec_sp(2);                  // Pop array and index
  62   const TypeAryPtr* arytype = _gvn.type(ary)->is_aryptr();
  63   if (arytype->klass()->is_value_array_klass()) {
  64     ciValueArrayKlass* vak = arytype->klass()->as_value_array_klass();
  65     ValueTypeNode* vt = ValueTypeNode::make_from_flattened(this, vak->element_klass()->as_value_klass(), ary, adr);
  66     push(vt);
  67     return;
  68   }
  69   const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type);
  70   Node* ld = make_load(control(), adr, elem, elem_type, adr_type, MemNode::unordered);
  71   push(ld);
  72 }
  73 
  74 
  75 //--------------------------------array_store----------------------------------
  76 void Parse::array_store(BasicType elem_type) {
  77   const Type* elem = Type::TOP;
  78   Node* adr = array_addressing(elem_type, 1, &elem);
  79   if (stopped())  return;     // guaranteed null or range check
  80   Node* val = pop();
  81   dec_sp(2);                  // Pop array and index
  82   const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type);
  83   if (elem == TypeInt::BOOL) {
  84     elem_type = T_BOOLEAN;
  85   }


< prev index next >