Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
3be7a074
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看板
提交
3be7a074
编写于
2月 04, 2013
作者:
C
coleenp
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
18772701
18ba0a7b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
32 addition
and
24 deletion
+32
-24
src/share/vm/classfile/classFileParser.cpp
src/share/vm/classfile/classFileParser.cpp
+30
-17
src/share/vm/oops/constMethod.hpp
src/share/vm/oops/constMethod.hpp
+1
-6
src/share/vm/prims/jvm.cpp
src/share/vm/prims/jvm.cpp
+1
-1
未找到文件。
src/share/vm/classfile/classFileParser.cpp
浏览文件 @
3be7a074
...
...
@@ -1947,6 +1947,8 @@ methodHandle ClassFileParser::parse_method(ClassLoaderData* loader_data,
u2
**
localvariable_type_table_start
;
u2
method_parameters_length
=
0
;
u1
*
method_parameters_data
=
NULL
;
bool
method_parameters_seen
=
false
;
bool
method_parameters_four_byte_flags
;
bool
parsed_code_attribute
=
false
;
bool
parsed_checked_exceptions_attribute
=
false
;
bool
parsed_stackmap_attribute
=
false
;
...
...
@@ -2157,21 +2159,31 @@ methodHandle ClassFileParser::parse_method(ClassLoaderData* loader_data,
method_attribute_length
,
cp
,
CHECK_
(
nullHandle
));
}
else
if
(
method_attribute_name
==
vmSymbols
::
tag_method_parameters
())
{
// reject multiple method parameters
if
(
method_parameters_seen
)
{
classfile_parse_error
(
"Multiple MethodParameters attributes in class file %s"
,
CHECK_
(
nullHandle
));
}
method_parameters_seen
=
true
;
method_parameters_length
=
cfs
->
get_u1_fast
();
// Track the actual size (note: this is written for clarity; a
// decent compiler will CSE and constant-fold this into a single
// expression)
u2
actual_size
=
1
;
// Use the attribute length to figure out the size of flags
if
(
method_attribute_length
==
(
method_parameters_length
*
6u
)
+
1u
)
{
method_parameters_four_byte_flags
=
true
;
}
else
if
(
method_attribute_length
==
(
method_parameters_length
*
4u
)
+
1u
)
{
method_parameters_four_byte_flags
=
false
;
}
else
{
classfile_parse_error
(
"Invalid MethodParameters method attribute length %u in class file"
,
method_attribute_length
,
CHECK_
(
nullHandle
));
}
method_parameters_data
=
cfs
->
get_u1_buffer
();
actual_size
+=
2
*
method_parameters_length
;
cfs
->
skip_u2_fast
(
method_parameters_length
);
actual_size
+=
4
*
method_parameters_length
;
if
(
method_parameters_four_byte_flags
)
{
cfs
->
skip_u4_fast
(
method_parameters_length
);
// Enforce attribute length
if
(
method_attribute_length
!=
actual_size
)
{
classfile_parse_error
(
"Invalid MethodParameters method attribute length %u in class file %s"
,
method_attribute_length
,
CHECK_
(
nullHandle
));
}
else
{
cfs
->
skip_u2_fast
(
method_parameters_length
);
}
// ignore this attribute if it cannot be reflected
if
(
!
SystemDictionary
::
Parameter_klass_loaded
())
...
...
@@ -2316,15 +2328,16 @@ methodHandle ClassFileParser::parse_method(ClassLoaderData* loader_data,
// Copy method parameters
if
(
method_parameters_length
>
0
)
{
MethodParametersElement
*
elem
=
m
->
constMethod
()
->
method_parameters_start
();
for
(
int
i
=
0
;
i
<
method_parameters_length
;
i
++
)
{
elem
[
i
].
name_cp_index
=
Bytes
::
get_Java_u2
(
method_parameters_data
);
for
(
int
i
=
0
;
i
<
method_parameters_length
;
i
++
)
{
elem
[
i
].
name_cp_index
=
Bytes
::
get_Java_u2
(
method_parameters_data
);
method_parameters_data
+=
2
;
u4
flags
=
Bytes
::
get_Java_u4
(
method_parameters_data
);
// This caused an alignment fault on Sparc, if flags was a u4
elem
[
i
].
flags_lo
=
extract_low_short_from_int
(
flags
);
elem
[
i
].
flags_hi
=
extract_high_short_from_int
(
flags
);
if
(
method_parameters_four_byte_flags
)
{
elem
[
i
].
flags
=
Bytes
::
get_Java_u4
(
method_parameters_data
);
method_parameters_data
+=
4
;
}
else
{
elem
[
i
].
flags
=
Bytes
::
get_Java_u2
(
method_parameters_data
);
method_parameters_data
+=
2
;
}
}
}
...
...
src/share/vm/oops/constMethod.hpp
浏览文件 @
3be7a074
...
...
@@ -122,12 +122,7 @@ class ExceptionTableElement VALUE_OBJ_CLASS_SPEC {
class
MethodParametersElement
VALUE_OBJ_CLASS_SPEC
{
public:
u2
name_cp_index
;
// This has to happen, otherwise it will cause SIGBUS from a
// misaligned u4 on some architectures (ie SPARC)
// because MethodParametersElements are only aligned mod 2
// within the ConstMethod container u2 flags_hi;
u2
flags_hi
;
u2
flags_lo
;
u2
flags
;
};
class
KlassSizeStats
;
...
...
src/share/vm/prims/jvm.cpp
浏览文件 @
3be7a074
...
...
@@ -1620,7 +1620,7 @@ JVM_ENTRY(jobjectArray, JVM_GetMethodParameters(JNIEnv *env, jobject method))
// For a 0 index, give a NULL symbol
Symbol
*
const
sym
=
0
!=
params
[
i
].
name_cp_index
?
mh
->
constants
()
->
symbol_at
(
params
[
i
].
name_cp_index
)
:
NULL
;
int
flags
=
build_int_from_shorts
(
params
[
i
].
flags_lo
,
params
[
i
].
flags_hi
)
;
int
flags
=
params
[
i
].
flags
;
oop
param
=
Reflection
::
new_parameter
(
reflected_method
,
i
,
sym
,
flags
,
CHECK_NULL
);
result
->
obj_at_put
(
i
,
param
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录