Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
f51328c3
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看板
提交
f51328c3
编写于
3月 17, 2014
作者:
R
roland
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
1ebe8dbb
9b29dcd9
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
218 addition
and
78 deletion
+218
-78
src/share/vm/opto/c2_globals.hpp
src/share/vm/opto/c2_globals.hpp
+6
-1
src/share/vm/opto/graphKit.cpp
src/share/vm/opto/graphKit.cpp
+16
-13
src/share/vm/opto/type.cpp
src/share/vm/opto/type.cpp
+159
-54
src/share/vm/opto/type.hpp
src/share/vm/opto/type.hpp
+37
-10
未找到文件。
src/share/vm/opto/c2_globals.hpp
浏览文件 @
f51328c3
...
...
@@ -644,7 +644,12 @@
"Propagate type improvements in callers of inlinee if possible") \
\
experimental(bool, UseTypeSpeculation, false, \
"Speculatively propagate types from profiles")
"Speculatively propagate types from profiles") \
\
diagnostic(bool, UseInlineDepthForSpeculativeTypes, true, \
"Carry inline depth of profile point with speculative type " \
"and give priority to profiling from lower inline depth") \
C2_FLAGS
(
DECLARE_DEVELOPER_FLAG
,
DECLARE_PD_DEVELOPER_FLAG
,
DECLARE_PRODUCT_FLAG
,
DECLARE_PD_PRODUCT_FLAG
,
DECLARE_DIAGNOSTIC_FLAG
,
DECLARE_EXPERIMENTAL_FLAG
,
DECLARE_NOTPRODUCT_FLAG
)
...
...
src/share/vm/opto/graphKit.cpp
浏览文件 @
f51328c3
...
...
@@ -2109,30 +2109,33 @@ void GraphKit::round_double_arguments(ciMethod* dest_method) {
* @return node with improved type
*/
Node
*
GraphKit
::
record_profile_for_speculation
(
Node
*
n
,
ciKlass
*
exact_kls
)
{
const
Type
OopPtr
*
current_type
=
_gvn
.
type
(
n
)
->
isa_oopptr
(
);
const
Type
*
current_type
=
_gvn
.
type
(
n
);
assert
(
UseTypeSpeculation
,
"type speculation must be on"
);
if
(
exact_kls
!=
NULL
&&
// nothing to improve if type is already exact
(
current_type
==
NULL
||
(
!
current_type
->
klass_is_exact
()
&&
(
current_type
->
speculative
()
==
NULL
||
!
current_type
->
speculative
()
->
klass_is_exact
()))))
{
const
TypeOopPtr
*
speculative
=
current_type
->
speculative
();
if
(
current_type
->
would_improve_type
(
exact_kls
,
jvms
()
->
depth
()))
{
const
TypeKlassPtr
*
tklass
=
TypeKlassPtr
::
make
(
exact_kls
);
const
TypeOopPtr
*
xtype
=
tklass
->
as_instance_type
();
assert
(
xtype
->
klass_is_exact
(),
"Should be exact"
);
// record the new speculative type's depth
speculative
=
xtype
->
with_inline_depth
(
jvms
()
->
depth
());
}
if
(
speculative
!=
current_type
->
speculative
())
{
// Build a type with a speculative type (what we think we know
// about the type but will need a guard when we use it)
const
TypeOopPtr
*
spec_type
=
TypeOopPtr
::
make
(
TypePtr
::
BotPTR
,
Type
::
OffsetBot
,
TypeOopPtr
::
InstanceBot
,
xtyp
e
);
// We're changing the type, we need a new
cast node to carry the
//
new type. The new type depends on the control: what profiling
//
tells us is only valid from here as far as we can tell.
Node
*
cast
=
new
(
C
)
CastPPNode
(
n
,
spec_type
);
cast
->
init_req
(
0
,
control
(
));
const
TypeOopPtr
*
spec_type
=
TypeOopPtr
::
make
(
TypePtr
::
BotPTR
,
Type
::
OffsetBot
,
TypeOopPtr
::
InstanceBot
,
speculativ
e
);
// We're changing the type, we need a new
CheckCast node to carry
//
the new type. The new type depends on the control: what
//
profiling tells us is only valid from here as far as we can
// tell.
Node
*
cast
=
new
(
C
)
CheckCastPPNode
(
control
(),
n
,
current_type
->
remove_speculative
()
->
join_speculative
(
spec_type
));
cast
=
_gvn
.
transform
(
cast
);
replace_in_map
(
n
,
cast
);
n
=
cast
;
}
return
n
;
}
...
...
src/share/vm/opto/type.cpp
浏览文件 @
f51328c3
此差异已折叠。
点击以展开。
src/share/vm/opto/type.hpp
浏览文件 @
f51328c3
...
...
@@ -415,10 +415,15 @@ public:
bool
is_autobox_cache
=
false
);
// Speculative type. See TypeInstPtr
virtual
const
TypeOopPtr
*
speculative
()
const
{
return
NULL
;
}
virtual
ciKlass
*
speculative_type
()
const
{
return
NULL
;
}
const
Type
*
maybe_remove_speculative
(
bool
include_speculative
)
const
;
virtual
const
Type
*
remove_speculative
()
const
{
return
this
;
}
virtual
bool
would_improve_type
(
ciKlass
*
exact_kls
,
int
inline_depth
)
const
{
return
exact_kls
!=
NULL
;
}
private:
// support arrays
static
const
BasicType
_basic_type
[];
...
...
@@ -842,7 +847,7 @@ public:
// Some kind of oop (Java pointer), either klass or instance or array.
class
TypeOopPtr
:
public
TypePtr
{
protected:
TypeOopPtr
(
TYPES
t
,
PTR
ptr
,
ciKlass
*
k
,
bool
xk
,
ciObject
*
o
,
int
offset
,
int
instance_id
,
const
TypeOopPtr
*
speculative
);
TypeOopPtr
(
TYPES
t
,
PTR
ptr
,
ciKlass
*
k
,
bool
xk
,
ciObject
*
o
,
int
offset
,
int
instance_id
,
const
TypeOopPtr
*
speculative
,
int
inline_depth
);
public:
virtual
bool
eq
(
const
Type
*
t
)
const
;
virtual
int
hash
()
const
;
// Type specific hashing
...
...
@@ -853,6 +858,10 @@ public:
};
protected:
enum
{
InlineDepthBottom
=
INT_MAX
,
InlineDepthTop
=
-
InlineDepthBottom
};
// Oop is NULL, unless this is a constant oop.
ciObject
*
_const_oop
;
// Constant oop
// If _klass is NULL, then so is _sig. This is an unloaded klass.
...
...
@@ -873,6 +882,11 @@ protected:
// use it, then we have to emit a guard: this part of the type is
// not something we know but something we speculate about the type.
const
TypeOopPtr
*
_speculative
;
// For speculative types, we record at what inlining depth the
// profiling point that provided the data is. We want to favor
// profile data coming from outer scopes which are likely better for
// the current compilation.
int
_inline_depth
;
static
const
TypeOopPtr
*
make_from_klass_common
(
ciKlass
*
klass
,
bool
klass_change
,
bool
try_for_exact
);
...
...
@@ -888,6 +902,12 @@ protected:
#ifndef PRODUCT
void
dump_speculative
(
outputStream
*
st
)
const
;
#endif
// utility methods to work on the inline depth of the type
int
dual_inline_depth
()
const
;
int
meet_inline_depth
(
int
depth
)
const
;
#ifndef PRODUCT
void
dump_inline_depth
(
outputStream
*
st
)
const
;
#endif
// Do not allow interface-vs.-noninterface joins to collapse to top.
virtual
const
Type
*
filter_helper
(
const
Type
*
kills
,
bool
include_speculative
)
const
;
...
...
@@ -918,7 +938,7 @@ public:
bool
not_null_elements
=
false
);
// Make a generic (unclassed) pointer to an oop.
static
const
TypeOopPtr
*
make
(
PTR
ptr
,
int
offset
,
int
instance_id
,
const
TypeOopPtr
*
speculative
);
static
const
TypeOopPtr
*
make
(
PTR
ptr
,
int
offset
,
int
instance_id
,
const
TypeOopPtr
*
speculative
=
NULL
,
int
inline_depth
=
InlineDepthBottom
);
ciObject
*
const_oop
()
const
{
return
_const_oop
;
}
virtual
ciKlass
*
klass
()
const
{
return
_klass
;
}
...
...
@@ -932,7 +952,7 @@ public:
bool
is_known_instance
()
const
{
return
_instance_id
>
0
;
}
int
instance_id
()
const
{
return
_instance_id
;
}
bool
is_known_instance_field
()
const
{
return
is_known_instance
()
&&
_offset
>=
0
;
}
const
TypeOopPtr
*
speculative
()
const
{
return
_speculative
;
}
virtual
const
TypeOopPtr
*
speculative
()
const
{
return
_speculative
;
}
virtual
intptr_t
get_con
()
const
;
...
...
@@ -965,18 +985,23 @@ public:
if
(
_speculative
!=
NULL
)
{
const
TypeOopPtr
*
speculative
=
_speculative
->
join
(
this
)
->
is_oopptr
();
if
(
speculative
->
klass_is_exact
())
{
return
speculative
->
klass
();
return
speculative
->
klass
();
}
}
return
NULL
;
}
int
inline_depth
()
const
{
return
_inline_depth
;
}
virtual
const
TypeOopPtr
*
with_inline_depth
(
int
depth
)
const
;
virtual
bool
would_improve_type
(
ciKlass
*
exact_kls
,
int
inline_depth
)
const
;
};
//------------------------------TypeInstPtr------------------------------------
// Class of Java object pointers, pointing either to non-array Java instances
// or to a Klass* (including array klasses).
class
TypeInstPtr
:
public
TypeOopPtr
{
TypeInstPtr
(
PTR
ptr
,
ciKlass
*
k
,
bool
xk
,
ciObject
*
o
,
int
offset
,
int
instance_id
,
const
TypeOopPtr
*
speculative
);
TypeInstPtr
(
PTR
ptr
,
ciKlass
*
k
,
bool
xk
,
ciObject
*
o
,
int
offset
,
int
instance_id
,
const
TypeOopPtr
*
speculative
,
int
inline_depth
);
virtual
bool
eq
(
const
Type
*
t
)
const
;
virtual
int
hash
()
const
;
// Type specific hashing
...
...
@@ -1012,7 +1037,7 @@ class TypeInstPtr : public TypeOopPtr {
}
// Make a pointer to an oop.
static
const
TypeInstPtr
*
make
(
PTR
ptr
,
ciKlass
*
k
,
bool
xk
,
ciObject
*
o
,
int
offset
,
int
instance_id
=
InstanceBot
,
const
TypeOopPtr
*
speculative
=
NULL
);
static
const
TypeInstPtr
*
make
(
PTR
ptr
,
ciKlass
*
k
,
bool
xk
,
ciObject
*
o
,
int
offset
,
int
instance_id
=
InstanceBot
,
const
TypeOopPtr
*
speculative
=
NULL
,
int
inline_depth
=
InlineDepthBottom
);
/** Create constant type for a constant boxed value */
const
Type
*
get_const_boxed_value
()
const
;
...
...
@@ -1031,6 +1056,7 @@ class TypeInstPtr : public TypeOopPtr {
virtual
const
TypePtr
*
add_offset
(
intptr_t
offset
)
const
;
// Return same type without a speculative part
virtual
const
Type
*
remove_speculative
()
const
;
virtual
const
TypeOopPtr
*
with_inline_depth
(
int
depth
)
const
;
// the core of the computation of the meet of 2 types
virtual
const
Type
*
xmeet_helper
(
const
Type
*
t
)
const
;
...
...
@@ -1052,8 +1078,8 @@ class TypeInstPtr : public TypeOopPtr {
// Class of Java array pointers
class
TypeAryPtr
:
public
TypeOopPtr
{
TypeAryPtr
(
PTR
ptr
,
ciObject
*
o
,
const
TypeAry
*
ary
,
ciKlass
*
k
,
bool
xk
,
int
offset
,
int
instance_id
,
bool
is_autobox_cache
,
const
TypeOopPtr
*
speculative
)
:
TypeOopPtr
(
AryPtr
,
ptr
,
k
,
xk
,
o
,
offset
,
instance_id
,
speculative
),
int
offset
,
int
instance_id
,
bool
is_autobox_cache
,
const
TypeOopPtr
*
speculative
,
int
inline_depth
)
:
TypeOopPtr
(
AryPtr
,
ptr
,
k
,
xk
,
o
,
offset
,
instance_id
,
speculative
,
inline_depth
),
_ary
(
ary
),
_is_autobox_cache
(
is_autobox_cache
)
{
...
...
@@ -1091,9 +1117,9 @@ public:
bool
is_autobox_cache
()
const
{
return
_is_autobox_cache
;
}
static
const
TypeAryPtr
*
make
(
PTR
ptr
,
const
TypeAry
*
ary
,
ciKlass
*
k
,
bool
xk
,
int
offset
,
int
instance_id
=
InstanceBot
,
const
TypeOopPtr
*
speculative
=
NULL
);
static
const
TypeAryPtr
*
make
(
PTR
ptr
,
const
TypeAry
*
ary
,
ciKlass
*
k
,
bool
xk
,
int
offset
,
int
instance_id
=
InstanceBot
,
const
TypeOopPtr
*
speculative
=
NULL
,
int
inline_depth
=
InlineDepthBottom
);
// Constant pointer to array
static
const
TypeAryPtr
*
make
(
PTR
ptr
,
ciObject
*
o
,
const
TypeAry
*
ary
,
ciKlass
*
k
,
bool
xk
,
int
offset
,
int
instance_id
=
InstanceBot
,
const
TypeOopPtr
*
speculative
=
NULL
,
bool
is_autobox_cache
=
false
);
static
const
TypeAryPtr
*
make
(
PTR
ptr
,
ciObject
*
o
,
const
TypeAry
*
ary
,
ciKlass
*
k
,
bool
xk
,
int
offset
,
int
instance_id
=
InstanceBot
,
const
TypeOopPtr
*
speculative
=
NULL
,
int
inline_depth
=
InlineDepthBottom
,
bool
is_autobox_cache
=
false
);
// Return a 'ptr' version of this type
virtual
const
Type
*
cast_to_ptr_type
(
PTR
ptr
)
const
;
...
...
@@ -1109,6 +1135,7 @@ public:
virtual
const
TypePtr
*
add_offset
(
intptr_t
offset
)
const
;
// Return same type without a speculative part
virtual
const
Type
*
remove_speculative
()
const
;
virtual
const
TypeOopPtr
*
with_inline_depth
(
int
depth
)
const
;
// the core of the computation of the meet of 2 types
virtual
const
Type
*
xmeet_helper
(
const
Type
*
t
)
const
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录