1 Star 0 Fork 81

Alex Gao/openjdk-1.8.0

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Huawei-Keep-objects-when-remove-unshareable-info.patch 3.70 KB
一键复制 编辑 原始数据 按行查看 历史
佛系少年中二 提交于 2024-07-19 15:08 . update to jdk8u422
From 844511f2b4b6a4be079fc5ac2f2d5b56826df85a Mon Sep 17 00:00:00 2001
Date: Tue, 4 Jun 2024 19:09:40 +0800
Subject: [PATCH] [Huawei]Keep objects when remove unshareable info
---
hotspot/src/share/vm/oops/instanceKlass.cpp | 18 +++---------------
.../Thread/TestThreadDumpClassInitMonitor.java | 15 +++++++++++----
2 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index 833cf9afe..df9aaabfb 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -2467,21 +2467,6 @@ void InstanceKlass::remove_unshareable_info() {
m->remove_unshareable_info();
}
- if (UseAppCDS || DynamicDumpSharedSpaces) {
- if (_oop_map_cache != NULL) {
- delete _oop_map_cache;
- _oop_map_cache = NULL;
- }
-
- JNIid::deallocate(jni_ids());
- set_jni_ids(NULL);
-
- jmethodID* jmeths = methods_jmethod_ids_acquire();
- if (jmeths != (jmethodID*)NULL) {
- release_set_methods_jmethod_ids(NULL);
- FreeHeap(jmeths);
- }
- }
// do array classes also.
array_klasses_do(remove_unshareable_in_class);
// These are not allocated from metaspace. They are safe to set to NULL.
@@ -2489,6 +2474,9 @@ void InstanceKlass::remove_unshareable_info() {
_member_names = NULL;
_osr_nmethods_head = NULL;
_init_thread = NULL;
+ _oop_map_cache = NULL;
+ _jni_ids = NULL;
+ _methods_jmethod_ids = NULL;
}
void InstanceKlass::remove_java_mirror() {
diff --git a/hotspot/test/runtime/Thread/TestThreadDumpClassInitMonitor.java b/hotspot/test/runtime/Thread/TestThreadDumpClassInitMonitor.java
index 8aa218efb..a2111c362 100644
--- a/hotspot/test/runtime/Thread/TestThreadDumpClassInitMonitor.java
+++ b/hotspot/test/runtime/Thread/TestThreadDumpClassInitMonitor.java
@@ -148,34 +148,41 @@ public class TestThreadDumpClassInitMonitor {
throw new Error("Unexpected thread state line: " + line);
}
if (isProduct) {
- foundLines += 3;
+ foundLines += 4;
} else {
foundLines++;
}
continue;
}
case 2: { // Debug build
+ if (!line.trim().equals(JAVATHREAD_STATE)) {
+ throw new Error("Unexpected JavaThread state line: " + line);
+ }
+ foundLines++;
+ continue;
+ }
+ case 3: { // Debug build
if (!line.startsWith(THREAD_INFO)) {
throw new Error("Unexpected thread info line: " + line);
}
foundLines++;
continue;
}
- case 3: { // Debug build
+ case 4: { // Debug build
if (!line.trim().equals(JAVATHREAD_STATE)) {
throw new Error("Unexpected JavaThread state line: " + line);
}
foundLines++;
continue;
}
- case 4: {
+ case 5: {
if (!line.trim().startsWith(CURRENT_METHOD)) {
throw new Error("Unexpected current method line: " + line);
}
foundLines++;
continue;
}
- case 5: {
+ case 6: {
if (!line.trim().equals(WAIT_INFO)) {
throw new Error("Unexpected monitor information line: " + line);
}
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gaoxiang90/openjdk-1.8.0.git
git@gitee.com:gaoxiang90/openjdk-1.8.0.git
gaoxiang90
openjdk-1.8.0
openjdk-1.8.0
master

搜索帮助