Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
1eb48c8e
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看板
提交
1eb48c8e
编写于
12月 21, 2011
作者:
C
coleenp
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
964c0070
545e04c2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
56 addition
and
4 deletion
+56
-4
src/share/vm/prims/jvmtiClassFileReconstituter.cpp
src/share/vm/prims/jvmtiClassFileReconstituter.cpp
+55
-4
src/share/vm/prims/jvmtiClassFileReconstituter.hpp
src/share/vm/prims/jvmtiClassFileReconstituter.hpp
+1
-0
未找到文件。
src/share/vm/prims/jvmtiClassFileReconstituter.cpp
浏览文件 @
1eb48c8e
...
...
@@ -43,7 +43,7 @@
#ifdef TARGET_ARCH_ppc
# include "bytes_ppc.hpp"
#endif
// FIXME: add Deprecated, LVT
, LVT
T attributes
// FIXME: add Deprecated, LVTT attributes
// FIXME: fix Synthetic attribute
// FIXME: per Serguei, add error return handling for constantPoolOopDesc::copy_cpool_bytes()
...
...
@@ -136,8 +136,9 @@ void JvmtiClassFileReconstituter::write_code_attribute(methodHandle method) {
constMethodHandle
const_method
(
thread
(),
method
->
constMethod
());
u2
line_num_cnt
=
0
;
int
stackmap_len
=
0
;
int
local_variable_table_length
=
0
;
// compute number and length of attributes
-- FIXME: for now no LVT
// compute number and length of attributes
int
attr_count
=
0
;
int
attr_size
=
0
;
if
(
const_method
->
has_linenumber_table
())
{
...
...
@@ -170,6 +171,25 @@ void JvmtiClassFileReconstituter::write_code_attribute(methodHandle method) {
attr_size
+=
2
+
4
+
stackmap_len
;
}
}
if
(
method
->
has_localvariable_table
())
{
local_variable_table_length
=
method
->
localvariable_table_length
();
++
attr_count
;
if
(
local_variable_table_length
!=
0
)
{
// Compute the size of the local variable table attribute (VM stores raw):
// LocalVariableTable_attribute {
// u2 attribute_name_index;
// u4 attribute_length;
// u2 local_variable_table_length;
// {
// u2 start_pc;
// u2 length;
// u2 name_index;
// u2 descriptor_index;
// u2 index;
// }
attr_size
+=
2
+
4
+
2
+
local_variable_table_length
*
(
2
+
2
+
2
+
2
+
2
);
}
}
typeArrayHandle
exception_table
(
thread
(),
const_method
->
exception_table
());
int
exception_table_length
=
exception_table
->
length
();
...
...
@@ -203,8 +223,9 @@ void JvmtiClassFileReconstituter::write_code_attribute(methodHandle method) {
if
(
stackmap_len
!=
0
)
{
write_stackmap_table_attribute
(
method
,
stackmap_len
);
}
// FIXME: write LVT attribute
if
(
local_variable_table_length
!=
0
)
{
write_local_variable_table_attribute
(
method
,
local_variable_table_length
);
}
}
// Write Exceptions attribute
...
...
@@ -371,6 +392,36 @@ void JvmtiClassFileReconstituter::write_line_number_table_attribute(methodHandle
}
}
// Write LineNumberTable attribute
// JVMSpec| LocalVariableTable_attribute {
// JVMSpec| u2 attribute_name_index;
// JVMSpec| u4 attribute_length;
// JVMSpec| u2 local_variable_table_length;
// JVMSpec| { u2 start_pc;
// JVMSpec| u2 length;
// JVMSpec| u2 name_index;
// JVMSpec| u2 descriptor_index;
// JVMSpec| u2 index;
// JVMSpec| } local_variable_table[local_variable_table_length];
// JVMSpec| }
void
JvmtiClassFileReconstituter
::
write_local_variable_table_attribute
(
methodHandle
method
,
u2
num_entries
)
{
write_attribute_name_index
(
"LocalVariableTable"
);
write_u4
(
2
+
num_entries
*
(
2
+
2
+
2
+
2
+
2
));
write_u2
(
num_entries
);
assert
(
method
->
localvariable_table_length
()
==
num_entries
,
"just checking"
);
LocalVariableTableElement
*
elem
=
method
->
localvariable_table_start
();
for
(
int
j
=
0
;
j
<
method
->
localvariable_table_length
();
j
++
)
{
write_u2
(
elem
->
start_bci
);
write_u2
(
elem
->
length
);
write_u2
(
elem
->
name_cp_index
);
write_u2
(
elem
->
descriptor_cp_index
);
write_u2
(
elem
->
slot
);
elem
++
;
}
}
// Write stack map table attribute
// JSR-202| StackMapTable_attribute {
// JSR-202| u2 attribute_name_index;
...
...
src/share/vm/prims/jvmtiClassFileReconstituter.hpp
浏览文件 @
1eb48c8e
...
...
@@ -119,6 +119,7 @@ class JvmtiClassFileReconstituter : public JvmtiConstantPoolReconstituter {
void
write_source_debug_extension_attribute
();
u2
line_number_table_entries
(
methodHandle
method
);
void
write_line_number_table_attribute
(
methodHandle
method
,
u2
num_entries
);
void
write_local_variable_table_attribute
(
methodHandle
method
,
u2
num_entries
);
void
write_stackmap_table_attribute
(
methodHandle
method
,
int
stackmap_table_len
);
u2
inner_classes_attribute_length
();
void
write_inner_classes_attribute
(
int
length
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录