Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
c512320a
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看板
提交
c512320a
编写于
5月 06, 2013
作者:
S
sla
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8009615: JvmtiClassFileReconstituter does not create BootstrapMethod attributes
Reviewed-by: coleenp, sspitsyn
上级
10c8736d
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
45 addition
and
0 deletion
+45
-0
src/share/vm/prims/jvmtiClassFileReconstituter.cpp
src/share/vm/prims/jvmtiClassFileReconstituter.cpp
+44
-0
src/share/vm/prims/jvmtiClassFileReconstituter.hpp
src/share/vm/prims/jvmtiClassFileReconstituter.hpp
+1
-0
未找到文件。
src/share/vm/prims/jvmtiClassFileReconstituter.cpp
浏览文件 @
c512320a
...
@@ -341,6 +341,44 @@ void JvmtiClassFileReconstituter::write_annotations_attribute(const char* attr_n
...
@@ -341,6 +341,44 @@ void JvmtiClassFileReconstituter::write_annotations_attribute(const char* attr_n
memcpy
(
writeable_address
(
length
),
annos
->
adr_at
(
0
),
length
);
memcpy
(
writeable_address
(
length
),
annos
->
adr_at
(
0
),
length
);
}
}
// BootstrapMethods_attribute {
// u2 attribute_name_index;
// u4 attribute_length;
// u2 num_bootstrap_methods;
// { u2 bootstrap_method_ref;
// u2 num_bootstrap_arguments;
// u2 bootstrap_arguments[num_bootstrap_arguments];
// } bootstrap_methods[num_bootstrap_methods];
// }
void
JvmtiClassFileReconstituter
::
write_boostrapmethod_attribute
()
{
Array
<
u2
>*
operands
=
cpool
()
->
operands
();
write_attribute_name_index
(
"BootstrapMethods"
);
int
num_bootstrap_methods
=
ConstantPool
::
operand_array_length
(
operands
);
// calculate length of attribute
int
length
=
sizeof
(
u2
);
// num_boostrap_methods
for
(
int
n
=
0
;
n
<
num_bootstrap_methods
;
n
++
)
{
u2
num_bootstrap_arguments
=
cpool
()
->
operand_argument_count_at
(
n
);
length
+=
sizeof
(
u2
);
// bootstrap_method_ref
length
+=
sizeof
(
u2
);
// num_bootstrap_arguments
length
+=
sizeof
(
u2
)
*
num_bootstrap_arguments
;
// bootstrap_arguments[num_bootstrap_arguments]
}
write_u4
(
length
);
// write attribute
write_u2
(
num_bootstrap_methods
);
for
(
int
n
=
0
;
n
<
num_bootstrap_methods
;
n
++
)
{
u2
bootstrap_method_ref
=
cpool
()
->
operand_bootstrap_method_ref_index_at
(
n
);
u2
num_bootstrap_arguments
=
cpool
()
->
operand_argument_count_at
(
n
);
write_u2
(
bootstrap_method_ref
);
write_u2
(
num_bootstrap_arguments
);
for
(
int
arg
=
0
;
arg
<
num_bootstrap_arguments
;
arg
++
)
{
u2
bootstrap_argument
=
cpool
()
->
operand_argument_index_at
(
n
,
arg
);
write_u2
(
bootstrap_argument
);
}
}
}
// Write InnerClasses attribute
// Write InnerClasses attribute
// JVMSpec| InnerClasses_attribute {
// JVMSpec| InnerClasses_attribute {
...
@@ -597,6 +635,9 @@ void JvmtiClassFileReconstituter::write_class_attributes() {
...
@@ -597,6 +635,9 @@ void JvmtiClassFileReconstituter::write_class_attributes() {
if
(
anno
!=
NULL
)
{
if
(
anno
!=
NULL
)
{
++
attr_count
;
// has RuntimeVisibleAnnotations attribute
++
attr_count
;
// has RuntimeVisibleAnnotations attribute
}
}
if
(
cpool
()
->
operands
()
!=
NULL
)
{
++
attr_count
;
}
write_u2
(
attr_count
);
write_u2
(
attr_count
);
...
@@ -615,6 +656,9 @@ void JvmtiClassFileReconstituter::write_class_attributes() {
...
@@ -615,6 +656,9 @@ void JvmtiClassFileReconstituter::write_class_attributes() {
if
(
anno
!=
NULL
)
{
if
(
anno
!=
NULL
)
{
write_annotations_attribute
(
"RuntimeVisibleAnnotations"
,
anno
);
write_annotations_attribute
(
"RuntimeVisibleAnnotations"
,
anno
);
}
}
if
(
cpool
()
->
operands
()
!=
NULL
)
{
write_boostrapmethod_attribute
();
}
}
}
// Write the method information portion of ClassFile structure
// Write the method information portion of ClassFile structure
...
...
src/share/vm/prims/jvmtiClassFileReconstituter.hpp
浏览文件 @
c512320a
...
@@ -127,6 +127,7 @@ class JvmtiClassFileReconstituter : public JvmtiConstantPoolReconstituter {
...
@@ -127,6 +127,7 @@ class JvmtiClassFileReconstituter : public JvmtiConstantPoolReconstituter {
void
write_signature_attribute
(
u2
generic_signaure_index
);
void
write_signature_attribute
(
u2
generic_signaure_index
);
void
write_attribute_name_index
(
const
char
*
name
);
void
write_attribute_name_index
(
const
char
*
name
);
void
write_annotations_attribute
(
const
char
*
attr_name
,
AnnotationArray
*
annos
);
void
write_annotations_attribute
(
const
char
*
attr_name
,
AnnotationArray
*
annos
);
void
write_boostrapmethod_attribute
();
address
writeable_address
(
size_t
size
);
address
writeable_address
(
size_t
size
);
void
write_u1
(
u1
x
);
void
write_u1
(
u1
x
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录