Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
eaaf5643
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看板
提交
eaaf5643
编写于
2月 20, 2013
作者:
S
sspitsyn
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
ed6d268f
ebe40ae6
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
336 addition
and
105 deletion
+336
-105
agent/src/os/bsd/MacosxDebuggerLocal.m
agent/src/os/bsd/MacosxDebuggerLocal.m
+93
-1
agent/src/os/bsd/libproc_impl.c
agent/src/os/bsd/libproc_impl.c
+9
-1
agent/src/os/bsd/libproc_impl.h
agent/src/os/bsd/libproc_impl.h
+2
-1
agent/src/os/bsd/ps_proc.c
agent/src/os/bsd/ps_proc.c
+54
-30
agent/src/os/linux/libproc_impl.c
agent/src/os/linux/libproc_impl.c
+9
-1
agent/src/os/linux/libproc_impl.h
agent/src/os/linux/libproc_impl.h
+2
-1
agent/src/os/linux/ps_proc.c
agent/src/os/linux/ps_proc.c
+60
-34
agent/src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java
...rc/share/classes/sun/jvm/hotspot/memory/CMSCollector.java
+2
-4
agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java
...sses/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java
+0
-1
agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java
agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java
+0
-1
agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java
agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java
+0
-1
agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
+6
-16
make/bsd/makefiles/vm.make
make/bsd/makefiles/vm.make
+6
-1
make/linux/makefiles/vm.make
make/linux/makefiles/vm.make
+7
-1
make/solaris/makefiles/vm.make
make/solaris/makefiles/vm.make
+7
-1
src/os/bsd/vm/os_bsd.cpp
src/os/bsd/vm/os_bsd.cpp
+2
-0
src/os/linux/vm/os_linux.cpp
src/os/linux/vm/os_linux.cpp
+2
-0
src/os/solaris/vm/os_solaris.cpp
src/os/solaris/vm/os_solaris.cpp
+3
-1
src/os/windows/vm/os_windows.cpp
src/os/windows/vm/os_windows.cpp
+6
-5
src/share/vm/classfile/verifier.cpp
src/share/vm/classfile/verifier.cpp
+8
-2
src/share/vm/oops/method.hpp
src/share/vm/oops/method.hpp
+2
-0
src/share/vm/prims/jvmtiRedefineClasses.cpp
src/share/vm/prims/jvmtiRedefineClasses.cpp
+12
-0
src/share/vm/runtime/vmStructs.cpp
src/share/vm/runtime/vmStructs.cpp
+0
-2
test/runtime/8007736/TestStaticIF.java
test/runtime/8007736/TestStaticIF.java
+44
-0
未找到文件。
agent/src/os/bsd/MacosxDebuggerLocal.m
浏览文件 @
eaaf5643
...
...
@@ -38,6 +38,8 @@
#import
<
dlfcn
.
h
>
#import
<
limits
.
h
>
#import
<
errno
.
h
>
#import
<
sys
/
types
.
h
>
#import
<
sys
/
ptrace
.
h
>
jboolean
debug
=
JNI
_
FALSE
;
...
...
@@ -430,6 +432,73 @@ Java_sun_jvm_hotspot_debugger_macosx_MacOSXDebuggerLocal_translateTID0(
return (jint) usable_tid;
}
static bool ptrace_continue(pid_t pid, int signal) {
// pass the signal to the process so we don't swallow it
int res;
if ((res = ptrace(PT_CONTINUE, pid, (caddr_t)1, signal)) < 0) {
fprintf(stderr, "attach: ptrace(PT_CONTINUE, %d) failed with %d\n", pid, res);
return false;
}
return true;
}
// waits until the ATTACH has stopped the process
// by signal SIGSTOP
static bool ptrace_waitpid(pid_t pid) {
int ret;
int status;
while (true) {
// Wait for debuggee to stop.
ret = waitpid(pid, &status, 0);
if (ret >= 0) {
if (WIFSTOPPED(status)) {
// Any signal will stop the thread, make sure it is SIGSTOP. Otherwise SIGSTOP
// will still be pending and delivered when the process is DETACHED and the process
// will go to sleep.
if (WSTOPSIG(status) == SIGSTOP) {
// Debuggee stopped by SIGSTOP.
return true;
}
if (!ptrace_continue(pid, WSTOPSIG(status))) {
fprintf(stderr, "attach: Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]\n", WSTOPSIG(status));
return false;
}
} else {
fprintf(stderr, "attach: waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
return false;
}
} else {
switch (errno) {
case EINTR:
continue;
break;
case ECHILD:
fprintf(stderr, "attach: waitpid() failed. Child process pid (%d) does not exist \n", pid);
break;
case EINVAL:
fprintf(stderr, "attach: waitpid() failed. Invalid options argument.\n");
break;
default:
fprintf(stderr, "attach: waitpid() failed. Unexpected error %d\n",errno);
break;
}
return false;
}
}
}
// attach to a process/thread specified by "pid"
static bool ptrace_attach(pid_t pid) {
int res;
if ((res = ptrace(PT_ATTACH, pid, 0, 0)) < 0) {
fprintf(stderr, "ptrace(PT_ATTACH, %d) failed with %d\n", pid, res);
return false;
} else {
return ptrace_waitpid(pid);
}
}
/*
* Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal
* Method: attach0
...
...
@@ -445,7 +514,8 @@ JNF_COCOA_ENTER(env);
else
debug = JNI_FALSE;
if (debug) printf("attach0 called for jpid=%d\n", (int)jpid);
// get the task from the pid
kern_return_t result;
task_t gTask = 0;
result = task_for_pid(mach_task_self(), jpid, &gTask);
...
...
@@ -455,6 +525,13 @@ JNF_COCOA_ENTER(env);
}
putTask(env, this_obj, gTask);
// use ptrace to stop the process
// on os x, ptrace only needs to be called on the process, not the individual threads
if (ptrace_attach(jpid) != true) {
mach_port_deallocate(mach_task_self(), gTask);
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process");
}
id symbolicator = nil;
id jrsSymbolicator = objc_lookUpClass("JRSSymbolicator");
if (jrsSymbolicator != nil) {
...
...
@@ -486,6 +563,21 @@ JNF_COCOA_ENTER(env);
if (debug) printf("detach0 called\n");
task_t gTask = getTask(env, this_obj);
// detach from the ptraced process causing it to resume execution
int pid;
kern_return_t k_res;
k_res = pid_for_task(gTask, &pid);
if (k_res != KERN_SUCCESS) {
fprintf(stderr, "detach: pid_for_task(%d) failed (%d)\n", pid, k_res);
}
else {
int res = ptrace(PT_DETACH, pid, 0, 0);
if (res < 0) {
fprintf(stderr, "detach: ptrace(PT_DETACH, %d) failed (%d)\n", pid, res);
}
}
mach_port_deallocate(mach_task_self(), gTask);
id symbolicator = getSymbolicator(env, this_obj);
if (symbolicator != nil) {
...
...
agent/src/os/bsd/libproc_impl.c
浏览文件 @
eaaf5643
/*
* Copyright (c) 2003, 201
0
, 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
...
...
@@ -91,6 +91,14 @@ void print_debug(const char* format,...) {
}
}
void
print_error
(
const
char
*
format
,...)
{
va_list
alist
;
va_start
(
alist
,
format
);
fputs
(
"ERROR: "
,
stderr
);
vfprintf
(
stderr
,
format
,
alist
);
va_end
(
alist
);
}
bool
is_debug
()
{
return
_libsaproc_debug
;
}
...
...
agent/src/os/bsd/libproc_impl.h
浏览文件 @
eaaf5643
/*
* Copyright (c) 2003, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
13
, 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
...
...
@@ -107,6 +107,7 @@ struct ps_prochandle {
int
pathmap_open
(
const
char
*
name
);
void
print_debug
(
const
char
*
format
,...);
void
print_error
(
const
char
*
format
,...);
bool
is_debug
();
typedef
bool
(
*
thread_info_callback
)(
struct
ps_prochandle
*
ph
,
pthread_t
pid
,
lwpid_t
lwpid
);
...
...
agent/src/os/bsd/ps_proc.c
浏览文件 @
eaaf5643
/*
* Copyright (c) 2003, 201
0
, 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
...
...
@@ -129,42 +129,66 @@ static bool process_get_lwp_info(struct ps_prochandle *ph, lwpid_t lwp_id, void
return
(
errno
==
0
)
?
true
:
false
;
}
// attach to a process/thread specified by "pid"
static
bool
ptrace_attach
(
pid_t
pid
)
{
if
(
ptrace
(
PT
_ATTACH
,
pid
,
NULL
,
0
)
<
0
)
{
print_debug
(
"ptrace(PTRACE_
ATTACH
, ..) failed for %d
\n
"
,
pid
);
static
bool
ptrace_continue
(
pid_t
pid
,
int
signal
)
{
// pass the signal to the process so we don't swallow it
if
(
ptrace
(
PT
RACE_CONT
,
pid
,
NULL
,
signal
)
<
0
)
{
print_debug
(
"ptrace(PTRACE_
CONT
, ..) failed for %d
\n
"
,
pid
);
return
false
;
}
else
{
int
ret
;
int
status
;
do
{
// Wait for debuggee to stop.
ret
=
waitpid
(
pid
,
&
status
,
0
);
if
(
ret
>=
0
)
{
if
(
WIFSTOPPED
(
status
))
{
// Debuggee stopped.
}
return
true
;
}
// waits until the ATTACH has stopped the process
// by signal SIGSTOP
static
bool
ptrace_waitpid
(
pid_t
pid
)
{
int
ret
;
int
status
;
do
{
// Wait for debuggee to stop.
ret
=
waitpid
(
pid
,
&
status
,
0
);
if
(
ret
>=
0
)
{
if
(
WIFSTOPPED
(
status
))
{
// Any signal will stop the thread, make sure it is SIGSTOP. Otherwise SIGSTOP
// will still be pending and delivered when the process is DETACHED and the process
// will go to sleep.
if
(
WSTOPSIG
(
status
)
==
SIGSTOP
)
{
// Debuggee stopped by SIGSTOP.
return
true
;
}
else
{
print_debug
(
"waitpid(): Child process exited/terminated (status = 0x%x)
\n
"
,
status
);
}
if
(
!
ptrace_continue
(
pid
,
WSTOPSIG
(
status
)))
{
print_error
(
"Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]
\n
"
,
WSTOPSIG
(
status
));
return
false
;
}
}
else
{
switch
(
errno
)
{
case
EINTR
:
continue
;
break
;
case
ECHILD
:
print_debug
(
"waitpid() failed. Child process pid (%d) does not exist
\n
"
,
pid
);
break
;
case
EINVAL
:
print_debug
(
"waitpid() failed. Invalid options argument.
\n
"
);
break
;
default:
print_debug
(
"waitpid() failed. Unexpected error %d
\n
"
,
errno
);
}
print_debug
(
"waitpid(): Child process exited/terminated (status = 0x%x)
\n
"
,
status
);
return
false
;
}
}
while
(
true
);
}
else
{
switch
(
errno
)
{
case
EINTR
:
continue
;
break
;
case
ECHILD
:
print_debug
(
"waitpid() failed. Child process pid (%d) does not exist
\n
"
,
pid
);
break
;
case
EINVAL
:
print_debug
(
"waitpid() failed. Invalid options argument.
\n
"
);
break
;
default:
print_debug
(
"waitpid() failed. Unexpected error %d
\n
"
,
errno
);
}
return
false
;
}
}
while
(
true
);
}
// attach to a process/thread specified by "pid"
static
bool
ptrace_attach
(
pid_t
pid
)
{
if
(
ptrace
(
PT_ATTACH
,
pid
,
NULL
,
0
)
<
0
)
{
print_debug
(
"ptrace(PTRACE_ATTACH, ..) failed for %d
\n
"
,
pid
);
return
false
;
}
else
{
return
ptrace_waitpid
(
pid
);
}
}
...
...
agent/src/os/linux/libproc_impl.c
浏览文件 @
eaaf5643
/*
* 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
...
...
@@ -92,6 +92,14 @@ void print_debug(const char* format,...) {
}
}
void
print_error
(
const
char
*
format
,...)
{
va_list
alist
;
va_start
(
alist
,
format
);
fputs
(
"ERROR: "
,
stderr
);
vfprintf
(
stderr
,
format
,
alist
);
va_end
(
alist
);
}
bool
is_debug
()
{
return
_libsaproc_debug
;
}
...
...
agent/src/os/linux/libproc_impl.h
浏览文件 @
eaaf5643
/*
* Copyright (c) 2003, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
13
, 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
...
...
@@ -105,6 +105,7 @@ struct ps_prochandle {
int
pathmap_open
(
const
char
*
name
);
void
print_debug
(
const
char
*
format
,...);
void
print_error
(
const
char
*
format
,...);
bool
is_debug
();
typedef
bool
(
*
thread_info_callback
)(
struct
ps_prochandle
*
ph
,
pthread_t
pid
,
lwpid_t
lwpid
);
...
...
agent/src/os/linux/ps_proc.c
浏览文件 @
eaaf5643
/*
* Copyright (c) 2003, 201
0
, 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 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <errno.h>
#include <sys/ptrace.h>
#include "libproc_impl.h"
...
...
@@ -142,46 +143,71 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use
}
// attach to a process/thread specified by "pid"
static
bool
ptrace_attach
(
pid_t
pid
)
{
if
(
ptrace
(
PTRACE_
ATTACH
,
pid
,
NULL
,
NULL
)
<
0
)
{
print_debug
(
"ptrace(PTRACE_
ATTACH
, ..) failed for %d
\n
"
,
pid
);
static
bool
ptrace_continue
(
pid_t
pid
,
int
signal
)
{
// pass the signal to the process so we don't swallow it
if
(
ptrace
(
PTRACE_
CONT
,
pid
,
NULL
,
signal
)
<
0
)
{
print_debug
(
"ptrace(PTRACE_
CONT
, ..) failed for %d
\n
"
,
pid
);
return
false
;
}
else
{
int
ret
;
int
status
;
do
{
// Wait for debuggee to stop.
ret
=
waitpid
(
pid
,
&
status
,
0
);
if
(
ret
==
-
1
&&
errno
==
ECHILD
)
{
// try cloned process.
ret
=
waitpid
(
pid
,
&
status
,
__WALL
);
}
if
(
ret
>=
0
)
{
if
(
WIFSTOPPED
(
status
))
{
// Debuggee stopped.
}
return
true
;
}
// waits until the ATTACH has stopped the process
// by signal SIGSTOP
static
bool
ptrace_waitpid
(
pid_t
pid
)
{
int
ret
;
int
status
;
while
(
true
)
{
// Wait for debuggee to stop.
ret
=
waitpid
(
pid
,
&
status
,
0
);
if
(
ret
==
-
1
&&
errno
==
ECHILD
)
{
// try cloned process.
ret
=
waitpid
(
pid
,
&
status
,
__WALL
);
}
if
(
ret
>=
0
)
{
if
(
WIFSTOPPED
(
status
))
{
// Any signal will stop the thread, make sure it is SIGSTOP. Otherwise SIGSTOP
// will still be pending and delivered when the process is DETACHED and the process
// will go to sleep.
if
(
WSTOPSIG
(
status
)
==
SIGSTOP
)
{
// Debuggee stopped by SIGSTOP.
return
true
;
}
else
{
print_debug
(
"waitpid(): Child process exited/terminated (status = 0x%x)
\n
"
,
status
);
}
if
(
!
ptrace_continue
(
pid
,
WSTOPSIG
(
status
)))
{
print_error
(
"Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]
\n
"
,
WSTOPSIG
(
status
));
return
false
;
}
}
else
{
switch
(
errno
)
{
case
EINTR
:
continue
;
break
;
case
ECHILD
:
print_debug
(
"waitpid() failed. Child process pid (%d) does not exist
\n
"
,
pid
);
break
;
case
EINVAL
:
print_debug
(
"waitpid() failed. Invalid options argument.
\n
"
);
break
;
default:
print_debug
(
"waitpid() failed. Unexpected error %d
\n
"
,
errno
);
}
print_debug
(
"waitpid(): Child process exited/terminated (status = 0x%x)
\n
"
,
status
);
return
false
;
}
}
while
(
true
);
}
else
{
switch
(
errno
)
{
case
EINTR
:
continue
;
break
;
case
ECHILD
:
print_debug
(
"waitpid() failed. Child process pid (%d) does not exist
\n
"
,
pid
);
break
;
case
EINVAL
:
print_debug
(
"waitpid() failed. Invalid options argument.
\n
"
);
break
;
default:
print_debug
(
"waitpid() failed. Unexpected error %d
\n
"
,
errno
);
break
;
}
return
false
;
}
}
}
// attach to a process/thread specified by "pid"
static
bool
ptrace_attach
(
pid_t
pid
)
{
if
(
ptrace
(
PTRACE_ATTACH
,
pid
,
NULL
,
NULL
)
<
0
)
{
print_debug
(
"ptrace(PTRACE_ATTACH, ..) failed for %d
\n
"
,
pid
);
return
false
;
}
else
{
return
ptrace_waitpid
(
pid
);
}
}
...
...
agent/src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java
浏览文件 @
eaaf5643
...
...
@@ -61,15 +61,13 @@ public class CMSCollector extends VMObject {
CMSBitMap
markBitMap
=
markBitMap
();
long
addressSize
=
VM
.
getVM
().
getAddressSize
();
if
(
markBitMap
.
isMarked
(
addr
)
&&
markBitMap
.
isMarked
(
addr
.
addOffsetTo
(
1
*
addressSize
))
)
{
System
.
err
.
println
(
"Printezis bits are set..."
);
Address
nextOneAddr
=
markBitMap
.
getNextMarkedWordAddress
(
addr
.
addOffsetTo
(
2
*
addressSize
));
//return size in bytes
long
size
=
(
nextOneAddr
.
addOffsetTo
(
1
*
addressSize
)).
minus
(
addr
);
return
size
;
}
else
{
//missing Printezis marks
System
.
err
.
println
(
"Missing Printszis marks..."
);
return
-
1
;
//missing Printezis marks
return
-
1
;
}
}
...
...
agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java
浏览文件 @
eaaf5643
...
...
@@ -191,7 +191,6 @@ public class CompactibleFreeListSpace extends CompactibleSpace {
//Find the object size using Printezis bits and skip over
long
size
=
collector
().
blockSizeUsingPrintezisBits
(
cur
);
if
(
size
==
-
1
)
{
System
.
err
.
println
(
"Printezis bits not set..."
);
break
;
}
cur
=
cur
.
addOffsetTo
(
adjustObjectSizeInBytes
(
size
));
...
...
agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java
浏览文件 @
eaaf5643
...
...
@@ -184,7 +184,6 @@ public class MethodData extends Metadata {
if
(
trapReasonName
[
index
]
==
null
)
{
throw
new
InternalError
(
"missing reason for "
+
index
);
}
System
.
out
.
println
(
trapReasonName
[
index
]);
}
}
...
...
agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java
浏览文件 @
eaaf5643
...
...
@@ -335,7 +335,6 @@ public class ObjectHeap {
}
if
(
obj
==
null
)
{
//Find the object size using Printezis bits and skip over
System
.
err
.
println
(
"Finding object size using Printezis bits and skipping over..."
);
long
size
=
0
;
if
(
(
cmsSpaceOld
!=
null
)
&&
cmsSpaceOld
.
contains
(
handle
)
){
...
...
agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
浏览文件 @
eaaf5643
...
...
@@ -90,10 +90,6 @@ public class VM {
/** Flags indicating whether we are attached to a core, C1, or C2 build */
private
boolean
usingClientCompiler
;
private
boolean
usingServerCompiler
;
/** Flag indicating whether UseTLAB is turned on */
private
boolean
useTLAB
;
/** Flag indicating whether invokedynamic support is on */
private
boolean
enableInvokeDynamic
;
/** alignment constants */
private
boolean
isLP64
;
private
int
bytesPerLong
;
...
...
@@ -326,9 +322,6 @@ public class VM {
}
}
useTLAB
=
(
db
.
lookupIntConstant
(
"UseTLAB"
).
intValue
()
!=
0
);
enableInvokeDynamic
=
(
db
.
lookupIntConstant
(
"EnableInvokeDynamic"
).
intValue
()
!=
0
);
if
(
debugger
!=
null
)
{
isLP64
=
debugger
.
getMachineDescription
().
isLP64
();
}
...
...
@@ -579,15 +572,6 @@ public class VM {
}
}
/** Indicates whether Thread-Local Allocation Buffers are used */
public
boolean
getUseTLAB
()
{
return
useTLAB
;
}
public
boolean
getEnableInvokeDynamic
()
{
return
enableInvokeDynamic
;
}
public
TypeDataBase
getTypeDataBase
()
{
return
db
;
}
...
...
@@ -822,6 +806,12 @@ public class VM {
return
objectAlignmentInBytes
;
}
/** Indicates whether Thread-Local Allocation Buffers are used */
public
boolean
getUseTLAB
()
{
Flag
flag
=
getCommandLineFlag
(
"UseTLAB"
);
return
(
flag
==
null
)
?
false
:
flag
.
getBool
();
}
// returns null, if not available.
public
Flag
[]
getCommandLineFlags
()
{
if
(
commandLineFlags
==
null
)
{
...
...
make/bsd/makefiles/vm.make
浏览文件 @
eaaf5643
...
...
@@ -94,7 +94,12 @@ CXXFLAGS = \
# This is VERY important! The version define must only be supplied to vm_version.o
# If not, ccache will not re-use the cache at all, since the version string might contain
# a time and date.
vm_version.o
:
CXXFLAGS += ${JRE_VERSION}
CXXFLAGS/
vm_version.o
+=
${JRE_VERSION}
CXXFLAGS/
BYFILE
=
$
(
CXXFLAGS/
$@
)
# File specific flags
CXXFLAGS
+=
$
(
CXXFLAGS/BYFILE
)
ifdef
DEFAULT_LIBPATH
CXXFLAGS
+=
-DDEFAULT_LIBPATH
=
"
\"
$(DEFAULT_LIBPATH)
\"
"
...
...
make/linux/makefiles/vm.make
浏览文件 @
eaaf5643
...
...
@@ -100,7 +100,13 @@ CXXFLAGS = \
# This is VERY important! The version define must only be supplied to vm_version.o
# If not, ccache will not re-use the cache at all, since the version string might contain
# a time and date.
vm_version.o
:
CXXFLAGS += ${JRE_VERSION}
CXXFLAGS/
vm_version.o
+=
${JRE_VERSION}
CXXFLAGS/
BYFILE
=
$
(
CXXFLAGS/
$@
)
# File specific flags
CXXFLAGS
+=
$
(
CXXFLAGS/BYFILE
)
ifndef
JAVASE_EMBEDDED
ifneq
(${ARCH},arm)
...
...
make/solaris/makefiles/vm.make
浏览文件 @
eaaf5643
...
...
@@ -88,7 +88,13 @@ CXXFLAGS = \
# This is VERY important! The version define must only be supplied to vm_version.o
# If not, ccache will not re-use the cache at all, since the version string might contain
# a time and date.
vm_version.o
:
CXXFLAGS += ${JRE_VERSION}
CXXFLAGS/
vm_version.o
+=
${JRE_VERSION}
CXXFLAGS/
BYFILE
=
$
(
CXXFLAGS/
$@
)
# File specific flags
CXXFLAGS
+=
$
(
CXXFLAGS/BYFILE
)
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
CFLAGS
+=
$(CFLAGS_WARN)
...
...
src/os/bsd/vm/os_bsd.cpp
浏览文件 @
eaaf5643
...
...
@@ -2887,7 +2887,9 @@ JVM_handle_bsd_signal(int signo, siginfo_t* siginfo,
void
signalHandler
(
int
sig
,
siginfo_t
*
info
,
void
*
uc
)
{
assert
(
info
!=
NULL
&&
uc
!=
NULL
,
"it must be old kernel"
);
int
orig_errno
=
errno
;
// Preserve errno value over signal handler.
JVM_handle_bsd_signal
(
sig
,
info
,
uc
,
true
);
errno
=
orig_errno
;
}
...
...
src/os/linux/vm/os_linux.cpp
浏览文件 @
eaaf5643
...
...
@@ -3653,7 +3653,9 @@ JVM_handle_linux_signal(int signo, siginfo_t* siginfo,
void
signalHandler
(
int
sig
,
siginfo_t
*
info
,
void
*
uc
)
{
assert
(
info
!=
NULL
&&
uc
!=
NULL
,
"it must be old kernel"
);
int
orig_errno
=
errno
;
// Preserve errno value over signal handler.
JVM_handle_linux_signal
(
sig
,
info
,
uc
,
true
);
errno
=
orig_errno
;
}
...
...
src/os/solaris/vm/os_solaris.cpp
浏览文件 @
eaaf5643
...
...
@@ -1865,7 +1865,7 @@ void os::abort(bool dump_core) {
// Die immediately, no exit hook, no abort hook, no cleanup.
void
os
::
die
()
{
_exit
(
-
1
);
::
abort
();
// dump core (for debugging)
}
// unused
...
...
@@ -4317,7 +4317,9 @@ JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext,
void
signalHandler
(
int
sig
,
siginfo_t
*
info
,
void
*
ucVoid
)
{
int
orig_errno
=
errno
;
// Preserve errno value over signal handler.
JVM_handle_solaris_signal
(
sig
,
info
,
ucVoid
,
true
);
errno
=
orig_errno
;
}
/* Do not delete - if guarantee is ever removed, a signal handler (even empty)
...
...
src/os/windows/vm/os_windows.cpp
浏览文件 @
eaaf5643
...
...
@@ -1940,7 +1940,7 @@ int os::sigexitnum_pd(){
// a counter for each possible signal value, including signal_thread exit signal
static
volatile
jint
pending_signals
[
NSIG
+
1
]
=
{
0
};
static
HANDLE
sig_sem
;
static
HANDLE
sig_sem
=
NULL
;
void
os
::
signal_init_pd
()
{
// Initialize signal structures
...
...
@@ -1970,10 +1970,11 @@ void os::signal_init_pd() {
void
os
::
signal_notify
(
int
signal_number
)
{
BOOL
ret
;
Atomic
::
inc
(
&
pending_signals
[
signal_number
]);
ret
=
::
ReleaseSemaphore
(
sig_sem
,
1
,
NULL
);
assert
(
ret
!=
0
,
"ReleaseSemaphore() failed"
);
if
(
sig_sem
!=
NULL
)
{
Atomic
::
inc
(
&
pending_signals
[
signal_number
]);
ret
=
::
ReleaseSemaphore
(
sig_sem
,
1
,
NULL
);
assert
(
ret
!=
0
,
"ReleaseSemaphore() failed"
);
}
}
static
int
check_pending_signals
(
bool
wait_for_signal
)
{
...
...
src/share/vm/classfile/verifier.cpp
浏览文件 @
eaaf5643
/*
* Copyright (c) 1998, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
...
...
@@ -61,7 +61,8 @@
# include "bytes_ppc.hpp"
#endif
#define NOFAILOVER_MAJOR_VERSION 51
#define NOFAILOVER_MAJOR_VERSION 51
#define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION 52
// Access to external entry for VerifyClassCodes - old byte code verifier
...
...
@@ -2317,6 +2318,11 @@ void ClassVerifier::verify_invoke_instructions(
types
=
(
1
<<
JVM_CONSTANT_InterfaceMethodref
)
|
(
1
<<
JVM_CONSTANT_Methodref
);
break
;
case
Bytecodes
::
_invokestatic
:
types
=
(
_klass
->
major_version
()
<
STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION
)
?
(
1
<<
JVM_CONSTANT_Methodref
)
:
((
1
<<
JVM_CONSTANT_InterfaceMethodref
)
|
(
1
<<
JVM_CONSTANT_Methodref
));
break
;
default:
types
=
1
<<
JVM_CONSTANT_Methodref
;
}
...
...
src/share/vm/oops/method.hpp
浏览文件 @
eaaf5643
...
...
@@ -456,6 +456,8 @@ class Method : public Metadata {
void
print_codes_on
(
int
from
,
int
to
,
outputStream
*
st
)
const
PRODUCT_RETURN
;
// method parameters
bool
has_method_parameters
()
const
{
return
constMethod
()
->
has_method_parameters
();
}
int
method_parameters_length
()
const
{
return
constMethod
()
->
method_parameters_length
();
}
MethodParametersElement
*
method_parameters_start
()
const
...
...
src/share/vm/prims/jvmtiRedefineClasses.cpp
浏览文件 @
eaaf5643
...
...
@@ -1558,6 +1558,18 @@ void VM_RedefineClasses::rewrite_cp_refs_in_method(methodHandle method,
}
break
;
}
}
// end for each bytecode
// We also need to rewrite the parameter name indexes, if there is
// method parameter data present
if
(
method
->
has_method_parameters
())
{
const
int
len
=
method
->
method_parameters_length
();
MethodParametersElement
*
elem
=
method
->
method_parameters_start
();
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
const
u2
cp_index
=
elem
[
i
].
name_cp_index
;
elem
[
i
].
name_cp_index
=
find_new_index
(
cp_index
);
}
}
}
// end rewrite_cp_refs_in_method()
...
...
src/share/vm/runtime/vmStructs.cpp
浏览文件 @
eaaf5643
...
...
@@ -2109,8 +2109,6 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
/* Useful globals */
\
/******************/
\
\
declare_constant(UseTLAB) \
declare_constant(EnableInvokeDynamic) \
\
/**************/
\
/* Stack bias */
\
...
...
test/runtime/8007736/TestStaticIF.java
0 → 100644
浏览文件 @
eaaf5643
/*
* Copyright (c) 2013, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/*
* @test
* @bug 8007736
* @summary Test static interface method.
* @run main/othervm -Xverify:all TestStaticIF
*/
public
class
TestStaticIF
implements
StaticMethodInInterface
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
printf
(
"main: %s%n"
,
StaticMethodInInterface
.
get
());
}
}
interface
StaticMethodInInterface
{
public
static
String
get
()
{
return
"Hello from StaticMethodInInterface.get()"
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录