Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
98b4cb87
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看板
提交
98b4cb87
编写于
10月 31, 2008
作者:
X
xlu
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
e39c0620
3d653807
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
29 addition
and
10 deletion
+29
-10
src/share/vm/interpreter/bytecodeStream.cpp
src/share/vm/interpreter/bytecodeStream.cpp
+9
-4
src/share/vm/interpreter/bytecodes.cpp
src/share/vm/interpreter/bytecodes.cpp
+16
-4
src/share/vm/interpreter/bytecodes.hpp
src/share/vm/interpreter/bytecodes.hpp
+4
-2
未找到文件。
src/share/vm/interpreter/bytecodeStream.cpp
浏览文件 @
98b4cb87
...
...
@@ -29,7 +29,8 @@ Bytecodes::Code RawBytecodeStream::raw_next_special(Bytecodes::Code code) {
assert
(
!
is_last_bytecode
(),
"should have been checked"
);
// set next bytecode position
address
bcp
=
RawBytecodeStream
::
bcp
();
int
l
=
Bytecodes
::
raw_special_length_at
(
bcp
);
address
end
=
method
()
->
code_base
()
+
end_bci
();
int
l
=
Bytecodes
::
raw_special_length_at
(
bcp
,
end
);
if
(
l
<=
0
||
(
_bci
+
l
)
>
_end_bci
)
{
code
=
Bytecodes
::
_illegal
;
}
else
{
...
...
@@ -39,10 +40,14 @@ Bytecodes::Code RawBytecodeStream::raw_next_special(Bytecodes::Code code) {
_is_wide
=
false
;
// check for special (uncommon) cases
if
(
code
==
Bytecodes
::
_wide
)
{
if
(
bcp
+
1
>=
end
)
{
code
=
Bytecodes
::
_illegal
;
}
else
{
code
=
(
Bytecodes
::
Code
)
bcp
[
1
];
_is_wide
=
true
;
}
}
}
_code
=
code
;
return
code
;
}
src/share/vm/interpreter/bytecodes.cpp
浏览文件 @
98b4cb87
...
...
@@ -54,13 +54,19 @@ Bytecodes::Code Bytecodes::non_breakpoint_code_at(address bcp, methodOop method)
return
method
->
orig_bytecode_at
(
method
->
bci_from
(
bcp
));
}
int
Bytecodes
::
special_length_at
(
address
bcp
)
{
int
Bytecodes
::
special_length_at
(
address
bcp
,
address
end
)
{
Code
code
=
code_at
(
bcp
);
switch
(
code
)
{
case
_wide
:
if
(
end
!=
NULL
&&
bcp
+
1
>=
end
)
{
return
-
1
;
// don't read past end of code buffer
}
return
wide_length_for
(
cast
(
*
(
bcp
+
1
)));
case
_tableswitch
:
{
address
aligned_bcp
=
(
address
)
round_to
((
intptr_t
)
bcp
+
1
,
jintSize
);
if
(
end
!=
NULL
&&
aligned_bcp
+
3
*
jintSize
>=
end
)
{
return
-
1
;
// don't read past end of code buffer
}
jlong
lo
=
(
jint
)
Bytes
::
get_Java_u4
(
aligned_bcp
+
1
*
jintSize
);
jlong
hi
=
(
jint
)
Bytes
::
get_Java_u4
(
aligned_bcp
+
2
*
jintSize
);
jlong
len
=
(
aligned_bcp
-
bcp
)
+
(
3
+
hi
-
lo
+
1
)
*
jintSize
;
...
...
@@ -73,6 +79,9 @@ int Bytecodes::special_length_at(address bcp) {
case
_fast_binaryswitch
:
// fall through
case
_fast_linearswitch
:
{
address
aligned_bcp
=
(
address
)
round_to
((
intptr_t
)
bcp
+
1
,
jintSize
);
if
(
end
!=
NULL
&&
aligned_bcp
+
2
*
jintSize
>=
end
)
{
return
-
1
;
// don't read past end of code buffer
}
jlong
npairs
=
(
jint
)
Bytes
::
get_Java_u4
(
aligned_bcp
+
jintSize
);
jlong
len
=
(
aligned_bcp
-
bcp
)
+
(
2
+
2
*
npairs
)
*
jintSize
;
// only return len if it can be represented as a positive int;
...
...
@@ -90,14 +99,17 @@ int Bytecodes::special_length_at(address bcp) {
// verifier when reading in bytecode to verify. Other mechanisms that
// run at runtime (such as generateOopMaps) need to iterate over the code
// and don't expect to see breakpoints: they want to see the instruction
// which was replace
s
so that they can get the correct length and find
// which was replace
d
so that they can get the correct length and find
// the next bytecode.
int
Bytecodes
::
raw_special_length_at
(
address
bcp
)
{
//
// 'end' indicates the end of the code buffer, which we should not try to read
// past.
int
Bytecodes
::
raw_special_length_at
(
address
bcp
,
address
end
)
{
Code
code
=
code_or_bp_at
(
bcp
);
if
(
code
==
_breakpoint
)
{
return
1
;
}
else
{
return
special_length_at
(
bcp
);
return
special_length_at
(
bcp
,
end
);
}
}
...
...
src/share/vm/interpreter/bytecodes.hpp
浏览文件 @
98b4cb87
...
...
@@ -340,8 +340,10 @@ class Bytecodes: AllStatic {
const
char
*
wf
=
wide_format
(
code
);
return
(
wf
==
NULL
)
?
0
:
(
int
)
strlen
(
wf
);
}
static
int
special_length_at
(
address
bcp
);
static
int
raw_special_length_at
(
address
bcp
);
// if 'end' is provided, it indicates the end of the code buffer which
// should not be read past when parsing.
static
int
special_length_at
(
address
bcp
,
address
end
=
NULL
);
static
int
raw_special_length_at
(
address
bcp
,
address
end
=
NULL
);
static
int
length_at
(
address
bcp
)
{
int
l
=
length_for
(
code_at
(
bcp
));
return
l
>
0
?
l
:
special_length_at
(
bcp
);
}
static
int
java_length_at
(
address
bcp
)
{
int
l
=
length_for
(
java_code_at
(
bcp
));
return
l
>
0
?
l
:
special_length_at
(
bcp
);
}
static
bool
is_java_code
(
Code
code
)
{
return
0
<=
code
&&
code
<
number_of_java_codes
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录