< prev index next >
src/share/vm/prims/jvm.cpp
Print this page
@@ -71,10 +71,11 @@
#include "utilities/copy.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
#include "utilities/histogram.hpp"
+#include "utilities/macros.hpp"
#include "utilities/top.hpp"
#include "utilities/utf8.hpp"
#ifdef TARGET_OS_FAMILY_linux
# include "jvm_linux.h"
#endif
@@ -91,10 +92,11 @@
# include "jvm_bsd.h"
#endif
#if INCLUDE_ALL_GCS
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/shenandoah/shenandoahBarrierSetClone.inline.hpp"
#endif // INCLUDE_ALL_GCS
#include <errno.h>
#include <jfr/recorder/jfrRecorder.hpp>
@@ -607,11 +609,11 @@
static void fixup_cloned_reference(ReferenceType ref_type, oop src, oop clone) {
// If G1 is enabled then we need to register a non-null referent
// with the SATB barrier.
#if INCLUDE_ALL_GCS
- if (UseG1GC) {
+ if (UseG1GC || (UseShenandoahGC && ShenandoahSATBBarrier)) {
oop referent = java_lang_ref_Reference::referent(clone);
if (referent != NULL) {
G1SATBCardTableModRefBS::enqueue(referent);
}
}
@@ -664,10 +666,16 @@
!klass->is_subclass_of(SystemDictionary::Reference_klass()),
"invariant");
new_obj_oop = CollectedHeap::obj_allocate(klass, size, CHECK_NULL);
}
+#if INCLUDE_ALL_GCS
+ if (UseShenandoahGC && ShenandoahCloneBarrier) {
+ ShenandoahBarrierSet::barrier_set()->clone_barrier_runtime(obj());
+ }
+#endif
+
// 4839641 (4840070): We must do an oop-atomic copy, because if another thread
// is modifying a reference field in the clonee, a non-oop-atomic copy might
// be suspended in the middle of copying the pointer and end up with parts
// of two different pointers in the field. Subsequent dereferences will crash.
// 4846409: an oop-copy of objects with long or double fields or arrays of same
@@ -1170,11 +1178,10 @@
}
return (jclass) JNIHandles::make_local(env, k->java_mirror());
}
-
JVM_ENTRY(jclass, JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd))
JVMWrapper2("JVM_DefineClass %s", name);
return jvm_define_class_common(env, name, loader, buf, len, pd, NULL, true, THREAD);
JVM_END
< prev index next >