< prev index next >

src/hotspot/share/opto/parse2.cpp

Print this page

        

@@ -52,11 +52,11 @@
 
 //---------------------------------array_load----------------------------------
 void Parse::array_load(BasicType bt) {
   const Type* elemtype = Type::TOP;
   bool big_val = bt == T_DOUBLE || bt == T_LONG;
-  Node* adr = array_addressing(bt, 0, &elemtype);
+  Node* adr = array_addressing(bt, 0, false, &elemtype);
   if (stopped())  return;     // guaranteed null or range check
 
   pop();                      // index (already used)
   Node* array = pop();        // the array itself
 

@@ -80,11 +80,11 @@
 
 //--------------------------------array_store----------------------------------
 void Parse::array_store(BasicType bt) {
   const Type* elemtype = Type::TOP;
   bool big_val = bt == T_DOUBLE || bt == T_LONG;
-  Node* adr = array_addressing(bt, big_val ? 2 : 1, &elemtype);
+  Node* adr = array_addressing(bt, big_val ? 2 : 1, true, &elemtype);
   if (stopped())  return;     // guaranteed null or range check
   if (bt == T_OBJECT) {
     array_store_check();
   }
   Node* val;                  // Oop to store

@@ -108,11 +108,11 @@
 }
 
 
 //------------------------------array_addressing-------------------------------
 // Pull array and index from the stack.  Compute pointer-to-element.
-Node* Parse::array_addressing(BasicType type, int vals, const Type* *result2) {
+Node* Parse::array_addressing(BasicType type, int vals, bool is_store, const Type* *result2) {
   Node *idx   = peek(0+vals);   // Get from stack without popping
   Node *ary   = peek(1+vals);   // in case of exception
 
   // Null check the array base, with correct stack contents
   ary = null_check(ary, T_ARRAY);

@@ -202,10 +202,16 @@
     }
   }
   // Check for always knowing you are throwing a range-check exception
   if (stopped())  return top();
 
+  if (is_store) {
+    ary = access_resolve_for_write(ary);
+  } else {
+    ary = access_resolve_for_read(ary);
+  }
+
   // Make array address computation control dependent to prevent it
   // from floating above the range check during loop optimizations.
   Node* ptr = array_element_address(ary, idx, type, sizetype, control());
 
   if (result2 != NULL)  *result2 = elemtype;

@@ -2747,10 +2753,16 @@
   handle_if_acmp:
     // If this is a backwards branch in the bytecodes, add Safepoint
     maybe_add_safepoint(iter().get_dest());
     a = pop();
     b = pop();
+#if INCLUDE_SHENANDOAHGC
+    if (UseShenandoahGC && ShenandoahAcmpBarrier) {
+      a = access_resolve_for_write(a);
+      b = access_resolve_for_write(b);
+    }
+#endif
     c = _gvn.transform( new CmpPNode(b, a) );
     c = optimize_cmp_with_klass(c);
     do_if(btest, c);
     break;
 
< prev index next >