Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
c5aa05e3
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看板
提交
c5aa05e3
编写于
12月 14, 2009
作者:
D
dcubed
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
9d885a3d
6d40fb4e
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
93 addition
and
19 deletion
+93
-19
src/share/vm/prims/jvmtiEnv.cpp
src/share/vm/prims/jvmtiEnv.cpp
+29
-9
src/share/vm/prims/jvmtiEnvBase.cpp
src/share/vm/prims/jvmtiEnvBase.cpp
+20
-1
src/share/vm/prims/jvmtiEnvBase.hpp
src/share/vm/prims/jvmtiEnvBase.hpp
+6
-2
src/share/vm/prims/jvmtiExport.cpp
src/share/vm/prims/jvmtiExport.cpp
+32
-3
src/share/vm/prims/jvmtiExport.hpp
src/share/vm/prims/jvmtiExport.hpp
+3
-1
src/share/vm/prims/jvmtiHpp.xsl
src/share/vm/prims/jvmtiHpp.xsl
+3
-3
未找到文件。
src/share/vm/prims/jvmtiEnv.cpp
浏览文件 @
c5aa05e3
/*
* Copyright 2003-200
7
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2003-200
9
Sun Microsystems, Inc. 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
...
...
@@ -32,15 +32,15 @@
// FIXLATER: hook into JvmtiTrace
#define TraceJVMTICalls false
JvmtiEnv
::
JvmtiEnv
(
)
:
JvmtiEnvBase
(
)
{
JvmtiEnv
::
JvmtiEnv
(
jint
version
)
:
JvmtiEnvBase
(
version
)
{
}
JvmtiEnv
::~
JvmtiEnv
()
{
}
JvmtiEnv
*
JvmtiEnv
::
create_a_jvmti
()
{
return
new
JvmtiEnv
();
JvmtiEnv
::
create_a_jvmti
(
jint
version
)
{
return
new
JvmtiEnv
(
version
);
}
// VM operation class to copy jni function table at safepoint.
...
...
@@ -411,8 +411,15 @@ JvmtiEnv::AddToBootstrapClassLoaderSearch(const char* segment) {
if
(
phase
==
JVMTI_PHASE_ONLOAD
)
{
Arguments
::
append_sysclasspath
(
segment
);
return
JVMTI_ERROR_NONE
;
}
else
{
assert
(
phase
==
JVMTI_PHASE_LIVE
,
"sanity check"
);
}
else
if
(
use_version_1_0_semantics
())
{
// This JvmtiEnv requested version 1.0 semantics and this function
// is only allowed in the ONLOAD phase in version 1.0 so we need to
// return an error here.
return
JVMTI_ERROR_WRONG_PHASE
;
}
else
if
(
phase
==
JVMTI_PHASE_LIVE
)
{
// The phase is checked by the wrapper that called this function,
// but this thread could be racing with the thread that is
// terminating the VM so we check one more time.
// create the zip entry
ClassPathZipEntry
*
zip_entry
=
ClassLoader
::
create_class_path_zip_entry
(
segment
);
...
...
@@ -433,6 +440,8 @@ JvmtiEnv::AddToBootstrapClassLoaderSearch(const char* segment) {
}
ClassLoader
::
add_to_list
(
zip_entry
);
return
JVMTI_ERROR_NONE
;
}
else
{
return
JVMTI_ERROR_WRONG_PHASE
;
}
}
/* end AddToBootstrapClassLoaderSearch */
...
...
@@ -451,11 +460,12 @@ JvmtiEnv::AddToSystemClassLoaderSearch(const char* segment) {
}
}
return
JVMTI_ERROR_NONE
;
}
else
{
}
else
if
(
phase
==
JVMTI_PHASE_LIVE
)
{
// The phase is checked by the wrapper that called this function,
// but this thread could be racing with the thread that is
// terminating the VM so we check one more time.
HandleMark
hm
;
assert
(
phase
==
JVMTI_PHASE_LIVE
,
"sanity check"
);
// create the zip entry (which will open the zip file and hence
// check that the segment is indeed a zip file).
ClassPathZipEntry
*
zip_entry
=
ClassLoader
::
create_class_path_zip_entry
(
segment
);
...
...
@@ -504,6 +514,8 @@ JvmtiEnv::AddToSystemClassLoaderSearch(const char* segment) {
}
return
JVMTI_ERROR_NONE
;
}
else
{
return
JVMTI_ERROR_WRONG_PHASE
;
}
}
/* end AddToSystemClassLoaderSearch */
...
...
@@ -2863,6 +2875,14 @@ JvmtiEnv::IsMethodSynthetic(methodOop method_oop, jboolean* is_synthetic_ptr) {
// is_obsolete_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv
::
IsMethodObsolete
(
methodOop
method_oop
,
jboolean
*
is_obsolete_ptr
)
{
if
(
use_version_1_0_semantics
()
&&
get_capabilities
()
->
can_redefine_classes
==
0
)
{
// This JvmtiEnv requested version 1.0 semantics and this function
// requires the can_redefine_classes capability in version 1.0 so
// we need to return an error here.
return
JVMTI_ERROR_MUST_POSSESS_CAPABILITY
;
}
if
(
method_oop
==
NULL
||
method_oop
->
is_obsolete
())
{
*
is_obsolete_ptr
=
true
;
}
else
{
...
...
src/share/vm/prims/jvmtiEnvBase.cpp
浏览文件 @
c5aa05e3
...
...
@@ -123,7 +123,26 @@ JvmtiEnvBase::is_valid() {
}
JvmtiEnvBase
::
JvmtiEnvBase
()
:
_env_event_enable
()
{
bool
JvmtiEnvBase
::
use_version_1_0_semantics
()
{
int
major
,
minor
,
micro
;
JvmtiExport
::
decode_version_values
(
_version
,
&
major
,
&
minor
,
&
micro
);
return
major
==
1
&&
minor
==
0
;
// micro version doesn't matter here
}
bool
JvmtiEnvBase
::
use_version_1_1_semantics
()
{
int
major
,
minor
,
micro
;
JvmtiExport
::
decode_version_values
(
_version
,
&
major
,
&
minor
,
&
micro
);
return
major
==
1
&&
minor
==
1
;
// micro version doesn't matter here
}
JvmtiEnvBase
::
JvmtiEnvBase
(
jint
version
)
:
_env_event_enable
()
{
_version
=
version
;
_env_local_storage
=
NULL
;
_tag_map
=
NULL
;
_native_method_prefix_count
=
0
;
...
...
src/share/vm/prims/jvmtiEnvBase.hpp
浏览文件 @
c5aa05e3
/*
* Copyright 2003-200
6
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2003-200
9
Sun Microsystems, Inc. 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
...
...
@@ -76,6 +76,7 @@ class JvmtiEnvBase : public CHeapObj {
jvmtiEnv
_jvmti_external
;
jint
_magic
;
jint
_version
;
// version value passed to JNI GetEnv()
JvmtiEnvBase
*
_next
;
bool
_is_retransformable
;
const
void
*
_env_local_storage
;
// per env agent allocated data.
...
...
@@ -91,7 +92,7 @@ class JvmtiEnvBase : public CHeapObj {
int
_native_method_prefix_count
;
protected:
JvmtiEnvBase
();
JvmtiEnvBase
(
jint
version
);
~
JvmtiEnvBase
();
void
dispose
();
void
env_dispose
();
...
...
@@ -122,6 +123,9 @@ class JvmtiEnvBase : public CHeapObj {
bool
is_valid
();
bool
use_version_1_0_semantics
();
// agent asked for version 1.0
bool
use_version_1_1_semantics
();
// agent asked for version 1.1
bool
is_retransformable
()
{
return
_is_retransformable
;
}
static
ByteSize
jvmti_external_offset
()
{
...
...
src/share/vm/prims/jvmtiExport.cpp
浏览文件 @
c5aa05e3
...
...
@@ -319,7 +319,27 @@ address JvmtiExport::get_field_modification_count_addr() {
jint
JvmtiExport
::
get_jvmti_interface
(
JavaVM
*
jvm
,
void
**
penv
,
jint
version
)
{
/* To Do: add version checks */
// The JVMTI_VERSION_INTERFACE_JVMTI part of the version number
// has already been validated in JNI GetEnv().
int
major
,
minor
,
micro
;
// micro version doesn't matter here (yet?)
decode_version_values
(
version
,
&
major
,
&
minor
,
&
micro
);
switch
(
major
)
{
case
1
:
switch
(
minor
)
{
case
0
:
// version 1.0.<micro> is recognized
case
1
:
// version 1.1.<micro> is recognized
break
;
default:
return
JNI_EVERSION
;
// unsupported minor version number
}
break
;
default:
return
JNI_EVERSION
;
// unsupported major version number
}
if
(
JvmtiEnv
::
get_phase
()
==
JVMTI_PHASE_LIVE
)
{
JavaThread
*
current_thread
=
(
JavaThread
*
)
ThreadLocalStorage
::
thread
();
...
...
@@ -328,13 +348,13 @@ JvmtiExport::get_jvmti_interface(JavaVM *jvm, void **penv, jint version) {
__ENTRY
(
jvmtiEnv
*
,
JvmtiExport
::
get_jvmti_interface
,
current_thread
)
debug_only
(
VMNativeEntryWrapper
__vew
;)
JvmtiEnv
*
jvmti_env
=
JvmtiEnv
::
create_a_jvmti
();
JvmtiEnv
*
jvmti_env
=
JvmtiEnv
::
create_a_jvmti
(
version
);
*
penv
=
jvmti_env
->
jvmti_external
();
// actual type is jvmtiEnv* -- not to be confused with JvmtiEnv*
return
JNI_OK
;
}
else
if
(
JvmtiEnv
::
get_phase
()
==
JVMTI_PHASE_ONLOAD
)
{
// not live, no thread to transition
JvmtiEnv
*
jvmti_env
=
JvmtiEnv
::
create_a_jvmti
();
JvmtiEnv
*
jvmti_env
=
JvmtiEnv
::
create_a_jvmti
(
version
);
*
penv
=
jvmti_env
->
jvmti_external
();
// actual type is jvmtiEnv* -- not to be confused with JvmtiEnv*
return
JNI_OK
;
...
...
@@ -345,6 +365,15 @@ JvmtiExport::get_jvmti_interface(JavaVM *jvm, void **penv, jint version) {
}
}
void
JvmtiExport
::
decode_version_values
(
jint
version
,
int
*
major
,
int
*
minor
,
int
*
micro
)
{
*
major
=
(
version
&
JVMTI_VERSION_MASK_MAJOR
)
>>
JVMTI_VERSION_SHIFT_MAJOR
;
*
minor
=
(
version
&
JVMTI_VERSION_MASK_MINOR
)
>>
JVMTI_VERSION_SHIFT_MINOR
;
*
micro
=
(
version
&
JVMTI_VERSION_MASK_MICRO
)
>>
JVMTI_VERSION_SHIFT_MICRO
;
}
void
JvmtiExport
::
enter_primordial_phase
()
{
JvmtiEnvBase
::
set_phase
(
JVMTI_PHASE_PRIMORDIAL
);
}
...
...
src/share/vm/prims/jvmtiExport.hpp
浏览文件 @
c5aa05e3
/*
* Copyright 1998-200
6
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1998-200
9
Sun Microsystems, Inc. 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
...
...
@@ -236,6 +236,8 @@ class JvmtiExport : public AllStatic {
static
bool
is_jvmti_version
(
jint
version
)
{
return
(
version
&
JVMTI_VERSION_MASK
)
==
JVMTI_VERSION_VALUE
;
}
static
bool
is_jvmdi_version
(
jint
version
)
{
return
(
version
&
JVMTI_VERSION_MASK
)
==
JVMDI_VERSION_VALUE
;
}
static
jint
get_jvmti_interface
(
JavaVM
*
jvm
,
void
**
penv
,
jint
version
);
static
void
decode_version_values
(
jint
version
,
int
*
major
,
int
*
minor
,
int
*
micro
);
// single stepping management methods
static
void
at_single_stepping_point
(
JavaThread
*
thread
,
methodOop
method
,
address
location
)
KERNEL_RETURN
;
...
...
src/share/vm/prims/jvmtiHpp.xsl
浏览文件 @
c5aa05e3
<?xml version="1.0"?>
<!--
Copyright 2002-200
5
Sun Microsystems, Inc. All Rights Reserved.
Copyright 2002-200
9
Sun Microsystems, Inc. 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
...
...
@@ -48,12 +48,12 @@ class JvmtiEnv : public JvmtiEnvBase {
private:
JvmtiEnv();
JvmtiEnv(
jint version
);
~JvmtiEnv();
public:
static JvmtiEnv* create_a_jvmti();
static JvmtiEnv* create_a_jvmti(
jint version
);
</xsl:text>
<xsl:apply-templates
select=
"functionsection"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录