Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
ad497b3b
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看板
提交
ad497b3b
编写于
3月 07, 2013
作者:
H
hseigel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7158805: Better rewriting of nested subroutine calls
Reviewed-by: mschoene, coleenp
上级
89681ac7
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
46 addition
and
27 deletion
+46
-27
src/share/vm/memory/allocation.cpp
src/share/vm/memory/allocation.cpp
+14
-16
src/share/vm/memory/allocation.hpp
src/share/vm/memory/allocation.hpp
+17
-6
src/share/vm/oops/generateOopMap.cpp
src/share/vm/oops/generateOopMap.cpp
+15
-5
未找到文件。
src/share/vm/memory/allocation.cpp
浏览文件 @
ad497b3b
/*
* Copyright (c) 1997, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
3
, 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
...
...
@@ -248,7 +248,7 @@ class ChunkPool: public CHeapObj<mtInternal> {
ChunkPool
(
size_t
size
)
:
_size
(
size
)
{
_first
=
NULL
;
_num_chunks
=
_num_used
=
0
;
}
// Allocate a new chunk from the pool (might expand the pool)
_NOINLINE_
void
*
allocate
(
size_t
bytes
)
{
_NOINLINE_
void
*
allocate
(
size_t
bytes
,
AllocFailType
alloc_failmode
)
{
assert
(
bytes
==
_size
,
"bad size"
);
void
*
p
=
NULL
;
// No VM lock can be taken inside ThreadCritical lock, so os::malloc
...
...
@@ -258,9 +258,9 @@ class ChunkPool: public CHeapObj<mtInternal> {
p
=
get_first
();
}
if
(
p
==
NULL
)
p
=
os
::
malloc
(
bytes
,
mtChunk
,
CURRENT_PC
);
if
(
p
==
NULL
)
if
(
p
==
NULL
&&
alloc_failmode
==
AllocFailStrategy
::
EXIT_OOM
)
{
vm_exit_out_of_memory
(
bytes
,
"ChunkPool::allocate"
);
}
return
p
;
}
...
...
@@ -357,7 +357,7 @@ class ChunkPoolCleaner : public PeriodicTask {
//--------------------------------------------------------------------------------------
// Chunk implementation
void
*
Chunk
::
operator
new
(
size_t
requested_siz
e
,
size_t
length
)
{
void
*
Chunk
::
operator
new
(
size_t
requested_size
,
AllocFailType
alloc_failmod
e
,
size_t
length
)
{
// requested_size is equal to sizeof(Chunk) but in order for the arena
// allocations to come out aligned as expected the size must be aligned
// to expected arean alignment.
...
...
@@ -365,13 +365,14 @@ void* Chunk::operator new(size_t requested_size, size_t length) {
assert
(
ARENA_ALIGN
(
requested_size
)
==
aligned_overhead_size
(),
"Bad alignment"
);
size_t
bytes
=
ARENA_ALIGN
(
requested_size
)
+
length
;
switch
(
length
)
{
case
Chunk
::
size
:
return
ChunkPool
::
large_pool
()
->
allocate
(
bytes
);
case
Chunk
::
medium_size
:
return
ChunkPool
::
medium_pool
()
->
allocate
(
bytes
);
case
Chunk
::
init_size
:
return
ChunkPool
::
small_pool
()
->
allocate
(
bytes
);
case
Chunk
::
size
:
return
ChunkPool
::
large_pool
()
->
allocate
(
bytes
,
alloc_failmode
);
case
Chunk
::
medium_size
:
return
ChunkPool
::
medium_pool
()
->
allocate
(
bytes
,
alloc_failmode
);
case
Chunk
::
init_size
:
return
ChunkPool
::
small_pool
()
->
allocate
(
bytes
,
alloc_failmode
);
default:
{
void
*
p
=
os
::
malloc
(
bytes
,
mtChunk
,
CALLER_PC
);
if
(
p
==
NULL
)
void
*
p
=
os
::
malloc
(
bytes
,
mtChunk
,
CALLER_PC
);
if
(
p
==
NULL
&&
alloc_failmode
==
AllocFailStrategy
::
EXIT_OOM
)
{
vm_exit_out_of_memory
(
bytes
,
"Chunk::new"
);
}
return
p
;
}
}
...
...
@@ -425,7 +426,7 @@ NOT_PRODUCT(volatile jint Arena::_instance_count = 0;)
Arena
::
Arena
(
size_t
init_size
)
{
size_t
round_size
=
(
sizeof
(
char
*
))
-
1
;
init_size
=
(
init_size
+
round_size
)
&
~
round_size
;
_first
=
_chunk
=
new
(
init_size
)
Chunk
(
init_size
);
_first
=
_chunk
=
new
(
AllocFailStrategy
::
EXIT_OOM
,
init_size
)
Chunk
(
init_size
);
_hwm
=
_chunk
->
bottom
();
// Save the cached hwm, max
_max
=
_chunk
->
top
();
set_size_in_bytes
(
init_size
);
...
...
@@ -433,7 +434,7 @@ Arena::Arena(size_t init_size) {
}
Arena
::
Arena
()
{
_first
=
_chunk
=
new
(
Chunk
::
init_size
)
Chunk
(
Chunk
::
init_size
);
_first
=
_chunk
=
new
(
AllocFailStrategy
::
EXIT_OOM
,
Chunk
::
init_size
)
Chunk
(
Chunk
::
init_size
);
_hwm
=
_chunk
->
bottom
();
// Save the cached hwm, max
_max
=
_chunk
->
top
();
set_size_in_bytes
(
Chunk
::
init_size
);
...
...
@@ -540,12 +541,9 @@ void* Arena::grow(size_t x, AllocFailType alloc_failmode) {
size_t
len
=
MAX2
(
x
,
(
size_t
)
Chunk
::
size
);
Chunk
*
k
=
_chunk
;
// Get filled-up chunk address
_chunk
=
new
(
len
)
Chunk
(
len
);
_chunk
=
new
(
alloc_failmode
,
len
)
Chunk
(
len
);
if
(
_chunk
==
NULL
)
{
if
(
alloc_failmode
==
AllocFailStrategy
::
EXIT_OOM
)
{
signal_out_of_memory
(
len
*
Chunk
::
aligned_overhead_size
(),
"Arena::grow"
);
}
return
NULL
;
}
if
(
k
)
k
->
set_next
(
_chunk
);
// Append new chunk to end of linked list
...
...
src/share/vm/memory/allocation.hpp
浏览文件 @
ad497b3b
/*
* Copyright (c) 1997, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
3
, 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
...
...
@@ -274,7 +274,7 @@ class Chunk: CHeapObj<mtChunk> {
Chunk
*
_next
;
// Next Chunk in list
const
size_t
_len
;
// Size of this Chunk
public:
void
*
operator
new
(
size_t
size
,
size_t
length
);
void
*
operator
new
(
size_t
size
,
AllocFailType
alloc_failmode
,
size_t
length
);
void
operator
delete
(
void
*
p
);
Chunk
(
size_t
length
);
...
...
@@ -337,10 +337,15 @@ protected:
void
signal_out_of_memory
(
size_t
request
,
const
char
*
whence
)
const
;
void
check_for_overflow
(
size_t
request
,
const
char
*
whence
)
const
{
bool
check_for_overflow
(
size_t
request
,
const
char
*
whence
,
AllocFailType
alloc_failmode
=
AllocFailStrategy
::
EXIT_OOM
)
const
{
if
(
UINTPTR_MAX
-
request
<
(
uintptr_t
)
_hwm
)
{
if
(
alloc_failmode
==
AllocFailStrategy
::
RETURN_NULL
)
{
return
false
;
}
signal_out_of_memory
(
request
,
whence
);
}
return
true
;
}
public:
...
...
@@ -364,7 +369,8 @@ protected:
assert
(
is_power_of_2
(
ARENA_AMALLOC_ALIGNMENT
)
,
"should be a power of 2"
);
x
=
ARENA_ALIGN
(
x
);
debug_only
(
if
(
UseMallocOnly
)
return
malloc
(
x
);)
check_for_overflow
(
x
,
"Arena::Amalloc"
);
if
(
!
check_for_overflow
(
x
,
"Arena::Amalloc"
,
alloc_failmode
))
return
NULL
;
NOT_PRODUCT
(
inc_bytes_allocated
(
x
);)
if
(
_hwm
+
x
>
_max
)
{
return
grow
(
x
,
alloc_failmode
);
...
...
@@ -378,7 +384,8 @@ protected:
void
*
Amalloc_4
(
size_t
x
,
AllocFailType
alloc_failmode
=
AllocFailStrategy
::
EXIT_OOM
)
{
assert
(
(
x
&
(
sizeof
(
char
*
)
-
1
))
==
0
,
"misaligned size"
);
debug_only
(
if
(
UseMallocOnly
)
return
malloc
(
x
);)
check_for_overflow
(
x
,
"Arena::Amalloc_4"
);
if
(
!
check_for_overflow
(
x
,
"Arena::Amalloc_4"
,
alloc_failmode
))
return
NULL
;
NOT_PRODUCT
(
inc_bytes_allocated
(
x
);)
if
(
_hwm
+
x
>
_max
)
{
return
grow
(
x
,
alloc_failmode
);
...
...
@@ -399,7 +406,8 @@ protected:
size_t
delta
=
(((
size_t
)
_hwm
+
DALIGN_M1
)
&
~
DALIGN_M1
)
-
(
size_t
)
_hwm
;
x
+=
delta
;
#endif
check_for_overflow
(
x
,
"Arena::Amalloc_D"
);
if
(
!
check_for_overflow
(
x
,
"Arena::Amalloc_D"
,
alloc_failmode
))
return
NULL
;
NOT_PRODUCT
(
inc_bytes_allocated
(
x
);)
if
(
_hwm
+
x
>
_max
)
{
return
grow
(
x
,
alloc_failmode
);
// grow() returns a result aligned >= 8 bytes.
...
...
@@ -539,6 +547,9 @@ class ResourceObj ALLOCATION_SUPER_CLASS_SPEC {
#define NEW_RESOURCE_ARRAY(type, size)\
(type*) resource_allocate_bytes((size) * sizeof(type))
#define NEW_RESOURCE_ARRAY_RETURN_NULL(type, size)\
(type*) resource_allocate_bytes((size) * sizeof(type), AllocFailStrategy::RETURN_NULL)
#define NEW_RESOURCE_ARRAY_IN_THREAD(thread, type, size)\
(type*) resource_allocate_bytes(thread, (size) * sizeof(type))
...
...
src/share/vm/oops/generateOopMap.cpp
浏览文件 @
ad497b3b
...
...
@@ -642,11 +642,21 @@ int GenerateOopMap::next_bb_start_pc(BasicBlock *bb) {
// CellType handling methods
//
// Allocate memory and throw LinkageError if failure.
#define ALLOC_RESOURCE_ARRAY(var, type, count) \
var = NEW_RESOURCE_ARRAY_RETURN_NULL(type, count); \
if (var == NULL) { \
report_error("Cannot reserve enough memory to analyze this method"); \
return; \
}
void
GenerateOopMap
::
init_state
()
{
_state_len
=
_max_locals
+
_max_stack
+
_max_monitors
;
_state
=
NEW_RESOURCE_ARRAY
(
CellTypeState
,
_state_len
);
ALLOC_RESOURCE_ARRAY
(
_state
,
CellTypeState
,
_state_len
);
memset
(
_state
,
0
,
_state_len
*
sizeof
(
CellTypeState
));
_state_vec_buf
=
NEW_RESOURCE_ARRAY
(
char
,
MAX3
(
_max_locals
,
_max_stack
,
_max_monitors
)
+
1
/*for null terminator char */
);
int
count
=
MAX3
(
_max_locals
,
_max_stack
,
_max_monitors
)
+
1
/*for null terminator char */
;
ALLOC_RESOURCE_ARRAY
(
_state_vec_buf
,
char
,
count
);
}
void
GenerateOopMap
::
make_context_uninitialized
()
{
...
...
@@ -905,7 +915,7 @@ void GenerateOopMap::init_basic_blocks() {
// But cumbersome since we don't know the stack heights yet. (Nor the
// monitor stack heights...)
_basic_blocks
=
NEW_RESOURCE_ARRAY
(
BasicBlock
,
_bb_count
);
ALLOC_RESOURCE_ARRAY
(
_basic_blocks
,
BasicBlock
,
_bb_count
);
// Make a pass through the bytecodes. Count the number of monitorenters.
// This can be used an upper bound on the monitor stack depth in programs
...
...
@@ -976,8 +986,8 @@ void GenerateOopMap::init_basic_blocks() {
return
;
}
CellTypeState
*
basicBlockState
=
NEW_RESOURCE_ARRAY
(
CellTypeState
,
bbNo
*
_state_len
);
CellTypeState
*
basicBlockState
;
ALLOC_RESOURCE_ARRAY
(
basicBlockState
,
CellTypeState
,
bbNo
*
_state_len
);
memset
(
basicBlockState
,
0
,
bbNo
*
_state_len
*
sizeof
(
CellTypeState
));
// Make a pass over the basicblocks and assign their state vectors.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录