1 Star 0 Fork 27

zhangxianting/openjdk-17

forked from src-openEuler/openjdk-17 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
add-8271579-G1-Move-copy-before-CAS-in-do_copy.patch 1.98 KB
一键复制 编辑 原始数据 按行查看 历史
From fc855b8ef1862144827199a06d0bb13ddf696dd9 Mon Sep 17 00:00:00 2001
Date: Thu, 21 Sep 2023 16:43:49 +0800
Subject: add 8271579-G1-Move-copy-before-CAS-in-do_copy
---
src/hotspot/share/gc/g1/g1ParScanThreadState.cpp | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
index 896c891ae..49d627205 100644
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
@@ -459,11 +459,11 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio
// We're going to allocate linearly, so might as well prefetch ahead.
Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes);
+ Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(old), obj_ptr, word_sz);
const oop obj = cast_to_oop(obj_ptr);
const oop forward_ptr = old->forward_to_atomic(obj, old_mark, memory_order_relaxed);
if (forward_ptr == NULL) {
- Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(old), obj_ptr, word_sz);
{
const uint young_index = from_region->young_index_in_cset();
@@ -475,19 +475,9 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio
if (dest_attr.is_young()) {
if (age < markWord::max_age) {
age++;
- }
- if (old_mark.has_displaced_mark_helper()) {
- // In this case, we have to install the old mark word containing the
- // displacement tag, and update the age in the displaced mark word.
- markWord new_mark = old_mark.displaced_mark_helper().set_age(age);
- old_mark.set_displaced_mark_helper(new_mark);
- obj->set_mark(old_mark);
- } else {
- obj->set_mark(old_mark.set_age(age));
+ obj->incr_age();
}
_age_table.add(age, word_sz);
- } else {
- obj->set_mark(old_mark);
}
// Most objects are not arrays, so do one array check rather than
--
2.22.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangxianting/openjdk-17.git
git@gitee.com:zhangxianting/openjdk-17.git
zhangxianting
openjdk-17
openjdk-17
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385