Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
2d832cc3
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看板
提交
2d832cc3
编写于
8月 07, 2014
作者:
I
iignatyev
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
a8020e81
f3162c5c
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
31 addition
and
95 deletion
+31
-95
src/share/vm/c1/c1_LinearScan.cpp
src/share/vm/c1/c1_LinearScan.cpp
+10
-13
src/share/vm/classfile/stackMapFrame.cpp
src/share/vm/classfile/stackMapFrame.cpp
+1
-16
src/share/vm/classfile/stackMapFrame.hpp
src/share/vm/classfile/stackMapFrame.hpp
+1
-5
src/share/vm/classfile/stackMapTable.cpp
src/share/vm/classfile/stackMapTable.cpp
+11
-25
src/share/vm/classfile/stackMapTable.hpp
src/share/vm/classfile/stackMapTable.hpp
+2
-6
src/share/vm/classfile/verifier.cpp
src/share/vm/classfile/verifier.cpp
+2
-11
src/share/vm/classfile/verifier.hpp
src/share/vm/classfile/verifier.hpp
+0
-16
src/share/vm/runtime/deoptimization.cpp
src/share/vm/runtime/deoptimization.cpp
+1
-1
test/runtime/7116786/Test7116786.java
test/runtime/7116786/Test7116786.java
+3
-2
未找到文件。
src/share/vm/c1/c1_LinearScan.cpp
浏览文件 @
2d832cc3
...
...
@@ -1628,25 +1628,22 @@ void LinearScan::allocate_registers() {
Interval
*
precolored_cpu_intervals
,
*
not_precolored_cpu_intervals
;
Interval
*
precolored_fpu_intervals
,
*
not_precolored_fpu_intervals
;
create_unhandled_lists
(
&
precolored_cpu_intervals
,
&
not_precolored_cpu_intervals
,
is_precolored_cpu_interval
,
is_virtual_cpu_interval
);
if
(
has_fpu_registers
())
{
create_unhandled_lists
(
&
precolored_fpu_intervals
,
&
not_precolored_fpu_intervals
,
is_precolored_fpu_interval
,
is_virtual_fpu_interval
);
#ifdef ASSERT
}
else
{
// fpu register allocation is omitted because no virtual fpu registers are present
// just check this again...
create_unhandled_lists
(
&
precolored_fpu_intervals
,
&
not_precolored_fpu_intervals
,
is_precolored_fpu_interval
,
is_virtual_fpu_interval
);
assert
(
not_precolored_fpu_intervals
==
Interval
::
end
(),
"missed an uncolored fpu interval"
);
#endif
}
// allocate cpu registers
create_unhandled_lists
(
&
precolored_cpu_intervals
,
&
not_precolored_cpu_intervals
,
is_precolored_cpu_interval
,
is_virtual_cpu_interval
);
// allocate fpu registers
create_unhandled_lists
(
&
precolored_fpu_intervals
,
&
not_precolored_fpu_intervals
,
is_precolored_fpu_interval
,
is_virtual_fpu_interval
);
// the fpu interval allocation cannot be moved down below with the fpu section as
// the cpu_lsw.walk() changes interval positions.
LinearScanWalker
cpu_lsw
(
this
,
precolored_cpu_intervals
,
not_precolored_cpu_intervals
);
cpu_lsw
.
walk
();
cpu_lsw
.
finish_allocation
();
if
(
has_fpu_registers
())
{
// allocate fpu registers
LinearScanWalker
fpu_lsw
(
this
,
precolored_fpu_intervals
,
not_precolored_fpu_intervals
);
fpu_lsw
.
walk
();
fpu_lsw
.
finish_allocation
();
...
...
src/share/vm/classfile/stackMapFrame.cpp
浏览文件 @
2d832cc3
/*
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
4
, 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
...
...
@@ -54,21 +54,6 @@ StackMapFrame* StackMapFrame::frame_in_exception_handler(u1 flags) {
return
frame
;
}
bool
StackMapFrame
::
has_new_object
()
const
{
int32_t
i
;
for
(
i
=
0
;
i
<
_max_locals
;
i
++
)
{
if
(
_locals
[
i
].
is_uninitialized
())
{
return
true
;
}
}
for
(
i
=
0
;
i
<
_stack_size
;
i
++
)
{
if
(
_stack
[
i
].
is_uninitialized
())
{
return
true
;
}
}
return
false
;
}
void
StackMapFrame
::
initialize_object
(
VerificationType
old_object
,
VerificationType
new_object
)
{
int32_t
i
;
...
...
src/share/vm/classfile/stackMapFrame.hpp
浏览文件 @
2d832cc3
/*
* Copyright (c) 2003, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
4
, 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
...
...
@@ -154,10 +154,6 @@ class StackMapFrame : public ResourceObj {
VerificationType
set_locals_from_arg
(
const
methodHandle
m
,
VerificationType
thisKlass
,
TRAPS
);
// Search local variable type array and stack type array.
// Return true if an uninitialized object is found.
bool
has_new_object
()
const
;
// Search local variable type array and stack type array.
// Set every element with type of old_object to new_object.
void
initialize_object
(
...
...
src/share/vm/classfile/stackMapTable.cpp
浏览文件 @
2d832cc3
...
...
@@ -70,24 +70,26 @@ int StackMapTable::get_index_from_offset(int32_t offset) const {
bool
StackMapTable
::
match_stackmap
(
StackMapFrame
*
frame
,
int32_t
target
,
bool
match
,
bool
update
,
ErrorContext
*
ctx
,
TRAPS
)
const
{
bool
match
,
bool
update
,
bool
handler
,
ErrorContext
*
ctx
,
TRAPS
)
const
{
int
index
=
get_index_from_offset
(
target
);
return
match_stackmap
(
frame
,
target
,
index
,
match
,
update
,
ctx
,
THREAD
);
return
match_stackmap
(
frame
,
target
,
index
,
match
,
update
,
handler
,
ctx
,
THREAD
);
}
// Match and/or update current_frame to the frame in stackmap table with
// specified offset and frame index. Return true if the two frames match.
// handler is true if the frame in stackmap_table is for an exception handler.
//
// The values of match and update are: _match__update_
// The values of match and update are: _match__update_
_handler
//
// checking a branch target/exception handler: true false
// checking a branch target: true false false
// checking an exception handler: true false true
// linear bytecode verification following an
// unconditional branch: false true
// unconditional branch: false true
false
// linear bytecode verification not following an
// unconditional branch: true true
// unconditional branch: true true
false
bool
StackMapTable
::
match_stackmap
(
StackMapFrame
*
frame
,
int32_t
target
,
int32_t
frame_index
,
bool
match
,
bool
update
,
ErrorContext
*
ctx
,
TRAPS
)
const
{
bool
match
,
bool
update
,
bool
handler
,
ErrorContext
*
ctx
,
TRAPS
)
const
{
if
(
frame_index
<
0
||
frame_index
>=
_frame_count
)
{
*
ctx
=
ErrorContext
::
missing_stackmap
(
frame
->
offset
());
frame
->
verifier
()
->
verify_error
(
...
...
@@ -98,11 +100,9 @@ bool StackMapTable::match_stackmap(
StackMapFrame
*
stackmap_frame
=
_frame_array
[
frame_index
];
bool
result
=
true
;
if
(
match
)
{
// when checking handler target, match == true && update == false
bool
is_exception_handler
=
!
update
;
// Has direct control flow from last instruction, need to match the two
// frames.
result
=
frame
->
is_assignable_to
(
stackmap_frame
,
is_exception_
handler
,
result
=
frame
->
is_assignable_to
(
stackmap_frame
,
handler
,
ctx
,
CHECK_VERIFY_
(
frame
->
verifier
(),
result
));
}
if
(
update
)
{
...
...
@@ -126,24 +126,10 @@ void StackMapTable::check_jump_target(
StackMapFrame
*
frame
,
int32_t
target
,
TRAPS
)
const
{
ErrorContext
ctx
;
bool
match
=
match_stackmap
(
frame
,
target
,
true
,
false
,
&
ctx
,
CHECK_VERIFY
(
frame
->
verifier
()));
frame
,
target
,
true
,
false
,
false
,
&
ctx
,
CHECK_VERIFY
(
frame
->
verifier
()));
if
(
!
match
||
(
target
<
0
||
target
>=
_code_length
))
{
frame
->
verifier
()
->
verify_error
(
ctx
,
"Inconsistent stackmap frames at branch target %d"
,
target
);
return
;
}
// check if uninitialized objects exist on backward branches
check_new_object
(
frame
,
target
,
CHECK_VERIFY
(
frame
->
verifier
()));
frame
->
verifier
()
->
update_furthest_jump
(
target
);
}
void
StackMapTable
::
check_new_object
(
const
StackMapFrame
*
frame
,
int32_t
target
,
TRAPS
)
const
{
if
(
frame
->
offset
()
>
target
&&
frame
->
has_new_object
())
{
frame
->
verifier
()
->
verify_error
(
ErrorContext
::
bad_code
(
frame
->
offset
()),
"Uninitialized object exists on backward branch %d"
,
target
);
return
;
}
}
...
...
src/share/vm/classfile/stackMapTable.hpp
浏览文件 @
2d832cc3
...
...
@@ -74,12 +74,12 @@ class StackMapTable : public StackObj {
// specified offset. Return true if the two frames match.
bool
match_stackmap
(
StackMapFrame
*
current_frame
,
int32_t
offset
,
bool
match
,
bool
update
,
ErrorContext
*
ctx
,
TRAPS
)
const
;
bool
match
,
bool
update
,
bool
handler
,
ErrorContext
*
ctx
,
TRAPS
)
const
;
// Match and/or update current_frame to the frame in stackmap table with
// specified offset and frame index. Return true if the two frames match.
bool
match_stackmap
(
StackMapFrame
*
current_frame
,
int32_t
offset
,
int32_t
frame_index
,
bool
match
,
bool
update
,
ErrorContext
*
ctx
,
TRAPS
)
const
;
bool
match
,
bool
update
,
bool
handler
,
ErrorContext
*
ctx
,
TRAPS
)
const
;
// Check jump instructions. Make sure there are no uninitialized
// instances on backward branch.
...
...
@@ -90,10 +90,6 @@ class StackMapTable : public StackObj {
// Returns the frame array index where the frame with offset is stored.
int
get_index_from_offset
(
int32_t
offset
)
const
;
// Make sure that there's no uninitialized object exist on backward branch.
void
check_new_object
(
const
StackMapFrame
*
frame
,
int32_t
target
,
TRAPS
)
const
;
void
print_on
(
outputStream
*
str
)
const
;
};
...
...
src/share/vm/classfile/verifier.cpp
浏览文件 @
2d832cc3
...
...
@@ -634,8 +634,6 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) {
// flow from current instruction to the next
// instruction in sequence
set_furthest_jump
(
0
);
Bytecodes
::
Code
opcode
;
while
(
!
bcs
.
is_last_bytecode
())
{
// Check for recursive re-verification before each bytecode.
...
...
@@ -1794,7 +1792,7 @@ u2 ClassVerifier::verify_stackmap_table(u2 stackmap_index, u2 bci,
// If matched, current_frame will be updated by this method.
bool
matches
=
stackmap_table
->
match_stackmap
(
current_frame
,
this_offset
,
stackmap_index
,
!
no_control_flow
,
true
,
&
ctx
,
CHECK_VERIFY_
(
this
,
0
));
!
no_control_flow
,
true
,
false
,
&
ctx
,
CHECK_VERIFY_
(
this
,
0
));
if
(
!
matches
)
{
// report type error
verify_error
(
ctx
,
"Instruction type does not match stack map"
);
...
...
@@ -1841,7 +1839,7 @@ void ClassVerifier::verify_exception_handler_targets(u2 bci, bool this_uninit, S
}
ErrorContext
ctx
;
bool
matches
=
stackmap_table
->
match_stackmap
(
new_frame
,
handler_pc
,
true
,
false
,
&
ctx
,
CHECK_VERIFY
(
this
));
new_frame
,
handler_pc
,
true
,
false
,
true
,
&
ctx
,
CHECK_VERIFY
(
this
));
if
(
!
matches
)
{
verify_error
(
ctx
,
"Stack map does not match the one at "
"exception handler %d"
,
handler_pc
);
...
...
@@ -2252,13 +2250,6 @@ void ClassVerifier::verify_invoke_init(
return
;
}
// Make sure that this call is not jumped over.
if
(
bci
<
furthest_jump
())
{
verify_error
(
ErrorContext
::
bad_code
(
bci
),
"Bad <init> method call from inside of a branch"
);
return
;
}
// Make sure that this call is not done from within a TRY block because
// that can result in returning an incomplete object. Simply checking
// (bci >= start_pc) also ensures that this call is not done after a TRY
...
...
src/share/vm/classfile/verifier.hpp
浏览文件 @
2d832cc3
...
...
@@ -258,9 +258,6 @@ class ClassVerifier : public StackObj {
ErrorContext
_error_context
;
// contains information about an error
// Used to detect illegal jumps over calls to super() nd this() in ctors.
int32_t
_furthest_jump
;
void
verify_method
(
methodHandle
method
,
TRAPS
);
char
*
generate_code_data
(
methodHandle
m
,
u4
code_length
,
TRAPS
);
void
verify_exception_handler_table
(
u4
code_length
,
char
*
code_data
,
...
...
@@ -407,19 +404,6 @@ class ClassVerifier : public StackObj {
TypeOrigin
ref_ctx
(
const
char
*
str
,
TRAPS
);
// Keep track of the furthest branch done in a method to make sure that
// there are no branches over calls to super() or this() from inside of
// a constructor.
int32_t
furthest_jump
()
{
return
_furthest_jump
;
}
void
set_furthest_jump
(
int32_t
target
)
{
_furthest_jump
=
target
;
}
void
update_furthest_jump
(
int32_t
target
)
{
if
(
target
>
_furthest_jump
)
_furthest_jump
=
target
;
}
};
inline
int
ClassVerifier
::
change_sig_to_verificationType
(
...
...
src/share/vm/runtime/deoptimization.cpp
浏览文件 @
2d832cc3
...
...
@@ -698,7 +698,7 @@ JRT_LEAF(BasicType, Deoptimization::unpack_frames(JavaThread* thread, int exec_m
(
iframe
->
interpreter_frame_expression_stack_size
()
==
(
next_mask_expression_stack_size
-
top_frame_expression_stack_adjustment
)))
||
(
is_top_frame
&&
(
exec_mode
==
Unpack_exception
)
&&
iframe
->
interpreter_frame_expression_stack_size
()
==
0
)
||
(
is_top_frame
&&
(
exec_mode
==
Unpack_uncommon_trap
||
exec_mode
==
Unpack_reexecute
)
&&
(
is_top_frame
&&
(
exec_mode
==
Unpack_uncommon_trap
||
exec_mode
==
Unpack_reexecute
||
el
->
should_reexecute
()
)
&&
(
iframe
->
interpreter_frame_expression_stack_size
()
==
mask
.
expression_stack_size
()
+
cur_invoke_parameter_size
))
))
{
ttyLocker
ttyl
;
...
...
test/runtime/7116786/Test7116786.java
浏览文件 @
2d832cc3
/*
* Copyright (c) 2012, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 201
4
, 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
...
...
@@ -147,7 +147,8 @@ class VerifyErrorCases {
"no stackmap frame at jump location or bad jump"
,
"Inconsistent stackmap frames at branch target "
),
new
Case
(
"case15"
,
"stackMapTable.cpp"
,
true
,
"check_new_object"
,
/* Backward jump with uninit is allowed starting with JDK 8 */
new
Case
(
"case15"
,
"stackMapTable.cpp"
,
false
,
"check_new_object"
,
"backward jump with uninit"
,
"Uninitialized object exists on backward branch "
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录