Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
a2aec15c
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看板
提交
a2aec15c
编写于
3月 01, 2013
作者:
D
dcubed
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
a975965f
db7b5bb8
变更
44
显示空白变更内容
内联
并排
Showing
44 changed file
with
266 addition
and
174 deletion
+266
-174
agent/src/os/linux/LinuxDebuggerLocal.c
agent/src/os/linux/LinuxDebuggerLocal.c
+50
-1
agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java
...un/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java
+6
-1
agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java
...es/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java
+6
-1
src/os/bsd/vm/os_bsd.cpp
src/os/bsd/vm/os_bsd.cpp
+8
-8
src/os/bsd/vm/os_bsd.hpp
src/os/bsd/vm/os_bsd.hpp
+12
-23
src/os/bsd/vm/os_bsd.inline.hpp
src/os/bsd/vm/os_bsd.inline.hpp
+17
-1
src/os/linux/vm/os_linux.cpp
src/os/linux/vm/os_linux.cpp
+8
-8
src/os/linux/vm/os_linux.hpp
src/os/linux/vm/os_linux.hpp
+12
-24
src/os/linux/vm/os_linux.inline.hpp
src/os/linux/vm/os_linux.inline.hpp
+17
-1
src/os/solaris/vm/os_solaris.inline.hpp
src/os/solaris/vm/os_solaris.inline.hpp
+0
-1
src/os/windows/vm/decoder_windows.cpp
src/os/windows/vm/decoder_windows.cpp
+2
-1
src/os/windows/vm/os_windows.inline.hpp
src/os/windows/vm/os_windows.inline.hpp
+0
-1
src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp
src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp
+1
-2
src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp
src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp
+3
-2
src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp
src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp
+1
-2
src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
+1
-2
src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp
src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp
+1
-2
src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
+3
-2
src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
+1
-2
src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp
src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp
+1
-2
src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp
...cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp
+2
-1
src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp
src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp
+1
-2
src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp
src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp
+2
-2
src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp
src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp
+1
-2
src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp
src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp
+3
-6
src/share/vm/c1/c1_FrameMap.cpp
src/share/vm/c1/c1_FrameMap.cpp
+0
-21
src/share/vm/c1/c1_FrameMap.hpp
src/share/vm/c1/c1_FrameMap.hpp
+0
-2
src/share/vm/classfile/classLoaderData.hpp
src/share/vm/classfile/classLoaderData.hpp
+1
-0
src/share/vm/classfile/classLoaderData.inline.hpp
src/share/vm/classfile/classLoaderData.inline.hpp
+8
-2
src/share/vm/classfile/dictionary.cpp
src/share/vm/classfile/dictionary.cpp
+1
-0
src/share/vm/classfile/systemDictionary.cpp
src/share/vm/classfile/systemDictionary.cpp
+10
-4
src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp
...hare/vm/gc_implementation/parNew/parCardTableModRefBS.cpp
+2
-0
src/share/vm/memory/allocation.inline.hpp
src/share/vm/memory/allocation.inline.hpp
+2
-1
src/share/vm/memory/cardTableModRefBS.cpp
src/share/vm/memory/cardTableModRefBS.cpp
+1
-1
src/share/vm/memory/cardTableRS.cpp
src/share/vm/memory/cardTableRS.cpp
+1
-1
src/share/vm/oops/symbol.cpp
src/share/vm/oops/symbol.cpp
+24
-1
src/share/vm/oops/symbol.hpp
src/share/vm/oops/symbol.hpp
+3
-26
src/share/vm/prims/jvmtiEnter.xsl
src/share/vm/prims/jvmtiEnter.xsl
+4
-4
src/share/vm/prims/jvmtiEnvBase.cpp
src/share/vm/prims/jvmtiEnvBase.cpp
+8
-2
src/share/vm/runtime/synchronizer.cpp
src/share/vm/runtime/synchronizer.cpp
+1
-0
src/share/vm/runtime/thread.cpp
src/share/vm/runtime/thread.cpp
+4
-2
src/share/vm/services/memReporter.cpp
src/share/vm/services/memReporter.cpp
+2
-2
src/share/vm/services/threadService.cpp
src/share/vm/services/threadService.cpp
+34
-4
src/share/vm/utilities/numberSeq.cpp
src/share/vm/utilities/numberSeq.cpp
+1
-1
未找到文件。
agent/src/os/linux/LinuxDebuggerLocal.c
浏览文件 @
a2aec15c
/*
* Copyright (c) 2002, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
...
...
@@ -25,6 +25,13 @@
#include <jni.h>
#include "libproc.h"
#include <elf.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <limits.h>
#if defined(x86_64) && !defined(amd64)
#define amd64 1
#endif
...
...
@@ -154,6 +161,39 @@ static void fillThreadsAndLoadObjects(JNIEnv* env, jobject this_obj, struct ps_p
}
}
/*
* Verify that a named ELF binary file (core or executable) has the same
* bitness as ourselves.
* Throw an exception if there is a mismatch or other problem.
*
* If we proceed using a mismatched debugger/debuggee, the best to hope
* for is a missing symbol, the worst is a crash searching for debug symbols.
*/
void
verifyBitness
(
JNIEnv
*
env
,
const
char
*
binaryName
)
{
int
fd
=
open
(
binaryName
,
O_RDONLY
);
if
(
fd
<
0
)
{
THROW_NEW_DEBUGGER_EXCEPTION
(
"cannot open binary file"
);
}
unsigned
char
elf_ident
[
EI_NIDENT
];
int
i
=
read
(
fd
,
&
elf_ident
,
sizeof
(
elf_ident
));
close
(
fd
);
if
(
i
<
0
)
{
THROW_NEW_DEBUGGER_EXCEPTION
(
"cannot read binary file"
);
}
#ifndef _LP64
if
(
elf_ident
[
EI_CLASS
]
==
ELFCLASS64
)
{
THROW_NEW_DEBUGGER_EXCEPTION
(
"debuggee is 64 bit, use 64-bit java for debugger"
);
}
#else
if
(
elf_ident
[
EI_CLASS
]
!=
ELFCLASS64
)
{
THROW_NEW_DEBUGGER_EXCEPTION
(
"debuggee is 32 bit, use 32 bit java for debugger"
);
}
#endif
}
/*
* Class: sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal
* Method: attach0
...
...
@@ -162,6 +202,12 @@ static void fillThreadsAndLoadObjects(JNIEnv* env, jobject this_obj, struct ps_p
JNIEXPORT
void
JNICALL
Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_attach0__I
(
JNIEnv
*
env
,
jobject
this_obj
,
jint
jpid
)
{
// For bitness checking, locate binary at /proc/jpid/exe
char
buf
[
PATH_MAX
];
snprintf
((
char
*
)
&
buf
,
PATH_MAX
,
"/proc/%d/exe"
,
jpid
);
verifyBitness
(
env
,
(
char
*
)
&
buf
);
CHECK_EXCEPTION
;
struct
ps_prochandle
*
ph
;
if
(
(
ph
=
Pgrab
(
jpid
))
==
NULL
)
{
THROW_NEW_DEBUGGER_EXCEPTION
(
"Can't attach to the process"
);
...
...
@@ -187,6 +233,9 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_at
coreName_cstr
=
(
*
env
)
->
GetStringUTFChars
(
env
,
coreName
,
&
isCopy
);
CHECK_EXCEPTION
;
verifyBitness
(
env
,
execName_cstr
);
CHECK_EXCEPTION
;
if
(
(
ph
=
Pgrab_core
(
execName_cstr
,
coreName_cstr
))
==
NULL
)
{
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
execName
,
execName_cstr
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
coreName
,
coreName_cstr
);
...
...
agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java
浏览文件 @
a2aec15c
...
...
@@ -60,8 +60,13 @@ final public class LinuxAMD64CFrame extends BasicCFrame {
return
null
;
}
// Check alignment of rbp
if
(
dbg
.
getAddressValue
(
rbp
)
%
ADDRESS_SIZE
!=
0
)
{
return
null
;
}
Address
nextRBP
=
rbp
.
getAddressAt
(
0
*
ADDRESS_SIZE
);
if
(
nextRBP
==
null
)
{
if
(
nextRBP
==
null
||
nextRBP
.
lessThanOrEqual
(
rbp
)
)
{
return
null
;
}
Address
nextPC
=
rbp
.
getAddressAt
(
1
*
ADDRESS_SIZE
);
...
...
agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java
浏览文件 @
a2aec15c
...
...
@@ -61,8 +61,13 @@ final public class LinuxX86CFrame extends BasicCFrame {
return
null
;
}
// Check alignment of ebp
if
(
dbg
.
getAddressValue
(
ebp
)
%
ADDRESS_SIZE
!=
0
)
{
return
null
;
}
Address
nextEBP
=
ebp
.
getAddressAt
(
0
*
ADDRESS_SIZE
);
if
(
nextEBP
==
null
)
{
if
(
nextEBP
==
null
||
nextEBP
.
lessThanOrEqual
(
ebp
)
)
{
return
null
;
}
Address
nextPC
=
ebp
.
getAddressAt
(
1
*
ADDRESS_SIZE
);
...
...
src/os/bsd/vm/os_bsd.cpp
浏览文件 @
a2aec15c
...
...
@@ -2695,7 +2695,7 @@ static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) {
assert
(
thread
->
is_VM_thread
(),
"Must be VMThread"
);
// read current suspend action
int
action
=
osthread
->
sr
.
suspend_action
();
if
(
action
==
SR_SUSPEND
)
{
if
(
action
==
os
::
Bsd
::
SuspendResume
::
SR_SUSPEND
)
{
suspend_save_context
(
osthread
,
siginfo
,
context
);
// Notify the suspend action is about to be completed. do_suspend()
...
...
@@ -2717,12 +2717,12 @@ static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) {
do
{
sigsuspend
(
&
suspend_set
);
// ignore all returns until we get a resume signal
}
while
(
osthread
->
sr
.
suspend_action
()
!=
SR_CONTINUE
);
}
while
(
osthread
->
sr
.
suspend_action
()
!=
os
::
Bsd
::
SuspendResume
::
SR_CONTINUE
);
resume_clear_context
(
osthread
);
}
else
{
assert
(
action
==
SR_CONTINUE
,
"unexpected sr action"
);
assert
(
action
==
os
::
Bsd
::
SuspendResume
::
SR_CONTINUE
,
"unexpected sr action"
);
// nothing special to do - just leave the handler
}
...
...
@@ -2776,7 +2776,7 @@ static int SR_finalize() {
// but this seems the normal response to library errors
static
bool
do_suspend
(
OSThread
*
osthread
)
{
// mark as suspended and send signal
osthread
->
sr
.
set_suspend_action
(
SR_SUSPEND
);
osthread
->
sr
.
set_suspend_action
(
os
::
Bsd
::
SuspendResume
::
SR_SUSPEND
);
int
status
=
pthread_kill
(
osthread
->
pthread_id
(),
SR_signum
);
assert_status
(
status
==
0
,
status
,
"pthread_kill"
);
...
...
@@ -2785,18 +2785,18 @@ static bool do_suspend(OSThread* osthread) {
for
(
int
i
=
0
;
!
osthread
->
sr
.
is_suspended
();
i
++
)
{
os
::
yield_all
(
i
);
}
osthread
->
sr
.
set_suspend_action
(
SR_NONE
);
osthread
->
sr
.
set_suspend_action
(
os
::
Bsd
::
SuspendResume
::
SR_NONE
);
return
true
;
}
else
{
osthread
->
sr
.
set_suspend_action
(
SR_NONE
);
osthread
->
sr
.
set_suspend_action
(
os
::
Bsd
::
SuspendResume
::
SR_NONE
);
return
false
;
}
}
static
void
do_resume
(
OSThread
*
osthread
)
{
assert
(
osthread
->
sr
.
is_suspended
(),
"thread should be suspended"
);
osthread
->
sr
.
set_suspend_action
(
SR_CONTINUE
);
osthread
->
sr
.
set_suspend_action
(
os
::
Bsd
::
SuspendResume
::
SR_CONTINUE
);
int
status
=
pthread_kill
(
osthread
->
pthread_id
(),
SR_signum
);
assert_status
(
status
==
0
,
status
,
"pthread_kill"
);
...
...
@@ -2806,7 +2806,7 @@ static void do_resume(OSThread* osthread) {
os
::
yield_all
(
i
);
}
}
osthread
->
sr
.
set_suspend_action
(
SR_NONE
);
osthread
->
sr
.
set_suspend_action
(
os
::
Bsd
::
SuspendResume
::
SR_NONE
);
}
////////////////////////////////////////////////////////////////////////////////
...
...
src/os/bsd/vm/os_bsd.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 1999, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
...
...
@@ -152,35 +152,24 @@ class Bsd {
class
SuspendResume
{
private:
volatile
int
_suspend_action
;
// values for suspend_action:
#define SR_NONE (0x00)
#define SR_SUSPEND (0x01) // suspend request
#define SR_CONTINUE (0x02) // resume request
volatile
jint
_state
;
// values for _state: + SR_NONE
#define SR_SUSPENDED (0x20)
public:
// values for suspend_action:
enum
{
SR_NONE
=
0x00
,
SR_SUSPEND
=
0x01
,
// suspend request
SR_CONTINUE
=
0x02
,
// resume request
SR_SUSPENDED
=
0x20
// values for _state: + SR_NONE
};
SuspendResume
()
{
_suspend_action
=
SR_NONE
;
_state
=
SR_NONE
;
}
int
suspend_action
()
const
{
return
_suspend_action
;
}
void
set_suspend_action
(
int
x
)
{
_suspend_action
=
x
;
}
// atomic updates for _state
void
set_suspended
()
{
jint
temp
,
temp2
;
do
{
temp
=
_state
;
temp2
=
Atomic
::
cmpxchg
(
temp
|
SR_SUSPENDED
,
&
_state
,
temp
);
}
while
(
temp2
!=
temp
);
}
void
clear_suspended
()
{
jint
temp
,
temp2
;
do
{
temp
=
_state
;
temp2
=
Atomic
::
cmpxchg
(
temp
&
~
SR_SUSPENDED
,
&
_state
,
temp
);
}
while
(
temp2
!=
temp
);
}
inline
void
set_suspended
();
inline
void
clear_suspended
();
bool
is_suspended
()
{
return
_state
&
SR_SUSPENDED
;
}
#undef SR_SUSPENDED
...
...
src/os/bsd/vm/os_bsd.inline.hpp
浏览文件 @
a2aec15c
...
...
@@ -25,7 +25,6 @@
#ifndef OS_BSD_VM_OS_BSD_INLINE_HPP
#define OS_BSD_VM_OS_BSD_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/os.hpp"
...
...
@@ -286,4 +285,21 @@ inline int os::set_sock_opt(int fd, int level, int optname,
const
char
*
optval
,
socklen_t
optlen
)
{
return
::
setsockopt
(
fd
,
level
,
optname
,
optval
,
optlen
);
}
inline
void
os
::
Bsd
::
SuspendResume
::
set_suspended
()
{
jint
temp
,
temp2
;
do
{
temp
=
_state
;
temp2
=
Atomic
::
cmpxchg
(
temp
|
SR_SUSPENDED
,
&
_state
,
temp
);
}
while
(
temp2
!=
temp
);
}
inline
void
os
::
Bsd
::
SuspendResume
::
clear_suspended
()
{
jint
temp
,
temp2
;
do
{
temp
=
_state
;
temp2
=
Atomic
::
cmpxchg
(
temp
&
~
SR_SUSPENDED
,
&
_state
,
temp
);
}
while
(
temp2
!=
temp
);
}
#endif // OS_BSD_VM_OS_BSD_INLINE_HPP
src/os/linux/vm/os_linux.cpp
浏览文件 @
a2aec15c
...
...
@@ -3461,7 +3461,7 @@ static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) {
assert
(
thread
->
is_VM_thread
(),
"Must be VMThread"
);
// read current suspend action
int
action
=
osthread
->
sr
.
suspend_action
();
if
(
action
==
SR_SUSPEND
)
{
if
(
action
==
os
::
Linux
::
SuspendResume
::
SR_SUSPEND
)
{
suspend_save_context
(
osthread
,
siginfo
,
context
);
// Notify the suspend action is about to be completed. do_suspend()
...
...
@@ -3483,12 +3483,12 @@ static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) {
do
{
sigsuspend
(
&
suspend_set
);
// ignore all returns until we get a resume signal
}
while
(
osthread
->
sr
.
suspend_action
()
!=
SR_CONTINUE
);
}
while
(
osthread
->
sr
.
suspend_action
()
!=
os
::
Linux
::
SuspendResume
::
SR_CONTINUE
);
resume_clear_context
(
osthread
);
}
else
{
assert
(
action
==
SR_CONTINUE
,
"unexpected sr action"
);
assert
(
action
==
os
::
Linux
::
SuspendResume
::
SR_CONTINUE
,
"unexpected sr action"
);
// nothing special to do - just leave the handler
}
...
...
@@ -3542,7 +3542,7 @@ static int SR_finalize() {
// but this seems the normal response to library errors
static
bool
do_suspend
(
OSThread
*
osthread
)
{
// mark as suspended and send signal
osthread
->
sr
.
set_suspend_action
(
SR_SUSPEND
);
osthread
->
sr
.
set_suspend_action
(
os
::
Linux
::
SuspendResume
::
SR_SUSPEND
);
int
status
=
pthread_kill
(
osthread
->
pthread_id
(),
SR_signum
);
assert_status
(
status
==
0
,
status
,
"pthread_kill"
);
...
...
@@ -3551,18 +3551,18 @@ static bool do_suspend(OSThread* osthread) {
for
(
int
i
=
0
;
!
osthread
->
sr
.
is_suspended
();
i
++
)
{
os
::
yield_all
(
i
);
}
osthread
->
sr
.
set_suspend_action
(
SR_NONE
);
osthread
->
sr
.
set_suspend_action
(
os
::
Linux
::
SuspendResume
::
SR_NONE
);
return
true
;
}
else
{
osthread
->
sr
.
set_suspend_action
(
SR_NONE
);
osthread
->
sr
.
set_suspend_action
(
os
::
Linux
::
SuspendResume
::
SR_NONE
);
return
false
;
}
}
static
void
do_resume
(
OSThread
*
osthread
)
{
assert
(
osthread
->
sr
.
is_suspended
(),
"thread should be suspended"
);
osthread
->
sr
.
set_suspend_action
(
SR_CONTINUE
);
osthread
->
sr
.
set_suspend_action
(
os
::
Linux
::
SuspendResume
::
SR_CONTINUE
);
int
status
=
pthread_kill
(
osthread
->
pthread_id
(),
SR_signum
);
assert_status
(
status
==
0
,
status
,
"pthread_kill"
);
...
...
@@ -3572,7 +3572,7 @@ static void do_resume(OSThread* osthread) {
os
::
yield_all
(
i
);
}
}
osthread
->
sr
.
set_suspend_action
(
SR_NONE
);
osthread
->
sr
.
set_suspend_action
(
os
::
Linux
::
SuspendResume
::
SR_NONE
);
}
////////////////////////////////////////////////////////////////////////////////
...
...
src/os/linux/vm/os_linux.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 1999, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
...
...
@@ -210,38 +210,26 @@ class Linux {
class
SuspendResume
{
private:
volatile
int
_suspend_action
;
// values for suspend_action:
#define SR_NONE (0x00)
#define SR_SUSPEND (0x01) // suspend request
#define SR_CONTINUE (0x02) // resume request
volatile
jint
_state
;
// values for _state: + SR_NONE
#define SR_SUSPENDED (0x20)
public:
// values for suspend_action:
enum
{
SR_NONE
=
0x00
,
SR_SUSPEND
=
0x01
,
// suspend request
SR_CONTINUE
=
0x02
,
// resume request
SR_SUSPENDED
=
0x20
// values for _state: + SR_NONE
};
SuspendResume
()
{
_suspend_action
=
SR_NONE
;
_state
=
SR_NONE
;
}
int
suspend_action
()
const
{
return
_suspend_action
;
}
void
set_suspend_action
(
int
x
)
{
_suspend_action
=
x
;
}
// atomic updates for _state
void
set_suspended
()
{
jint
temp
,
temp2
;
do
{
temp
=
_state
;
temp2
=
Atomic
::
cmpxchg
(
temp
|
SR_SUSPENDED
,
&
_state
,
temp
);
}
while
(
temp2
!=
temp
);
}
void
clear_suspended
()
{
jint
temp
,
temp2
;
do
{
temp
=
_state
;
temp2
=
Atomic
::
cmpxchg
(
temp
&
~
SR_SUSPENDED
,
&
_state
,
temp
);
}
while
(
temp2
!=
temp
);
}
inline
void
set_suspended
();
inline
void
clear_suspended
();
bool
is_suspended
()
{
return
_state
&
SR_SUSPENDED
;
}
#undef SR_SUSPENDED
};
private:
...
...
src/os/linux/vm/os_linux.inline.hpp
浏览文件 @
a2aec15c
...
...
@@ -25,7 +25,6 @@
#ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP
#define OS_LINUX_VM_OS_LINUX_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/os.hpp"
...
...
@@ -288,4 +287,21 @@ inline int os::set_sock_opt(int fd, int level, int optname,
const
char
*
optval
,
socklen_t
optlen
)
{
return
::
setsockopt
(
fd
,
level
,
optname
,
optval
,
optlen
);
}
inline
void
os
::
Linux
::
SuspendResume
::
set_suspended
()
{
jint
temp
,
temp2
;
do
{
temp
=
_state
;
temp2
=
Atomic
::
cmpxchg
(
temp
|
SR_SUSPENDED
,
&
_state
,
temp
);
}
while
(
temp2
!=
temp
);
}
inline
void
os
::
Linux
::
SuspendResume
::
clear_suspended
()
{
jint
temp
,
temp2
;
do
{
temp
=
_state
;
temp2
=
Atomic
::
cmpxchg
(
temp
&
~
SR_SUSPENDED
,
&
_state
,
temp
);
}
while
(
temp2
!=
temp
);
}
#endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP
src/os/solaris/vm/os_solaris.inline.hpp
浏览文件 @
a2aec15c
...
...
@@ -25,7 +25,6 @@
#ifndef OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
#define OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/os.hpp"
...
...
src/os/windows/vm/decoder_windows.cpp
浏览文件 @
a2aec15c
/*
* 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
...
...
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "prims/jvm.h"
#include "runtime/arguments.hpp"
#include "decoder_windows.hpp"
WindowsDecoder
::
WindowsDecoder
()
{
...
...
src/os/windows/vm/os_windows.inline.hpp
浏览文件 @
a2aec15c
...
...
@@ -25,7 +25,6 @@
#ifndef OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
#define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/os.hpp"
...
...
src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 1999, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
...
...
@@ -25,7 +25,6 @@
#ifndef OS_CPU_BSD_X86_VM_ATOMIC_BSD_X86_INLINE_HPP
#define OS_CPU_BSD_X86_VM_ATOMIC_BSD_X86_INLINE_HPP
#include "orderAccess_bsd_x86.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/os.hpp"
#include "vm_version_x86.hpp"
...
...
src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
...
...
@@ -25,8 +25,9 @@
#ifndef OS_CPU_BSD_X86_VM_ORDERACCESS_BSD_X86_INLINE_HPP
#define OS_CPU_BSD_X86_VM_ORDERACCESS_BSD_X86_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/atomic.
inline.
hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/os.hpp"
#include "vm_version_x86.hpp"
// Implementation of class OrderAccess.
...
...
src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
...
...
@@ -26,7 +26,6 @@
#ifndef OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_INLINE_HPP
#define OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_INLINE_HPP
#include "orderAccess_bsd_zero.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/os.hpp"
#include "vm_version_zero.hpp"
...
...
src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 1999, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
...
...
@@ -25,7 +25,6 @@
#ifndef OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP
#define OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP
#include "orderAccess_linux_sparc.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/os.hpp"
#include "vm_version_sparc.hpp"
...
...
src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 1999, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
...
...
@@ -25,7 +25,6 @@
#ifndef OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP
#define OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP
#include "orderAccess_linux_x86.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/os.hpp"
#include "vm_version_x86.hpp"
...
...
src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
...
...
@@ -25,8 +25,9 @@
#ifndef OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
#define OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/atomic.
inline.
hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/os.hpp"
#include "vm_version_x86.hpp"
// Implementation of class OrderAccess.
...
...
src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
...
...
@@ -26,7 +26,6 @@
#ifndef OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP
#define OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP
#include "orderAccess_linux_zero.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/os.hpp"
#include "vm_version_zero.hpp"
...
...
src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 1999, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
...
...
@@ -25,7 +25,6 @@
#ifndef OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP
#define OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP
#include "orderAccess_solaris_sparc.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/os.hpp"
#include "vm_version_sparc.hpp"
...
...
src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
...
...
@@ -25,6 +25,7 @@
#ifndef OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
#define OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
#include "runtime/atomic.inline.hpp"
#include "runtime/orderAccess.hpp"
#include "vm_version_sparc.hpp"
...
...
src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 1999, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
...
...
@@ -25,7 +25,6 @@
#ifndef OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP
#define OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP
#include "orderAccess_solaris_x86.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/os.hpp"
#include "vm_version_x86.hpp"
...
...
src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
...
...
@@ -25,7 +25,7 @@
#ifndef OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
#define OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/atomic.
inline.
hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/os.hpp"
#include "vm_version_x86.hpp"
...
...
src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 1999, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
...
...
@@ -25,7 +25,6 @@
#ifndef OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
#define OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
#include "orderAccess_windows_x86.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/os.hpp"
#include "vm_version_x86.hpp"
...
...
src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
...
...
@@ -25,12 +25,11 @@
#ifndef OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
#define OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/atomic.
inline.
hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/os.hpp"
#include "vm_version_x86.hpp"
#pragma warning(disable: 4035) // Disables warnings reporting missing return statement
// Implementation of class OrderAccess.
inline
void
OrderAccess
::
loadload
()
{
acquire
();
}
...
...
@@ -214,6 +213,4 @@ inline void OrderAccess::release_store_ptr_fence(volatile void* p, void*
#endif // AMD64
}
#pragma warning(default: 4035) // Enables warnings reporting missing return statement
#endif // OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
src/share/vm/c1/c1_FrameMap.cpp
浏览文件 @
a2aec15c
...
...
@@ -308,27 +308,6 @@ ByteSize FrameMap::sp_offset_for_monitor_object(int index) const {
return
sp_offset_for_monitor_base
(
index
)
+
in_ByteSize
(
BasicObjectLock
::
obj_offset_in_bytes
());
}
void
FrameMap
::
print_frame_layout
()
const
{
int
svar
;
tty
->
print_cr
(
"#####################################"
);
tty
->
print_cr
(
"Frame size in words %d"
,
framesize
());
if
(
_num_monitors
>
0
)
{
tty
->
print_cr
(
"monitor [0]:%d | [%2d]:%d"
,
in_bytes
(
sp_offset_for_monitor_base
(
0
)),
in_bytes
(
sp_offset_for_monitor_base
(
_num_monitors
)));
}
if
(
_num_spills
>
0
)
{
svar
=
_num_spills
-
1
;
if
(
svar
==
0
)
tty
->
print_cr
(
"spill [0]:%d"
,
in_bytes
(
sp_offset_for_spill
(
0
)));
else
tty
->
print_cr
(
"spill [0]:%d | [%2d]:%d"
,
in_bytes
(
sp_offset_for_spill
(
0
)),
svar
,
in_bytes
(
sp_offset_for_spill
(
svar
)));
}
}
// For OopMaps, map a local variable or spill index to an VMReg.
// This is the offset from sp() in the frame of the slot for the index,
...
...
src/share/vm/c1/c1_FrameMap.hpp
浏览文件 @
a2aec15c
...
...
@@ -226,8 +226,6 @@ class FrameMap : public CompilationResourceObj {
return
make_new_address
(
sp_offset_for_monitor_object
(
monitor_index
));
}
void
print_frame_layout
()
const
;
// Creates Location describing desired slot and returns it via pointer
// to Location object. Returns true if the stack frame offset was legal
// (as defined by Location::legal_offset_in_bytes()), false otherwise.
...
...
src/share/vm/classfile/classLoaderData.hpp
浏览文件 @
a2aec15c
...
...
@@ -234,6 +234,7 @@ class ClassLoaderData : public CHeapObj<mtClass> {
void
add_to_deallocate_list
(
Metadata
*
m
);
static
ClassLoaderData
*
class_loader_data
(
oop
loader
);
static
ClassLoaderData
*
class_loader_data_or_null
(
oop
loader
);
static
ClassLoaderData
*
anonymous_class_loader_data
(
oop
loader
,
TRAPS
);
static
void
print_loader
(
ClassLoaderData
*
loader_data
,
outputStream
*
out
);
...
...
src/share/vm/classfile/classLoaderData.inline.hpp
浏览文件 @
a2aec15c
...
...
@@ -25,9 +25,15 @@
#include "classfile/classLoaderData.hpp"
#include "classfile/javaClasses.hpp"
inline
ClassLoaderData
*
ClassLoaderData
::
class_loader_data_or_null
(
oop
loader
)
{
if
(
loader
==
NULL
)
{
return
ClassLoaderData
::
the_null_class_loader_data
();
}
return
java_lang_ClassLoader
::
loader_data
(
loader
);
}
inline
ClassLoaderData
*
ClassLoaderData
::
class_loader_data
(
oop
loader
)
{
if
(
loader
==
NULL
)
return
ClassLoaderData
::
the_null_class_loader_data
();
ClassLoaderData
*
loader_data
=
java_lang_ClassLoader
::
loader_data
(
loader
);
ClassLoaderData
*
loader_data
=
class_loader_data_or_null
(
loader
);
assert
(
loader_data
!=
NULL
,
"Must be"
);
return
loader_data
;
}
...
...
src/share/vm/classfile/dictionary.cpp
浏览文件 @
a2aec15c
...
...
@@ -347,6 +347,7 @@ void Dictionary::add_klass(Symbol* class_name, ClassLoaderData* loader_data,
assert_locked_or_safepoint
(
SystemDictionary_lock
);
assert
(
obj
()
!=
NULL
,
"adding NULL obj"
);
assert
(
obj
()
->
name
()
==
class_name
,
"sanity check on name"
);
assert
(
loader_data
!=
NULL
,
"Must be non-NULL"
);
unsigned
int
hash
=
compute_hash
(
class_name
,
loader_data
);
int
index
=
hash_to_index
(
hash
);
...
...
src/share/vm/classfile/systemDictionary.cpp
浏览文件 @
a2aec15c
...
...
@@ -875,7 +875,13 @@ Klass* SystemDictionary::find(Symbol* class_name,
// of the call to resolve_instance_class_or_null().
// See evaluation 6790209 and 4474172 for more details.
class_loader
=
Handle
(
THREAD
,
java_lang_ClassLoader
::
non_reflection_class_loader
(
class_loader
()));
ClassLoaderData
*
loader_data
=
register_loader
(
class_loader
,
CHECK_NULL
);
ClassLoaderData
*
loader_data
=
ClassLoaderData
::
class_loader_data_or_null
(
class_loader
());
if
(
loader_data
==
NULL
)
{
// If the ClassLoaderData has not been setup,
// then the class loader has no entries in the dictionary.
return
NULL
;
}
unsigned
int
d_hash
=
dictionary
()
->
compute_hash
(
class_name
,
loader_data
);
int
d_index
=
dictionary
()
->
hash_to_index
(
d_hash
);
...
...
src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp
浏览文件 @
a2aec15c
...
...
@@ -373,6 +373,8 @@ process_chunk_boundaries(Space* sp,
" does not exceed used.end() = "
PTR_FORMAT
","
" yet last_chunk_index_to_check "
INTPTR_FORMAT
" exceeds last_chunk_index "
INTPTR_FORMAT
,
last_block
,
last_block
+
last_block_size
,
used
.
end
(),
last_chunk_index_to_check
,
last_chunk_index
));
assert
(
sp
->
used_region
().
end
()
>
used
.
end
(),
err_msg
(
"Expansion did not happen: "
...
...
src/share/vm/memory/allocation.inline.hpp
浏览文件 @
a2aec15c
/*
* 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
...
...
@@ -25,6 +25,7 @@
#ifndef SHARE_VM_MEMORY_ALLOCATION_INLINE_HPP
#define SHARE_VM_MEMORY_ALLOCATION_INLINE_HPP
#include "runtime/atomic.inline.hpp"
#include "runtime/os.hpp"
// Explicit C-heap memory management
...
...
src/share/vm/memory/cardTableModRefBS.cpp
浏览文件 @
a2aec15c
...
...
@@ -694,7 +694,7 @@ void CardTableModRefBS::verify_region(MemRegion mr,
if
(
failed
)
{
if
(
!
failures
)
{
tty
->
cr
();
tty
->
print_cr
(
"== CT verification failed: ["
PTR_FORMAT
","
PTR_FORMAT
"]"
);
tty
->
print_cr
(
"== CT verification failed: ["
PTR_FORMAT
","
PTR_FORMAT
"]"
,
start
,
end
);
tty
->
print_cr
(
"== %sexpecting value: %d"
,
(
val_equals
)
?
""
:
"not "
,
val
);
failures
=
true
;
...
...
src/share/vm/memory/cardTableRS.cpp
浏览文件 @
a2aec15c
...
...
@@ -353,7 +353,7 @@ protected:
assert
(
jp
>=
_begin
&&
jp
<
_end
,
err_msg
(
"Error: jp "
PTR_FORMAT
" should be within "
"[_begin, _end) = ["
PTR_FORMAT
","
PTR_FORMAT
")"
,
_begin
,
_end
));
jp
,
_begin
,
_end
));
oop
obj
=
oopDesc
::
load_decode_heap_oop
(
p
);
guarantee
(
obj
==
NULL
||
(
HeapWord
*
)
obj
>=
_boundary
,
err_msg
(
"pointer "
PTR_FORMAT
" at "
PTR_FORMAT
" on "
...
...
src/share/vm/oops/symbol.cpp
浏览文件 @
a2aec15c
/*
* 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
...
...
@@ -27,6 +27,7 @@
#include "classfile/altHashing.hpp"
#include "classfile/classLoaderData.hpp"
#include "oops/symbol.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/os.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
...
...
@@ -210,6 +211,28 @@ unsigned int Symbol::new_hash(jint seed) {
return
AltHashing
::
murmur3_32
(
seed
,
(
const
jbyte
*
)
as_C_string
(),
utf8_length
());
}
void
Symbol
::
increment_refcount
()
{
// Only increment the refcount if positive. If negative either
// overflow has occurred or it is a permanent symbol in a read only
// shared archive.
if
(
_refcount
>=
0
)
{
Atomic
::
inc
(
&
_refcount
);
NOT_PRODUCT
(
Atomic
::
inc
(
&
_total_count
);)
}
}
void
Symbol
::
decrement_refcount
()
{
if
(
_refcount
>=
0
)
{
Atomic
::
dec
(
&
_refcount
);
#ifdef ASSERT
if
(
_refcount
<
0
)
{
print
();
assert
(
false
,
"reference count underflow for symbol"
);
}
#endif
}
}
void
Symbol
::
print_on
(
outputStream
*
st
)
const
{
if
(
this
==
NULL
)
{
st
->
print_cr
(
"NULL"
);
...
...
src/share/vm/oops/symbol.hpp
浏览文件 @
a2aec15c
/*
* 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
...
...
@@ -27,7 +27,6 @@
#include "utilities/utf8.hpp"
#include "memory/allocation.hpp"
#include "runtime/atomic.hpp"
// A Symbol is a canonicalized string.
// All Symbols reside in global SymbolTable and are reference counted.
...
...
@@ -150,8 +149,8 @@ class Symbol : public MetaspaceObj {
// Reference counting. See comments above this class for when to use.
int
refcount
()
const
{
return
_refcount
;
}
inline
void
increment_refcount
();
inline
void
decrement_refcount
();
void
increment_refcount
();
void
decrement_refcount
();
int
byte_at
(
int
index
)
const
{
assert
(
index
>=
0
&&
index
<
_length
,
"symbol index overflow"
);
...
...
@@ -232,26 +231,4 @@ int Symbol::fast_compare(Symbol* other) const {
return
(((
uintptr_t
)
this
<
(
uintptr_t
)
other
)
?
-
1
:
((
uintptr_t
)
this
==
(
uintptr_t
)
other
)
?
0
:
1
);
}
inline
void
Symbol
::
increment_refcount
()
{
// Only increment the refcount if positive. If negative either
// overflow has occurred or it is a permanent symbol in a read only
// shared archive.
if
(
_refcount
>=
0
)
{
Atomic
::
inc
(
&
_refcount
);
NOT_PRODUCT
(
Atomic
::
inc
(
&
_total_count
);)
}
}
inline
void
Symbol
::
decrement_refcount
()
{
if
(
_refcount
>=
0
)
{
Atomic
::
dec
(
&
_refcount
);
#ifdef ASSERT
if
(
_refcount
<
0
)
{
print
();
assert
(
false
,
"reference count underflow for symbol"
);
}
#endif
}
}
#endif // SHARE_VM_OOPS_SYMBOL_HPP
src/share/vm/prims/jvmtiEnter.xsl
浏览文件 @
a2aec15c
...
...
@@ -773,7 +773,7 @@ static jvmtiError JNICALL
</xsl:text>
<xsl:apply-templates
select=
".."
mode=
"traceError"
>
<xsl:with-param
name=
"err"
>
JVMTI_ERROR_INVALID_THREAD
</xsl:with-param>
<xsl:with-param
name=
"comment"
>
- jthread resolved to NULL - jthread =
%
0x%x
</xsl:with-param>
<xsl:with-param
name=
"comment"
>
- jthread resolved to NULL - jthread = 0x%x
</xsl:with-param>
<xsl:with-param
name=
"extraValue"
>
,
<xsl:value-of
select=
"$name"
/></xsl:with-param>
</xsl:apply-templates>
<xsl:text>
...
...
@@ -782,7 +782,7 @@ static jvmtiError JNICALL
</xsl:text>
<xsl:apply-templates
select=
".."
mode=
"traceError"
>
<xsl:with-param
name=
"err"
>
JVMTI_ERROR_INVALID_THREAD
</xsl:with-param>
<xsl:with-param
name=
"comment"
>
- oop is not a thread - jthread =
%
0x%x
</xsl:with-param>
<xsl:with-param
name=
"comment"
>
- oop is not a thread - jthread = 0x%x
</xsl:with-param>
<xsl:with-param
name=
"extraValue"
>
,
<xsl:value-of
select=
"$name"
/></xsl:with-param>
</xsl:apply-templates>
<xsl:text>
...
...
@@ -794,7 +794,7 @@ static jvmtiError JNICALL
<xsl:with-param
name=
"err"
>
<xsl:text>
JVMTI_ERROR_THREAD_NOT_ALIVE
</xsl:text>
</xsl:with-param>
<xsl:with-param
name=
"comment"
>
- not a Java thread - jthread =
%
0x%x
</xsl:with-param>
<xsl:with-param
name=
"comment"
>
- not a Java thread - jthread = 0x%x
</xsl:with-param>
<xsl:with-param
name=
"extraValue"
>
,
<xsl:value-of
select=
"$name"
/></xsl:with-param>
</xsl:apply-templates>
<xsl:text>
...
...
@@ -838,7 +838,7 @@ static jvmtiError JNICALL
</xsl:text>
<xsl:apply-templates
select=
".."
mode=
"traceError"
>
<xsl:with-param
name=
"err"
>
JVMTI_ERROR_ILLEGAL_ARGUMENT
</xsl:with-param>
<xsl:with-param
name=
"comment"
>
- negative depth - jthread =
%
0x%x
</xsl:with-param>
<xsl:with-param
name=
"comment"
>
- negative depth - jthread = 0x%x
</xsl:with-param>
<xsl:with-param
name=
"extraValue"
>
,
<xsl:value-of
select=
"$name"
/></xsl:with-param>
</xsl:apply-templates>
<xsl:text>
...
...
src/share/vm/prims/jvmtiEnvBase.cpp
浏览文件 @
a2aec15c
...
...
@@ -997,13 +997,19 @@ JvmtiEnvBase::get_object_monitor_usage(JavaThread* calling_thread, jobject objec
// move our object at this point. However, our owner value is safe
// since it is either the Lock word on a stack or a JavaThread *.
owning_thread
=
Threads
::
owning_thread_from_monitor_owner
(
owner
,
!
at_safepoint
);
assert
(
owning_thread
!=
NULL
,
"sanity check"
);
if
(
owning_thread
!=
NULL
)
{
// robustness
// Cannot assume (owning_thread != NULL) here because this function
// may not have been called at a safepoint and the owning_thread
// might not be suspended.
if
(
owning_thread
!=
NULL
)
{
// The monitor's owner either has to be the current thread, at safepoint
// or it has to be suspended. Any of these conditions will prevent both
// contending and waiting threads from modifying the state of
// the monitor.
if
(
!
at_safepoint
&&
!
JvmtiEnv
::
is_thread_fully_suspended
(
owning_thread
,
true
,
&
debug_bits
))
{
// Don't worry! This return of JVMTI_ERROR_THREAD_NOT_SUSPENDED
// will not make it back to the JVM/TI agent. The error code will
// get intercepted in JvmtiEnv::GetObjectMonitorUsage() which
// will retry the call via a VM_GetObjectMonitorUsage VM op.
return
JVMTI_ERROR_THREAD_NOT_SUSPENDED
;
}
HandleMark
hm
;
...
...
src/share/vm/runtime/synchronizer.cpp
浏览文件 @
a2aec15c
...
...
@@ -813,6 +813,7 @@ JavaThread* ObjectSynchronizer::get_lock_owner(Handle h_obj, bool doLock) {
}
if
(
owner
!=
NULL
)
{
// owning_thread_from_monitor_owner() may also return NULL here
return
Threads
::
owning_thread_from_monitor_owner
(
owner
,
doLock
);
}
...
...
src/share/vm/runtime/thread.cpp
浏览文件 @
a2aec15c
...
...
@@ -4285,7 +4285,9 @@ JavaThread *Threads::owning_thread_from_monitor_owner(address owner, bool doLock
if
(
owner
==
(
address
)
p
)
return
p
;
}
}
assert
(
UseHeavyMonitors
==
false
,
"Did not find owning Java thread with UseHeavyMonitors enabled"
);
// Cannot assert on lack of success here since this function may be
// used by code that is trying to report useful problem information
// like deadlock detection.
if
(
UseHeavyMonitors
)
return
NULL
;
//
...
...
@@ -4303,7 +4305,7 @@ JavaThread *Threads::owning_thread_from_monitor_owner(address owner, bool doLock
}
}
}
assert
(
the_owner
!=
NULL
,
"Did not find owning Java thread for lock word address"
);
// cannot assert on lack of success here; see above comment
return
the_owner
;
}
...
...
src/share/vm/services/memReporter.cpp
浏览文件 @
a2aec15c
...
...
@@ -419,7 +419,7 @@ void BaselineTTYOutputer::virtual_memory_callsite(address pc, size_t reserved_am
_output
->
print_cr
(
"["
PTR_FORMAT
"] %s+0x%x"
,
pc
,
buf
,
offset
);
_output
->
print
(
"%28s"
,
" "
);
}
else
{
_output
->
print
(
"["
PTR_FORMAT
"]%18s"
,
" "
);
_output
->
print
(
"["
PTR_FORMAT
"]%18s"
,
pc
,
" "
);
}
_output
->
print_cr
(
"(mmap: reserved=%d%s, committed=%d%s)"
,
...
...
@@ -596,7 +596,7 @@ void BaselineTTYOutputer::diff_virtual_memory_callsite(address pc,
_output
->
print_cr
(
"["
PTR_FORMAT
"] %s+0x%x"
,
pc
,
buf
,
offset
);
_output
->
print
(
"%28s"
,
" "
);
}
else
{
_output
->
print
(
"["
PTR_FORMAT
"]%18s"
,
" "
);
_output
->
print
(
"["
PTR_FORMAT
"]%18s"
,
pc
,
" "
);
}
}
...
...
src/share/vm/services/threadService.cpp
浏览文件 @
a2aec15c
/*
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
...
...
@@ -327,8 +327,28 @@ DeadlockCycle* ThreadService::find_deadlocks_at_safepoint(bool concurrent_locks)
while
(
waitingToLockMonitor
!=
NULL
||
waitingToLockBlocker
!=
NULL
)
{
cycle
->
add_thread
(
currentThread
);
if
(
waitingToLockMonitor
!=
NULL
)
{
currentThread
=
Threads
::
owning_thread_from_monitor_owner
((
address
)
waitingToLockMonitor
->
owner
(),
currentThread
=
Threads
::
owning_thread_from_monitor_owner
(
(
address
)
waitingToLockMonitor
->
owner
(),
false
/* no locking needed */
);
if
(
currentThread
==
NULL
)
{
// This function is called at a safepoint so the JavaThread
// that owns waitingToLockMonitor should be findable, but
// if it is not findable, then the previous currentThread is
// blocked permanently. We record this as a deadlock.
num_deadlocks
++
;
cycle
->
set_deadlock
(
true
);
// add this cycle to the deadlocks list
if
(
deadlocks
==
NULL
)
{
deadlocks
=
cycle
;
}
else
{
last
->
set_next
(
cycle
);
}
last
=
cycle
;
cycle
=
new
DeadlockCycle
();
break
;
}
}
else
{
if
(
concurrent_locks
)
{
if
(
waitingToLockBlocker
->
is_a
(
SystemDictionary
::
abstract_ownable_synchronizer_klass
()))
{
...
...
@@ -841,7 +861,17 @@ void DeadlockCycle::print_on(outputStream* st) const {
owner_desc
=
" (JVMTI raw monitor),
\n
which is held by"
;
}
currentThread
=
Threads
::
owning_thread_from_monitor_owner
(
(
address
)
waitingToLockMonitor
->
owner
(),
false
/* no locking needed */
);
(
address
)
waitingToLockMonitor
->
owner
(),
false
/* no locking needed */
);
if
(
currentThread
==
NULL
)
{
// The deadlock was detected at a safepoint so the JavaThread
// that owns waitingToLockMonitor should be findable, but
// if it is not findable, then the previous currentThread is
// blocked permanently.
st
->
print
(
"%s UNKNOWN_owner_addr="
PTR_FORMAT
,
owner_desc
,
(
address
)
waitingToLockMonitor
->
owner
());
continue
;
}
}
else
{
st
->
print
(
" waiting for ownable synchronizer "
INTPTR_FORMAT
", (a %s)"
,
(
address
)
waitingToLockBlocker
,
...
...
src/share/vm/utilities/numberSeq.cpp
浏览文件 @
a2aec15c
...
...
@@ -245,7 +245,7 @@ void AbsSeq::dump_on(outputStream* s) {
void
NumberSeq
::
dump_on
(
outputStream
*
s
)
{
AbsSeq
::
dump_on
(
s
);
s
->
print_cr
(
"
\t\t
_last = %7.3f, _maximum = %7.3f"
);
s
->
print_cr
(
"
\t\t
_last = %7.3f, _maximum = %7.3f"
,
_last
,
_maximum
);
}
void
TruncatedSeq
::
dump_on
(
outputStream
*
s
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录