Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
4b437dc0
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看板
提交
4b437dc0
编写于
7月 06, 2011
作者:
J
jcoomes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7061197: ThreadLocalStorage sp map table should be optional
Reviewed-by: dholmes, never, jwilhelm, kvn
上级
349d9164
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
49 addition
and
15 deletion
+49
-15
src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp
src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp
+23
-0
src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp
src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp
+14
-7
src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
+12
-8
未找到文件。
src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp
浏览文件 @
4b437dc0
...
...
@@ -33,6 +33,28 @@ void MacroAssembler::int3() {
call
(
RuntimeAddress
(
CAST_FROM_FN_PTR
(
address
,
os
::
breakpoint
)));
}
#ifdef MINIMIZE_RAM_USAGE
void
MacroAssembler
::
get_thread
(
Register
thread
)
{
// call pthread_getspecific
// void * pthread_getspecific(pthread_key_t key);
if
(
thread
!=
rax
)
push
(
rax
);
push
(
rcx
);
push
(
rdx
);
push
(
ThreadLocalStorage
::
thread_index
());
call
(
RuntimeAddress
(
CAST_FROM_FN_PTR
(
address
,
pthread_getspecific
)));
increment
(
rsp
,
wordSize
);
pop
(
rdx
);
pop
(
rcx
);
if
(
thread
!=
rax
)
{
mov
(
thread
,
rax
);
pop
(
rax
);
}
}
#else
void
MacroAssembler
::
get_thread
(
Register
thread
)
{
movl
(
thread
,
rsp
);
shrl
(
thread
,
PAGE_SHIFT
);
...
...
@@ -43,6 +65,7 @@ void MacroAssembler::get_thread(Register thread) {
movptr
(
thread
,
tls
);
}
#endif // MINIMIZE_RAM_USAGE
#else
void
MacroAssembler
::
int3
()
{
call
(
RuntimeAddress
(
CAST_FROM_FN_PTR
(
address
,
os
::
breakpoint
)));
...
...
src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp
浏览文件 @
4b437dc0
...
...
@@ -52,25 +52,20 @@
// MADV_DONTNEED on Linux keeps the virtual memory mapping, but zaps the
// physical memory page (i.e. similar to MADV_FREE on Solaris).
#if
ndef AMD64
#if
!defined(AMD64) && !defined(MINIMIZE_RAM_USAGE)
Thread
*
ThreadLocalStorage
::
_sp_map
[
1UL
<<
(
SP_BITLENGTH
-
PAGE_SHIFT
)];
#endif // !AMD64
void
ThreadLocalStorage
::
generate_code_for_get_thread
()
{
// nothing we can do here for user-level thread
}
void
ThreadLocalStorage
::
pd_init
()
{
#ifndef AMD64
assert
(
align_size_down
(
os
::
vm_page_size
(),
PAGE_SIZE
)
==
os
::
vm_page_size
(),
"page size must be multiple of PAGE_SIZE"
);
#endif // !AMD64
}
void
ThreadLocalStorage
::
pd_set_thread
(
Thread
*
thread
)
{
os
::
thread_local_storage_at_put
(
ThreadLocalStorage
::
thread_index
(),
thread
);
#ifndef AMD64
address
stack_top
=
os
::
current_stack_base
();
size_t
stack_size
=
os
::
current_stack_size
();
...
...
@@ -88,5 +83,17 @@ void ThreadLocalStorage::pd_set_thread(Thread* thread) {
"thread exited without detaching from VM??"
);
_sp_map
[(
uintptr_t
)
p
>>
PAGE_SHIFT
]
=
thread
;
}
#endif // !AMD64
}
#else
void
ThreadLocalStorage
::
generate_code_for_get_thread
()
{
// nothing we can do here for user-level thread
}
void
ThreadLocalStorage
::
pd_init
()
{
}
void
ThreadLocalStorage
::
pd_set_thread
(
Thread
*
thread
)
{
os
::
thread_local_storage_at_put
(
ThreadLocalStorage
::
thread_index
(),
thread
);
}
#endif // !AMD64 && !MINIMIZE_RAM_USAGE
src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
浏览文件 @
4b437dc0
...
...
@@ -27,28 +27,32 @@
// Processor dependent parts of ThreadLocalStorage
#ifndef AMD64
#if !defined(AMD64) && !defined(MINIMIZE_RAM_USAGE)
// map stack pointer to thread pointer - see notes in threadLS_linux_x86.cpp
#define SP_BITLENGTH 32
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL << PAGE_SHIFT)
static
Thread
*
_sp_map
[
1UL
<<
(
SP_BITLENGTH
-
PAGE_SHIFT
)];
#endif // !AMD64
public
:
#ifndef AMD64
static
Thread
**
sp_map_addr
()
{
return
_sp_map
;
}
#endif // !AMD64
static
Thread
*
thread
()
{
#ifdef AMD64
return
(
Thread
*
)
os
::
thread_local_storage_at
(
thread_index
());
#else
uintptr_t
sp
;
__asm__
volatile
(
"movl %%esp, %0"
:
"=r"
(
sp
));
return
_sp_map
[
sp
>>
PAGE_SHIFT
];
#endif // AMD64
}
#else
public
:
static
Thread
*
thread
()
{
return
(
Thread
*
)
os
::
thread_local_storage_at
(
thread_index
());
}
#endif // AMD64 || MINIMIZE_RAM_USAGE
#endif // OS_CPU_LINUX_X86_VM_THREADLS_LINUX_X86_HPP
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录