Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
8de5c68f
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看板
提交
8de5c68f
编写于
6月 30, 2016
作者:
H
hseigel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8159511: Stack map validation
Reviewed-by: acorn, mschoene Contributed-by: harold.seigel@oracle.com
上级
1bf99daf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
1 deletion
+49
-1
src/share/vm/classfile/stackMapTableFormat.hpp
src/share/vm/classfile/stackMapTableFormat.hpp
+38
-1
src/share/vm/classfile/verifier.cpp
src/share/vm/classfile/verifier.cpp
+11
-0
未找到文件。
src/share/vm/classfile/stackMapTableFormat.hpp
浏览文件 @
8de5c68f
/*
* Copyright (c) 2010, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 201
6
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -203,6 +203,7 @@ class stack_map_frame {
inline
bool
verify
(
address
start
,
address
end
)
const
;
inline
void
print_on
(
outputStream
*
st
,
int
current_offset
)
const
;
inline
void
print_truncated
(
outputStream
*
st
,
int
current_offset
)
const
;
// Create as_xxx and is_xxx methods for the subtypes
#define FRAME_TYPE_DECL(stackmap_frame_type, arg1, arg2) \
...
...
@@ -263,6 +264,10 @@ class same_frame : public stack_map_frame {
void
print_on
(
outputStream
*
st
,
int
current_offset
=
-
1
)
const
{
st
->
print
(
"same_frame(@%d)"
,
offset_delta
()
+
current_offset
);
}
void
print_truncated
(
outputStream
*
st
,
int
current_offset
=
-
1
)
const
{
print_on
(
st
,
current_offset
);
}
};
class
same_frame_extended
:
public
stack_map_frame
{
...
...
@@ -309,6 +314,10 @@ class same_frame_extended : public stack_map_frame {
void
print_on
(
outputStream
*
st
,
int
current_offset
=
-
1
)
const
{
st
->
print
(
"same_frame_extended(@%d)"
,
offset_delta
()
+
current_offset
);
}
void
print_truncated
(
outputStream
*
st
,
int
current_offset
=
-
1
)
const
{
print_on
(
st
,
current_offset
);
}
};
class
same_locals_1_stack_item_frame
:
public
stack_map_frame
{
...
...
@@ -381,6 +390,11 @@ class same_locals_1_stack_item_frame : public stack_map_frame {
types
()
->
print_on
(
st
);
st
->
print
(
")"
);
}
void
print_truncated
(
outputStream
*
st
,
int
current_offset
=
-
1
)
const
{
st
->
print
(
"same_locals_1_stack_item_frame(@%d), output truncated, Stackmap exceeds table size."
,
offset_delta
()
+
current_offset
);
}
};
class
same_locals_1_stack_item_extended
:
public
stack_map_frame
{
...
...
@@ -446,6 +460,11 @@ class same_locals_1_stack_item_extended : public stack_map_frame {
types
()
->
print_on
(
st
);
st
->
print
(
")"
);
}
void
print_truncated
(
outputStream
*
st
,
int
current_offset
=
-
1
)
const
{
st
->
print
(
"same_locals_1_stack_item_extended(@%d), output truncated, Stackmap exceeds table size."
,
offset_delta
()
+
current_offset
);
}
};
class
chop_frame
:
public
stack_map_frame
{
...
...
@@ -511,6 +530,10 @@ class chop_frame : public stack_map_frame {
void
print_on
(
outputStream
*
st
,
int
current_offset
=
-
1
)
const
{
st
->
print
(
"chop_frame(@%d,%d)"
,
offset_delta
()
+
current_offset
,
chops
());
}
void
print_truncated
(
outputStream
*
st
,
int
current_offset
=
-
1
)
const
{
print_on
(
st
,
current_offset
);
}
};
class
append_frame
:
public
stack_map_frame
{
...
...
@@ -619,6 +642,11 @@ class append_frame : public stack_map_frame {
}
st
->
print
(
")"
);
}
void
print_truncated
(
outputStream
*
st
,
int
current_offset
=
-
1
)
const
{
st
->
print
(
"append_frame(@%d), output truncated, Stackmap exceeds table size."
,
offset_delta
()
+
current_offset
);
}
};
class
full_frame
:
public
stack_map_frame
{
...
...
@@ -784,6 +812,11 @@ class full_frame : public stack_map_frame {
}
st
->
print
(
"})"
);
}
void
print_truncated
(
outputStream
*
st
,
int
current_offset
=
-
1
)
const
{
st
->
print
(
"full_frame(@%d), output truncated, Stackmap exceeds table size."
,
offset_delta
()
+
current_offset
);
}
};
#define VIRTUAL_DISPATCH(stack_frame_type, func_name, args) \
...
...
@@ -841,6 +874,10 @@ void stack_map_frame::print_on(outputStream* st, int offs = -1) const {
FOR_EACH_STACKMAP_FRAME_TYPE
(
VOID_VIRTUAL_DISPATCH
,
print_on
,
(
st
,
offs
));
}
void
stack_map_frame
::
print_truncated
(
outputStream
*
st
,
int
offs
=
-
1
)
const
{
FOR_EACH_STACKMAP_FRAME_TYPE
(
VOID_VIRTUAL_DISPATCH
,
print_truncated
,
(
st
,
offs
));
}
#undef VIRTUAL_DISPATCH
#undef VOID_VIRTUAL_DISPATCH
...
...
src/share/vm/classfile/verifier.cpp
浏览文件 @
8de5c68f
...
...
@@ -504,8 +504,19 @@ void ErrorContext::stackmap_details(outputStream* ss, const Method* method) cons
stack_map_frame
*
sm_frame
=
sm_table
->
entries
();
streamIndentor
si2
(
ss
);
int
current_offset
=
-
1
;
// Subtract two from StackMapAttribute length because the length includes
// two bytes for number of table entries.
size_t
sm_table_space
=
method
->
stackmap_data
()
->
length
()
-
2
;
for
(
u2
i
=
0
;
i
<
sm_table
->
number_of_entries
();
++
i
)
{
ss
->
indent
();
size_t
sm_frame_size
=
sm_frame
->
size
();
// If the size of the next stackmap exceeds the length of the entire
// stackmap table then print a truncated message and return.
if
(
sm_frame_size
>
sm_table_space
)
{
sm_frame
->
print_truncated
(
ss
,
current_offset
);
return
;
}
sm_table_space
-=
sm_frame_size
;
sm_frame
->
print_on
(
ss
,
current_offset
);
ss
->
cr
();
current_offset
+=
sm_frame
->
offset_delta
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录