Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
1a5c6af2
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看板
提交
1a5c6af2
编写于
5月 04, 2011
作者:
K
kamg
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
da871d83
3e912606
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
311 addition
and
26 deletion
+311
-26
agent/src/os/solaris/proc/libproc.h
agent/src/os/solaris/proc/libproc.h
+16
-1
agent/src/os/solaris/proc/salibproc.h
agent/src/os/solaris/proc/salibproc.h
+17
-1
agent/src/os/solaris/proc/saproc.cpp
agent/src/os/solaris/proc/saproc.cpp
+155
-3
make/jdk6_hotspot_distro
make/jdk6_hotspot_distro
+32
-0
make/linux/makefiles/gcc.make
make/linux/makefiles/gcc.make
+1
-1
make/linux/makefiles/vm.make
make/linux/makefiles/vm.make
+4
-0
make/solaris/makefiles/saproc.make
make/solaris/makefiles/saproc.make
+26
-1
make/solaris/makefiles/sparcWorks.make
make/solaris/makefiles/sparcWorks.make
+0
-5
make/windows/build.make
make/windows/build.make
+20
-2
src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
+2
-2
src/share/vm/memory/allocation.cpp
src/share/vm/memory/allocation.cpp
+8
-0
src/share/vm/memory/allocation.hpp
src/share/vm/memory/allocation.hpp
+3
-0
src/share/vm/prims/jvmtiExport.cpp
src/share/vm/prims/jvmtiExport.cpp
+2
-0
src/share/vm/prims/jvmtiImpl.cpp
src/share/vm/prims/jvmtiImpl.cpp
+16
-3
src/share/vm/utilities/elfFile.cpp
src/share/vm/utilities/elfFile.cpp
+5
-4
src/share/vm/utilities/elfStringTable.cpp
src/share/vm/utilities/elfStringTable.cpp
+4
-3
未找到文件。
agent/src/os/solaris/proc/libproc.h
浏览文件 @
1a5c6af2
/*
* Copyright (c) 2002, 20
03
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 20
11
, 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
...
...
@@ -420,7 +420,22 @@ extern uintptr_t Ppltdest(struct ps_prochandle *, uintptr_t, int *);
/*
* Stack frame iteration interface.
*/
#ifdef SOLARIS_11_B159_OR_LATER
/* building on Nevada-B159 or later so define the new callback */
typedef
int
proc_stack_f
(
void
*
,
/* the cookie given to Pstack_iter() */
const
prgregset_t
,
/* the frame's registers */
uint_t
,
/* argc for the frame's function */
const
long
*
,
/* argv for the frame's function */
int
,
/* bitwise flags describing the frame (see below) */
int
);
/* a signal number */
#define PR_SIGNAL_FRAME 1
/* called by a signal handler */
#define PR_FOUND_SIGNAL 2
/* we found the corresponding signal number */
#else
/* building on Nevada-B158 or earlier so define the old callback */
typedef
int
proc_stack_f
(
void
*
,
const
prgregset_t
,
uint_t
,
const
long
*
);
#endif
extern
int
Pstack_iter
(
struct
ps_prochandle
*
,
const
prgregset_t
,
proc_stack_f
*
,
void
*
);
...
...
agent/src/os/solaris/proc/salibproc.h
浏览文件 @
1a5c6af2
/*
* Copyright (c) 2003, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -101,7 +101,23 @@ extern int Pstop(struct ps_prochandle *, uint_t);
/*
* Stack frame iteration interface.
*/
#ifdef SOLARIS_11_B159_OR_LATER
/* building on Nevada-B159 or later so define the new callback */
typedef
int
proc_stack_f
(
void
*
,
/* the cookie given to Pstack_iter() */
const
prgregset_t
,
/* the frame's registers */
uint_t
,
/* argc for the frame's function */
const
long
*
,
/* argv for the frame's function */
int
,
/* bitwise flags describing the frame (see below) */
int
);
/* a signal number */
#define PR_SIGNAL_FRAME 1
/* called by a signal handler */
#define PR_FOUND_SIGNAL 2
/* we found the corresponding signal number */
#else
/* building on Nevada-B158 or earlier so define the old callback */
typedef
int
proc_stack_f
(
void
*
,
const
prgregset_t
,
uint_t
,
const
long
*
);
#endif
extern
int
Pstack_iter
(
struct
ps_prochandle
*
,
const
prgregset_t
,
proc_stack_f
*
,
void
*
);
...
...
agent/src/os/solaris/proc/saproc.cpp
浏览文件 @
1a5c6af2
/*
* Copyright (c) 2002, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 20
11
, 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,9 @@
#include "salibproc.h"
#include "sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal.h"
#ifndef SOLARIS_11_B159_OR_LATER
#include <sys/utsname.h>
#endif
#include <thread_db.h>
#include <strings.h>
#include <limits.h>
...
...
@@ -40,8 +43,22 @@
#define SYMBOL_BUF_SIZE 256
#define ERR_MSG_SIZE (PATH_MAX + 256)
// debug mode
// debug mode
s
static
int
_libsaproc_debug
=
0
;
#ifndef SOLARIS_11_B159_OR_LATER
static
bool
_Pstack_iter_debug
=
false
;
static
void
dprintf_2
(
const
char
*
format
,...)
{
if
(
_Pstack_iter_debug
)
{
va_list
alist
;
va_start
(
alist
,
format
);
fputs
(
"Pstack_iter DEBUG: "
,
stderr
);
vfprintf
(
stderr
,
format
,
alist
);
va_end
(
alist
);
}
}
#endif // !SOLARIS_11_B159_OR_LATER
static
void
print_debug
(
const
char
*
format
,...)
{
if
(
_libsaproc_debug
)
{
...
...
@@ -450,6 +467,7 @@ fill_load_object_list(void *cd, const prmap_t* pmp, const char* obj_name) {
return
0
;
}
// Pstack_iter() proc_stack_f callback prior to Nevada-B159
static
int
fill_cframe_list
(
void
*
cd
,
const
prgregset_t
regs
,
uint_t
argc
,
const
long
*
argv
)
{
DebuggerWith2Objects
*
dbgo2
=
(
DebuggerWith2Objects
*
)
cd
;
...
...
@@ -472,6 +490,14 @@ fill_cframe_list(void *cd, const prgregset_t regs, uint_t argc, const long *argv
return
0
;
}
// Pstack_iter() proc_stack_f callback in Nevada-B159 or later
/*ARGSUSED*/
static
int
wrapper_fill_cframe_list
(
void
*
cd
,
const
prgregset_t
regs
,
uint_t
argc
,
const
long
*
argv
,
int
frame_flags
,
int
sig
)
{
return
(
fill_cframe_list
(
cd
,
regs
,
argc
,
argv
));
}
// part of the class sharing workaround
// FIXME: !!HACK ALERT!!
...
...
@@ -970,6 +996,11 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_fill
TD_THR_ANY_STATE
,
TD_THR_LOWEST_PRIORITY
,
TD_SIGNO_MASK
,
TD_THR_ANY_USER_FLAGS
);
}
#ifndef SOLARIS_11_B159_OR_LATER
// building on Nevada-B158 or earlier so more hoops to jump through
static
bool
has_newer_Pstack_iter
=
false
;
// older version by default
#endif
/*
* Class: sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal
* Method: fillCFrameList0
...
...
@@ -997,7 +1028,24 @@ JNIEXPORT jobject JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_f
env
->
ReleaseLongArrayElements
(
regsArray
,
ptr
,
JNI_ABORT
);
CHECK_EXCEPTION_
(
0
);
Pstack_iter
((
struct
ps_prochandle
*
)
p_ps_prochandle
,
gregs
,
fill_cframe_list
,
&
dbgo2
);
#ifdef SOLARIS_11_B159_OR_LATER
// building on Nevada-B159 or later so use the new callback
Pstack_iter
((
struct
ps_prochandle
*
)
p_ps_prochandle
,
gregs
,
wrapper_fill_cframe_list
,
&
dbgo2
);
#else
// building on Nevada-B158 or earlier so figure out which callback to use
if
(
has_newer_Pstack_iter
)
{
// Since we're building on Nevada-B158 or earlier, we have to
// cast wrapper_fill_cframe_list to make the compiler happy.
Pstack_iter
((
struct
ps_prochandle
*
)
p_ps_prochandle
,
gregs
,
(
proc_stack_f
*
)
wrapper_fill_cframe_list
,
&
dbgo2
);
}
else
{
Pstack_iter
((
struct
ps_prochandle
*
)
p_ps_prochandle
,
gregs
,
fill_cframe_list
,
&
dbgo2
);
}
#endif // SOLARIS_11_B159_OR_LATER
return
dbgo2
.
obj
;
}
...
...
@@ -1218,6 +1266,102 @@ JNIEXPORT jstring JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_d
return
res
;
}
#ifndef SOLARIS_11_B159_OR_LATER
// Determine if the OS we're running on has the newer version
// of libproc's Pstack_iter.
//
// Set env var PSTACK_ITER_DEBUG=true to debug this logic.
// Set env var PSTACK_ITER_DEBUG_RELEASE to simulate a 'release' value.
// Set env var PSTACK_ITER_DEBUG_VERSION to simulate a 'version' value.
//
// frankenputer 'uname -r -v': 5.10 Generic_141445-09
// jurassic 'uname -r -v': 5.11 snv_164
// lonepeak 'uname -r -v': 5.11 snv_127
//
static
void
set_has_newer_Pstack_iter
(
JNIEnv
*
env
)
{
static
bool
done_set
=
false
;
if
(
done_set
)
{
// already set has_newer_Pstack_iter
return
;
}
struct
utsname
name
;
if
(
uname
(
&
name
)
==
-
1
)
{
THROW_NEW_DEBUGGER_EXCEPTION
(
"uname() failed!"
);
}
dprintf_2
(
"release='%s' version='%s'
\n
"
,
name
.
release
,
name
.
version
);
if
(
_Pstack_iter_debug
)
{
char
*
override
=
getenv
(
"PSTACK_ITER_DEBUG_RELEASE"
);
if
(
override
!=
NULL
)
{
strncpy
(
name
.
release
,
override
,
SYS_NMLN
-
1
);
name
.
release
[
SYS_NMLN
-
2
]
=
'\0'
;
dprintf_2
(
"overriding with release='%s'
\n
"
,
name
.
release
);
}
override
=
getenv
(
"PSTACK_ITER_DEBUG_VERSION"
);
if
(
override
!=
NULL
)
{
strncpy
(
name
.
version
,
override
,
SYS_NMLN
-
1
);
name
.
version
[
SYS_NMLN
-
2
]
=
'\0'
;
dprintf_2
(
"overriding with version='%s'
\n
"
,
name
.
version
);
}
}
// the major number corresponds to the old SunOS major number
int
major
=
atoi
(
name
.
release
);
if
(
major
>=
6
)
{
dprintf_2
(
"release is SunOS 6 or later
\n
"
);
has_newer_Pstack_iter
=
true
;
done_set
=
true
;
return
;
}
if
(
major
<
5
)
{
dprintf_2
(
"release is SunOS 4 or earlier
\n
"
);
done_set
=
true
;
return
;
}
// some SunOS 5.* build so now check for Solaris versions
char
*
dot
=
strchr
(
name
.
release
,
'.'
);
int
minor
=
0
;
if
(
dot
!=
NULL
)
{
// release is major.minor format
*
dot
=
NULL
;
minor
=
atoi
(
dot
+
1
);
}
if
(
minor
<=
10
)
{
dprintf_2
(
"release is Solaris 10 or earlier
\n
"
);
done_set
=
true
;
return
;
}
else
if
(
minor
>=
12
)
{
dprintf_2
(
"release is Solaris 12 or later
\n
"
);
has_newer_Pstack_iter
=
true
;
done_set
=
true
;
return
;
}
// some Solaris 11 build so now check for internal build numbers
if
(
strncmp
(
name
.
version
,
"snv_"
,
4
)
!=
0
)
{
dprintf_2
(
"release is Solaris 11 post-GA or later
\n
"
);
has_newer_Pstack_iter
=
true
;
done_set
=
true
;
return
;
}
// version begins with "snv_" so a pre-GA build of Solaris 11
int
build
=
atoi
(
&
name
.
version
[
4
]);
if
(
build
>=
159
)
{
dprintf_2
(
"release is Nevada-B159 or later
\n
"
);
has_newer_Pstack_iter
=
true
;
}
else
{
dprintf_2
(
"release is Nevada-B158 or earlier
\n
"
);
}
done_set
=
true
;
}
#endif // !SOLARIS_11_B159_OR_LATER
/*
* Class: sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal
* Method: initIDs
...
...
@@ -1237,6 +1381,14 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_init
if
(
libproc_handle
==
0
)
THROW_NEW_DEBUGGER_EXCEPTION
(
"can't load libproc.so, if you are using Solaris 5.7 or below, copy libproc.so from 5.8!"
);
#ifndef SOLARIS_11_B159_OR_LATER
_Pstack_iter_debug
=
getenv
(
"PSTACK_ITER_DEBUG"
)
!=
NULL
;
set_has_newer_Pstack_iter
(
env
);
CHECK_EXCEPTION
;
dprintf_2
(
"has_newer_Pstack_iter=%d
\n
"
,
has_newer_Pstack_iter
);
#endif
p_ps_prochandle_ID
=
env
->
GetFieldID
(
clazz
,
"p_ps_prochandle"
,
"J"
);
CHECK_EXCEPTION
;
...
...
make/jdk6_hotspot_distro
0 → 100644
浏览文件 @
1a5c6af2
#
# Copyright (c) 2011, 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.
#
#
# This file format must remain compatible with both
# GNU Makefile and Microsoft nmake formats.
#
# Don't put quotes (fail windows build).
HOTSPOT_VM_DISTRO=Java HotSpot(TM)
COMPANY_NAME=Sun Microsystems, Inc.
PRODUCT_NAME=Java(TM) Platform SE
make/linux/makefiles/gcc.make
浏览文件 @
1a5c6af2
...
...
@@ -205,7 +205,7 @@ SONAMEFLAG = -Xlinker -soname=SONAME
SHARED_FLAG
=
-shared
# Keep symbols even they are not used
AOUT_FLAGS
+=
-export-dynamic
AOUT_FLAGS
+=
-
Xlinker
-
export-dynamic
#------------------------------------------------------------------------
# Debug flags
...
...
make/linux/makefiles/vm.make
浏览文件 @
1a5c6af2
...
...
@@ -102,6 +102,10 @@ CFLAGS += $(CFLAGS/NOEX)
CFLAGS
+=
$(EXTRA_CFLAGS)
LFLAGS
+=
$(EXTRA_CFLAGS)
# Don't set excutable bit on stack segment
# the same could be done by separate execstack command
LFLAGS
+=
-Xlinker
-z
-Xlinker
noexecstack
LIBS
+=
-lm
-ldl
-lpthread
# By default, link the *.o into the library, not the executable.
...
...
make/solaris/makefiles/saproc.make
浏览文件 @
1a5c6af2
#
# Copyright (c) 2005, 201
0
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2005, 201
1
, 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
...
...
@@ -56,6 +56,30 @@ else
SA_LFLAGS
+=
-mt
-xnolib
-norunpath
endif
# The libproc Pstack_iter() interface changed in Nevada-B159.
# This logic needs to match
# agent/src/os/solaris/proc/saproc.cpp: set_has_newer_Pstack_iter():
# - skip SunOS 4 or older
# - skip Solaris 10 or older
# - skip two digit Nevada builds
# - skip three digit Nevada builds thru 149
# - skip Nevada builds 150-158
SOLARIS_11_B159_OR_LATER
:=
\
$(
shell
uname
-r
-v
\
|
sed
-n
' \
/^[0-3]\. /b \
/^5\.[0-9] /b \
/^5\.10 /b \
/ snv_[0-9][0-9]$/b \
/ snv_[01][0-4][0-9]$/b \
/ snv_15[0-8]$/b \
s/.*/-DSOLARIS_11_B159_OR_LATER/p \
'
)
# Uncomment the following to simulate building on Nevada-B159 or later
# when actually building on Nevada-B158 or earlier:
#SOLARIS_11_B159_OR_LATER=-DSOLARIS_11_B159_OR_LATER
$(LIBSAPROC)
:
$(SASRCFILES) $(SAMAPFILE)
$(QUIETLY)
if
[
"
$(BOOT_JAVA_HOME)
"
=
""
]
;
then
\
echo
"ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"
;
\
...
...
@@ -68,6 +92,7 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
-I
$(GENERATED)
\
-I
$(BOOT_JAVA_HOME)
/include
\
-I
$(BOOT_JAVA_HOME)
/include/
$(Platform_os_family)
\
$(SOLARIS_11_B159_OR_LATER)
\
$(SASRCFILES)
\
$(SA_LFLAGS)
\
-o
$@
\
...
...
make/solaris/makefiles/sparcWorks.make
浏览文件 @
1a5c6af2
...
...
@@ -100,11 +100,6 @@ JVM_CHECK_SYMBOLS = $(NM) -u -p $(LIBJVM.o) | \
LINK_LIB.CC/
PRE_HOOK
+=
$(JVM_CHECK_SYMBOLS)
||
exit
1
;
# Some interfaces (_lwp_create) changed with LP64 and Solaris 7
SOLARIS_7_OR_LATER
:=
\
$(
shell
uname
-r
|
awk
-F
.
'{ if ($$2 >= 7
)
print "-DSOLARIS_7_OR_LATER";
}
'
)
CFLAGS
+=
${SOLARIS_7_OR_LATER}
# New architecture options started in SS12 (5.9), we need both styles to build.
# The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as.
# Note: default for 32bit sparc is now the same as v8plus, so the
...
...
make/windows/build.make
浏览文件 @
1a5c6af2
#
# Copyright (c) 1998, 201
0
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1998, 201
1
, 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
...
...
@@ -125,7 +125,25 @@ VARIANT_TEXT=Kernel
# or make/hotspot_distro.
!
ifndef
HOTSPOT_VM_DISTRO
!if
exists($(WorkSpace)\src\closed)
# if the build is for JDK6 or earlier version, it should include jdk6_hotspot_distro,
# instead of hotspot_distro.
JDK6_OR_EARLIER
=
0
!if
"$(JDK_MAJOR_VERSION)"
!=
""
&&
"$(JDK_MINOR_VERSION)"
!=
""
&&
"$(JDK_MICRO_VERSION)"
!=
""
!if
$(JDK_MAJOR_VERSION)
==
1
&&
$(JDK_MINOR_VERSION)
< 7
JDK6_OR_EARLIER
=
1
!
endif
!
else
!if
$(JDK_MAJOR_VER)
==
1
&&
$(JDK_MINOR_VER)
< 7
JDK6_OR_EARLIER
=
1
!
endif
!
endif
!if
$(JDK6_OR_EARLIER)
==
1
!
include
$(WorkSpace)\make\jdk6_hotspot_distro
!
else
!
include
$(WorkSpace)\make\hotspot_distro
!
endif
!
else
!
include
$(WorkSpace)\make\openjdk_distro
!
endif
...
...
@@ -260,7 +278,7 @@ $(variantDir)\local.make: checks
@
echo
Variant
=
$(realVariant)
>>
$@
@
echo
WorkSpace
=
$(WorkSpace)
>>
$@
@
echo
BootStrapDir
=
$(BootStrapDir)
>>
$@
@
if
"$(USERNAME)"
NEQ
""
echo
BuildUser
=
$(USERNAME)
>>
$@
@
if
"
$(USERNAME)
"
NEQ
""
echo
BuildUser
=
$(USERNAME)
>>
$@
@
echo
HS_VER
=
$(HS_VER)
>>
$@
@
echo
HS_DOTVER
=
$(HS_DOTVER)
>>
$@
@
echo
HS_COMPANY
=
$(COMPANY_NAME)
>>
$@
...
...
src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
浏览文件 @
1a5c6af2
...
...
@@ -93,7 +93,7 @@ inline void OrderAccess::release_store_ptr(volatile void* p, void* v)
inline
void
OrderAccess
::
store_fence
(
jbyte
*
p
,
jbyte
v
)
{
__asm__
volatile
(
"xchgb (%2),%0"
:
"=
r
"
(
v
)
:
"=
q
"
(
v
)
:
"0"
(
v
),
"r"
(
p
)
:
"memory"
);
}
...
...
@@ -155,7 +155,7 @@ inline void OrderAccess::store_ptr_fence(void** p, void* v) {
// Must duplicate definitions instead of calling store_fence because we don't want to cast away volatile.
inline
void
OrderAccess
::
release_store_fence
(
volatile
jbyte
*
p
,
jbyte
v
)
{
__asm__
volatile
(
"xchgb (%2),%0"
:
"=
r
"
(
v
)
:
"=
q
"
(
v
)
:
"0"
(
v
),
"r"
(
p
)
:
"memory"
);
}
...
...
src/share/vm/memory/allocation.cpp
浏览文件 @
1a5c6af2
...
...
@@ -44,6 +44,14 @@ void* CHeapObj::operator new(size_t size){
return
(
void
*
)
AllocateHeap
(
size
,
"CHeapObj-new"
);
}
void
*
CHeapObj
::
operator
new
(
size_t
size
,
const
std
::
nothrow_t
&
nothrow_constant
)
{
char
*
p
=
(
char
*
)
os
::
malloc
(
size
);
#ifdef ASSERT
if
(
PrintMallocFree
)
trace_heap_malloc
(
size
,
"CHeapObj-new"
,
p
);
#endif
return
p
;
}
void
CHeapObj
::
operator
delete
(
void
*
p
){
FreeHeap
(
p
);
}
...
...
src/share/vm/memory/allocation.hpp
浏览文件 @
1a5c6af2
...
...
@@ -34,6 +34,8 @@
#include "opto/c2_globals.hpp"
#endif
#include <new>
#define ARENA_ALIGN_M1 (((size_t)(ARENA_AMALLOC_ALIGNMENT)) - 1)
#define ARENA_ALIGN_MASK (~((size_t)ARENA_ALIGN_M1))
#define ARENA_ALIGN(x) ((((size_t)(x)) + ARENA_ALIGN_M1) & ARENA_ALIGN_MASK)
...
...
@@ -99,6 +101,7 @@ class AllocatedObj {
class
CHeapObj
ALLOCATION_SUPER_CLASS_SPEC
{
public:
void
*
operator
new
(
size_t
size
);
void
*
operator
new
(
size_t
size
,
const
std
::
nothrow_t
&
nothrow_constant
);
void
operator
delete
(
void
*
p
);
void
*
new_array
(
size_t
size
);
};
...
...
src/share/vm/prims/jvmtiExport.cpp
浏览文件 @
1a5c6af2
...
...
@@ -1804,6 +1804,8 @@ void JvmtiExport::post_compiled_method_load(JvmtiEnv* env, const jmethodID metho
}
void
JvmtiExport
::
post_dynamic_code_generated_internal
(
const
char
*
name
,
const
void
*
code_begin
,
const
void
*
code_end
)
{
assert
(
name
!=
NULL
&&
name
[
0
]
!=
'\0'
,
"sanity check"
);
JavaThread
*
thread
=
JavaThread
::
current
();
// In theory everyone coming thru here is in_vm but we need to be certain
// because a callee will do a vm->native transition
...
...
src/share/vm/prims/jvmtiImpl.cpp
浏览文件 @
1a5c6af2
...
...
@@ -38,6 +38,7 @@
#include "runtime/handles.inline.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/os.hpp"
#include "runtime/serviceThread.hpp"
#include "runtime/signature.hpp"
#include "runtime/vframe.hpp"
...
...
@@ -939,10 +940,15 @@ JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_unload_event(
nmethodLocker
::
lock_nmethod
(
nm
,
true
/* zombie_ok */
);
return
event
;
}
JvmtiDeferredEvent
JvmtiDeferredEvent
::
dynamic_code_generated_event
(
const
char
*
name
,
const
void
*
code_begin
,
const
void
*
code_end
)
{
JvmtiDeferredEvent
event
=
JvmtiDeferredEvent
(
TYPE_DYNAMIC_CODE_GENERATED
);
event
.
_event_data
.
dynamic_code_generated
.
name
=
name
;
// Need to make a copy of the name since we don't know how long
// the event poster will keep it around after we enqueue the
// deferred event and return. strdup() failure is handled in
// the post() routine below.
event
.
_event_data
.
dynamic_code_generated
.
name
=
os
::
strdup
(
name
);
event
.
_event_data
.
dynamic_code_generated
.
code_begin
=
code_begin
;
event
.
_event_data
.
dynamic_code_generated
.
code_end
=
code_end
;
return
event
;
...
...
@@ -968,12 +974,19 @@ void JvmtiDeferredEvent::post() {
nmethodLocker
::
unlock_nmethod
(
nm
);
break
;
}
case
TYPE_DYNAMIC_CODE_GENERATED
:
case
TYPE_DYNAMIC_CODE_GENERATED
:
{
JvmtiExport
::
post_dynamic_code_generated_internal
(
_event_data
.
dynamic_code_generated
.
name
,
// if strdup failed give the event a default name
(
_event_data
.
dynamic_code_generated
.
name
==
NULL
)
?
"unknown_code"
:
_event_data
.
dynamic_code_generated
.
name
,
_event_data
.
dynamic_code_generated
.
code_begin
,
_event_data
.
dynamic_code_generated
.
code_end
);
if
(
_event_data
.
dynamic_code_generated
.
name
!=
NULL
)
{
// release our copy
os
::
free
((
void
*
)
_event_data
.
dynamic_code_generated
.
name
);
}
break
;
}
default:
ShouldNotReachHere
();
}
...
...
src/share/vm/utilities/elfFile.cpp
浏览文件 @
1a5c6af2
...
...
@@ -29,6 +29,7 @@
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <new>
#include "memory/allocation.inline.hpp"
#include "utilities/decoder.hpp"
...
...
@@ -46,7 +47,7 @@ ElfFile::ElfFile(const char* filepath) {
m_status
=
Decoder
::
no_error
;
int
len
=
strlen
(
filepath
)
+
1
;
m_filepath
=
NEW_C_HEAP_ARRAY
(
char
,
len
);
m_filepath
=
(
const
char
*
)
os
::
malloc
(
len
*
sizeof
(
char
)
);
if
(
m_filepath
!=
NULL
)
{
strcpy
((
char
*
)
m_filepath
,
filepath
);
m_file
=
fopen
(
filepath
,
"r"
);
...
...
@@ -74,7 +75,7 @@ ElfFile::~ElfFile() {
}
if
(
m_filepath
!=
NULL
)
{
FREE_C_HEAP_ARRAY
(
char
,
m_filepath
);
os
::
free
((
void
*
)
m_filepath
);
}
if
(
m_next
!=
NULL
)
{
...
...
@@ -120,14 +121,14 @@ bool ElfFile::load_tables() {
}
// string table
if
(
shdr
.
sh_type
==
SHT_STRTAB
)
{
ElfStringTable
*
table
=
new
ElfStringTable
(
m_file
,
shdr
,
index
);
ElfStringTable
*
table
=
new
(
std
::
nothrow
)
ElfStringTable
(
m_file
,
shdr
,
index
);
if
(
table
==
NULL
)
{
m_status
=
Decoder
::
out_of_memory
;
return
false
;
}
add_string_table
(
table
);
}
else
if
(
shdr
.
sh_type
==
SHT_SYMTAB
||
shdr
.
sh_type
==
SHT_DYNSYM
)
{
ElfSymbolTable
*
table
=
new
ElfSymbolTable
(
m_file
,
shdr
);
ElfSymbolTable
*
table
=
new
(
std
::
nothrow
)
ElfSymbolTable
(
m_file
,
shdr
);
if
(
table
==
NULL
)
{
m_status
=
Decoder
::
out_of_memory
;
return
false
;
...
...
src/share/vm/utilities/elfStringTable.cpp
浏览文件 @
1a5c6af2
...
...
@@ -27,6 +27,7 @@
#ifndef _WINDOWS
#include "memory/allocation.inline.hpp"
#include "runtime/os.hpp"
#include "utilities/elfStringTable.hpp"
// We will try to load whole string table into memory if we can.
...
...
@@ -41,14 +42,14 @@ ElfStringTable::ElfStringTable(FILE* file, Elf_Shdr shdr, int index) {
// try to load the string table
long
cur_offset
=
ftell
(
file
);
m_table
=
(
char
*
)
NEW_C_HEAP_ARRAY
(
char
,
shdr
.
sh_size
);
m_table
=
(
char
*
)
os
::
malloc
(
sizeof
(
char
)
*
shdr
.
sh_size
);
if
(
m_table
!=
NULL
)
{
// if there is an error, mark the error
if
(
fseek
(
file
,
shdr
.
sh_offset
,
SEEK_SET
)
||
fread
((
void
*
)
m_table
,
shdr
.
sh_size
,
1
,
file
)
!=
1
||
fseek
(
file
,
cur_offset
,
SEEK_SET
))
{
m_status
=
Decoder
::
file_invalid
;
FREE_C_HEAP_ARRAY
(
char
,
m_table
);
os
::
free
((
void
*
)
m_table
);
m_table
=
NULL
;
}
}
else
{
...
...
@@ -58,7 +59,7 @@ ElfStringTable::ElfStringTable(FILE* file, Elf_Shdr shdr, int index) {
ElfStringTable
::~
ElfStringTable
()
{
if
(
m_table
!=
NULL
)
{
FREE_C_HEAP_ARRAY
(
char
,
m_table
);
os
::
free
((
void
*
)
m_table
);
}
if
(
m_next
!=
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录