Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
626458f7
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看板
提交
626458f7
编写于
3月 25, 2009
作者:
A
acorn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6603316: Improve instrumentation for classes loaded at startup
Reviewed-by: xlu, mchung
上级
bddea71a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
9 deletion
+37
-9
src/share/vm/classfile/classFileParser.cpp
src/share/vm/classfile/classFileParser.cpp
+2
-2
src/share/vm/prims/jni.cpp
src/share/vm/prims/jni.cpp
+14
-1
src/share/vm/prims/jvm.cpp
src/share/vm/prims/jvm.cpp
+20
-6
src/share/vm/prims/jvm_misc.hpp
src/share/vm/prims/jvm_misc.hpp
+1
-0
未找到文件。
src/share/vm/classfile/classFileParser.cpp
浏览文件 @
626458f7
...
...
@@ -3230,7 +3230,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name,
// print out the superclass.
const
char
*
from
=
Klass
::
cast
(
this_klass
())
->
external_name
();
if
(
this_klass
->
java_super
()
!=
NULL
)
{
tty
->
print
(
"RESOLVE %s %s
\n
"
,
from
,
instanceKlass
::
cast
(
this_klass
->
java_super
())
->
external_name
());
tty
->
print
(
"RESOLVE %s %s
(super)
\n
"
,
from
,
instanceKlass
::
cast
(
this_klass
->
java_super
())
->
external_name
());
}
// print out each of the interface classes referred to by this class.
objArrayHandle
local_interfaces
(
THREAD
,
this_klass
->
local_interfaces
());
...
...
@@ -3240,7 +3240,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name,
klassOop
k
=
klassOop
(
local_interfaces
->
obj_at
(
i
));
instanceKlass
*
to_class
=
instanceKlass
::
cast
(
k
);
const
char
*
to
=
to_class
->
external_name
();
tty
->
print
(
"RESOLVE %s %s
\n
"
,
from
,
to
);
tty
->
print
(
"RESOLVE %s %s
(interface)
\n
"
,
from
,
to
);
}
}
}
...
...
src/share/vm/prims/jni.cpp
浏览文件 @
626458f7
...
...
@@ -301,6 +301,10 @@ JNI_ENTRY(jclass, jni_DefineClass(JNIEnv *env, const char *name, jobject loaderR
klassOop
k
=
SystemDictionary
::
resolve_from_stream
(
class_name
,
class_loader
,
Handle
(),
&
st
,
CHECK_NULL
);
if
(
TraceClassResolution
&&
k
!=
NULL
)
{
trace_class_resolution
(
k
);
}
cls
=
(
jclass
)
JNIHandles
::
make_local
(
env
,
Klass
::
cast
(
k
)
->
java_mirror
());
return
cls
;
...
...
@@ -365,6 +369,10 @@ JNI_ENTRY(jclass, jni_FindClass(JNIEnv *env, const char *name))
result
=
find_class_from_class_loader
(
env
,
sym
,
true
,
loader
,
protection_domain
,
true
,
thread
);
if
(
TraceClassResolution
&&
result
!=
NULL
)
{
trace_class_resolution
(
java_lang_Class
::
as_klassOop
(
JNIHandles
::
resolve_non_null
(
result
)));
}
// If we were the first invocation of jni_FindClass, we enable compilation again
// rather than just allowing invocation counter to overflow and decay.
// Controlled by flag DelayCompilationDuringStartup.
...
...
@@ -2646,7 +2654,12 @@ static jclass lookupOne(JNIEnv* env, const char* name, TRAPS) {
Handle
protection_domain
;
// null protection domain
symbolHandle
sym
=
oopFactory
::
new_symbol_handle
(
name
,
CHECK_NULL
);
return
find_class_from_class_loader
(
env
,
sym
,
true
,
loader
,
protection_domain
,
true
,
CHECK_NULL
);
jclass
result
=
find_class_from_class_loader
(
env
,
sym
,
true
,
loader
,
protection_domain
,
true
,
CHECK_NULL
);
if
(
TraceClassResolution
&&
result
!=
NULL
)
{
trace_class_resolution
(
java_lang_Class
::
as_klassOop
(
JNIHandles
::
resolve_non_null
(
result
)));
}
return
result
;
}
// These lookups are done with the NULL (bootstrap) ClassLoader to
...
...
src/share/vm/prims/jvm.cpp
浏览文件 @
626458f7
...
...
@@ -64,6 +64,7 @@ static void trace_class_resolution_impl(klassOop to_class, TRAPS) {
ResourceMark
rm
;
int
line_number
=
-
1
;
const
char
*
source_file
=
NULL
;
const
char
*
trace
=
"explicit"
;
klassOop
caller
=
NULL
;
JavaThread
*
jthread
=
JavaThread
::
current
();
if
(
jthread
->
has_last_Java_frame
())
{
...
...
@@ -107,12 +108,21 @@ static void trace_class_resolution_impl(klassOop to_class, TRAPS) {
(
last_caller
->
name
()
==
vmSymbols
::
loadClassInternal_name
()
||
last_caller
->
name
()
==
vmSymbols
::
loadClass_name
()))
{
found_it
=
true
;
}
else
if
(
!
vfst
.
at_end
())
{
if
(
vfst
.
method
()
->
is_native
())
{
// JNI call
found_it
=
true
;
}
}
if
(
found_it
&&
!
vfst
.
at_end
())
{
// found the caller
caller
=
vfst
.
method
()
->
method_holder
();
line_number
=
vfst
.
method
()
->
line_number_from_bci
(
vfst
.
bci
());
symbolOop
s
=
instanceKlass
::
cast
(
vfst
.
method
()
->
method_holder
())
->
source_file_name
();
if
(
line_number
==
-
1
)
{
// show method name if it's a native method
trace
=
vfst
.
method
()
->
name_and_sig_as_C_string
();
}
symbolOop
s
=
instanceKlass
::
cast
(
caller
)
->
source_file_name
();
if
(
s
!=
NULL
)
{
source_file
=
s
->
as_C_string
();
}
...
...
@@ -124,15 +134,15 @@ static void trace_class_resolution_impl(klassOop to_class, TRAPS) {
const
char
*
to
=
Klass
::
cast
(
to_class
)
->
external_name
();
// print in a single call to reduce interleaving between threads
if
(
source_file
!=
NULL
)
{
tty
->
print
(
"RESOLVE %s %s %s:%d (
explicit)
\n
"
,
from
,
to
,
source_file
,
line_number
);
tty
->
print
(
"RESOLVE %s %s %s:%d (
%s)
\n
"
,
from
,
to
,
source_file
,
line_number
,
trace
);
}
else
{
tty
->
print
(
"RESOLVE %s %s (
explicit)
\n
"
,
from
,
to
);
tty
->
print
(
"RESOLVE %s %s (
%s)
\n
"
,
from
,
to
,
trace
);
}
}
}
}
static
void
trace_class_resolution
(
klassOop
to_class
)
{
void
trace_class_resolution
(
klassOop
to_class
)
{
EXCEPTION_MARK
;
trace_class_resolution_impl
(
to_class
,
THREAD
);
if
(
HAS_PENDING_EXCEPTION
)
{
...
...
@@ -3213,8 +3223,12 @@ JVM_ENTRY(jclass, JVM_LoadClass0(JNIEnv *env, jobject receiver,
}
Handle
h_loader
(
THREAD
,
loader
);
Handle
h_prot
(
THREAD
,
protection_domain
);
return
find_class_from_class_loader
(
env
,
name
,
true
,
h_loader
,
h_prot
,
false
,
thread
);
jclass
result
=
find_class_from_class_loader
(
env
,
name
,
true
,
h_loader
,
h_prot
,
false
,
thread
);
if
(
TraceClassResolution
&&
result
!=
NULL
)
{
trace_class_resolution
(
java_lang_Class
::
as_klassOop
(
JNIHandles
::
resolve_non_null
(
result
)));
}
return
result
;
JVM_END
...
...
src/share/vm/prims/jvm_misc.hpp
浏览文件 @
626458f7
...
...
@@ -27,6 +27,7 @@
jclass
find_class_from_class_loader
(
JNIEnv
*
env
,
symbolHandle
name
,
jboolean
init
,
Handle
loader
,
Handle
protection_domain
,
jboolean
throwError
,
TRAPS
);
void
trace_class_resolution
(
klassOop
to_class
);
/*
* Support for Serialization and RMI. Currently used by HotSpot only.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录