提交 cd273b84 编写于 作者: S sangheki

8173013: JVMTI tagged object access needs G1 pre-barrier

Summary: Add missing G1 pre-barrier at TagObjectCollector::do_entry
Reviewed-by: kbarrett, tschatzl
上级 eb9e846d
/* /*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "services/serviceUtil.hpp" #include "services/serviceUtil.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_ALL_GCS
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
...@@ -1519,6 +1520,14 @@ class TagObjectCollector : public JvmtiTagHashmapEntryClosure { ...@@ -1519,6 +1520,14 @@ class TagObjectCollector : public JvmtiTagHashmapEntryClosure {
if (_tags[i] == entry->tag()) { if (_tags[i] == entry->tag()) {
oop o = entry->object(); oop o = entry->object();
assert(o != NULL && Universe::heap()->is_in_reserved(o), "sanity check"); assert(o != NULL && Universe::heap()->is_in_reserved(o), "sanity check");
#if INCLUDE_ALL_GCS
if (UseG1GC) {
// The reference in this tag map could be the only (implicitly weak)
// reference to that object. If we hand it out, we need to keep it live wrt
// SATB marking similar to other j.l.ref.Reference referents.
G1SATBCardTableModRefBS::enqueue(o);
}
#endif
jobject ref = JNIHandles::make_local(JavaThread::current(), o); jobject ref = JNIHandles::make_local(JavaThread::current(), o);
_object_results->append(ref); _object_results->append(ref);
_tag_results->append((uint64_t)entry->tag()); _tag_results->append((uint64_t)entry->tag());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册