Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
655ba149
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看板
提交
655ba149
编写于
12月 16, 2009
作者:
X
xlu
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
3c64bbd3
d8754ee7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
21 deletion
+21
-21
src/share/vm/classfile/classFileParser.cpp
src/share/vm/classfile/classFileParser.cpp
+3
-2
src/share/vm/oops/instanceKlass.cpp
src/share/vm/oops/instanceKlass.cpp
+6
-4
src/share/vm/oops/instanceKlass.hpp
src/share/vm/oops/instanceKlass.hpp
+3
-3
src/share/vm/prims/jvm.cpp
src/share/vm/prims/jvm.cpp
+9
-12
未找到文件。
src/share/vm/classfile/classFileParser.cpp
浏览文件 @
655ba149
...
@@ -3766,8 +3766,9 @@ bool ClassFileParser::has_illegal_visibility(jint flags) {
...
@@ -3766,8 +3766,9 @@ bool ClassFileParser::has_illegal_visibility(jint flags) {
}
}
bool
ClassFileParser
::
is_supported_version
(
u2
major
,
u2
minor
)
{
bool
ClassFileParser
::
is_supported_version
(
u2
major
,
u2
minor
)
{
u2
max_version
=
JDK_Version
::
is_gte_jdk17x_version
()
?
u2
max_version
=
JAVA_MAX_SUPPORTED_VERSION
:
JAVA_6_VERSION
;
JDK_Version
::
is_gte_jdk17x_version
()
?
JAVA_MAX_SUPPORTED_VERSION
:
(
JDK_Version
::
is_gte_jdk16x_version
()
?
JAVA_6_VERSION
:
JAVA_1_5_VERSION
);
return
(
major
>=
JAVA_MIN_SUPPORTED_VERSION
)
&&
return
(
major
>=
JAVA_MIN_SUPPORTED_VERSION
)
&&
(
major
<=
max_version
)
&&
(
major
<=
max_version
)
&&
((
major
!=
max_version
)
||
((
major
!=
max_version
)
||
...
...
src/share/vm/oops/instanceKlass.cpp
浏览文件 @
655ba149
...
@@ -2045,8 +2045,9 @@ bool instanceKlass::is_same_package_member_impl(instanceKlassHandle class1,
...
@@ -2045,8 +2045,9 @@ bool instanceKlass::is_same_package_member_impl(instanceKlassHandle class1,
// As we walk along, look for equalities between outer1 and class2.
// As we walk along, look for equalities between outer1 and class2.
// Eventually, the walks will terminate as outer1 stops
// Eventually, the walks will terminate as outer1 stops
// at the top-level class around the original class.
// at the top-level class around the original class.
symbolOop
ignore_name
;
bool
ignore_inner_is_member
;
klassOop
next
=
outer1
->
compute_enclosing_class
(
ignore_name
,
CHECK_false
);
klassOop
next
=
outer1
->
compute_enclosing_class
(
&
ignore_inner_is_member
,
CHECK_false
);
if
(
next
==
NULL
)
break
;
if
(
next
==
NULL
)
break
;
if
(
next
==
class2
())
return
true
;
if
(
next
==
class2
())
return
true
;
outer1
=
instanceKlassHandle
(
THREAD
,
next
);
outer1
=
instanceKlassHandle
(
THREAD
,
next
);
...
@@ -2055,8 +2056,9 @@ bool instanceKlass::is_same_package_member_impl(instanceKlassHandle class1,
...
@@ -2055,8 +2056,9 @@ bool instanceKlass::is_same_package_member_impl(instanceKlassHandle class1,
// Now do the same for class2.
// Now do the same for class2.
instanceKlassHandle
outer2
=
class2
;
instanceKlassHandle
outer2
=
class2
;
for
(;;)
{
for
(;;)
{
symbolOop
ignore_name
;
bool
ignore_inner_is_member
;
klassOop
next
=
outer2
->
compute_enclosing_class
(
ignore_name
,
CHECK_false
);
klassOop
next
=
outer2
->
compute_enclosing_class
(
&
ignore_inner_is_member
,
CHECK_false
);
if
(
next
==
NULL
)
break
;
if
(
next
==
NULL
)
break
;
// Might as well check the new outer against all available values.
// Might as well check the new outer against all available values.
if
(
next
==
class1
())
return
true
;
if
(
next
==
class1
())
return
true
;
...
...
src/share/vm/oops/instanceKlass.hpp
浏览文件 @
655ba149
...
@@ -337,12 +337,12 @@ class instanceKlass: public Klass {
...
@@ -337,12 +337,12 @@ class instanceKlass: public Klass {
static
bool
is_same_class_package
(
oop
class_loader1
,
symbolOop
class_name1
,
oop
class_loader2
,
symbolOop
class_name2
);
static
bool
is_same_class_package
(
oop
class_loader1
,
symbolOop
class_name1
,
oop
class_loader2
,
symbolOop
class_name2
);
// find an enclosing class (defined where original code was, in jvm.cpp!)
// find an enclosing class (defined where original code was, in jvm.cpp!)
klassOop
compute_enclosing_class
(
symbolOop
&
simple_name_result
,
TRAPS
)
{
klassOop
compute_enclosing_class
(
bool
*
inner_is_member
,
TRAPS
)
{
instanceKlassHandle
self
(
THREAD
,
this
->
as_klassOop
());
instanceKlassHandle
self
(
THREAD
,
this
->
as_klassOop
());
return
compute_enclosing_class_impl
(
self
,
simple_name_result
,
THREAD
);
return
compute_enclosing_class_impl
(
self
,
inner_is_member
,
THREAD
);
}
}
static
klassOop
compute_enclosing_class_impl
(
instanceKlassHandle
self
,
static
klassOop
compute_enclosing_class_impl
(
instanceKlassHandle
self
,
symbolOop
&
simple_name_result
,
TRAPS
);
bool
*
inner_is_member
,
TRAPS
);
// tell if two classes have the same enclosing class (at package level)
// tell if two classes have the same enclosing class (at package level)
bool
is_same_package_member
(
klassOop
class2
,
TRAPS
)
{
bool
is_same_package_member
(
klassOop
class2
,
TRAPS
)
{
...
...
src/share/vm/prims/jvm.cpp
浏览文件 @
655ba149
...
@@ -1318,19 +1318,20 @@ JVM_ENTRY(jclass, JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass))
...
@@ -1318,19 +1318,20 @@ JVM_ENTRY(jclass, JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass))
return
NULL
;
return
NULL
;
}
}
symbolOop
simple_name
=
NULL
;
bool
inner_is_member
=
false
;
klassOop
outer_klass
klassOop
outer_klass
=
instanceKlass
::
cast
(
java_lang_Class
::
as_klassOop
(
JNIHandles
::
resolve_non_null
(
ofClass
))
=
instanceKlass
::
cast
(
java_lang_Class
::
as_klassOop
(
JNIHandles
::
resolve_non_null
(
ofClass
))
)
->
compute_enclosing_class
(
simple_name
,
CHECK_NULL
);
)
->
compute_enclosing_class
(
&
inner_is_member
,
CHECK_NULL
);
if
(
outer_klass
==
NULL
)
return
NULL
;
// already a top-level class
if
(
outer_klass
==
NULL
)
return
NULL
;
// already a top-level class
if
(
simple_name
==
NULL
)
return
NULL
;
// an anonymous class (inside a method)
if
(
!
inner_is_member
)
return
NULL
;
// an anonymous class (inside a method)
return
(
jclass
)
JNIHandles
::
make_local
(
env
,
Klass
::
cast
(
outer_klass
)
->
java_mirror
());
return
(
jclass
)
JNIHandles
::
make_local
(
env
,
Klass
::
cast
(
outer_klass
)
->
java_mirror
());
}
}
JVM_END
JVM_END
// should be in instanceKlass.cpp, but is here for historical reasons
// should be in instanceKlass.cpp, but is here for historical reasons
klassOop
instanceKlass
::
compute_enclosing_class_impl
(
instanceKlassHandle
k
,
klassOop
instanceKlass
::
compute_enclosing_class_impl
(
instanceKlassHandle
k
,
symbolOop
&
simple_name_result
,
TRAPS
)
{
bool
*
inner_is_member
,
TRAPS
)
{
Thread
*
thread
=
THREAD
;
Thread
*
thread
=
THREAD
;
const
int
inner_class_info_index
=
inner_class_inner_class_info_offset
;
const
int
inner_class_info_index
=
inner_class_inner_class_info_offset
;
const
int
outer_class_info_index
=
inner_class_outer_class_info_offset
;
const
int
outer_class_info_index
=
inner_class_outer_class_info_offset
;
...
@@ -1347,8 +1348,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k,
...
@@ -1347,8 +1348,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k,
bool
found
=
false
;
bool
found
=
false
;
klassOop
ok
;
klassOop
ok
;
instanceKlassHandle
outer_klass
;
instanceKlassHandle
outer_klass
;
bool
inner_is_member
=
false
;
*
inner_is_member
=
false
;
int
simple_name_index
=
0
;
// Find inner_klass attribute
// Find inner_klass attribute
for
(
int
i
=
0
;
i
<
i_length
&&
!
found
;
i
+=
inner_class_next_offset
)
{
for
(
int
i
=
0
;
i
<
i_length
&&
!
found
;
i
+=
inner_class_next_offset
)
{
...
@@ -1364,8 +1364,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k,
...
@@ -1364,8 +1364,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k,
if
(
found
&&
ooff
!=
0
)
{
if
(
found
&&
ooff
!=
0
)
{
ok
=
i_cp
->
klass_at
(
ooff
,
CHECK_NULL
);
ok
=
i_cp
->
klass_at
(
ooff
,
CHECK_NULL
);
outer_klass
=
instanceKlassHandle
(
thread
,
ok
);
outer_klass
=
instanceKlassHandle
(
thread
,
ok
);
simple_name_index
=
noff
;
*
inner_is_member
=
true
;
inner_is_member
=
true
;
}
}
}
}
}
}
...
@@ -1377,7 +1376,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k,
...
@@ -1377,7 +1376,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k,
if
(
encl_method_class_idx
!=
0
)
{
if
(
encl_method_class_idx
!=
0
)
{
ok
=
i_cp
->
klass_at
(
encl_method_class_idx
,
CHECK_NULL
);
ok
=
i_cp
->
klass_at
(
encl_method_class_idx
,
CHECK_NULL
);
outer_klass
=
instanceKlassHandle
(
thread
,
ok
);
outer_klass
=
instanceKlassHandle
(
thread
,
ok
);
inner_is_member
=
false
;
*
inner_is_member
=
false
;
}
}
}
}
...
@@ -1387,9 +1386,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k,
...
@@ -1387,9 +1386,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k,
// Throws an exception if outer klass has not declared k as an inner klass
// Throws an exception if outer klass has not declared k as an inner klass
// We need evidence that each klass knows about the other, or else
// We need evidence that each klass knows about the other, or else
// the system could allow a spoof of an inner class to gain access rights.
// the system could allow a spoof of an inner class to gain access rights.
Reflection
::
check_for_inner_class
(
outer_klass
,
k
,
inner_is_member
,
CHECK_NULL
);
Reflection
::
check_for_inner_class
(
outer_klass
,
k
,
*
inner_is_member
,
CHECK_NULL
);
simple_name_result
=
(
inner_is_member
?
i_cp
->
symbol_at
(
simple_name_index
)
:
symbolOop
(
NULL
));
return
outer_klass
();
return
outer_klass
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录