Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
5ec82f18
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5ec82f18
编写于
1月 12, 2011
作者:
K
kevinw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6994753: Implement optional hook to a Java method at VM startup.
Reviewed-by: mchung, acorn
上级
d2da833b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
43 addition
and
14 deletion
+43
-14
src/share/vm/classfile/systemDictionary.hpp
src/share/vm/classfile/systemDictionary.hpp
+3
-1
src/share/vm/classfile/vmSymbols.hpp
src/share/vm/classfile/vmSymbols.hpp
+2
-1
src/share/vm/prims/jvm.h
src/share/vm/prims/jvm.h
+3
-2
src/share/vm/runtime/arguments.cpp
src/share/vm/runtime/arguments.cpp
+2
-4
src/share/vm/runtime/java.cpp
src/share/vm/runtime/java.cpp
+3
-2
src/share/vm/runtime/java.hpp
src/share/vm/runtime/java.hpp
+9
-4
src/share/vm/runtime/thread.cpp
src/share/vm/runtime/thread.cpp
+21
-0
未找到文件。
src/share/vm/classfile/systemDictionary.hpp
浏览文件 @
5ec82f18
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
1
, 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
...
...
@@ -172,6 +172,8 @@ class SymbolPropertyTable;
\
template(sun_jkernel_DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel) \
\
template(sun_misc_PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt) \
\
/* Preload boxing klasses */
\
template(Boolean_klass, java_lang_Boolean, Pre) \
template(Character_klass, java_lang_Character, Pre) \
...
...
src/share/vm/classfile/vmSymbols.hpp
浏览文件 @
5ec82f18
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
1
, 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
...
...
@@ -111,6 +111,7 @@
template(sun_jkernel_DownloadManager, "sun/jkernel/DownloadManager") \
template(getBootClassPathEntryForClass_name, "getBootClassPathEntryForClass") \
template(setBootClassLoaderHook_name, "setBootClassLoaderHook") \
template(sun_misc_PostVMInitHook, "sun/misc/PostVMInitHook") \
\
/* class file format tags */
\
template(tag_source_file, "SourceFile") \
...
...
src/share/vm/prims/jvm.h
浏览文件 @
5ec82f18
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
1
, 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
...
...
@@ -1649,7 +1649,8 @@ typedef struct {
* the new bit is also added in the main/baseline.
*/
unsigned
int
thread_park_blocker
:
1
;
unsigned
int
:
31
;
unsigned
int
post_vm_init_hook_enabled
:
1
;
unsigned
int
:
30
;
unsigned
int
:
32
;
unsigned
int
:
32
;
}
jdk_version_info
;
...
...
src/share/vm/runtime/arguments.cpp
浏览文件 @
5ec82f18
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
1
, 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
...
...
@@ -918,9 +918,7 @@ bool Arguments::add_property(const char* prop) {
}
else
if
(
strcmp
(
key
,
"sun.java.command"
)
==
0
)
{
_java_command
=
value
;
// don't add this property to the properties exposed to the java application
FreeHeap
(
key
);
return
true
;
// Record value in Arguments, but let it get passed to Java.
}
else
if
(
strcmp
(
key
,
"sun.java.launcher.pid"
)
==
0
)
{
// launcher.pid property is private and is processed
// in process_sun_java_launcher_properties();
...
...
src/share/vm/runtime/java.cpp
浏览文件 @
5ec82f18
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
1
, 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
...
...
@@ -663,7 +663,8 @@ void JDK_Version::initialize() {
}
_current
=
JDK_Version
(
major
,
minor
,
micro
,
info
.
update_version
,
info
.
special_update_version
,
build
,
info
.
thread_park_blocker
==
1
);
info
.
thread_park_blocker
==
1
,
info
.
post_vm_init_hook_enabled
==
1
);
}
}
...
...
src/share/vm/runtime/java.hpp
浏览文件 @
5ec82f18
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
1
, 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
...
...
@@ -92,6 +92,7 @@ class JDK_Version VALUE_OBJ_CLASS_SPEC {
bool
_partially_initialized
;
bool
_thread_park_blocker
;
bool
_post_vm_init_hook_enabled
;
bool
is_valid
()
const
{
return
(
_major
!=
0
||
_partially_initialized
);
...
...
@@ -113,14 +114,15 @@ class JDK_Version VALUE_OBJ_CLASS_SPEC {
JDK_Version
()
:
_major
(
0
),
_minor
(
0
),
_micro
(
0
),
_update
(
0
),
_special
(
0
),
_build
(
0
),
_partially_initialized
(
false
),
_thread_park_blocker
(
false
)
{}
_thread_park_blocker
(
false
)
,
_post_vm_init_hook_enabled
(
false
)
{}
JDK_Version
(
uint8_t
major
,
uint8_t
minor
=
0
,
uint8_t
micro
=
0
,
uint8_t
update
=
0
,
uint8_t
special
=
0
,
uint8_t
build
=
0
,
bool
thread_park_blocker
=
false
)
:
bool
thread_park_blocker
=
false
,
bool
post_vm_init_hook_enabled
=
false
)
:
_major
(
major
),
_minor
(
minor
),
_micro
(
micro
),
_update
(
update
),
_special
(
special
),
_build
(
build
),
_partially_initialized
(
false
),
_thread_park_blocker
(
thread_park_blocker
)
{}
_thread_park_blocker
(
thread_park_blocker
),
_post_vm_init_hook_enabled
(
post_vm_init_hook_enabled
)
{}
// Returns the current running JDK version
static
JDK_Version
current
()
{
return
_current
;
}
...
...
@@ -144,6 +146,9 @@ class JDK_Version VALUE_OBJ_CLASS_SPEC {
bool
supports_thread_park_blocker
()
const
{
return
_thread_park_blocker
;
}
bool
post_vm_init_hook_enabled
()
const
{
return
_post_vm_init_hook_enabled
;
}
// Performs a full ordering comparison using all fields (update, build, etc.)
int
compare
(
const
JDK_Version
&
other
)
const
;
...
...
src/share/vm/runtime/thread.cpp
浏览文件 @
5ec82f18
...
...
@@ -978,6 +978,19 @@ static void set_jkernel_boot_classloader_hook(TRAPS) {
}
#endif // KERNEL
// General purpose hook into Java code, run once when the VM is initialized.
// The Java library method itself may be changed independently from the VM.
static
void
call_postVMInitHook
(
TRAPS
)
{
klassOop
k
=
SystemDictionary
::
sun_misc_PostVMInitHook_klass
();
instanceKlassHandle
klass
(
THREAD
,
k
);
if
(
klass
.
not_null
())
{
JavaValue
result
(
T_VOID
);
JavaCalls
::
call_static
(
&
result
,
klass
,
vmSymbolHandles
::
run_method_name
(),
vmSymbolHandles
::
void_method_signature
(),
CHECK
);
}
}
static
void
reset_vm_info_property
(
TRAPS
)
{
// the vm info string
ResourceMark
rm
(
THREAD
);
...
...
@@ -3346,6 +3359,14 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
BiasedLocking
::
init
();
if
(
JDK_Version
::
current
().
post_vm_init_hook_enabled
())
{
call_postVMInitHook
(
THREAD
);
// The Java side of PostVMInitHook.run must deal with all
// exceptions and provide means of diagnosis.
if
(
HAS_PENDING_EXCEPTION
)
{
CLEAR_PENDING_EXCEPTION
;
}
}
// Start up the WatcherThread if there are any periodic tasks
// NOTE: All PeriodicTasks should be registered by now. If they
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录