Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
99af26bc
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看板
提交
99af26bc
编写于
5月 27, 2010
作者:
J
jrose
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6956164: nightly regressions from 6939207
Summary: Fix errors in 6939207. Reviewed-by: kvn
上级
23439c9d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
17 deletion
+31
-17
src/share/vm/classfile/verifier.cpp
src/share/vm/classfile/verifier.cpp
+15
-14
src/share/vm/classfile/verifier.hpp
src/share/vm/classfile/verifier.hpp
+10
-0
src/share/vm/interpreter/bytecodeStream.hpp
src/share/vm/interpreter/bytecodeStream.hpp
+1
-1
src/share/vm/interpreter/bytecodes.cpp
src/share/vm/interpreter/bytecodes.cpp
+1
-0
src/share/vm/interpreter/bytecodes.hpp
src/share/vm/interpreter/bytecodes.hpp
+4
-2
未找到文件。
src/share/vm/classfile/verifier.cpp
浏览文件 @
99af26bc
...
...
@@ -254,6 +254,9 @@ void ClassVerifier::verify_class(TRAPS) {
int
num_methods
=
methods
->
length
();
for
(
int
index
=
0
;
index
<
num_methods
;
index
++
)
{
// Check for recursive re-verification before each method.
if
(
was_recursively_verified
())
return
;
methodOop
m
=
(
methodOop
)
methods
->
obj_at
(
index
);
if
(
m
->
is_native
()
||
m
->
is_abstract
())
{
// If m is native or abstract, skip it. It is checked in class file
...
...
@@ -262,6 +265,12 @@ void ClassVerifier::verify_class(TRAPS) {
}
verify_method
(
methodHandle
(
THREAD
,
m
),
CHECK_VERIFY
(
this
));
}
if
(
_verify_verbose
||
TraceClassInitialization
)
{
if
(
was_recursively_verified
())
tty
->
print_cr
(
"Recursive verification detected for: %s"
,
_klass
->
external_name
());
}
}
void
ClassVerifier
::
verify_method
(
methodHandle
m
,
TRAPS
)
{
...
...
@@ -326,6 +335,9 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) {
// instruction in sequence
Bytecodes
::
Code
opcode
;
while
(
!
bcs
.
is_last_bytecode
())
{
// Check for recursive re-verification before each bytecode.
if
(
was_recursively_verified
())
return
;
opcode
=
bcs
.
raw_next
();
u2
bci
=
bcs
.
bci
();
...
...
@@ -1470,20 +1482,9 @@ void ClassVerifier::verify_cp_type(
// In some situations, bytecode rewriting may occur while we're verifying.
// In this case, a constant pool cache exists and some indices refer to that
// instead. Get the original index for the tag check
constantPoolCacheOop
cache
=
cp
->
cache
();
if
(
cache
!=
NULL
&&
((
types
==
(
1
<<
JVM_CONSTANT_InterfaceMethodref
))
||
(
types
==
(
1
<<
JVM_CONSTANT_Methodref
))
||
(
types
==
(
1
<<
JVM_CONSTANT_Fieldref
))))
{
int
native_index
=
index
;
if
(
Bytes
::
is_Java_byte_ordering_different
())
{
native_index
=
Bytes
::
swap_u2
(
index
);
}
assert
((
native_index
>=
0
)
&&
(
native_index
<
cache
->
length
()),
"Must be a legal index into the cp cache"
);
index
=
cache
->
entry_at
(
native_index
)
->
constant_pool_index
();
}
// instead. Be sure we don't pick up such indices by accident.
// We must check was_recursively_verified() before we get here.
guarantee
(
cp
->
cache
()
==
NULL
,
"not rewritten yet"
);
verify_cp_index
(
cp
,
index
,
CHECK_VERIFY
(
this
));
unsigned
int
tag
=
cp
->
tag_at
(
index
).
value
();
...
...
src/share/vm/classfile/verifier.hpp
浏览文件 @
99af26bc
...
...
@@ -158,6 +158,16 @@ class ClassVerifier : public StackObj {
methodHandle
_method
;
// current method being verified
VerificationType
_this_type
;
// the verification type of the current class
// Some recursive calls from the verifier to the name resolver
// can cause the current class to be re-verified and rewritten.
// If this happens, the original verification should not continue,
// because constant pool indexes will have changed.
// The rewriter is preceded by the verifier. If the verifier throws
// an error, rewriting is prevented. Also, rewriting always precedes
// bytecode execution or compilation. Thus, is_rewritten implies
// that a class has been verified and prepared for execution.
bool
was_recursively_verified
()
{
return
_klass
->
is_rewritten
();
}
public:
enum
{
BYTECODE_OFFSET
=
1
,
...
...
src/share/vm/interpreter/bytecodeStream.hpp
浏览文件 @
99af26bc
...
...
@@ -212,5 +212,5 @@ class BytecodeStream: public BaseBytecodeStream {
return
bytecode
()
->
get_index_u2_cpcache
(
raw_code
());
}
int
get_index_u4
()
const
{
assert_raw_stream
(
false
);
return
bytecode
()
->
get_index_u4
(
raw_code
());
}
int
has_index_u4
()
const
{
return
bytecode
()
->
get
_index_u4
(
raw_code
());
}
bool
has_index_u4
()
const
{
return
bytecode
()
->
has
_index_u4
(
raw_code
());
}
};
src/share/vm/interpreter/bytecodes.cpp
浏览文件 @
99af26bc
...
...
@@ -86,6 +86,7 @@ int Bytecodes::special_length_at(address bcp, address end) {
return
(
len
>
0
&&
len
==
(
int
)
len
)
?
len
:
-
1
;
}
}
// Note: Length functions must return <=0 for invalid bytecodes.
return
0
;
}
...
...
src/share/vm/interpreter/bytecodes.hpp
浏览文件 @
99af26bc
...
...
@@ -353,8 +353,10 @@ class Bytecodes: AllStatic {
static
const
char
*
name
(
Code
code
)
{
check
(
code
);
return
_name
[
code
];
}
static
BasicType
result_type
(
Code
code
)
{
check
(
code
);
return
_result_type
[
code
];
}
static
int
depth
(
Code
code
)
{
check
(
code
);
return
_depth
[
code
];
}
static
int
length_for
(
Code
code
)
{
check
(
code
);
return
_lengths
[
code
]
&
0xF
;
}
static
int
wide_length_for
(
Code
code
)
{
check
(
code
);
return
_lengths
[
code
]
>>
4
;
}
// Note: Length functions must return <=0 for invalid bytecodes.
// Calling check(code) in length functions would throw an unwanted assert.
static
int
length_for
(
Code
code
)
{
/*no check*/
return
_lengths
[
code
]
&
0xF
;
}
static
int
wide_length_for
(
Code
code
)
{
/*no check*/
return
_lengths
[
code
]
>>
4
;
}
static
bool
can_trap
(
Code
code
)
{
check
(
code
);
return
has_all_flags
(
code
,
_bc_can_trap
,
false
);
}
static
Code
java_code
(
Code
code
)
{
check
(
code
);
return
_java_code
[
code
];
}
static
bool
can_rewrite
(
Code
code
)
{
check
(
code
);
return
has_all_flags
(
code
,
_bc_can_rewrite
,
false
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录