< prev index next >

src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp

Print this page
*** 416,11 ***
      MemNode* mem = node->as_Mem();
      mem->set_barrier_data(0);
    }
  }
  
! void ShenandoahBarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const {
    eliminate_gc_barrier_data(node);
  }
  
  void ShenandoahBarrierSetC2::elide_dominated_barrier(MachNode* node, MachNode* dominator) const {
    uint8_t orig_bd = node->barrier_data();
--- 416,11 ---
      MemNode* mem = node->as_Mem();
      mem->set_barrier_data(0);
    }
  }
  
! void ShenandoahBarrierSetC2::eliminate_gc_barrier(PhaseIterGVN* macro, Node* node) const {
    eliminate_gc_barrier_data(node);
  }
  
  void ShenandoahBarrierSetC2::elide_dominated_barrier(MachNode* node, MachNode* dominator) const {
    uint8_t orig_bd = node->barrier_data();

*** 555,12 ***
        return false;
      }
    } else if (src_type->isa_aryptr() != nullptr) {
      // Array: need barrier only if array is oop-bearing.
      BasicType src_elem = src_type->isa_aryptr()->elem()->array_element_basic_type();
!     if (is_reference_type(src_elem, true)) {
        is_oop_array = true;
      } else {
        return false;
      }
    }
  
--- 555,14 ---
        return false;
      }
    } else if (src_type->isa_aryptr() != nullptr) {
      // Array: need barrier only if array is oop-bearing.
      BasicType src_elem = src_type->isa_aryptr()->elem()->array_element_basic_type();
!     if (is_reference_type(src_elem, true) && src_type->is_not_flat()) {
        is_oop_array = true;
+     } else if (!src_type->is_not_flat()) {
+       // Maybe flat, assume the worst.
      } else {
        return false;
      }
    }
  

*** 634,10 ***
--- 636,16 ---
    // This is the full clone, so offsets should equal each other and be at array base.
    assert(src_offset == dest_offset, "should be equal");
    const jlong offset = src_offset->get_long();
    const TypeAryPtr* const ary_ptr = src->get_ptr_type()->isa_aryptr();
    BasicType bt = ary_ptr->elem()->array_element_basic_type();
+   if (offset != arrayOopDesc::base_offset_in_bytes(bt)) {
+     // Something is off with flat arrays. Go to runtime instead.
+     // TODO: Figure this out.
+     clone_in_runtime(phase, ac, ShenandoahRuntime::clone_addr(), "ShenandoahRuntime::clone");
+     return;
+   }
    assert(offset == arrayOopDesc::base_offset_in_bytes(bt), "should match");
  
    const char*   copyfunc_name = "arraycopy";
    const address copyfunc_addr = phase->basictype2arraycopy(T_OBJECT, nullptr, nullptr, true, copyfunc_name, true);
  
< prev index next >