Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
412ae2fd
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看板
提交
412ae2fd
编写于
7月 18, 2013
作者:
C
clucasius
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
a6ed85fa
7db30f27
变更
24
显示空白变更内容
内联
并排
Showing
24 changed file
with
241 addition
and
313 deletion
+241
-313
make/linux/makefiles/vm.make
make/linux/makefiles/vm.make
+2
-1
src/cpu/sparc/vm/stubGenerator_sparc.cpp
src/cpu/sparc/vm/stubGenerator_sparc.cpp
+53
-0
src/cpu/x86/vm/stubGenerator_x86_32.cpp
src/cpu/x86/vm/stubGenerator_x86_32.cpp
+41
-0
src/cpu/x86/vm/stubGenerator_x86_64.cpp
src/cpu/x86/vm/stubGenerator_x86_64.cpp
+46
-0
src/os/windows/vm/os_windows.cpp
src/os/windows/vm/os_windows.cpp
+5
-0
src/os_cpu/bsd_x86/vm/bsd_x86_32.s
src/os_cpu/bsd_x86/vm/bsd_x86_32.s
+0
-18
src/os_cpu/bsd_x86/vm/bsd_x86_64.s
src/os_cpu/bsd_x86/vm/bsd_x86_64.s
+0
-22
src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
+3
-16
src/os_cpu/linux_sparc/vm/linux_sparc.s
src/os_cpu/linux_sparc/vm/linux_sparc.s
+0
-36
src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
+2
-11
src/os_cpu/linux_x86/vm/linux_x86_32.s
src/os_cpu/linux_x86/vm/linux_x86_32.s
+0
-18
src/os_cpu/linux_x86/vm/linux_x86_64.s
src/os_cpu/linux_x86/vm/linux_x86_64.s
+0
-22
src/os_cpu/linux_x86/vm/os_linux_x86.cpp
src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+3
-16
src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
+4
-16
src/os_cpu/solaris_sparc/vm/solaris_sparc.s
src/os_cpu/solaris_sparc/vm/solaris_sparc.s
+0
-41
src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
+3
-17
src/os_cpu/solaris_x86/vm/solaris_x86_32.s
src/os_cpu/solaris_x86/vm/solaris_x86_32.s
+0
-14
src/os_cpu/solaris_x86/vm/solaris_x86_64.s
src/os_cpu/solaris_x86/vm/solaris_x86_64.s
+16
-36
src/os_cpu/windows_x86/vm/os_windows_x86.cpp
src/os_cpu/windows_x86/vm/os_windows_x86.cpp
+0
-18
src/share/vm/runtime/os.hpp
src/share/vm/runtime/os.hpp
+1
-3
src/share/vm/runtime/stubRoutines.cpp
src/share/vm/runtime/stubRoutines.cpp
+7
-0
src/share/vm/runtime/stubRoutines.hpp
src/share/vm/runtime/stubRoutines.hpp
+47
-0
src/share/vm/services/memTracker.cpp
src/share/vm/services/memTracker.cpp
+4
-4
src/share/vm/utilities/globalDefinitions.hpp
src/share/vm/utilities/globalDefinitions.hpp
+4
-4
未找到文件。
make/linux/makefiles/vm.make
浏览文件 @
412ae2fd
...
...
@@ -46,6 +46,7 @@ ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
include
$(MAKEFILES_DIR)/zeroshark.make
else
include
$(MAKEFILES_DIR)/$(BUILDARCH).make
-include
$(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make
endif
# set VPATH so make knows where to look for source files
...
...
@@ -380,4 +381,4 @@ build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) dtraceChe
install
:
install_jvm install_jsig install_saproc
.PHONY
:
default build install install_jvm
.PHONY
:
default build install install_jvm
$(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make
src/cpu/sparc/vm/stubGenerator_sparc.cpp
浏览文件 @
412ae2fd
...
...
@@ -410,6 +410,51 @@ class StubGenerator: public StubCodeGenerator {
return
start
;
}
// Safefetch stubs.
void
generate_safefetch
(
const
char
*
name
,
int
size
,
address
*
entry
,
address
*
fault_pc
,
address
*
continuation_pc
)
{
// safefetch signatures:
// int SafeFetch32(int* adr, int errValue);
// intptr_t SafeFetchN (intptr_t* adr, intptr_t errValue);
//
// arguments:
// o0 = adr
// o1 = errValue
//
// result:
// o0 = *adr or errValue
StubCodeMark
mark
(
this
,
"StubRoutines"
,
name
);
// Entry point, pc or function descriptor.
__
align
(
CodeEntryAlignment
);
*
entry
=
__
pc
();
__
mov
(
O0
,
G1
);
// g1 = o0
__
mov
(
O1
,
O0
);
// o0 = o1
// Load *adr into c_rarg1, may fault.
*
fault_pc
=
__
pc
();
switch
(
size
)
{
case
4
:
// int32_t
__
ldsw
(
G1
,
0
,
O0
);
// o0 = [g1]
break
;
case
8
:
// int64_t
__
ldx
(
G1
,
0
,
O0
);
// o0 = [g1]
break
;
default:
ShouldNotReachHere
();
}
// return errValue or *adr
*
continuation_pc
=
__
pc
();
// By convention with the trap handler we ensure there is a non-CTI
// instruction in the trap shadow.
__
nop
();
__
retl
();
__
delayed
()
->
nop
();
}
//------------------------------------------------------------------------------------------------------------------------
// Continuation point for throwing of implicit exceptions that are not handled in
...
...
@@ -3315,6 +3360,14 @@ class StubGenerator: public StubCodeGenerator {
// Don't initialize the platform math functions since sparc
// doesn't have intrinsics for these operations.
// Safefetch stubs.
generate_safefetch
(
"SafeFetch32"
,
sizeof
(
int
),
&
StubRoutines
::
_safefetch32_entry
,
&
StubRoutines
::
_safefetch32_fault_pc
,
&
StubRoutines
::
_safefetch32_continuation_pc
);
generate_safefetch
(
"SafeFetchN"
,
sizeof
(
intptr_t
),
&
StubRoutines
::
_safefetchN_entry
,
&
StubRoutines
::
_safefetchN_fault_pc
,
&
StubRoutines
::
_safefetchN_continuation_pc
);
}
...
...
src/cpu/x86/vm/stubGenerator_x86_32.cpp
浏览文件 @
412ae2fd
...
...
@@ -2766,6 +2766,39 @@ class StubGenerator: public StubCodeGenerator {
return
start
;
}
// Safefetch stubs.
void
generate_safefetch
(
const
char
*
name
,
int
size
,
address
*
entry
,
address
*
fault_pc
,
address
*
continuation_pc
)
{
// safefetch signatures:
// int SafeFetch32(int* adr, int errValue);
// intptr_t SafeFetchN (intptr_t* adr, intptr_t errValue);
StubCodeMark
mark
(
this
,
"StubRoutines"
,
name
);
// Entry point, pc or function descriptor.
*
entry
=
__
pc
();
__
movl
(
rax
,
Address
(
rsp
,
0x8
));
__
movl
(
rcx
,
Address
(
rsp
,
0x4
));
// Load *adr into eax, may fault.
*
fault_pc
=
__
pc
();
switch
(
size
)
{
case
4
:
// int32_t
__
movl
(
rax
,
Address
(
rcx
,
0
));
break
;
case
8
:
// int64_t
Unimplemented
();
break
;
default:
ShouldNotReachHere
();
}
// Return errValue or *adr.
*
continuation_pc
=
__
pc
();
__
ret
(
0
);
}
public:
// Information about frame layout at time of blocking runtime call.
...
...
@@ -2978,6 +3011,14 @@ class StubGenerator: public StubCodeGenerator {
StubRoutines
::
_cipherBlockChaining_encryptAESCrypt
=
generate_cipherBlockChaining_encryptAESCrypt
();
StubRoutines
::
_cipherBlockChaining_decryptAESCrypt
=
generate_cipherBlockChaining_decryptAESCrypt
();
}
// Safefetch stubs.
generate_safefetch
(
"SafeFetch32"
,
sizeof
(
int
),
&
StubRoutines
::
_safefetch32_entry
,
&
StubRoutines
::
_safefetch32_fault_pc
,
&
StubRoutines
::
_safefetch32_continuation_pc
);
StubRoutines
::
_safefetchN_entry
=
StubRoutines
::
_safefetch32_entry
;
StubRoutines
::
_safefetchN_fault_pc
=
StubRoutines
::
_safefetch32_fault_pc
;
StubRoutines
::
_safefetchN_continuation_pc
=
StubRoutines
::
_safefetch32_continuation_pc
;
}
...
...
src/cpu/x86/vm/stubGenerator_x86_64.cpp
浏览文件 @
412ae2fd
...
...
@@ -3357,7 +3357,45 @@ class StubGenerator: public StubCodeGenerator {
return
start
;
}
// Safefetch stubs.
void
generate_safefetch
(
const
char
*
name
,
int
size
,
address
*
entry
,
address
*
fault_pc
,
address
*
continuation_pc
)
{
// safefetch signatures:
// int SafeFetch32(int* adr, int errValue);
// intptr_t SafeFetchN (intptr_t* adr, intptr_t errValue);
//
// arguments:
// c_rarg0 = adr
// c_rarg1 = errValue
//
// result:
// PPC_RET = *adr or errValue
StubCodeMark
mark
(
this
,
"StubRoutines"
,
name
);
// Entry point, pc or function descriptor.
*
entry
=
__
pc
();
// Load *adr into c_rarg1, may fault.
*
fault_pc
=
__
pc
();
switch
(
size
)
{
case
4
:
// int32_t
__
movl
(
c_rarg1
,
Address
(
c_rarg0
,
0
));
break
;
case
8
:
// int64_t
__
movq
(
c_rarg1
,
Address
(
c_rarg0
,
0
));
break
;
default:
ShouldNotReachHere
();
}
// return errValue or *adr
*
continuation_pc
=
__
pc
();
__
movq
(
rax
,
c_rarg1
);
__
ret
(
0
);
}
// This is a version of CBC/AES Decrypt which does 4 blocks in a loop at a time
// to hide instruction latency
...
...
@@ -3833,6 +3871,14 @@ class StubGenerator: public StubCodeGenerator {
StubRoutines
::
_cipherBlockChaining_encryptAESCrypt
=
generate_cipherBlockChaining_encryptAESCrypt
();
StubRoutines
::
_cipherBlockChaining_decryptAESCrypt
=
generate_cipherBlockChaining_decryptAESCrypt_Parallel
();
}
// Safefetch stubs.
generate_safefetch
(
"SafeFetch32"
,
sizeof
(
int
),
&
StubRoutines
::
_safefetch32_entry
,
&
StubRoutines
::
_safefetch32_fault_pc
,
&
StubRoutines
::
_safefetch32_continuation_pc
);
generate_safefetch
(
"SafeFetchN"
,
sizeof
(
intptr_t
),
&
StubRoutines
::
_safefetchN_entry
,
&
StubRoutines
::
_safefetchN_fault_pc
,
&
StubRoutines
::
_safefetchN_continuation_pc
);
}
public:
...
...
src/os/windows/vm/os_windows.cpp
浏览文件 @
412ae2fd
...
...
@@ -2323,6 +2323,11 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
#endif
Thread
*
t
=
ThreadLocalStorage
::
get_thread_slow
();
// slow & steady
// Handle SafeFetch32 and SafeFetchN exceptions.
if
(
StubRoutines
::
is_safefetch_fault
(
pc
))
{
return
Handle_Exception
(
exceptionInfo
,
StubRoutines
::
continuation_for_safefetch_fault
(
pc
));
}
#ifndef _WIN64
// Execution protection violation - win32 running on AMD64 only
// Handled first to avoid misdiagnosis as a "normal" access violation;
...
...
src/os_cpu/bsd_x86/vm/bsd_x86_32.s
浏览文件 @
412ae2fd
...
...
@@ -63,24 +63,6 @@ SYMBOL(fixcw):
popl
%
eax
ret
.
globl
SYMBOL
(
SafeFetch32
),
SYMBOL
(
Fetch32PFI
),
SYMBOL
(
Fetch32Resume
)
.
globl
SYMBOL
(
SafeFetchN
)
#
#
TODO
:
avoid
exposing
Fetch32PFI
and
Fetch32Resume
.
#
#
Instead
,
the
signal
handler
would
call
a
new
SafeFetchTriage
(
FaultingEIP
)
#
#
routine
to
vet
the
address
.
If
the
address
is
the
faulting
LD
then
#
#
SafeFetchTriage
()
would
return
the
resume
-
at
EIP
,
otherwise
null
.
ELF_TYPE
(
SafeFetch32
,@
function
)
.
p2align
4
,,
15
SYMBOL
(
SafeFetch32
):
SYMBOL
(
SafeFetchN
):
movl
0x8
(%
esp
),
%
eax
movl
0x4
(%
esp
),
%
ecx
SYMBOL
(
Fetch32PFI
):
movl
(%
ecx
),
%
eax
SYMBOL
(
Fetch32Resume
):
ret
.
globl
SYMBOL
(
SpinPause
)
ELF_TYPE
(
SpinPause
,@
function
)
.
p2align
4
,,
15
...
...
src/os_cpu/bsd_x86/vm/bsd_x86_64.s
浏览文件 @
412ae2fd
...
...
@@ -46,28 +46,6 @@
.
text
.
globl
SYMBOL
(
SafeFetch32
),
SYMBOL
(
Fetch32PFI
),
SYMBOL
(
Fetch32Resume
)
.
p2align
4
,,
15
ELF_TYPE
(
SafeFetch32
,@
function
)
//
Prototype
:
int
SafeFetch32
(
int
*
Adr
,
int
ErrValue
)
SYMBOL
(
SafeFetch32
):
movl
%
esi
,
%
eax
SYMBOL
(
Fetch32PFI
):
movl
(%
rdi
),
%
eax
SYMBOL
(
Fetch32Resume
):
ret
.
globl
SYMBOL
(
SafeFetchN
),
SYMBOL
(
FetchNPFI
),
SYMBOL
(
FetchNResume
)
.
p2align
4
,,
15
ELF_TYPE
(
SafeFetchN
,@
function
)
//
Prototype
:
intptr_t
SafeFetchN
(
intptr_t
*
Adr
,
intptr_t
ErrValue
)
SYMBOL
(
SafeFetchN
):
movq
%
rsi
,
%
rax
SYMBOL
(
FetchNPFI
):
movq
(%
rdi
),
%
rax
SYMBOL
(
FetchNResume
):
ret
.
globl
SYMBOL
(
SpinPause
)
.
p2align
4
,,
15
ELF_TYPE
(
SpinPause
,@
function
)
...
...
src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
浏览文件 @
412ae2fd
...
...
@@ -385,13 +385,6 @@ enum {
trap_page_fault
=
0xE
};
extern
"C"
void
Fetch32PFI
()
;
extern
"C"
void
Fetch32Resume
()
;
#ifdef AMD64
extern
"C"
void
FetchNPFI
()
;
extern
"C"
void
FetchNResume
()
;
#endif // AMD64
extern
"C"
JNIEXPORT
int
JVM_handle_bsd_signal
(
int
sig
,
siginfo_t
*
info
,
...
...
@@ -454,16 +447,10 @@ JVM_handle_bsd_signal(int sig,
if
(
info
!=
NULL
&&
uc
!=
NULL
&&
thread
!=
NULL
)
{
pc
=
(
address
)
os
::
Bsd
::
ucontext_get_pc
(
uc
);
if
(
pc
==
(
address
)
Fetch32PFI
)
{
uc
->
context_pc
=
intptr_t
(
Fetch32Resume
)
;
return
1
;
}
#ifdef AMD64
if
(
pc
==
(
address
)
FetchNPFI
)
{
uc
->
context_pc
=
intptr_t
(
FetchNResume
)
;
return
1
;
if
(
StubRoutines
::
is_safefetch_fault
(
pc
))
{
uc
->
context_pc
=
intptr_t
(
StubRoutines
::
continuation_for_safefetch_fault
(
pc
));
return
1
;
}
#endif // AMD64
// Handle ALL stack overflow variations here
if
(
sig
==
SIGSEGV
||
sig
==
SIGBUS
)
{
...
...
src/os_cpu/linux_sparc/vm/linux_sparc.s
浏览文件 @
412ae2fd
...
...
@@ -21,42 +21,6 @@
#
questions
.
#
#
Prototype
:
int
SafeFetch32
(
int
*
adr
,
int
ErrValue
)
#
The
"ld"
at
Fetch32
is
potentially
faulting
instruction
.
#
If
the
instruction
traps
the
trap
handler
will
arrange
#
for
control
to
resume
at
Fetch32Resume
.
#
By
convention
with
the
trap
handler
we
ensure
there
is
a
non
-
CTI
#
instruction
in
the
trap
shadow
.
.
globl
SafeFetch32
,
Fetch32PFI
,
Fetch32Resume
.
globl
SafeFetchN
.
align
32
.
type
SafeFetch32
,
@
function
SafeFetch32
:
mov
%
o0
,
%
g1
mov
%
o1
,
%
o0
Fetch32PFI
:
#
<--
Potentially
faulting
instruction
ld
[%
g1
],
%
o0
Fetch32Resume
:
nop
retl
nop
.
globl
SafeFetchN
,
FetchNPFI
,
FetchNResume
.
type
SafeFetchN
,
@
function
.
align
32
SafeFetchN
:
mov
%
o0
,
%
g1
mov
%
o1
,
%
o0
FetchNPFI
:
ldn
[%
g1
],
%
o0
FetchNResume
:
nop
retl
nop
#
Possibilities
:
#
--
membar
#
--
CAS
(
SP
+
BIAS
,
G0
,
G0
)
...
...
src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
浏览文件 @
412ae2fd
...
...
@@ -366,18 +366,9 @@ intptr_t* os::Linux::ucontext_get_fp(ucontext_t *uc) {
// Utility functions
extern
"C"
void
Fetch32PFI
();
extern
"C"
void
Fetch32Resume
();
extern
"C"
void
FetchNPFI
();
extern
"C"
void
FetchNResume
();
inline
static
bool
checkPrefetch
(
sigcontext
*
uc
,
address
pc
)
{
if
(
pc
==
(
address
)
Fetch32PFI
)
{
set_cont_address
(
uc
,
address
(
Fetch32Resume
));
return
true
;
}
if
(
pc
==
(
address
)
FetchNPFI
)
{
set_cont_address
(
uc
,
address
(
FetchNResume
));
if
(
StubRoutines
::
is_safefetch_fault
(
pc
))
{
set_cont_address
(
uc
,
address
(
StubRoutines
::
continuation_for_safefetch_fault
(
pc
)));
return
true
;
}
return
false
;
...
...
src/os_cpu/linux_x86/vm/linux_x86_32.s
浏览文件 @
412ae2fd
...
...
@@ -42,24 +42,6 @@
.
text
.
globl
SafeFetch32
,
Fetch32PFI
,
Fetch32Resume
.
globl
SafeFetchN
#
#
TODO
:
avoid
exposing
Fetch32PFI
and
Fetch32Resume
.
#
#
Instead
,
the
signal
handler
would
call
a
new
SafeFetchTriage
(
FaultingEIP
)
#
#
routine
to
vet
the
address
.
If
the
address
is
the
faulting
LD
then
#
#
SafeFetchTriage
()
would
return
the
resume
-
at
EIP
,
otherwise
null
.
.
type
SafeFetch32
,
@
function
.
p2align
4
,,
15
SafeFetch32
:
SafeFetchN
:
movl
0x8
(%
esp
),
%
eax
movl
0x4
(%
esp
),
%
ecx
Fetch32PFI
:
movl
(%
ecx
),
%
eax
Fetch32Resume
:
ret
.
globl
SpinPause
.
type
SpinPause
,
@
function
.
p2align
4
,,
15
...
...
src/os_cpu/linux_x86/vm/linux_x86_64.s
浏览文件 @
412ae2fd
...
...
@@ -38,28 +38,6 @@
.
text
.
globl
SafeFetch32
,
Fetch32PFI
,
Fetch32Resume
.
align
16
.
type
SafeFetch32
,
@
function
//
Prototype
:
int
SafeFetch32
(
int
*
Adr
,
int
ErrValue
)
SafeFetch32
:
movl
%
esi
,
%
eax
Fetch32PFI
:
movl
(%
rdi
),
%
eax
Fetch32Resume
:
ret
.
globl
SafeFetchN
,
FetchNPFI
,
FetchNResume
.
align
16
.
type
SafeFetchN
,
@
function
//
Prototype
:
intptr_t
SafeFetchN
(
intptr_t
*
Adr
,
intptr_t
ErrValue
)
SafeFetchN
:
movq
%
rsi
,
%
rax
FetchNPFI
:
movq
(%
rdi
),
%
rax
FetchNResume
:
ret
.
globl
SpinPause
.
align
16
.
type
SpinPause
,
@
function
...
...
src/os_cpu/linux_x86/vm/os_linux_x86.cpp
浏览文件 @
412ae2fd
...
...
@@ -209,13 +209,6 @@ enum {
trap_page_fault
=
0xE
};
extern
"C"
void
Fetch32PFI
()
;
extern
"C"
void
Fetch32Resume
()
;
#ifdef AMD64
extern
"C"
void
FetchNPFI
()
;
extern
"C"
void
FetchNResume
()
;
#endif // AMD64
extern
"C"
JNIEXPORT
int
JVM_handle_linux_signal
(
int
sig
,
siginfo_t
*
info
,
...
...
@@ -278,16 +271,10 @@ JVM_handle_linux_signal(int sig,
if
(
info
!=
NULL
&&
uc
!=
NULL
&&
thread
!=
NULL
)
{
pc
=
(
address
)
os
::
Linux
::
ucontext_get_pc
(
uc
);
if
(
pc
==
(
address
)
Fetch32PFI
)
{
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
=
intptr_t
(
Fetch32Resume
)
;
return
1
;
}
#ifdef AMD64
if
(
pc
==
(
address
)
FetchNPFI
)
{
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
=
intptr_t
(
FetchNResume
)
;
return
1
;
if
(
StubRoutines
::
is_safefetch_fault
(
pc
))
{
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
=
intptr_t
(
StubRoutines
::
continuation_for_safefetch_fault
(
pc
));
return
1
;
}
#endif // AMD64
#ifndef AMD64
// Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs
...
...
src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
浏览文件 @
412ae2fd
...
...
@@ -303,11 +303,6 @@ bool os::is_allocatable(size_t bytes) {
#endif
}
extern
"C"
void
Fetch32PFI
()
;
extern
"C"
void
Fetch32Resume
()
;
extern
"C"
void
FetchNPFI
()
;
extern
"C"
void
FetchNResume
()
;
extern
"C"
JNIEXPORT
int
JVM_handle_solaris_signal
(
int
sig
,
siginfo_t
*
info
,
void
*
ucVoid
,
int
abort_if_unrecognized
)
{
...
...
@@ -379,17 +374,10 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
npc
=
(
address
)
uc
->
uc_mcontext
.
gregs
[
REG_nPC
];
// SafeFetch() support
// Implemented with either a fixed set of addresses such
// as Fetch32*, or with Thread._OnTrap.
if
(
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
==
intptr_t
(
Fetch32PFI
))
{
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
=
intptr_t
(
Fetch32Resume
)
;
uc
->
uc_mcontext
.
gregs
[
REG_nPC
]
=
intptr_t
(
Fetch32Resume
)
+
4
;
return
true
;
}
if
(
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
==
intptr_t
(
FetchNPFI
))
{
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
=
intptr_t
(
FetchNResume
)
;
uc
->
uc_mcontext
.
gregs
[
REG_nPC
]
=
intptr_t
(
FetchNResume
)
+
4
;
return
true
;
if
(
StubRoutines
::
is_safefetch_fault
(
pc
))
{
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
=
intptr_t
(
StubRoutines
::
continuation_for_safefetch_fault
(
pc
));
uc
->
uc_mcontext
.
gregs
[
REG_nPC
]
=
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
+
4
;
return
1
;
}
// Handle ALL stack overflow variations here
...
...
src/os_cpu/solaris_sparc/vm/solaris_sparc.s
浏览文件 @
412ae2fd
...
...
@@ -21,47 +21,6 @@
!!
questions
.
!!
!
!
Prototype
:
int
SafeFetch32
(
int
*
adr
,
int
ErrValue
)
!
!
The
"ld"
at
Fetch32
is
potentially
faulting
instruction
.
!
!
If
the
instruction
traps
the
trap
handler
will
arrange
!
!
for
control
to
resume
at
Fetch32Resume
.
!
!
By
convention
with
the
trap
handler
we
ensure
there
is
a
non
-
CTI
!
!
instruction
in
the
trap
shadow
.
!
!
!
!
The
reader
might
be
tempted
to
move
this
service
to
.
il
.
!
!
Don
't. Sun'
s
CC
back
-
end
reads
and
optimize
code
emitted
!
!
by
the
.
il
"call"
,
in
some
cases
optimizing
the
code
,
completely
eliding
it
,
!
!
or
by
moving
the
code
from
the
"call site"
.
!
!
ASM
better
know
we
may
use
G6
for
our
own
purposes
.
register
%
g6
,
#
ignore
.
globl
SafeFetch32
.
align
32
.
global
Fetch32PFI
,
Fetch32Resume
SafeFetch32
:
mov
%
o0
,
%
g1
mov
%
o1
,
%
o0
Fetch32PFI
:
ld
[%
g1
],
%
o0
!!
<--
Potentially
faulting
instruction
Fetch32Resume
:
nop
retl
nop
.
globl
SafeFetchN
.
align
32
.
globl
FetchNPFI
,
FetchNResume
SafeFetchN
:
mov
%
o0
,
%
g1
mov
%
o1
,
%
o0
FetchNPFI
:
ldn
[%
g1
],
%
o0
FetchNResume
:
nop
retl
nop
!
!
Possibilities
:
!
!
--
membar
!
!
--
CAS
(
SP
+
BIAS
,
G0
,
G0
)
...
...
src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
浏览文件 @
412ae2fd
...
...
@@ -352,13 +352,6 @@ bool os::is_allocatable(size_t bytes) {
}
extern
"C"
void
Fetch32PFI
()
;
extern
"C"
void
Fetch32Resume
()
;
#ifdef AMD64
extern
"C"
void
FetchNPFI
()
;
extern
"C"
void
FetchNResume
()
;
#endif // AMD64
extern
"C"
JNIEXPORT
int
JVM_handle_solaris_signal
(
int
sig
,
siginfo_t
*
info
,
void
*
ucVoid
,
int
abort_if_unrecognized
)
{
...
...
@@ -436,17 +429,10 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
// factor me: getPCfromContext
pc
=
(
address
)
uc
->
uc_mcontext
.
gregs
[
REG_PC
];
// SafeFetch32() support
if
(
pc
==
(
address
)
Fetch32PFI
)
{
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
=
intptr_t
(
Fetch32Resume
)
;
return
true
;
}
#ifdef AMD64
if
(
pc
==
(
address
)
FetchNPFI
)
{
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
=
intptr_t
(
FetchNResume
)
;
return
true
;
if
(
StubRoutines
::
is_safefetch_fault
(
pc
))
{
uc
->
uc_mcontext
.
gregs
[
REG_PC
]
=
intptr_t
(
StubRoutines
::
continuation_for_safefetch_fault
(
pc
));
return
true
;
}
#endif // AMD64
// Handle ALL stack overflow variations here
if
(
sig
==
SIGSEGV
&&
info
->
si_code
==
SEGV_ACCERR
)
{
...
...
src/os_cpu/solaris_x86/vm/solaris_x86_32.s
浏览文件 @
412ae2fd
...
...
@@ -54,20 +54,6 @@ fixcw:
popl
%
eax
ret
.
align
16
.
globl
SafeFetch32
.
globl
SafeFetchN
.
globl
Fetch32PFI
,
Fetch32Resume
SafeFetch32
:
SafeFetchN
:
movl
0x8
(%
esp
),
%
eax
movl
0x4
(%
esp
),
%
ecx
Fetch32PFI
:
movl
(%
ecx
),
%
eax
Fetch32Resume
:
ret
.
align
16
.
globl
SpinPause
SpinPause
:
...
...
src/os_cpu/solaris_x86/vm/solaris_x86_64.s
浏览文件 @
412ae2fd
...
...
@@ -51,26 +51,6 @@ fs_thread:
movq
%
fs
:
0x0
,%
rax
ret
.
globl
SafeFetch32
,
Fetch32PFI
,
Fetch32Resume
.
align
16
//
Prototype
:
int
SafeFetch32
(
int
*
Adr
,
int
ErrValue
)
SafeFetch32
:
movl
%
esi
,
%
eax
Fetch32PFI
:
movl
(%
rdi
),
%
eax
Fetch32Resume
:
ret
.
globl
SafeFetchN
,
FetchNPFI
,
FetchNResume
.
align
16
//
Prototype
:
intptr_t
SafeFetchN
(
intptr_t
*
Adr
,
intptr_t
ErrValue
)
SafeFetchN
:
movq
%
rsi
,
%
rax
FetchNPFI
:
movq
(%
rdi
),
%
rax
FetchNResume
:
ret
.
globl
SpinPause
.
align
16
SpinPause
:
...
...
src/os_cpu/windows_x86/vm/os_windows_x86.cpp
浏览文件 @
412ae2fd
...
...
@@ -518,24 +518,6 @@ void os::print_register_info(outputStream *st, void *context) {
st
->
cr
();
}
extern
"C"
int
SafeFetch32
(
int
*
adr
,
int
Err
)
{
int
rv
=
Err
;
_try
{
rv
=
*
((
volatile
int
*
)
adr
)
;
}
__except
(
EXCEPTION_EXECUTE_HANDLER
)
{
}
return
rv
;
}
extern
"C"
intptr_t
SafeFetchN
(
intptr_t
*
adr
,
intptr_t
Err
)
{
intptr_t
rv
=
Err
;
_try
{
rv
=
*
((
volatile
intptr_t
*
)
adr
)
;
}
__except
(
EXCEPTION_EXECUTE_HANDLER
)
{
}
return
rv
;
}
extern
"C"
int
SpinPause
()
{
#ifdef AMD64
return
0
;
...
...
src/share/vm/runtime/os.hpp
浏览文件 @
412ae2fd
...
...
@@ -915,8 +915,6 @@ class os: AllStatic {
// of the global SpinPause() with C linkage.
// It'd also be eligible for inlining on many platforms.
extern
"C"
int
SpinPause
()
;
extern
"C"
int
SafeFetch32
(
int
*
adr
,
int
errValue
)
;
extern
"C"
intptr_t
SafeFetchN
(
intptr_t
*
adr
,
intptr_t
errValue
)
;
extern
"C"
int
SpinPause
();
#endif // SHARE_VM_RUNTIME_OS_HPP
src/share/vm/runtime/stubRoutines.cpp
浏览文件 @
412ae2fd
...
...
@@ -136,6 +136,13 @@ double (* StubRoutines::_intrinsic_sin )(double) = NULL;
double
(
*
StubRoutines
::
_intrinsic_cos
)(
double
)
=
NULL
;
double
(
*
StubRoutines
::
_intrinsic_tan
)(
double
)
=
NULL
;
address
StubRoutines
::
_safefetch32_entry
=
NULL
;
address
StubRoutines
::
_safefetch32_fault_pc
=
NULL
;
address
StubRoutines
::
_safefetch32_continuation_pc
=
NULL
;
address
StubRoutines
::
_safefetchN_entry
=
NULL
;
address
StubRoutines
::
_safefetchN_fault_pc
=
NULL
;
address
StubRoutines
::
_safefetchN_continuation_pc
=
NULL
;
// Initialization
//
// Note: to break cycle with universe initialization, stubs are generated in two phases.
...
...
src/share/vm/runtime/stubRoutines.hpp
浏览文件 @
412ae2fd
...
...
@@ -221,6 +221,14 @@ class StubRoutines: AllStatic {
static
double
(
*
_intrinsic_cos
)(
double
);
static
double
(
*
_intrinsic_tan
)(
double
);
// Safefetch stubs.
static
address
_safefetch32_entry
;
static
address
_safefetch32_fault_pc
;
static
address
_safefetch32_continuation_pc
;
static
address
_safefetchN_entry
;
static
address
_safefetchN_fault_pc
;
static
address
_safefetchN_continuation_pc
;
public:
// Initialization/Testing
static
void
initialize1
();
// must happen before universe::genesis
...
...
@@ -381,6 +389,34 @@ class StubRoutines: AllStatic {
return
_intrinsic_tan
(
d
);
}
//
// Safefetch stub support
//
typedef
int
(
*
SafeFetch32Stub
)(
int
*
adr
,
int
errValue
);
typedef
intptr_t
(
*
SafeFetchNStub
)
(
intptr_t
*
adr
,
intptr_t
errValue
);
static
SafeFetch32Stub
SafeFetch32_stub
()
{
return
CAST_TO_FN_PTR
(
SafeFetch32Stub
,
_safefetch32_entry
);
}
static
SafeFetchNStub
SafeFetchN_stub
()
{
return
CAST_TO_FN_PTR
(
SafeFetchNStub
,
_safefetchN_entry
);
}
static
bool
is_safefetch_fault
(
address
pc
)
{
return
pc
!=
NULL
&&
(
pc
==
_safefetch32_fault_pc
||
pc
==
_safefetchN_fault_pc
);
}
static
address
continuation_for_safefetch_fault
(
address
pc
)
{
assert
(
_safefetch32_continuation_pc
!=
NULL
&&
_safefetchN_continuation_pc
!=
NULL
,
"not initialized"
);
if
(
pc
==
_safefetch32_fault_pc
)
return
_safefetch32_continuation_pc
;
if
(
pc
==
_safefetchN_fault_pc
)
return
_safefetchN_continuation_pc
;
ShouldNotReachHere
();
return
NULL
;
}
//
// Default versions of the above arraycopy functions for platforms which do
// not have specialized versions
...
...
@@ -400,4 +436,15 @@ class StubRoutines: AllStatic {
static
void
arrayof_oop_copy_uninit
(
HeapWord
*
src
,
HeapWord
*
dest
,
size_t
count
);
};
// Safefetch allows to load a value from a location that's not known
// to be valid. If the load causes a fault, the error value is returned.
inline
int
SafeFetch32
(
int
*
adr
,
int
errValue
)
{
assert
(
StubRoutines
::
SafeFetch32_stub
(),
"stub not yet generated"
);
return
StubRoutines
::
SafeFetch32_stub
()(
adr
,
errValue
);
}
inline
intptr_t
SafeFetchN
(
intptr_t
*
adr
,
intptr_t
errValue
)
{
assert
(
StubRoutines
::
SafeFetchN_stub
(),
"stub not yet generated"
);
return
StubRoutines
::
SafeFetchN_stub
()(
adr
,
errValue
);
}
#endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP
src/share/vm/services/memTracker.cpp
浏览文件 @
412ae2fd
...
...
@@ -81,13 +81,13 @@ void MemTracker::init_tracking_options(const char* option_line) {
}
else
if
(
strcmp
(
option_line
,
"=detail"
)
==
0
)
{
// detail relies on a stack-walking ability that may not
// be available depending on platform and/or compiler flags
if
(
PLATFORM_NMT_DETAIL_SUPPORTED
)
{
#if PLATFORM_NATIVE_STACK_WALKING_SUPPORTED
_tracking_level
=
NMT_detail
;
}
else
{
#else
jio_fprintf
(
defaultStream
::
error_stream
(),
"NMT detail is not supported on this platform. Using NMT summary instead."
);
"NMT detail is not supported on this platform. Using NMT summary instead.
\n
"
);
_tracking_level
=
NMT_summary
;
}
#endif
}
else
if
(
strcmp
(
option_line
,
"=off"
)
!=
0
)
{
vm_exit_during_initialization
(
"Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]"
,
NULL
);
}
...
...
src/share/vm/utilities/globalDefinitions.hpp
浏览文件 @
412ae2fd
...
...
@@ -381,12 +381,12 @@ const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlass
#endif
/*
* If a platform does not support
NMT_detail
* If a platform does not support
native stack walking
* the platform specific globalDefinitions (above)
* can set PLATFORM_N
MT_DETAIL_SUPPORTED to false
* can set PLATFORM_N
ATIVE_STACK_WALKING_SUPPORTED to 0
*/
#ifndef PLATFORM_N
MT_DETAIL
_SUPPORTED
#define PLATFORM_N
MT_DETAIL_SUPPORTED true
#ifndef PLATFORM_N
ATIVE_STACK_WALKING
_SUPPORTED
#define PLATFORM_N
ATIVE_STACK_WALKING_SUPPORTED 1
#endif
// The byte alignment to be used by Arena::Amalloc. See bugid 4169348.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录