Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
52087b0d
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
52087b0d
编写于
2月 02, 2016
作者:
S
shade
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8059677: Thread.getName() instantiates Strings
Reviewed-by: coleenp, dholmes, sla
上级
5abb9f95
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
22 addition
and
25 deletion
+22
-25
agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
.../src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
+3
-3
src/share/vm/classfile/javaClasses.cpp
src/share/vm/classfile/javaClasses.cpp
+5
-8
src/share/vm/classfile/javaClasses.hpp
src/share/vm/classfile/javaClasses.hpp
+3
-3
src/share/vm/prims/jvmtiEnv.cpp
src/share/vm/prims/jvmtiEnv.cpp
+4
-4
src/share/vm/prims/jvmtiTrace.cpp
src/share/vm/prims/jvmtiTrace.cpp
+3
-3
src/share/vm/runtime/thread.cpp
src/share/vm/runtime/thread.cpp
+4
-4
未找到文件。
agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
浏览文件 @
52087b0d
/*
* Copyright (c) 2000, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
6
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -219,7 +219,7 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
if
(
threadNameField
==
null
)
{
SystemDictionary
sysDict
=
VM
.
getVM
().
getSystemDictionary
();
InstanceKlass
k
=
sysDict
.
getThreadKlass
();
threadNameField
=
(
OopField
)
k
.
findField
(
"name"
,
"
[C
"
);
threadNameField
=
(
OopField
)
k
.
findField
(
"name"
,
"
Ljava/lang/String;
"
);
threadGroupField
=
(
OopField
)
k
.
findField
(
"group"
,
"Ljava/lang/ThreadGroup;"
);
threadEETopField
=
(
LongField
)
k
.
findField
(
"eetop"
,
"J"
);
threadTIDField
=
(
LongField
)
k
.
findField
(
"tid"
,
"J"
);
...
...
@@ -258,7 +258,7 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
public
static
String
threadOopGetName
(
Oop
threadOop
)
{
initThreadFields
();
return
charArrayToString
((
TypeArray
)
threadNameField
.
getValue
(
threadOop
));
return
stringOopToString
(
threadNameField
.
getValue
(
threadOop
));
}
/** May return null if, e.g., thread was not started */
...
...
src/share/vm/classfile/javaClasses.cpp
浏览文件 @
52087b0d
/*
* Copyright (c) 1997, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
6
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -936,7 +936,7 @@ void java_lang_Thread::compute_offsets() {
assert
(
_group_offset
==
0
,
"offsets should be initialized only once"
);
Klass
*
k
=
SystemDictionary
::
Thread_klass
();
compute_offset
(
_name_offset
,
k
,
vmSymbols
::
name_name
(),
vmSymbols
::
char_array
_signature
());
compute_offset
(
_name_offset
,
k
,
vmSymbols
::
name_name
(),
vmSymbols
::
string
_signature
());
compute_offset
(
_group_offset
,
k
,
vmSymbols
::
group_name
(),
vmSymbols
::
threadgroup_signature
());
compute_offset
(
_contextClassLoader_offset
,
k
,
vmSymbols
::
contextClassLoader_name
(),
vmSymbols
::
classloader_signature
());
compute_offset
(
_inheritedAccessControlContext_offset
,
k
,
vmSymbols
::
inheritedAccessControlContext_name
(),
vmSymbols
::
accesscontrolcontext_signature
());
...
...
@@ -966,15 +966,12 @@ void java_lang_Thread::set_thread(oop java_thread, JavaThread* thread) {
}
typeArrayOop
java_lang_Thread
::
name
(
oop
java_thread
)
{
oop
name
=
java_thread
->
obj_field
(
_name_offset
);
assert
(
name
==
NULL
||
(
name
->
is_typeArray
()
&&
TypeArrayKlass
::
cast
(
name
->
klass
())
->
element_type
()
==
T_CHAR
),
"just checking"
);
return
typeArrayOop
(
name
);
oop
java_lang_Thread
::
name
(
oop
java_thread
)
{
return
java_thread
->
obj_field
(
_name_offset
);
}
void
java_lang_Thread
::
set_name
(
oop
java_thread
,
typeArrayOop
name
)
{
assert
(
java_thread
->
obj_field
(
_name_offset
)
==
NULL
,
"name should be NULL"
);
void
java_lang_Thread
::
set_name
(
oop
java_thread
,
oop
name
)
{
java_thread
->
obj_field_put
(
_name_offset
,
name
);
}
...
...
src/share/vm/classfile/javaClasses.hpp
浏览文件 @
52087b0d
/*
* Copyright (c) 1997, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
6
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -343,8 +343,8 @@ class java_lang_Thread : AllStatic {
// Set JavaThread for instance
static
void
set_thread
(
oop
java_thread
,
JavaThread
*
thread
);
// Name
static
typeArrayO
op
name
(
oop
java_thread
);
static
void
set_name
(
oop
java_thread
,
typeArrayO
op
name
);
static
o
op
name
(
oop
java_thread
);
static
void
set_name
(
oop
java_thread
,
o
op
name
);
// Priority
static
ThreadPriority
priority
(
oop
java_thread
);
static
void
set_priority
(
oop
java_thread
,
ThreadPriority
priority
);
...
...
src/share/vm/prims/jvmtiEnv.cpp
浏览文件 @
52087b0d
/*
* Copyright (c) 2003, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
6
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -946,7 +946,7 @@ JvmtiEnv::GetThreadInfo(jthread thread, jvmtiThreadInfo* info_ptr) {
return
JVMTI_ERROR_INVALID_THREAD
;
Handle
thread_obj
(
current_thread
,
thread_oop
);
typeArrayHandle
name
;
Handle
name
;
ThreadPriority
priority
;
Handle
thread_group
;
Handle
context_class_loader
;
...
...
@@ -954,7 +954,7 @@ JvmtiEnv::GetThreadInfo(jthread thread, jvmtiThreadInfo* info_ptr) {
{
MutexLocker
mu
(
Threads_lock
);
name
=
typeArray
Handle
(
current_thread
,
java_lang_Thread
::
name
(
thread_obj
()));
name
=
Handle
(
current_thread
,
java_lang_Thread
::
name
(
thread_obj
()));
priority
=
java_lang_Thread
::
priority
(
thread_obj
());
thread_group
=
Handle
(
current_thread
,
java_lang_Thread
::
threadGroup
(
thread_obj
()));
is_daemon
=
java_lang_Thread
::
is_daemon
(
thread_obj
());
...
...
@@ -965,7 +965,7 @@ JvmtiEnv::GetThreadInfo(jthread thread, jvmtiThreadInfo* info_ptr) {
{
const
char
*
n
;
if
(
name
()
!=
NULL
)
{
n
=
UNICODE
::
as_utf8
((
jchar
*
)
name
->
base
(
T_CHAR
),
name
->
length
());
n
=
java_lang_String
::
as_utf8_string
(
name
());
}
else
{
n
=
UNICODE
::
as_utf8
(
NULL
,
0
);
}
...
...
src/share/vm/prims/jvmtiTrace.cpp
浏览文件 @
52087b0d
/*
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
6
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -266,11 +266,11 @@ const char *JvmtiTrace::safe_get_thread_name(Thread *thread) {
if
(
threadObj
==
NULL
)
{
return
"NULL"
;
}
typeArrayO
op
name
=
java_lang_Thread
::
name
(
threadObj
);
o
op
name
=
java_lang_Thread
::
name
(
threadObj
);
if
(
name
==
NULL
)
{
return
"<NOT FILLED IN>"
;
}
return
UNICODE
::
as_utf8
((
jchar
*
)
name
->
base
(
T_CHAR
),
name
->
length
()
);
return
java_lang_String
::
as_utf8_string
(
name
);
}
...
...
src/share/vm/runtime/thread.cpp
浏览文件 @
52087b0d
/*
* Copyright (c) 1997, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
6
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -2926,13 +2926,13 @@ const char* JavaThread::get_thread_name_string(char* buf, int buflen) const {
const
char
*
name_str
;
oop
thread_obj
=
threadObj
();
if
(
thread_obj
!=
NULL
)
{
typeArrayO
op
name
=
java_lang_Thread
::
name
(
thread_obj
);
o
op
name
=
java_lang_Thread
::
name
(
thread_obj
);
if
(
name
!=
NULL
)
{
if
(
buf
==
NULL
)
{
name_str
=
UNICODE
::
as_utf8
((
jchar
*
)
name
->
base
(
T_CHAR
),
name
->
length
()
);
name_str
=
java_lang_String
::
as_utf8_string
(
name
);
}
else
{
name_str
=
UNICODE
::
as_utf8
((
jchar
*
)
name
->
base
(
T_CHAR
),
name
->
length
()
,
buf
,
buflen
);
name_str
=
java_lang_String
::
as_utf8_string
(
name
,
buf
,
buflen
);
}
}
else
if
(
is_attaching_via_jni
())
{
// workaround for 6412693 - see 6404306
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录