< prev index next >

src/hotspot/share/opto/parse2.cpp

Print this page

  82   Node* adr = array_addressing(bt, big_val ? 2 : 1, elemtype);
  83   if (stopped())  return;     // guaranteed null or range check
  84   if (bt == T_OBJECT) {
  85     array_store_check();
  86     if (stopped()) {
  87       return;
  88     }
  89   }
  90   Node* val;                  // Oop to store
  91   if (big_val) {
  92     val = pop_pair();
  93   } else {
  94     val = pop();
  95   }
  96   pop();                      // index (already used)
  97   Node* array = pop();        // the array itself
  98 
  99   if (elemtype == TypeInt::BOOL) {
 100     bt = T_BOOLEAN;
 101   }











 102   const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(bt);
 103 
 104   access_store_at(array, adr, adr_type, val, elemtype, bt, MO_UNORDERED | IN_HEAP | IS_ARRAY);
 105 }
 106 
 107 
 108 //------------------------------array_addressing-------------------------------
 109 // Pull array and index from the stack.  Compute pointer-to-element.
 110 Node* Parse::array_addressing(BasicType type, int vals, const Type*& elemtype) {
 111   Node *idx   = peek(0+vals);   // Get from stack without popping
 112   Node *ary   = peek(1+vals);   // in case of exception
 113 
 114   // Null check the array base, with correct stack contents
 115   ary = null_check(ary, T_ARRAY);
 116   // Compile-time detect of null-exception?
 117   if (stopped())  return top();
 118 
 119   const TypeAryPtr* arytype  = _gvn.type(ary)->is_aryptr();
 120   const TypeInt*    sizetype = arytype->size();
 121   elemtype = arytype->elem();

  82   Node* adr = array_addressing(bt, big_val ? 2 : 1, elemtype);
  83   if (stopped())  return;     // guaranteed null or range check
  84   if (bt == T_OBJECT) {
  85     array_store_check();
  86     if (stopped()) {
  87       return;
  88     }
  89   }
  90   Node* val;                  // Oop to store
  91   if (big_val) {
  92     val = pop_pair();
  93   } else {
  94     val = pop();
  95   }
  96   pop();                      // index (already used)
  97   Node* array = pop();        // the array itself
  98 
  99   if (elemtype == TypeInt::BOOL) {
 100     bt = T_BOOLEAN;
 101   }
 102 
 103   if (DoPartialEscapeAnalysis && bt == T_OBJECT) {
 104     PartialEscapeAnalysis* pea = PEA();
 105     PEAState& as = jvms()->alloc_state();
 106     VirtualState* obj_vs = as.as_virtual(pea, val);    // obj is tracked and Virtual
 107     VirtualState* ary_vs = as.as_virtual(pea, array);  // array is not-tracked or Escaped
 108 
 109     if (ary_vs == nullptr && obj_vs != nullptr) {
 110       val = as.materialize(this, val);
 111     }
 112   }
 113   const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(bt);
 114 
 115   access_store_at(array, adr, adr_type, val, elemtype, bt, MO_UNORDERED | IN_HEAP | IS_ARRAY);
 116 }
 117 
 118 
 119 //------------------------------array_addressing-------------------------------
 120 // Pull array and index from the stack.  Compute pointer-to-element.
 121 Node* Parse::array_addressing(BasicType type, int vals, const Type*& elemtype) {
 122   Node *idx   = peek(0+vals);   // Get from stack without popping
 123   Node *ary   = peek(1+vals);   // in case of exception
 124 
 125   // Null check the array base, with correct stack contents
 126   ary = null_check(ary, T_ARRAY);
 127   // Compile-time detect of null-exception?
 128   if (stopped())  return top();
 129 
 130   const TypeAryPtr* arytype  = _gvn.type(ary)->is_aryptr();
 131   const TypeInt*    sizetype = arytype->size();
 132   elemtype = arytype->elem();
< prev index next >