Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
8a65d66b
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看板
提交
8a65d66b
编写于
9月 09, 2014
作者:
I
iveresov
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
2fc5e409
a4398dd3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
148 addition
and
10 deletion
+148
-10
make/solaris/makefiles/vm.make
make/solaris/makefiles/vm.make
+1
-1
src/cpu/sparc/vm/vm_version_sparc.cpp
src/cpu/sparc/vm/vm_version_sparc.cpp
+4
-2
src/cpu/sparc/vm/vm_version_sparc.hpp
src/cpu/sparc/vm/vm_version_sparc.hpp
+5
-3
src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
+138
-4
未找到文件。
make/solaris/makefiles/vm.make
浏览文件 @
8a65d66b
...
...
@@ -141,7 +141,7 @@ else
LIBS
+=
-lsocket
-lsched
-ldl
$(LIBM)
-lthread
-lc
-ldemangle
endif
# sparcWorks
LIBS
+=
-lkstat
LIBS
+=
-lkstat
-lpicl
# By default, link the *.o into the library, not the executable.
LINK_INTO$(LINK_INTO)
=
LIBJVM
...
...
src/cpu/sparc/vm/vm_version_sparc.cpp
浏览文件 @
8a65d66b
...
...
@@ -37,6 +37,7 @@
int
VM_Version
::
_features
=
VM_Version
::
unknown_m
;
const
char
*
VM_Version
::
_features_str
=
""
;
unsigned
int
VM_Version
::
_L2_cache_line_size
=
0
;
void
VM_Version
::
initialize
()
{
_features
=
determine_features
();
...
...
@@ -197,7 +198,7 @@ void VM_Version::initialize() {
}
assert
(
BlockZeroingLowLimit
>
0
,
"invalid value"
);
if
(
has_block_zeroing
())
{
if
(
has_block_zeroing
()
&&
cache_line_size
>
0
)
{
if
(
FLAG_IS_DEFAULT
(
UseBlockZeroing
))
{
FLAG_SET_DEFAULT
(
UseBlockZeroing
,
true
);
}
...
...
@@ -207,7 +208,7 @@ void VM_Version::initialize() {
}
assert
(
BlockCopyLowLimit
>
0
,
"invalid value"
);
if
(
has_block_zeroing
())
{
// has_blk_init() && is_T4(): core's local L2 cache
if
(
has_block_zeroing
()
&&
cache_line_size
>
0
)
{
// has_blk_init() && is_T4(): core's local L2 cache
if
(
FLAG_IS_DEFAULT
(
UseBlockCopy
))
{
FLAG_SET_DEFAULT
(
UseBlockCopy
,
true
);
}
...
...
@@ -362,6 +363,7 @@ void VM_Version::initialize() {
#ifndef PRODUCT
if
(
PrintMiscellaneous
&&
Verbose
)
{
tty
->
print_cr
(
"L2 cache line size: %u"
,
L2_cache_line_size
());
tty
->
print
(
"Allocation"
);
if
(
AllocatePrefetchStyle
<=
0
)
{
tty
->
print_cr
(
": no prefetching"
);
...
...
src/cpu/sparc/vm/vm_version_sparc.hpp
浏览文件 @
8a65d66b
...
...
@@ -96,6 +96,9 @@ protected:
static
int
_features
;
static
const
char
*
_features_str
;
static
unsigned
int
_L2_cache_line_size
;
static
unsigned
int
L2_cache_line_size
()
{
return
_L2_cache_line_size
;
}
static
void
print_features
();
static
int
determine_features
();
static
int
platform_features
(
int
features
);
...
...
@@ -167,9 +170,8 @@ public:
static
const
char
*
cpu_features
()
{
return
_features_str
;
}
static
intx
prefetch_data_size
()
{
return
is_T4
()
&&
!
is_T7
()
?
32
:
64
;
// default prefetch block size on sparc
}
// default prefetch block size on sparc
static
intx
prefetch_data_size
()
{
return
L2_cache_line_size
();
}
// Prefetch
static
intx
prefetch_copy_interval_in_bytes
()
{
...
...
src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
浏览文件 @
8a65d66b
...
...
@@ -26,10 +26,140 @@
#include "runtime/os.hpp"
#include "vm_version_sparc.hpp"
# include <sys/auxv.h>
# include <sys/auxv_SPARC.h>
# include <sys/systeminfo.h>
# include <kstat.h>
#include <sys/auxv.h>
#include <sys/auxv_SPARC.h>
#include <sys/systeminfo.h>
#include <kstat.h>
#include <picl.h>
extern
"C"
static
int
PICL_get_l1_data_cache_line_size_helper
(
picl_nodehdl_t
nodeh
,
void
*
result
);
extern
"C"
static
int
PICL_get_l2_cache_line_size_helper
(
picl_nodehdl_t
nodeh
,
void
*
result
);
class
PICL
{
// Get a value of the integer property. The value in the tree can be either 32 or 64 bit
// depending on the platform. The result is converted to int.
static
int
get_int_property
(
picl_nodehdl_t
nodeh
,
const
char
*
name
,
int
*
result
)
{
picl_propinfo_t
pinfo
;
picl_prophdl_t
proph
;
if
(
picl_get_prop_by_name
(
nodeh
,
name
,
&
proph
)
!=
PICL_SUCCESS
||
picl_get_propinfo
(
proph
,
&
pinfo
)
!=
PICL_SUCCESS
)
{
return
PICL_FAILURE
;
}
if
(
pinfo
.
type
!=
PICL_PTYPE_INT
&&
pinfo
.
type
!=
PICL_PTYPE_UNSIGNED_INT
)
{
assert
(
false
,
"Invalid property type"
);
return
PICL_FAILURE
;
}
if
(
pinfo
.
size
==
sizeof
(
int64_t
))
{
int64_t
val
;
if
(
picl_get_propval
(
proph
,
&
val
,
sizeof
(
int64_t
))
!=
PICL_SUCCESS
)
{
return
PICL_FAILURE
;
}
*
result
=
static_cast
<
int
>
(
val
);
}
else
if
(
pinfo
.
size
==
sizeof
(
int32_t
))
{
int32_t
val
;
if
(
picl_get_propval
(
proph
,
&
val
,
sizeof
(
int32_t
))
!=
PICL_SUCCESS
)
{
return
PICL_FAILURE
;
}
*
result
=
static_cast
<
int
>
(
val
);
}
else
{
assert
(
false
,
"Unexpected integer property size"
);
return
PICL_FAILURE
;
}
return
PICL_SUCCESS
;
}
// Visitor and a state machine that visits integer properties and verifies that the
// values are the same. Stores the unique value observed.
class
UniqueValueVisitor
{
enum
{
INITIAL
,
// Start state, no assignments happened
ASSIGNED
,
// Assigned a value
INCONSISTENT
// Inconsistent value seen
}
_state
;
int
_value
;
public:
UniqueValueVisitor
()
:
_state
(
INITIAL
)
{
}
int
value
()
{
assert
(
_state
==
ASSIGNED
,
"Precondition"
);
return
_value
;
}
void
set_value
(
int
value
)
{
assert
(
_state
==
INITIAL
,
"Precondition"
);
_value
=
value
;
_state
=
ASSIGNED
;
}
bool
is_initial
()
{
return
_state
==
INITIAL
;
}
bool
is_assigned
()
{
return
_state
==
ASSIGNED
;
}
bool
is_inconsistent
()
{
return
_state
==
INCONSISTENT
;
}
void
set_inconsistent
()
{
_state
=
INCONSISTENT
;
}
static
int
visit
(
picl_nodehdl_t
nodeh
,
const
char
*
name
,
void
*
arg
)
{
UniqueValueVisitor
*
state
=
static_cast
<
UniqueValueVisitor
*>
(
arg
);
assert
(
!
state
->
is_inconsistent
(),
"Precondition"
);
int
curr
;
if
(
PICL
::
get_int_property
(
nodeh
,
name
,
&
curr
)
==
PICL_SUCCESS
)
{
if
(
!
state
->
is_assigned
())
{
// first iteration
state
->
set_value
(
curr
);
}
else
if
(
curr
!=
state
->
value
())
{
// following iterations
state
->
set_inconsistent
();
}
}
if
(
state
->
is_inconsistent
())
{
return
PICL_WALK_TERMINATE
;
}
return
PICL_WALK_CONTINUE
;
}
};
int
_L1_data_cache_line_size
;
int
_L2_cache_line_size
;
public:
static
int
get_l1_data_cache_line_size
(
picl_nodehdl_t
nodeh
,
void
*
state
)
{
return
UniqueValueVisitor
::
visit
(
nodeh
,
"l1-dcache-line-size"
,
state
);
}
static
int
get_l2_cache_line_size
(
picl_nodehdl_t
nodeh
,
void
*
state
)
{
return
UniqueValueVisitor
::
visit
(
nodeh
,
"l2-cache-line-size"
,
state
);
}
PICL
()
:
_L1_data_cache_line_size
(
0
),
_L2_cache_line_size
(
0
)
{
if
(
picl_initialize
()
==
PICL_SUCCESS
)
{
picl_nodehdl_t
rooth
;
if
(
picl_get_root
(
&
rooth
)
==
PICL_SUCCESS
)
{
UniqueValueVisitor
L1_state
;
// Visit all "cpu" class instances
picl_walk_tree_by_class
(
rooth
,
"cpu"
,
&
L1_state
,
PICL_get_l1_data_cache_line_size_helper
);
if
(
L1_state
.
is_initial
())
{
// Still initial, iteration found no values
// Try walk all "core" class instances, it might be a Fujitsu machine
picl_walk_tree_by_class
(
rooth
,
"core"
,
&
L1_state
,
PICL_get_l1_data_cache_line_size_helper
);
}
if
(
L1_state
.
is_assigned
())
{
// Is there a value?
_L1_data_cache_line_size
=
L1_state
.
value
();
}
UniqueValueVisitor
L2_state
;
picl_walk_tree_by_class
(
rooth
,
"cpu"
,
&
L2_state
,
PICL_get_l2_cache_line_size_helper
);
if
(
L2_state
.
is_initial
())
{
picl_walk_tree_by_class
(
rooth
,
"core"
,
&
L2_state
,
PICL_get_l2_cache_line_size_helper
);
}
if
(
L2_state
.
is_assigned
())
{
_L2_cache_line_size
=
L2_state
.
value
();
}
}
picl_shutdown
();
}
}
unsigned
int
L1_data_cache_line_size
()
const
{
return
_L1_data_cache_line_size
;
}
unsigned
int
L2_cache_line_size
()
const
{
return
_L2_cache_line_size
;
}
};
extern
"C"
static
int
PICL_get_l1_data_cache_line_size_helper
(
picl_nodehdl_t
nodeh
,
void
*
result
)
{
return
PICL
::
get_l1_data_cache_line_size
(
nodeh
,
result
);
}
extern
"C"
static
int
PICL_get_l2_cache_line_size_helper
(
picl_nodehdl_t
nodeh
,
void
*
result
)
{
return
PICL
::
get_l2_cache_line_size
(
nodeh
,
result
);
}
// We need to keep these here as long as we have to build on Solaris
// versions before 10.
...
...
@@ -263,5 +393,9 @@ int VM_Version::platform_features(int features) {
kstat_close
(
kc
);
}
// Figure out cache line sizes using PICL
PICL
picl
;
_L2_cache_line_size
=
picl
.
L2_cache_line_size
();
return
features
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录