< prev index next >

src/hotspot/share/cds/cdsProtectionDomain.cpp

Print this page
*** 35,10 ***
--- 35,11 ---
  #include "classfile/vmSymbols.hpp"
  #include "memory/oopFactory.hpp"
  #include "memory/resourceArea.hpp"
  #include "memory/universe.hpp"
  #include "oops/instanceKlass.hpp"
+ #include "oops/refArrayOop.hpp"
  #include "oops/symbol.hpp"
  #include "runtime/javaCalls.hpp"
  
  OopHandle CDSProtectionDomain::_shared_protection_domains;
  OopHandle CDSProtectionDomain::_shared_jar_urls;

*** 294,11 ***
  void CDSProtectionDomain::atomic_set_array_index(OopHandle array, int index, oop o) {
    // Benign race condition:  array.obj_at(index) may already be filled in.
    // The important thing here is that all threads pick up the same result.
    // It doesn't matter which racing thread wins, as long as only one
    // result is used by all threads, and all future queries.
!   ((objArrayOop)array.resolve())->replace_if_null(index, o);
  }
  
  oop CDSProtectionDomain::shared_protection_domain(int index) {
    return ((objArrayOop)_shared_protection_domains.resolve())->obj_at(index);
  }
--- 295,11 ---
  void CDSProtectionDomain::atomic_set_array_index(OopHandle array, int index, oop o) {
    // Benign race condition:  array.obj_at(index) may already be filled in.
    // The important thing here is that all threads pick up the same result.
    // It doesn't matter which racing thread wins, as long as only one
    // result is used by all threads, and all future queries.
!   refArrayOopDesc::cast(array.resolve())->replace_if_null(index, o);
  }
  
  oop CDSProtectionDomain::shared_protection_domain(int index) {
    return ((objArrayOop)_shared_protection_domains.resolve())->obj_at(index);
  }
< prev index next >