mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-19 07:29:08 +00:00
Merge
This commit is contained in:
commit
81d4345cb8
2
.hgtags
2
.hgtags
@ -229,3 +229,5 @@ b5ed503c26ad38869c247c5e32debec217fd056b jdk8-b104
|
||||
589f4fdc584e373a47cde0162e9eceec9165c381 jdk8-b105
|
||||
514b0b69fb9683ef52062fd962a3e0644431f64d jdk8-b106
|
||||
892889f445755790ae90e61775bfb59ddc6182b5 jdk8-b107
|
||||
74049f7a28b48c14910106a75d9f2504169c352e jdk8-b108
|
||||
af9a674e12a16da1a4bd53e4990ddb1121a21ef1 jdk8-b109
|
||||
|
||||
@ -229,3 +229,5 @@ b7e64be81c8a7690703df5711f4fc2375da8a9cb jdk8-b103
|
||||
5166118c59178b5d31001bc4058e92486ee07d9b jdk8-b105
|
||||
8e7b4d9fb00fdf1334376aeac050c9bca6d1b383 jdk8-b106
|
||||
0874bb4707b723d5bb108d379c557cf41529d1a7 jdk8-b107
|
||||
9286a6e61291246d88af713f1ef79adeea30fe2e jdk8-b108
|
||||
91f47e8da5c60de58ed195e9b57f3bf192a18f83 jdk8-b109
|
||||
|
||||
@ -76,13 +76,13 @@ diff_text() {
|
||||
TMP=1
|
||||
|
||||
if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then
|
||||
TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \
|
||||
TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
|
||||
$GREP '^[<>]' | \
|
||||
$SED -e '/[<>] Ant-Version: Apache Ant .*/d' \
|
||||
-e '/[<>] Created-By: .* (Oracle Corporation).*/d')
|
||||
fi
|
||||
if test "x$SUFFIX" = "xjava"; then
|
||||
TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \
|
||||
TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
|
||||
$GREP '^[<>]' | \
|
||||
$SED -e '/[<>] \* from.*\.idl/d' \
|
||||
-e '/[<>] \*.*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
|
||||
@ -121,8 +121,8 @@ diff_text() {
|
||||
# | $SED -e '/^#/d' -e '/^$/d' \
|
||||
# -e :a -e '/\\$/N; s/\\\n//; ta' \
|
||||
# -e 's/^[ \t]*//;s/[ \t]*$//' \
|
||||
# -e 's/\\=/=/' | LANG=C $SORT > $OTHER_FILE.cleaned
|
||||
TMP=$(LANG=C $DIFF $OTHER_FILE.cleaned $THIS_FILE)
|
||||
# -e 's/\\=/=/' | LC_ALL=C $SORT > $OTHER_FILE.cleaned
|
||||
TMP=$(LC_ALL=C $DIFF $OTHER_FILE.cleaned $THIS_FILE)
|
||||
fi
|
||||
if test -n "$TMP"; then
|
||||
echo Files $OTHER_FILE and $THIS_FILE differ
|
||||
@ -410,11 +410,11 @@ compare_zip_file() {
|
||||
CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff
|
||||
# On solaris, there is no -q option.
|
||||
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
|
||||
LANG=C $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \
|
||||
LC_ALL=C $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \
|
||||
| $GREP -v -e "^<" -e "^>" -e "^Common subdirectories:" \
|
||||
> $CONTENTS_DIFF_FILE
|
||||
else
|
||||
LANG=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE
|
||||
LC_ALL=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE
|
||||
fi
|
||||
|
||||
ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE)
|
||||
@ -459,11 +459,11 @@ compare_zip_file() {
|
||||
if [ -n "$SHOW_DIFFS" ]; then
|
||||
for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do
|
||||
if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then
|
||||
LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap
|
||||
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap
|
||||
elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then
|
||||
LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i
|
||||
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i
|
||||
else
|
||||
LANG=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i
|
||||
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@ -703,7 +703,7 @@ compare_bin_file() {
|
||||
$NM -a $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
|
||||
fi
|
||||
|
||||
LANG=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
|
||||
LC_ALL=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
|
||||
if [ -s $WORK_FILE_BASE.symbols.diff ]; then
|
||||
SYM_MSG=" diff "
|
||||
if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then
|
||||
@ -732,8 +732,8 @@ compare_bin_file() {
|
||||
(cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2</dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
|
||||
(cd $FILE_WORK_DIR && $RM -f $NAME)
|
||||
|
||||
LANG=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff
|
||||
LANG=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq
|
||||
LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff
|
||||
LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq
|
||||
|
||||
if [ -s $WORK_FILE_BASE.deps.diff ]; then
|
||||
if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then
|
||||
@ -768,7 +768,7 @@ compare_bin_file() {
|
||||
if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then
|
||||
$FULLDUMP_CMD $OTHER_FILE > $WORK_FILE_BASE.fulldump.other 2>&1
|
||||
$FULLDUMP_CMD $THIS_FILE > $WORK_FILE_BASE.fulldump.this 2>&1
|
||||
LANG=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this > $WORK_FILE_BASE.fulldump.diff
|
||||
LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this > $WORK_FILE_BASE.fulldump.diff
|
||||
|
||||
if [ -s $WORK_FILE_BASE.fulldump.diff ]; then
|
||||
ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.fulldump.diff | awk '{print $5}')
|
||||
@ -802,7 +802,7 @@ compare_bin_file() {
|
||||
$DIS_CMD $OTHER_FILE | $GREP -v $NAME | $DIS_DIFF_FILTER > $WORK_FILE_BASE.dis.other 2>&1
|
||||
$DIS_CMD $THIS_FILE | $GREP -v $NAME | $DIS_DIFF_FILTER > $WORK_FILE_BASE.dis.this 2>&1
|
||||
|
||||
LANG=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
|
||||
LC_ALL=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
|
||||
|
||||
if [ -s $WORK_FILE_BASE.dis.diff ]; then
|
||||
DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}')
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 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
|
||||
@ -200,13 +200,8 @@ $(JPRT_ARCHIVE_BUNDLE): bundles
|
||||
$(RM) $@
|
||||
$(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64)
|
||||
SRC_JDK_IMAGE_DIR := $(JDK_OVERLAY_IMAGE_DIR)
|
||||
SRC_JRE_IMAGE_DIR := $(JRE_OVERLAY_IMAGE_DIR)
|
||||
else
|
||||
SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
|
||||
SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR)
|
||||
endif
|
||||
SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
|
||||
SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR)
|
||||
SRC_JDK_BUNDLE_DIR := $(JDK_BUNDLE_DIR)
|
||||
SRC_JRE_BUNDLE_DIR := $(JRE_BUNDLE_DIR)
|
||||
|
||||
@ -215,10 +210,10 @@ bundles: all bundles-only
|
||||
bundles-only: start-make
|
||||
@$(call TargetEnter)
|
||||
$(MKDIR) -p $(BUILD_OUTPUT)/bundles
|
||||
$(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
|
||||
$(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
|
||||
$(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
|
||||
$(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
|
||||
if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
|
||||
$(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
|
||||
$(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
|
||||
fi
|
||||
@$(call TargetExit)
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@ -68,10 +68,6 @@ default: jdk
|
||||
all: images docs
|
||||
@$(call CheckIfMakeAtEnd)
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64)
|
||||
all: overlay-images
|
||||
endif
|
||||
|
||||
# Setup a rule for SPEC file that fails if executed. This check makes sure the configuration
|
||||
# is up to date after changes to configure
|
||||
$(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
|
||||
|
||||
@ -229,3 +229,5 @@ d411c60a8c2fe8fdc572af907775e90f7eefd513 jdk8-b104
|
||||
4e38de7c767e34104fa147b5b346d9fe6b731279 jdk8-b105
|
||||
2e3a056c84a71eba78945c18b05397858ffd7ad0 jdk8-b106
|
||||
23fc34133152692b725db4bd617b4c8dfd6ccb05 jdk8-b107
|
||||
a4bb3b4500164748a9c33b2283cfda76d89f25ab jdk8-b108
|
||||
428428cf5e06163322144cfb5367e1faa86acf20 jdk8-b109
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2006, 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
|
||||
@ -39,8 +39,8 @@ jprt.build.targets= \
|
||||
solaris_x64_5.10-{product|fastdebug}, \
|
||||
linux_i586_2.6-{product|fastdebug}, \
|
||||
linux_x64_2.6-{product|fastdebug}, \
|
||||
windows_i586_5.1-{product|fastdebug}, \
|
||||
windows_x64_5.2-{product|fastdebug}
|
||||
windows_i586_6.1-{product|fastdebug}, \
|
||||
windows_x64_6.1-{product|fastdebug}
|
||||
|
||||
# Directories to be excluded from the source bundles
|
||||
jprt.bundle.exclude.src.dirs=build dist webrev
|
||||
|
||||
@ -379,3 +379,5 @@ aed585cafc0d9655726af6d1e1081d1c94cb3b5c jdk8-b106
|
||||
a09fe9d1e016c285307507a5793bc4fa6215e9c9 hs25-b50
|
||||
85072013aad46050a362d10ab78e963121c8014c jdk8-b108
|
||||
566db1b0e6efca31f181456e54c8911d0192410d hs25-b51
|
||||
c81dd5393a5e333df7cb1f6621f5897ada6522b5 jdk8-b109
|
||||
58043478c26d4e8bf48700acea5f97aba8b417d4 hs25-b52
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1999, 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
|
||||
@ -59,5 +59,5 @@ CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE)
|
||||
MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
|
||||
|
||||
VERSION = fastdebug
|
||||
SYSDEFS += -DASSERT
|
||||
SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS
|
||||
PICFLAGS = DEFAULT
|
||||
|
||||
@ -88,7 +88,7 @@ ifeq ($(INCLUDE_ALL_GCS), false)
|
||||
g1ErgoVerbose.cpp g1GCPhaseTimes.cpp g1HRPrinter.cpp g1HotCardCache.cpp g1Log.cpp \
|
||||
g1MMUTracker.cpp g1MarkSweep.cpp g1MemoryPool.cpp g1MonitoringSupport.cpp \
|
||||
g1RemSet.cpp g1RemSetSummary.cpp g1SATBCardTableModRefBS.cpp g1_globals.cpp heapRegion.cpp \
|
||||
heapRegionRemSet.cpp heapRegionSeq.cpp heapRegionSet.cpp heapRegionSets.cpp \
|
||||
g1BiasedArray.cpp heapRegionRemSet.cpp heapRegionSeq.cpp heapRegionSet.cpp heapRegionSets.cpp \
|
||||
ptrQueue.cpp satbQueue.cpp sparsePRT.cpp survRateGroup.cpp vm_operations_g1.cpp \
|
||||
adjoiningGenerations.cpp adjoiningVirtualSpaces.cpp asPSOldGen.cpp asPSYoungGen.cpp \
|
||||
cardTableExtension.cpp gcTaskManager.cpp gcTaskThread.cpp objectStartArray.cpp \
|
||||
|
||||
@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
|
||||
|
||||
HS_MAJOR_VER=25
|
||||
HS_MINOR_VER=0
|
||||
HS_BUILD_NUMBER=51
|
||||
HS_BUILD_NUMBER=53
|
||||
|
||||
JDK_MAJOR_VER=1
|
||||
JDK_MINOR_VER=8
|
||||
|
||||
@ -120,13 +120,13 @@ jprt.my.macosx.x64.jdk7=macosx_x64_10.7
|
||||
jprt.my.macosx.x64.jdk7u8=${jprt.my.macosx.x64.jdk7}
|
||||
jprt.my.macosx.x64=${jprt.my.macosx.x64.${jprt.tools.default.release}}
|
||||
|
||||
jprt.my.windows.i586.jdk8=windows_i586_5.1
|
||||
jprt.my.windows.i586.jdk7=windows_i586_5.1
|
||||
jprt.my.windows.i586.jdk8=windows_i586_6.1
|
||||
jprt.my.windows.i586.jdk7=windows_i586_6.1
|
||||
jprt.my.windows.i586.jdk7u8=${jprt.my.windows.i586.jdk7}
|
||||
jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}}
|
||||
|
||||
jprt.my.windows.x64.jdk8=windows_x64_5.2
|
||||
jprt.my.windows.x64.jdk7=windows_x64_5.2
|
||||
jprt.my.windows.x64.jdk8=windows_x64_6.1
|
||||
jprt.my.windows.x64.jdk7=windows_x64_6.1
|
||||
jprt.my.windows.x64.jdk7u8=${jprt.my.windows.x64.jdk7}
|
||||
jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}}
|
||||
|
||||
|
||||
@ -59,5 +59,5 @@ CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE)
|
||||
MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug
|
||||
|
||||
VERSION = optimized
|
||||
SYSDEFS += -DASSERT
|
||||
SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS
|
||||
PICFLAGS = DEFAULT
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 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
|
||||
@ -38,7 +38,7 @@ default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA
|
||||
!include ../local.make
|
||||
!include compile.make
|
||||
|
||||
CXX_FLAGS=$(CXX_FLAGS) $(FASTDEBUG_OPT_OPTION)
|
||||
CXX_FLAGS=$(CXX_FLAGS) $(FASTDEBUG_OPT_OPTION) /D "CHECK_UNHANDLED_OOPS"
|
||||
|
||||
!include $(WorkSpace)/make/windows/makefiles/vm.make
|
||||
!include local.make
|
||||
|
||||
@ -764,7 +764,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
|
||||
#ifdef CC_INTERP
|
||||
*oop_result = istate->_oop_temp;
|
||||
#else
|
||||
oop obj = (oop) at(interpreter_frame_oop_temp_offset);
|
||||
oop obj = cast_to_oop(at(interpreter_frame_oop_temp_offset));
|
||||
assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check");
|
||||
*oop_result = obj;
|
||||
#endif // CC_INTERP
|
||||
@ -788,7 +788,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
|
||||
switch(type) {
|
||||
case T_OBJECT:
|
||||
case T_ARRAY: {
|
||||
oop obj = (oop)*tos_addr;
|
||||
oop obj = cast_to_oop(*tos_addr);
|
||||
assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check");
|
||||
*oop_result = obj;
|
||||
break;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -358,7 +358,7 @@ void NativeMovConstReg::set_data(intptr_t x) {
|
||||
oop_Relocation *r = iter.oop_reloc();
|
||||
if (oop_addr == NULL) {
|
||||
oop_addr = r->oop_addr();
|
||||
*oop_addr = (oop)x;
|
||||
*oop_addr = cast_to_oop(x);
|
||||
} else {
|
||||
assert(oop_addr == r->oop_addr(), "must be only one set-oop here");
|
||||
}
|
||||
@ -478,7 +478,7 @@ void NativeMovConstRegPatching::set_data(int x) {
|
||||
oop_Relocation *r = iter.oop_reloc();
|
||||
if (oop_addr == NULL) {
|
||||
oop_addr = r->oop_addr();
|
||||
*oop_addr = (oop)x;
|
||||
*oop_addr = cast_to_oop(x);
|
||||
} else {
|
||||
assert(oop_addr == r->oop_addr(), "must be only one set-oop here");
|
||||
}
|
||||
|
||||
@ -52,6 +52,11 @@ extern "C" void bad_compiled_vtable_index(JavaThread* thread, oopDesc* receiver,
|
||||
VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
||||
const int sparc_code_length = VtableStub::pd_code_size_limit(true);
|
||||
VtableStub* s = new(sparc_code_length) VtableStub(true, vtable_index);
|
||||
// Can be NULL if there is no free space in the code cache.
|
||||
if (s == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ResourceMark rm;
|
||||
CodeBuffer cb(s->entry_point(), sparc_code_length);
|
||||
MacroAssembler* masm = new MacroAssembler(&cb);
|
||||
@ -125,6 +130,11 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
||||
VtableStub* VtableStubs::create_itable_stub(int itable_index) {
|
||||
const int sparc_code_length = VtableStub::pd_code_size_limit(false);
|
||||
VtableStub* s = new(sparc_code_length) VtableStub(false, itable_index);
|
||||
// Can be NULL if there is no free space in the code cache.
|
||||
if (s == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ResourceMark rm;
|
||||
CodeBuffer cb(s->entry_point(), sparc_code_length);
|
||||
MacroAssembler* masm = new MacroAssembler(&cb);
|
||||
|
||||
@ -639,7 +639,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
|
||||
#ifdef CC_INTERP
|
||||
obj = istate->_oop_temp;
|
||||
#else
|
||||
obj = (oop) at(interpreter_frame_oop_temp_offset);
|
||||
obj = cast_to_oop(at(interpreter_frame_oop_temp_offset));
|
||||
#endif // CC_INTERP
|
||||
} else {
|
||||
oop* obj_p = (oop*)tos_addr;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -475,7 +475,7 @@ void trace_method_handle_stub(const char* adaptername,
|
||||
const char* mh_reg_name = has_mh ? "rcx_mh" : "rcx";
|
||||
tty->print_cr("MH %s %s="PTR_FORMAT" sp="PTR_FORMAT,
|
||||
adaptername, mh_reg_name,
|
||||
mh, entry_sp);
|
||||
(void *)mh, entry_sp);
|
||||
|
||||
if (Verbose) {
|
||||
tty->print_cr("Registers:");
|
||||
|
||||
@ -58,6 +58,11 @@ extern "C" void bad_compiled_vtable_index(JavaThread* thread, oop receiver, int
|
||||
VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
||||
const int i486_code_length = VtableStub::pd_code_size_limit(true);
|
||||
VtableStub* s = new(i486_code_length) VtableStub(true, vtable_index);
|
||||
// Can be NULL if there is no free space in the code cache.
|
||||
if (s == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ResourceMark rm;
|
||||
CodeBuffer cb(s->entry_point(), i486_code_length);
|
||||
MacroAssembler* masm = new MacroAssembler(&cb);
|
||||
@ -132,6 +137,11 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
|
||||
// add code here, bump the code stub size returned by pd_code_size_limit!
|
||||
const int i486_code_length = VtableStub::pd_code_size_limit(false);
|
||||
VtableStub* s = new(i486_code_length) VtableStub(false, itable_index);
|
||||
// Can be NULL if there is no free space in the code cache.
|
||||
if (s == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ResourceMark rm;
|
||||
CodeBuffer cb(s->entry_point(), i486_code_length);
|
||||
MacroAssembler* masm = new MacroAssembler(&cb);
|
||||
|
||||
@ -49,6 +49,11 @@ extern "C" void bad_compiled_vtable_index(JavaThread* thread,
|
||||
VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
||||
const int amd64_code_length = VtableStub::pd_code_size_limit(true);
|
||||
VtableStub* s = new(amd64_code_length) VtableStub(true, vtable_index);
|
||||
// Can be NULL if there is no free space in the code cache.
|
||||
if (s == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ResourceMark rm;
|
||||
CodeBuffer cb(s->entry_point(), amd64_code_length);
|
||||
MacroAssembler* masm = new MacroAssembler(&cb);
|
||||
@ -126,6 +131,11 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
|
||||
// returned by pd_code_size_limit!
|
||||
const int amd64_code_length = VtableStub::pd_code_size_limit(false);
|
||||
VtableStub* s = new(amd64_code_length) VtableStub(false, itable_index);
|
||||
// Can be NULL if there is no free space in the code cache.
|
||||
if (s == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ResourceMark rm;
|
||||
CodeBuffer cb(s->entry_point(), amd64_code_length);
|
||||
MacroAssembler* masm = new MacroAssembler(&cb);
|
||||
|
||||
@ -351,7 +351,7 @@ void emit_d32_reloc(CodeBuffer &cbuf, int d32, RelocationHolder const& rspec,
|
||||
int format) {
|
||||
#ifdef ASSERT
|
||||
if (rspec.reloc()->type() == relocInfo::oop_type && d32 != 0 && d32 != (int)Universe::non_oop_word()) {
|
||||
assert(oop(d32)->is_oop() && (ScavengeRootsInCode || !oop(d32)->is_scavengable()), "cannot embed scavengable oops in code");
|
||||
assert(cast_to_oop(d32)->is_oop() && (ScavengeRootsInCode || !cast_to_oop(d32)->is_scavengable()), "cannot embed scavengable oops in code");
|
||||
}
|
||||
#endif
|
||||
cbuf.relocate(cbuf.insts_mark(), rspec, format);
|
||||
|
||||
@ -529,7 +529,7 @@ void emit_d32_reloc(CodeBuffer& cbuf, int d32, RelocationHolder const& rspec, in
|
||||
if (rspec.reloc()->type() == relocInfo::oop_type &&
|
||||
d32 != 0 && d32 != (intptr_t) Universe::non_oop_word()) {
|
||||
assert(Universe::heap()->is_in_reserved((address)(intptr_t)d32), "should be real oop");
|
||||
assert(oop((intptr_t)d32)->is_oop() && (ScavengeRootsInCode || !oop((intptr_t)d32)->is_scavengable()), "cannot embed scavengable oops in code");
|
||||
assert(cast_to_oop((intptr_t)d32)->is_oop() && (ScavengeRootsInCode || !cast_to_oop((intptr_t)d32)->is_scavengable()), "cannot embed scavengable oops in code");
|
||||
}
|
||||
#endif
|
||||
cbuf.relocate(cbuf.insts_mark(), rspec, format);
|
||||
@ -556,7 +556,7 @@ void emit_d64_reloc(CodeBuffer& cbuf, int64_t d64, RelocationHolder const& rspec
|
||||
if (rspec.reloc()->type() == relocInfo::oop_type &&
|
||||
d64 != 0 && d64 != (int64_t) Universe::non_oop_word()) {
|
||||
assert(Universe::heap()->is_in_reserved((address)d64), "should be real oop");
|
||||
assert(oop(d64)->is_oop() && (ScavengeRootsInCode || !oop(d64)->is_scavengable()),
|
||||
assert(cast_to_oop(d64)->is_oop() && (ScavengeRootsInCode || !cast_to_oop(d64)->is_scavengable()),
|
||||
"cannot embed scavengable oops in code");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -4219,7 +4219,9 @@ void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool succes
|
||||
}
|
||||
}
|
||||
|
||||
if (!PrintInlining) return;
|
||||
if (!PrintInlining && !compilation()->method()->has_option("PrintInlining")) {
|
||||
return;
|
||||
}
|
||||
CompileTask::print_inlining(callee, scope()->level(), bci(), msg);
|
||||
if (success && CIPrintMethodCodes) {
|
||||
callee->print_codes();
|
||||
|
||||
@ -1019,7 +1019,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
|
||||
n_copy->set_data((intx) (load_klass()));
|
||||
} else {
|
||||
assert(mirror() != NULL, "klass not set");
|
||||
n_copy->set_data((intx) (mirror()));
|
||||
n_copy->set_data(cast_from_oop<intx>(mirror()));
|
||||
}
|
||||
|
||||
if (TracePatching) {
|
||||
@ -1031,7 +1031,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
|
||||
assert(n_copy->data() == 0 ||
|
||||
n_copy->data() == (intptr_t)Universe::non_oop_word(),
|
||||
"illegal init value");
|
||||
n_copy->set_data((intx) (appendix()));
|
||||
n_copy->set_data(cast_from_oop<intx>(appendix()));
|
||||
|
||||
if (TracePatching) {
|
||||
Disassembler::decode(copy_buff, copy_buff + *byte_count, tty);
|
||||
|
||||
@ -261,7 +261,7 @@ void ClassLoaderData::add_class(Klass* k) {
|
||||
k,
|
||||
k->external_name(),
|
||||
k->class_loader_data(),
|
||||
k->class_loader(),
|
||||
(void *)k->class_loader(),
|
||||
loader_name());
|
||||
}
|
||||
}
|
||||
@ -297,7 +297,7 @@ void ClassLoaderData::unload() {
|
||||
if (TraceClassLoaderData) {
|
||||
ResourceMark rm;
|
||||
tty->print("[ClassLoaderData: unload loader data "PTR_FORMAT, this);
|
||||
tty->print(" for instance "PTR_FORMAT" of %s", class_loader(),
|
||||
tty->print(" for instance "PTR_FORMAT" of %s", (void *)class_loader(),
|
||||
loader_name());
|
||||
if (is_anonymous()) {
|
||||
tty->print(" for anonymous class "PTR_FORMAT " ", _klasses);
|
||||
@ -458,7 +458,7 @@ const char* ClassLoaderData::loader_name() {
|
||||
void ClassLoaderData::dump(outputStream * const out) {
|
||||
ResourceMark rm;
|
||||
out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {",
|
||||
this, class_loader(),
|
||||
this, (void *)class_loader(),
|
||||
class_loader() != NULL ? class_loader()->klass() : NULL, loader_name());
|
||||
if (claimed()) out->print(" claimed ");
|
||||
if (is_unloading()) out->print(" unloading ");
|
||||
@ -553,7 +553,7 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRA
|
||||
ResourceMark rm;
|
||||
tty->print("[ClassLoaderData: ");
|
||||
tty->print("create class loader data "PTR_FORMAT, cld);
|
||||
tty->print(" for instance "PTR_FORMAT" of %s", cld->class_loader(),
|
||||
tty->print(" for instance "PTR_FORMAT" of %s", (void *)cld->class_loader(),
|
||||
cld->loader_name());
|
||||
tty->print_cr("]");
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -264,7 +264,7 @@ class SymbolPropertyEntry : public HashtableEntry<Symbol*, mtSymbol> {
|
||||
}
|
||||
if (method_type() != NULL) {
|
||||
if (printed) st->print(" and ");
|
||||
st->print(INTPTR_FORMAT, method_type());
|
||||
st->print(INTPTR_FORMAT, (void *)method_type());
|
||||
printed = true;
|
||||
}
|
||||
st->print_cr(printed ? "" : "(empty)");
|
||||
|
||||
@ -341,7 +341,7 @@ Symbol* SymbolTable::new_permanent_symbol(const char* name, TRAPS) {
|
||||
|
||||
Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len,
|
||||
unsigned int hashValue_arg, bool c_heap, TRAPS) {
|
||||
assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(),
|
||||
assert(!Universe::heap()->is_in_reserved(name),
|
||||
"proposed name of symbol must be stable");
|
||||
|
||||
// Don't allow symbols to be created which cannot fit in a Symbol*.
|
||||
@ -685,7 +685,7 @@ oop StringTable::intern(Handle string_or_null, jchar* name,
|
||||
if (found_string != NULL) return found_string;
|
||||
|
||||
debug_only(StableMemoryChecker smc(name, len * sizeof(name[0])));
|
||||
assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(),
|
||||
assert(!Universe::heap()->is_in_reserved(name),
|
||||
"proposed name of symbol must be stable");
|
||||
|
||||
Handle string;
|
||||
@ -840,7 +840,7 @@ StringTable::VerifyRetTypes StringTable::compare_entries(
|
||||
if (str1 == str2) {
|
||||
tty->print_cr("ERROR: identical oop values (0x" PTR_FORMAT ") "
|
||||
"in entry @ bucket[%d][%d] and entry @ bucket[%d][%d]",
|
||||
str1, bkt1, e_cnt1, bkt2, e_cnt2);
|
||||
(void *)str1, bkt1, e_cnt1, bkt2, e_cnt2);
|
||||
return _verify_fail_continue;
|
||||
}
|
||||
|
||||
|
||||
@ -160,7 +160,7 @@ address CompiledIC::stub_address() const {
|
||||
// High-level access to an inline cache. Guaranteed to be MT-safe.
|
||||
|
||||
|
||||
void CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) {
|
||||
bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) {
|
||||
assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");
|
||||
assert(!is_optimized(), "cannot set an optimized virtual call to megamorphic");
|
||||
assert(is_call_to_compiled() || is_call_to_interpreted(), "going directly to megamorphic?");
|
||||
@ -170,8 +170,10 @@ void CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
|
||||
assert(bytecode == Bytecodes::_invokeinterface, "");
|
||||
int itable_index = call_info->itable_index();
|
||||
entry = VtableStubs::find_itable_stub(itable_index);
|
||||
if (entry == false) {
|
||||
return false;
|
||||
}
|
||||
#ifdef ASSERT
|
||||
assert(entry != NULL, "entry not computed");
|
||||
int index = call_info->resolved_method()->itable_index();
|
||||
assert(index == itable_index, "CallInfo pre-computes this");
|
||||
#endif //ASSERT
|
||||
@ -184,6 +186,9 @@ void CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
|
||||
int vtable_index = call_info->vtable_index();
|
||||
assert(call_info->resolved_klass()->verify_vtable_index(vtable_index), "sanity check");
|
||||
entry = VtableStubs::find_vtable_stub(vtable_index);
|
||||
if (entry == NULL) {
|
||||
return false;
|
||||
}
|
||||
InlineCacheBuffer::create_transition_stub(this, NULL, entry);
|
||||
}
|
||||
|
||||
@ -200,6 +205,7 @@ void CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
|
||||
// race because the IC entry was complete when we safepointed so
|
||||
// cleaning it immediately is harmless.
|
||||
// assert(is_megamorphic(), "sanity check");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -226,7 +226,10 @@ class CompiledIC: public ResourceObj {
|
||||
//
|
||||
void set_to_clean(); // Can only be called during a safepoint operation
|
||||
void set_to_monomorphic(CompiledICInfo& info);
|
||||
void set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS);
|
||||
|
||||
// Returns true if successful and false otherwise. The call can fail if memory
|
||||
// allocation in the code cache fails.
|
||||
bool set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS);
|
||||
|
||||
static void compute_monomorphic_entry(methodHandle method, KlassHandle receiver_klass,
|
||||
bool is_optimized, bool static_bound, CompiledICInfo& info, TRAPS);
|
||||
|
||||
@ -1965,7 +1965,7 @@ public:
|
||||
if (!_detected_scavenge_root) _print_nm->print_on(tty, "new scavenge root");
|
||||
tty->print_cr(""PTR_FORMAT"[offset=%d] detected scavengable oop "PTR_FORMAT" (found at "PTR_FORMAT")",
|
||||
_print_nm, (int)((intptr_t)p - (intptr_t)_print_nm),
|
||||
(intptr_t)(*p), (intptr_t)p);
|
||||
(void *)(*p), (intptr_t)p);
|
||||
(*p)->print();
|
||||
}
|
||||
#endif //PRODUCT
|
||||
@ -2345,7 +2345,7 @@ public:
|
||||
_ok = false;
|
||||
}
|
||||
tty->print_cr("*** non-oop "PTR_FORMAT" found at "PTR_FORMAT" (offset %d)",
|
||||
(intptr_t)(*p), (intptr_t)p, (int)((intptr_t)p - (intptr_t)_nm));
|
||||
(void *)(*p), (intptr_t)p, (int)((intptr_t)p - (intptr_t)_nm));
|
||||
}
|
||||
virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
|
||||
};
|
||||
@ -2466,7 +2466,7 @@ public:
|
||||
_ok = false;
|
||||
}
|
||||
tty->print_cr("*** scavengable oop "PTR_FORMAT" found at "PTR_FORMAT" (offset %d)",
|
||||
(intptr_t)(*p), (intptr_t)p, (int)((intptr_t)p - (intptr_t)_nm));
|
||||
(void *)(*p), (intptr_t)p, (int)((intptr_t)p - (intptr_t)_nm));
|
||||
(*p)->print();
|
||||
}
|
||||
virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
|
||||
|
||||
@ -46,12 +46,9 @@ address VtableStub::_chunk = NULL;
|
||||
address VtableStub::_chunk_end = NULL;
|
||||
VMReg VtableStub::_receiver_location = VMRegImpl::Bad();
|
||||
|
||||
static int num_vtable_chunks = 0;
|
||||
|
||||
|
||||
void* VtableStub::operator new(size_t size, int code_size) throw() {
|
||||
assert(size == sizeof(VtableStub), "mismatched size");
|
||||
num_vtable_chunks++;
|
||||
// compute real VtableStub size (rounded to nearest word)
|
||||
const int real_size = round_to(code_size + sizeof(VtableStub), wordSize);
|
||||
// malloc them in chunks to minimize header overhead
|
||||
@ -60,7 +57,7 @@ void* VtableStub::operator new(size_t size, int code_size) throw() {
|
||||
const int bytes = chunk_factor * real_size + pd_code_alignment();
|
||||
BufferBlob* blob = BufferBlob::create("vtable chunks", bytes);
|
||||
if (blob == NULL) {
|
||||
vm_exit_out_of_memory(bytes, OOM_MALLOC_ERROR, "CodeCache: no room for vtable chunks");
|
||||
return NULL;
|
||||
}
|
||||
_chunk = blob->content_begin();
|
||||
_chunk_end = _chunk + bytes;
|
||||
@ -121,6 +118,12 @@ address VtableStubs::find_stub(bool is_vtable_stub, int vtable_index) {
|
||||
} else {
|
||||
s = create_itable_stub(vtable_index);
|
||||
}
|
||||
|
||||
// Creation of vtable or itable can fail if there is not enough free space in the code cache.
|
||||
if (s == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
enter(is_vtable_stub, vtable_index, s);
|
||||
if (PrintAdapterHandlers) {
|
||||
tty->print_cr("Decoding VtableStub %s[%d]@%d",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@ -628,7 +628,7 @@ void DerivedPointerTable::clear() {
|
||||
|
||||
|
||||
// Returns value of location as an int
|
||||
intptr_t value_of_loc(oop *pointer) { return (intptr_t)(*pointer); }
|
||||
intptr_t value_of_loc(oop *pointer) { return cast_from_oop<intptr_t>((*pointer)); }
|
||||
|
||||
|
||||
void DerivedPointerTable::add(oop *derived_loc, oop *base_loc) {
|
||||
|
||||
@ -9065,7 +9065,7 @@ bool CMSCollector::take_from_overflow_list(size_t num, CMSMarkStack* stack) {
|
||||
return !stack->isEmpty();
|
||||
}
|
||||
|
||||
#define BUSY (oop(0x1aff1aff))
|
||||
#define BUSY (cast_to_oop<intptr_t>(0x1aff1aff))
|
||||
// (MT-safe) Get a prefix of at most "num" from the list.
|
||||
// The overflow list is chained through the mark word of
|
||||
// each object in the list. We fetch the entire list,
|
||||
@ -9098,7 +9098,7 @@ bool CMSCollector::par_take_from_overflow_list(size_t num,
|
||||
return false;
|
||||
}
|
||||
// Grab the entire list; we'll put back a suffix
|
||||
oop prefix = (oop)Atomic::xchg_ptr(BUSY, &_overflow_list);
|
||||
oop prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list));
|
||||
Thread* tid = Thread::current();
|
||||
// Before "no_of_gc_threads" was introduced CMSOverflowSpinCount was
|
||||
// set to ParallelGCThreads.
|
||||
@ -9113,7 +9113,7 @@ bool CMSCollector::par_take_from_overflow_list(size_t num,
|
||||
return false;
|
||||
} else if (_overflow_list != BUSY) {
|
||||
// Try and grab the prefix
|
||||
prefix = (oop)Atomic::xchg_ptr(BUSY, &_overflow_list);
|
||||
prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list));
|
||||
}
|
||||
}
|
||||
// If the list was found to be empty, or we spun long
|
||||
|
||||
@ -2694,7 +2694,7 @@ public:
|
||||
|
||||
if (print_it) {
|
||||
_out->print_cr(" "PTR_FORMAT"%s",
|
||||
o, (over_tams) ? " >" : (marked) ? " M" : "");
|
||||
(void *)o, (over_tams) ? " >" : (marked) ? " M" : "");
|
||||
PrintReachableOopClosure oopCl(_out, _vo, _all);
|
||||
o->oop_iterate_no_header(&oopCl);
|
||||
}
|
||||
|
||||
141
hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp
Normal file
141
hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp
Normal file
@ -0,0 +1,141 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc_implementation/g1/g1BiasedArray.hpp"
|
||||
|
||||
#ifndef PRODUCT
|
||||
void G1BiasedMappedArrayBase::verify_index(idx_t index) const {
|
||||
guarantee(_base != NULL, "Array not initialized");
|
||||
guarantee(index < length(), err_msg("Index out of bounds index: "SIZE_FORMAT" length: "SIZE_FORMAT, index, length()));
|
||||
}
|
||||
|
||||
void G1BiasedMappedArrayBase::verify_biased_index(idx_t biased_index) const {
|
||||
guarantee(_biased_base != NULL, "Array not initialized");
|
||||
guarantee(biased_index >= bias() && biased_index < (bias() + length()),
|
||||
err_msg("Biased index out of bounds, index: "SIZE_FORMAT" bias: "SIZE_FORMAT" length: "SIZE_FORMAT, biased_index, bias(), length()));
|
||||
}
|
||||
|
||||
void G1BiasedMappedArrayBase::verify_biased_index_inclusive_end(idx_t biased_index) const {
|
||||
guarantee(_biased_base != NULL, "Array not initialized");
|
||||
guarantee(biased_index >= bias() && biased_index <= (bias() + length()),
|
||||
err_msg("Biased index out of inclusive bounds, index: "SIZE_FORMAT" bias: "SIZE_FORMAT" length: "SIZE_FORMAT, biased_index, bias(), length()));
|
||||
}
|
||||
|
||||
class TestMappedArray : public G1BiasedMappedArray<int> {
|
||||
protected:
|
||||
virtual int default_value() const { return 0xBAADBABE; }
|
||||
public:
|
||||
static void test_biasedarray() {
|
||||
const size_t REGION_SIZE_IN_WORDS = 512;
|
||||
const size_t NUM_REGIONS = 20;
|
||||
HeapWord* fake_heap = (HeapWord*)LP64_ONLY(0xBAAA00000) NOT_LP64(0xBA000000); // Any value that is non-zero
|
||||
|
||||
TestMappedArray array;
|
||||
array.initialize(fake_heap, fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS,
|
||||
REGION_SIZE_IN_WORDS * HeapWordSize);
|
||||
// Check address calculation (bounds)
|
||||
assert(array.bottom_address_mapped() == fake_heap,
|
||||
err_msg("bottom mapped address should be "PTR_FORMAT", but is "PTR_FORMAT, fake_heap, array.bottom_address_mapped()));
|
||||
assert(array.end_address_mapped() == (fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS), "must be");
|
||||
|
||||
int* bottom = array.address_mapped_to(fake_heap);
|
||||
assert((void*)bottom == (void*) array.base(), "must be");
|
||||
int* end = array.address_mapped_to(fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS);
|
||||
assert((void*)end == (void*)(array.base() + array.length()), "must be");
|
||||
// The entire array should contain default value elements
|
||||
for (int* current = bottom; current < end; current++) {
|
||||
assert(*current == array.default_value(), "must be");
|
||||
}
|
||||
|
||||
// Test setting values in the table
|
||||
|
||||
HeapWord* region_start_address = fake_heap + REGION_SIZE_IN_WORDS * (NUM_REGIONS / 2);
|
||||
HeapWord* region_end_address = fake_heap + (REGION_SIZE_IN_WORDS * (NUM_REGIONS / 2) + REGION_SIZE_IN_WORDS - 1);
|
||||
|
||||
// Set/get by address tests: invert some value; first retrieve one
|
||||
int actual_value = array.get_by_index(NUM_REGIONS / 2);
|
||||
array.set_by_index(NUM_REGIONS / 2, ~actual_value);
|
||||
// Get the same value by address, should correspond to the start of the "region"
|
||||
int value = array.get_by_address(region_start_address);
|
||||
assert(value == ~actual_value, "must be");
|
||||
// Get the same value by address, at one HeapWord before the start
|
||||
value = array.get_by_address(region_start_address - 1);
|
||||
assert(value == array.default_value(), "must be");
|
||||
// Get the same value by address, at the end of the "region"
|
||||
value = array.get_by_address(region_end_address);
|
||||
assert(value == ~actual_value, "must be");
|
||||
// Make sure the next value maps to another index
|
||||
value = array.get_by_address(region_end_address + 1);
|
||||
assert(value == array.default_value(), "must be");
|
||||
|
||||
// Reset the value in the array
|
||||
array.set_by_address(region_start_address + (region_end_address - region_start_address) / 2, actual_value);
|
||||
|
||||
// The entire array should have the default value again
|
||||
for (int* current = bottom; current < end; current++) {
|
||||
assert(*current == array.default_value(), "must be");
|
||||
}
|
||||
|
||||
// Set/get by index tests: invert some value
|
||||
idx_t index = NUM_REGIONS / 2;
|
||||
actual_value = array.get_by_index(index);
|
||||
array.set_by_index(index, ~actual_value);
|
||||
|
||||
value = array.get_by_index(index);
|
||||
assert(value == ~actual_value, "must be");
|
||||
|
||||
value = array.get_by_index(index - 1);
|
||||
assert(value == array.default_value(), "must be");
|
||||
|
||||
value = array.get_by_index(index + 1);
|
||||
assert(value == array.default_value(), "must be");
|
||||
|
||||
array.set_by_index(0, 0);
|
||||
value = array.get_by_index(0);
|
||||
assert(value == 0, "must be");
|
||||
|
||||
array.set_by_index(array.length() - 1, 0);
|
||||
value = array.get_by_index(array.length() - 1);
|
||||
assert(value == 0, "must be");
|
||||
|
||||
array.set_by_index(index, 0);
|
||||
|
||||
// The array should have three zeros, and default values otherwise
|
||||
size_t num_zeros = 0;
|
||||
for (int* current = bottom; current < end; current++) {
|
||||
assert(*current == array.default_value() || *current == 0, "must be");
|
||||
if (*current == 0) {
|
||||
num_zeros++;
|
||||
}
|
||||
}
|
||||
assert(num_zeros == 3, "must be");
|
||||
}
|
||||
};
|
||||
|
||||
void TestG1BiasedArray_test() {
|
||||
TestMappedArray::test_biasedarray();
|
||||
}
|
||||
|
||||
#endif
|
||||
181
hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp
Normal file
181
hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp
Normal file
@ -0,0 +1,181 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1BIASEDARRAY_HPP
|
||||
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1BIASEDARRAY_HPP
|
||||
|
||||
#include "utilities/debug.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
|
||||
// Implements the common base functionality for arrays that contain provisions
|
||||
// for accessing its elements using a biased index.
|
||||
// The element type is defined by the instantiating the template.
|
||||
class G1BiasedMappedArrayBase VALUE_OBJ_CLASS_SPEC {
|
||||
friend class VMStructs;
|
||||
public:
|
||||
typedef size_t idx_t;
|
||||
protected:
|
||||
address _base; // the real base address
|
||||
size_t _length; // the length of the array
|
||||
address _biased_base; // base address biased by "bias" elements
|
||||
size_t _bias; // the bias, i.e. the offset biased_base is located to the right in elements
|
||||
uint _shift_by; // the amount of bits to shift right when mapping to an index of the array.
|
||||
|
||||
protected:
|
||||
|
||||
G1BiasedMappedArrayBase() : _base(NULL), _length(0), _biased_base(NULL),
|
||||
_bias(0), _shift_by(0) { }
|
||||
|
||||
// Allocate a new array, generic version.
|
||||
static address create_new_base_array(size_t length, size_t elem_size) {
|
||||
assert(length > 0, "just checking");
|
||||
assert(elem_size > 0, "just checking");
|
||||
return NEW_C_HEAP_ARRAY(u_char, length * elem_size, mtGC);
|
||||
}
|
||||
|
||||
// Initialize the members of this class. The biased start address of this array
|
||||
// is the bias (in elements) multiplied by the element size.
|
||||
void initialize_base(address base, size_t length, size_t bias, size_t elem_size, uint shift_by) {
|
||||
assert(base != NULL, "just checking");
|
||||
assert(length > 0, "just checking");
|
||||
assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by %zd, larger than word size?", shift_by));
|
||||
_base = base;
|
||||
_length = length;
|
||||
_biased_base = base - (bias * elem_size);
|
||||
_bias = bias;
|
||||
_shift_by = shift_by;
|
||||
}
|
||||
|
||||
// Allocate and initialize this array to cover the heap addresses in the range
|
||||
// of [bottom, end).
|
||||
void initialize(HeapWord* bottom, HeapWord* end, size_t target_elem_size_in_bytes, size_t mapping_granularity_in_bytes) {
|
||||
assert(mapping_granularity_in_bytes > 0, "just checking");
|
||||
assert(is_power_of_2(mapping_granularity_in_bytes),
|
||||
err_msg("mapping granularity must be power of 2, is %zd", mapping_granularity_in_bytes));
|
||||
assert((uintptr_t)bottom % mapping_granularity_in_bytes == 0,
|
||||
err_msg("bottom mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT,
|
||||
mapping_granularity_in_bytes, bottom));
|
||||
assert((uintptr_t)end % mapping_granularity_in_bytes == 0,
|
||||
err_msg("end mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT,
|
||||
mapping_granularity_in_bytes, end));
|
||||
size_t num_target_elems = (end - bottom) / (mapping_granularity_in_bytes / HeapWordSize);
|
||||
idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes;
|
||||
address base = create_new_base_array(num_target_elems, target_elem_size_in_bytes);
|
||||
initialize_base(base, num_target_elems, bias, target_elem_size_in_bytes, log2_intptr(mapping_granularity_in_bytes));
|
||||
}
|
||||
|
||||
size_t bias() const { return _bias; }
|
||||
uint shift_by() const { return _shift_by; }
|
||||
|
||||
void verify_index(idx_t index) const PRODUCT_RETURN;
|
||||
void verify_biased_index(idx_t biased_index) const PRODUCT_RETURN;
|
||||
void verify_biased_index_inclusive_end(idx_t biased_index) const PRODUCT_RETURN;
|
||||
|
||||
public:
|
||||
// Return the length of the array in elements.
|
||||
size_t length() const { return _length; }
|
||||
};
|
||||
|
||||
// Array that provides biased access and mapping from (valid) addresses in the
|
||||
// heap into this array.
|
||||
template<class T>
|
||||
class G1BiasedMappedArray : public G1BiasedMappedArrayBase {
|
||||
public:
|
||||
typedef G1BiasedMappedArrayBase::idx_t idx_t;
|
||||
|
||||
T* base() const { return (T*)G1BiasedMappedArrayBase::_base; }
|
||||
// Return the element of the given array at the given index. Assume
|
||||
// the index is valid. This is a convenience method that does sanity
|
||||
// checking on the index.
|
||||
T get_by_index(idx_t index) const {
|
||||
verify_index(index);
|
||||
return this->base()[index];
|
||||
}
|
||||
|
||||
// Set the element of the given array at the given index to the
|
||||
// given value. Assume the index is valid. This is a convenience
|
||||
// method that does sanity checking on the index.
|
||||
void set_by_index(idx_t index, T value) {
|
||||
verify_index(index);
|
||||
this->base()[index] = value;
|
||||
}
|
||||
|
||||
// The raw biased base pointer.
|
||||
T* biased_base() const { return (T*)G1BiasedMappedArrayBase::_biased_base; }
|
||||
|
||||
// Return the element of the given array that covers the given word in the
|
||||
// heap. Assumes the index is valid.
|
||||
T get_by_address(HeapWord* value) const {
|
||||
idx_t biased_index = ((uintptr_t)value) >> this->shift_by();
|
||||
this->verify_biased_index(biased_index);
|
||||
return biased_base()[biased_index];
|
||||
}
|
||||
|
||||
// Set the value of the array entry that corresponds to the given array.
|
||||
void set_by_address(HeapWord * address, T value) {
|
||||
idx_t biased_index = ((uintptr_t)address) >> this->shift_by();
|
||||
this->verify_biased_index(biased_index);
|
||||
biased_base()[biased_index] = value;
|
||||
}
|
||||
|
||||
protected:
|
||||
// Returns the address of the element the given address maps to
|
||||
T* address_mapped_to(HeapWord* address) {
|
||||
idx_t biased_index = ((uintptr_t)address) >> this->shift_by();
|
||||
this->verify_biased_index_inclusive_end(biased_index);
|
||||
return biased_base() + biased_index;
|
||||
}
|
||||
|
||||
public:
|
||||
// Return the smallest address (inclusive) in the heap that this array covers.
|
||||
HeapWord* bottom_address_mapped() const {
|
||||
return (HeapWord*) ((uintptr_t)this->bias() << this->shift_by());
|
||||
}
|
||||
|
||||
// Return the highest address (exclusive) in the heap that this array covers.
|
||||
HeapWord* end_address_mapped() const {
|
||||
return (HeapWord*) ((uintptr_t)(this->bias() + this->length()) << this->shift_by());
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual T default_value() const = 0;
|
||||
// Set all elements of the given array to the given value.
|
||||
void clear() {
|
||||
T value = default_value();
|
||||
for (idx_t i = 0; i < length(); i++) {
|
||||
set_by_index(i, value);
|
||||
}
|
||||
}
|
||||
public:
|
||||
G1BiasedMappedArray() {}
|
||||
|
||||
// Allocate and initialize this array to cover the heap addresses in the range
|
||||
// of [bottom, end).
|
||||
void initialize(HeapWord* bottom, HeapWord* end, size_t mapping_granularity) {
|
||||
G1BiasedMappedArrayBase::initialize(bottom, end, sizeof(T), mapping_granularity);
|
||||
this->clear();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1BIASEDARRAY_HPP
|
||||
@ -2069,8 +2069,10 @@ jint G1CollectedHeap::initialize() {
|
||||
_g1_storage.initialize(g1_rs, 0);
|
||||
_g1_committed = MemRegion((HeapWord*)_g1_storage.low(), (size_t) 0);
|
||||
_hrs.initialize((HeapWord*) _g1_reserved.start(),
|
||||
(HeapWord*) _g1_reserved.end(),
|
||||
_expansion_regions);
|
||||
(HeapWord*) _g1_reserved.end());
|
||||
assert(_hrs.max_length() == _expansion_regions,
|
||||
err_msg("max length: %u expansion regions: %u",
|
||||
_hrs.max_length(), _expansion_regions));
|
||||
|
||||
// Do later initialization work for concurrent refinement.
|
||||
_cg1r->init();
|
||||
@ -4615,7 +4617,7 @@ bool G1ParScanThreadState::verify_ref(narrowOop* ref) const {
|
||||
assert(!has_partial_array_mask(ref), err_msg("ref=" PTR_FORMAT, ref));
|
||||
oop p = oopDesc::load_decode_heap_oop(ref);
|
||||
assert(_g1h->is_in_g1_reserved(p),
|
||||
err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, intptr_t(p)));
|
||||
err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, (void *)p));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4625,11 +4627,11 @@ bool G1ParScanThreadState::verify_ref(oop* ref) const {
|
||||
// Must be in the collection set--it's already been copied.
|
||||
oop p = clear_partial_array_mask(ref);
|
||||
assert(_g1h->obj_in_cs(p),
|
||||
err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, intptr_t(p)));
|
||||
err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, (void *)p));
|
||||
} else {
|
||||
oop p = oopDesc::load_decode_heap_oop(ref);
|
||||
assert(_g1h->is_in_g1_reserved(p),
|
||||
err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, intptr_t(p)));
|
||||
err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, (void *)p));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -703,7 +703,7 @@ public:
|
||||
if (_g1_committed.contains((HeapWord*) obj)) {
|
||||
// no need to subtract the bottom of the heap from obj,
|
||||
// _in_cset_fast_test is biased
|
||||
uintx index = (uintx) obj >> HeapRegion::LogOfHRGrainBytes;
|
||||
uintx index = cast_from_oop<uintx>(obj) >> HeapRegion::LogOfHRGrainBytes;
|
||||
bool ret = _in_cset_fast_test[index];
|
||||
// let's make sure the result is consistent with what the slower
|
||||
// test returns
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -91,12 +91,12 @@ template <class T> inline bool has_partial_array_mask(T* ref) {
|
||||
}
|
||||
|
||||
template <class T> inline T* set_partial_array_mask(T obj) {
|
||||
assert(((uintptr_t)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!");
|
||||
return (T*) ((uintptr_t)obj | G1_PARTIAL_ARRAY_MASK);
|
||||
assert(((uintptr_t)(void *)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!");
|
||||
return (T*) ((uintptr_t)(void *)obj | G1_PARTIAL_ARRAY_MASK);
|
||||
}
|
||||
|
||||
template <class T> inline oop clear_partial_array_mask(T* ref) {
|
||||
return oop((intptr_t)ref & ~G1_PARTIAL_ARRAY_MASK);
|
||||
return cast_to_oop((intptr_t)ref & ~G1_PARTIAL_ARRAY_MASK);
|
||||
}
|
||||
|
||||
class G1ParScanPartialArrayClosure : public G1ParClosureSuper {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -95,7 +95,7 @@ void
|
||||
G1SATBCardTableLoggingModRefBS::write_ref_field_static(void* field,
|
||||
oop new_val) {
|
||||
uintptr_t field_uint = (uintptr_t)field;
|
||||
uintptr_t new_val_uint = (uintptr_t)new_val;
|
||||
uintptr_t new_val_uint = cast_from_oop<uintptr_t>(new_val);
|
||||
uintptr_t comb = field_uint ^ new_val_uint;
|
||||
comb = comb >> HeapRegion::LogOfHRGrainBytes;
|
||||
if (comb == 0) return;
|
||||
|
||||
@ -637,7 +637,7 @@ class VerifyStrongCodeRootOopClosure: public OopClosure {
|
||||
gclog_or_tty->print_cr("Object "PTR_FORMAT" in region "
|
||||
"["PTR_FORMAT", "PTR_FORMAT") is above "
|
||||
"top "PTR_FORMAT,
|
||||
obj, _hr->bottom(), _hr->end(), _hr->top());
|
||||
(void *)obj, _hr->bottom(), _hr->end(), _hr->top());
|
||||
_failures = true;
|
||||
return;
|
||||
}
|
||||
@ -951,12 +951,12 @@ void HeapRegion::verify(VerifyOption vo,
|
||||
Klass* klass = obj->klass();
|
||||
if (!klass->is_metaspace_object()) {
|
||||
gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" "
|
||||
"not metadata", klass, obj);
|
||||
"not metadata", klass, (void *)obj);
|
||||
*failures = true;
|
||||
return;
|
||||
} else if (!klass->is_klass()) {
|
||||
gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" "
|
||||
"not a klass", klass, obj);
|
||||
"not a klass", klass, (void *)obj);
|
||||
*failures = true;
|
||||
return;
|
||||
} else {
|
||||
@ -971,7 +971,7 @@ void HeapRegion::verify(VerifyOption vo,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gclog_or_tty->print_cr(PTR_FORMAT" no an oop", obj);
|
||||
gclog_or_tty->print_cr(PTR_FORMAT" no an oop", (void *)obj);
|
||||
*failures = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -91,8 +91,8 @@ protected:
|
||||
gclog_or_tty->print_cr(" PRT::Add_reference_work(" PTR_FORMAT "->" PTR_FORMAT").",
|
||||
from,
|
||||
UseCompressedOops
|
||||
? oopDesc::load_decode_heap_oop((narrowOop*)from)
|
||||
: oopDesc::load_decode_heap_oop((oop*)from));
|
||||
? (void *)oopDesc::load_decode_heap_oop((narrowOop*)from)
|
||||
: (void *)oopDesc::load_decode_heap_oop((oop*)from));
|
||||
}
|
||||
|
||||
HeapRegion* loc_hr = hr();
|
||||
@ -403,8 +403,8 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, int tid) {
|
||||
gclog_or_tty->print_cr("ORT::add_reference_work(" PTR_FORMAT "->" PTR_FORMAT ").",
|
||||
from,
|
||||
UseCompressedOops
|
||||
? oopDesc::load_decode_heap_oop((narrowOop*)from)
|
||||
: oopDesc::load_decode_heap_oop((oop*)from));
|
||||
? (void *)oopDesc::load_decode_heap_oop((narrowOop*)from)
|
||||
: (void *)oopDesc::load_decode_heap_oop((oop*)from));
|
||||
}
|
||||
|
||||
int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift);
|
||||
|
||||
@ -71,27 +71,16 @@ uint HeapRegionSeq::find_contiguous_from(uint from, uint num) {
|
||||
|
||||
// Public
|
||||
|
||||
void HeapRegionSeq::initialize(HeapWord* bottom, HeapWord* end,
|
||||
uint max_length) {
|
||||
void HeapRegionSeq::initialize(HeapWord* bottom, HeapWord* end) {
|
||||
assert((uintptr_t) bottom % HeapRegion::GrainBytes == 0,
|
||||
"bottom should be heap region aligned");
|
||||
assert((uintptr_t) end % HeapRegion::GrainBytes == 0,
|
||||
"end should be heap region aligned");
|
||||
|
||||
_length = 0;
|
||||
_heap_bottom = bottom;
|
||||
_heap_end = end;
|
||||
_region_shift = HeapRegion::LogOfHRGrainBytes;
|
||||
_next_search_index = 0;
|
||||
_allocated_length = 0;
|
||||
_max_length = max_length;
|
||||
|
||||
_regions = NEW_C_HEAP_ARRAY(HeapRegion*, max_length, mtGC);
|
||||
memset(_regions, 0, (size_t) max_length * sizeof(HeapRegion*));
|
||||
_regions_biased = _regions - ((uintx) bottom >> _region_shift);
|
||||
|
||||
assert(&_regions[0] == &_regions_biased[addr_to_index_biased(bottom)],
|
||||
"bottom should be included in the region with index 0");
|
||||
_regions.initialize(bottom, end, HeapRegion::GrainBytes);
|
||||
}
|
||||
|
||||
MemRegion HeapRegionSeq::expand_by(HeapWord* old_end,
|
||||
@ -101,15 +90,15 @@ MemRegion HeapRegionSeq::expand_by(HeapWord* old_end,
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
|
||||
HeapWord* next_bottom = old_end;
|
||||
assert(_heap_bottom <= next_bottom, "invariant");
|
||||
assert(heap_bottom() <= next_bottom, "invariant");
|
||||
while (next_bottom < new_end) {
|
||||
assert(next_bottom < _heap_end, "invariant");
|
||||
assert(next_bottom < heap_end(), "invariant");
|
||||
uint index = length();
|
||||
|
||||
assert(index < _max_length, "otherwise we cannot expand further");
|
||||
assert(index < max_length(), "otherwise we cannot expand further");
|
||||
if (index == 0) {
|
||||
// We have not allocated any regions so far
|
||||
assert(next_bottom == _heap_bottom, "invariant");
|
||||
assert(next_bottom == heap_bottom(), "invariant");
|
||||
} else {
|
||||
// next_bottom should match the end of the last/previous region
|
||||
assert(next_bottom == at(index - 1)->end(), "invariant");
|
||||
@ -122,8 +111,8 @@ MemRegion HeapRegionSeq::expand_by(HeapWord* old_end,
|
||||
// allocation failed, we bail out and return what we have done so far
|
||||
return MemRegion(old_end, next_bottom);
|
||||
}
|
||||
assert(_regions[index] == NULL, "invariant");
|
||||
_regions[index] = new_hr;
|
||||
assert(_regions.get_by_index(index) == NULL, "invariant");
|
||||
_regions.set_by_index(index, new_hr);
|
||||
increment_allocated_length();
|
||||
}
|
||||
// Have to increment the length first, otherwise we will get an
|
||||
@ -228,26 +217,26 @@ uint HeapRegionSeq::shrink_by(uint num_regions_to_remove) {
|
||||
|
||||
#ifndef PRODUCT
|
||||
void HeapRegionSeq::verify_optional() {
|
||||
guarantee(_length <= _allocated_length,
|
||||
guarantee(length() <= _allocated_length,
|
||||
err_msg("invariant: _length: %u _allocated_length: %u",
|
||||
_length, _allocated_length));
|
||||
guarantee(_allocated_length <= _max_length,
|
||||
length(), _allocated_length));
|
||||
guarantee(_allocated_length <= max_length(),
|
||||
err_msg("invariant: _allocated_length: %u _max_length: %u",
|
||||
_allocated_length, _max_length));
|
||||
guarantee(_next_search_index <= _length,
|
||||
_allocated_length, max_length()));
|
||||
guarantee(_next_search_index <= length(),
|
||||
err_msg("invariant: _next_search_index: %u _length: %u",
|
||||
_next_search_index, _length));
|
||||
_next_search_index, length()));
|
||||
|
||||
HeapWord* prev_end = _heap_bottom;
|
||||
HeapWord* prev_end = heap_bottom();
|
||||
for (uint i = 0; i < _allocated_length; i += 1) {
|
||||
HeapRegion* hr = _regions[i];
|
||||
HeapRegion* hr = _regions.get_by_index(i);
|
||||
guarantee(hr != NULL, err_msg("invariant: i: %u", i));
|
||||
guarantee(hr->bottom() == prev_end,
|
||||
err_msg("invariant i: %u "HR_FORMAT" prev_end: "PTR_FORMAT,
|
||||
i, HR_FORMAT_PARAMS(hr), prev_end));
|
||||
guarantee(hr->hrs_index() == i,
|
||||
err_msg("invariant: i: %u hrs_index(): %u", i, hr->hrs_index()));
|
||||
if (i < _length) {
|
||||
if (i < length()) {
|
||||
// Asserts will fire if i is >= _length
|
||||
HeapWord* addr = hr->bottom();
|
||||
guarantee(addr_to_region(addr) == hr, "sanity");
|
||||
@ -265,8 +254,8 @@ void HeapRegionSeq::verify_optional() {
|
||||
prev_end = hr->end();
|
||||
}
|
||||
}
|
||||
for (uint i = _allocated_length; i < _max_length; i += 1) {
|
||||
guarantee(_regions[i] == NULL, err_msg("invariant i: %u", i));
|
||||
for (uint i = _allocated_length; i < max_length(); i += 1) {
|
||||
guarantee(_regions.get_by_index(i) == NULL, err_msg("invariant i: %u", i));
|
||||
}
|
||||
}
|
||||
#endif // PRODUCT
|
||||
|
||||
@ -25,10 +25,17 @@
|
||||
#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP
|
||||
#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP
|
||||
|
||||
#include "gc_implementation/g1/g1BiasedArray.hpp"
|
||||
|
||||
class HeapRegion;
|
||||
class HeapRegionClosure;
|
||||
class FreeRegionList;
|
||||
|
||||
class G1HeapRegionTable : public G1BiasedMappedArray<HeapRegion*> {
|
||||
protected:
|
||||
virtual HeapRegion* default_value() const { return NULL; }
|
||||
};
|
||||
|
||||
// This class keeps track of the region metadata (i.e., HeapRegion
|
||||
// instances). They are kept in the _regions array in address
|
||||
// order. A region's index in the array corresponds to its index in
|
||||
@ -44,35 +51,21 @@ class FreeRegionList;
|
||||
//
|
||||
// We keep track of three lengths:
|
||||
//
|
||||
// * _length (returned by length()) is the number of currently
|
||||
// * _committed_length (returned by length()) is the number of currently
|
||||
// committed regions.
|
||||
// * _allocated_length (not exposed outside this class) is the
|
||||
// number of regions for which we have HeapRegions.
|
||||
// * _max_length (returned by max_length()) is the maximum number of
|
||||
// regions the heap can have.
|
||||
// * max_length() returns the maximum number of regions the heap can have.
|
||||
//
|
||||
// and maintain that: _length <= _allocated_length <= _max_length
|
||||
// and maintain that: _committed_length <= _allocated_length <= max_length()
|
||||
|
||||
class HeapRegionSeq: public CHeapObj<mtGC> {
|
||||
friend class VMStructs;
|
||||
|
||||
// The array that holds the HeapRegions.
|
||||
HeapRegion** _regions;
|
||||
|
||||
// Version of _regions biased to address 0
|
||||
HeapRegion** _regions_biased;
|
||||
G1HeapRegionTable _regions;
|
||||
|
||||
// The number of regions committed in the heap.
|
||||
uint _length;
|
||||
|
||||
// The address of the first reserved word in the heap.
|
||||
HeapWord* _heap_bottom;
|
||||
|
||||
// The address of the last reserved word in the heap - 1.
|
||||
HeapWord* _heap_end;
|
||||
|
||||
// The log of the region byte size.
|
||||
uint _region_shift;
|
||||
uint _committed_length;
|
||||
|
||||
// A hint for which index to start searching from for humongous
|
||||
// allocations.
|
||||
@ -81,37 +74,33 @@ class HeapRegionSeq: public CHeapObj<mtGC> {
|
||||
// The number of regions for which we have allocated HeapRegions for.
|
||||
uint _allocated_length;
|
||||
|
||||
// The maximum number of regions in the heap.
|
||||
uint _max_length;
|
||||
|
||||
// Find a contiguous set of empty regions of length num, starting
|
||||
// from the given index.
|
||||
uint find_contiguous_from(uint from, uint num);
|
||||
|
||||
// Map a heap address to a biased region index. Assume that the
|
||||
// address is valid.
|
||||
inline uintx addr_to_index_biased(HeapWord* addr) const;
|
||||
|
||||
void increment_allocated_length() {
|
||||
assert(_allocated_length < _max_length, "pre-condition");
|
||||
assert(_allocated_length < max_length(), "pre-condition");
|
||||
_allocated_length++;
|
||||
}
|
||||
|
||||
void increment_length() {
|
||||
assert(_length < _max_length, "pre-condition");
|
||||
_length++;
|
||||
assert(length() < max_length(), "pre-condition");
|
||||
_committed_length++;
|
||||
}
|
||||
|
||||
void decrement_length() {
|
||||
assert(_length > 0, "pre-condition");
|
||||
_length--;
|
||||
assert(length() > 0, "pre-condition");
|
||||
_committed_length--;
|
||||
}
|
||||
|
||||
HeapWord* heap_bottom() const { return _regions.bottom_address_mapped(); }
|
||||
HeapWord* heap_end() const {return _regions.end_address_mapped(); }
|
||||
|
||||
public:
|
||||
// Empty contructor, we'll initialize it with the initialize() method.
|
||||
HeapRegionSeq() { }
|
||||
HeapRegionSeq() : _regions(), _committed_length(0), _next_search_index(0), _allocated_length(0) { }
|
||||
|
||||
void initialize(HeapWord* bottom, HeapWord* end, uint max_length);
|
||||
void initialize(HeapWord* bottom, HeapWord* end);
|
||||
|
||||
// Return the HeapRegion at the given index. Assume that the index
|
||||
// is valid.
|
||||
@ -126,10 +115,10 @@ class HeapRegionSeq: public CHeapObj<mtGC> {
|
||||
inline HeapRegion* addr_to_region_unsafe(HeapWord* addr) const;
|
||||
|
||||
// Return the number of regions that have been committed in the heap.
|
||||
uint length() const { return _length; }
|
||||
uint length() const { return _committed_length; }
|
||||
|
||||
// Return the maximum number of regions in the heap.
|
||||
uint max_length() const { return _max_length; }
|
||||
uint max_length() const { return (uint)_regions.length(); }
|
||||
|
||||
// Expand the sequence to reflect that the heap has grown from
|
||||
// old_end to new_end. Either create new HeapRegions, or re-use
|
||||
|
||||
@ -28,28 +28,16 @@
|
||||
#include "gc_implementation/g1/heapRegion.hpp"
|
||||
#include "gc_implementation/g1/heapRegionSeq.hpp"
|
||||
|
||||
inline uintx HeapRegionSeq::addr_to_index_biased(HeapWord* addr) const {
|
||||
assert(_heap_bottom <= addr && addr < _heap_end,
|
||||
err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT" end: "PTR_FORMAT,
|
||||
addr, _heap_bottom, _heap_end));
|
||||
uintx index = (uintx) addr >> _region_shift;
|
||||
return index;
|
||||
}
|
||||
|
||||
inline HeapRegion* HeapRegionSeq::addr_to_region_unsafe(HeapWord* addr) const {
|
||||
assert(_heap_bottom <= addr && addr < _heap_end,
|
||||
err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT" end: "PTR_FORMAT,
|
||||
addr, _heap_bottom, _heap_end));
|
||||
uintx index_biased = addr_to_index_biased(addr);
|
||||
HeapRegion* hr = _regions_biased[index_biased];
|
||||
HeapRegion* hr = _regions.get_by_address(addr);
|
||||
assert(hr != NULL, "invariant");
|
||||
return hr;
|
||||
}
|
||||
|
||||
inline HeapRegion* HeapRegionSeq::addr_to_region(HeapWord* addr) const {
|
||||
if (addr != NULL && addr < _heap_end) {
|
||||
assert(addr >= _heap_bottom,
|
||||
err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT, addr, _heap_bottom));
|
||||
if (addr != NULL && addr < heap_end()) {
|
||||
assert(addr >= heap_bottom(),
|
||||
err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT, addr, heap_bottom()));
|
||||
return addr_to_region_unsafe(addr);
|
||||
}
|
||||
return NULL;
|
||||
@ -57,7 +45,7 @@ inline HeapRegion* HeapRegionSeq::addr_to_region(HeapWord* addr) const {
|
||||
|
||||
inline HeapRegion* HeapRegionSeq::at(uint index) const {
|
||||
assert(index < length(), "pre-condition");
|
||||
HeapRegion* hr = _regions[index];
|
||||
HeapRegion* hr = _regions.get_by_index(index);
|
||||
assert(hr != NULL, "sanity");
|
||||
assert(hr->hrs_index() == index, "sanity");
|
||||
return hr;
|
||||
|
||||
@ -34,8 +34,14 @@
|
||||
static_field(HeapRegion, GrainBytes, size_t) \
|
||||
static_field(HeapRegion, LogOfHRGrainBytes, int) \
|
||||
\
|
||||
nonstatic_field(HeapRegionSeq, _regions, HeapRegion**) \
|
||||
nonstatic_field(HeapRegionSeq, _length, uint) \
|
||||
nonstatic_field(G1HeapRegionTable, _base, address) \
|
||||
nonstatic_field(G1HeapRegionTable, _length, size_t) \
|
||||
nonstatic_field(G1HeapRegionTable, _biased_base, address) \
|
||||
nonstatic_field(G1HeapRegionTable, _bias, size_t) \
|
||||
nonstatic_field(G1HeapRegionTable, _shift_by, uint) \
|
||||
\
|
||||
nonstatic_field(HeapRegionSeq, _regions, G1HeapRegionTable) \
|
||||
nonstatic_field(HeapRegionSeq, _committed_length, uint) \
|
||||
\
|
||||
nonstatic_field(G1CollectedHeap, _hrs, HeapRegionSeq) \
|
||||
nonstatic_field(G1CollectedHeap, _g1_committed, MemRegion) \
|
||||
@ -58,6 +64,8 @@
|
||||
|
||||
#define VM_TYPES_G1(declare_type, declare_toplevel_type) \
|
||||
\
|
||||
declare_toplevel_type(G1HeapRegionTable) \
|
||||
\
|
||||
declare_type(G1CollectedHeap, SharedHeap) \
|
||||
\
|
||||
declare_type(HeapRegion, ContiguousSpace) \
|
||||
|
||||
@ -1103,7 +1103,7 @@ void ParNewGeneration::waste_some_time() {
|
||||
}
|
||||
}
|
||||
|
||||
static const oop ClaimedForwardPtr = oop(0x4);
|
||||
static const oop ClaimedForwardPtr = cast_to_oop<intptr_t>(0x4);
|
||||
|
||||
// Because of concurrency, there are times where an object for which
|
||||
// "is_forwarded()" is true contains an "interim" forwarding pointer
|
||||
@ -1226,7 +1226,7 @@ oop ParNewGeneration::copy_to_survivor_space_avoiding_promotion_undo(
|
||||
if (TraceScavenge) {
|
||||
gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
|
||||
is_in_reserved(new_obj) ? "copying" : "tenuring",
|
||||
new_obj->klass()->internal_name(), old, new_obj, new_obj->size());
|
||||
new_obj->klass()->internal_name(), (void *)old, (void *)new_obj, new_obj->size());
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1347,7 +1347,7 @@ oop ParNewGeneration::copy_to_survivor_space_with_undo(
|
||||
if (TraceScavenge) {
|
||||
gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
|
||||
is_in_reserved(new_obj) ? "copying" : "tenuring",
|
||||
new_obj->klass()->internal_name(), old, new_obj, new_obj->size());
|
||||
new_obj->klass()->internal_name(), (void *)old, (void *)new_obj, new_obj->size());
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1436,7 +1436,7 @@ bool ParNewGeneration::should_simulate_overflow() {
|
||||
// (although some performance comparisons would be useful since
|
||||
// single global lists have their own performance disadvantages
|
||||
// as we were made painfully aware not long ago, see 6786503).
|
||||
#define BUSY (oop(0x1aff1aff))
|
||||
#define BUSY (cast_to_oop<intptr_t>(0x1aff1aff))
|
||||
void ParNewGeneration::push_on_overflow_list(oop from_space_obj, ParScanThreadState* par_scan_state) {
|
||||
assert(is_in_reserved(from_space_obj), "Should be from this generation");
|
||||
if (ParGCUseLocalOverflow) {
|
||||
@ -1512,7 +1512,7 @@ bool ParNewGeneration::take_from_overflow_list_work(ParScanThreadState* par_scan
|
||||
if (_overflow_list == NULL) return false;
|
||||
|
||||
// Otherwise, there was something there; try claiming the list.
|
||||
oop prefix = (oop)Atomic::xchg_ptr(BUSY, &_overflow_list);
|
||||
oop prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list));
|
||||
// Trim off a prefix of at most objsFromOverflow items
|
||||
Thread* tid = Thread::current();
|
||||
size_t spin_count = (size_t)ParallelGCThreads;
|
||||
@ -1526,7 +1526,7 @@ bool ParNewGeneration::take_from_overflow_list_work(ParScanThreadState* par_scan
|
||||
return false;
|
||||
} else if (_overflow_list != BUSY) {
|
||||
// try and grab the prefix
|
||||
prefix = (oop)Atomic::xchg_ptr(BUSY, &_overflow_list);
|
||||
prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list));
|
||||
}
|
||||
}
|
||||
if (prefix == NULL || prefix == BUSY) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 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
|
||||
@ -84,7 +84,7 @@ inline void ParScanClosure::do_oop_work(T* p,
|
||||
Space* sp = gch->space_containing(p);
|
||||
oop obj = oop(sp->block_start(p));
|
||||
assert((HeapWord*)obj < (HeapWord*)p, "Error");
|
||||
tty->print_cr("Object: " PTR_FORMAT, obj);
|
||||
tty->print_cr("Object: " PTR_FORMAT, (void *)obj);
|
||||
tty->print_cr("-------");
|
||||
obj->print();
|
||||
tty->print_cr("-----");
|
||||
@ -110,7 +110,7 @@ inline void ParScanClosure::do_oop_work(T* p,
|
||||
if (TraceScavenge) {
|
||||
gclog_or_tty->print_cr("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
|
||||
"forwarded ",
|
||||
new_obj->klass()->internal_name(), p, obj, new_obj, new_obj->size());
|
||||
new_obj->klass()->internal_name(), p, (void *)obj, (void *)new_obj, new_obj->size());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -333,7 +333,7 @@ oop PSPromotionManager::oop_promotion_failed(oop obj, markOop obj_mark) {
|
||||
gclog_or_tty->print_cr("{%s %s 0x%x (%d)}",
|
||||
"promotion-failure",
|
||||
obj->klass()->internal_name(),
|
||||
obj, obj->size());
|
||||
(void *)obj, obj->size());
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -126,7 +126,7 @@ class PSPromotionManager VALUE_OBJ_CLASS_SPEC {
|
||||
|
||||
oop* mask_chunked_array_oop(oop obj) {
|
||||
assert(!is_oop_masked((oop*) obj), "invariant");
|
||||
oop* ret = (oop*) ((uintptr_t)obj | PS_CHUNKED_ARRAY_OOP_MASK);
|
||||
oop* ret = (oop*) (cast_from_oop<uintptr_t>(obj) | PS_CHUNKED_ARRAY_OOP_MASK);
|
||||
assert(is_oop_masked(ret), "invariant");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) {
|
||||
if (TraceScavenge) {
|
||||
gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
|
||||
PSScavenge::should_scavenge(&new_obj) ? "copying" : "tenuring",
|
||||
new_obj->klass()->internal_name(), o, new_obj, new_obj->size());
|
||||
new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 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
|
||||
@ -81,7 +81,7 @@ inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm,
|
||||
if (TraceScavenge && o->is_forwarded()) {
|
||||
gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
|
||||
"forwarding",
|
||||
new_obj->klass()->internal_name(), o, new_obj, new_obj->size());
|
||||
new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -215,7 +215,7 @@ void print_oop(oop value, outputStream* st) {
|
||||
st->print_cr(" %s", buf);
|
||||
}
|
||||
} else {
|
||||
st->print_cr(" " PTR_FORMAT, (intptr_t) value);
|
||||
st->print_cr(" " PTR_FORMAT, (void *)value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1384,7 +1384,7 @@ void LinkResolver::resolve_dynamic_call(CallInfo& result,
|
||||
THREAD);
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
if (TraceMethodHandles) {
|
||||
tty->print_cr("invokedynamic throws BSME for "INTPTR_FORMAT, PENDING_EXCEPTION);
|
||||
tty->print_cr("invokedynamic throws BSME for "INTPTR_FORMAT, (void *)PENDING_EXCEPTION);
|
||||
PENDING_EXCEPTION->print();
|
||||
}
|
||||
if (PENDING_EXCEPTION->is_a(SystemDictionary::BootstrapMethodError_klass())) {
|
||||
|
||||
@ -122,7 +122,7 @@ void GC_locker::jni_unlock(JavaThread* thread) {
|
||||
// strictly needed. It's added here to make it clear that
|
||||
// the GC will NOT be performed if any other caller
|
||||
// of GC_locker::lock() still needs GC locked.
|
||||
if (!is_active()) {
|
||||
if (!is_active_internal()) {
|
||||
_doing_gc = true;
|
||||
{
|
||||
// Must give up the lock while at a safepoint
|
||||
|
||||
@ -88,7 +88,7 @@ class GC_locker: public AllStatic {
|
||||
public:
|
||||
// Accessors
|
||||
static bool is_active() {
|
||||
assert(_needs_gc || SafepointSynchronize::is_at_safepoint(), "only read at safepoint");
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "only read at safepoint");
|
||||
return is_active_internal();
|
||||
}
|
||||
static bool needs_gc() { return _needs_gc; }
|
||||
|
||||
@ -150,11 +150,11 @@ public:
|
||||
HEAP_INSPECTION_COLUMNS_DO(DECLARE_KLASS_SIZE_STATS_FIELD)
|
||||
|
||||
static int count(oop x) {
|
||||
return (HeapWordSize * ((x) ? (x)->size() : 0));
|
||||
return (HeapWordSize * (((x) != NULL) ? (x)->size() : 0));
|
||||
}
|
||||
|
||||
static int count_array(objArrayOop x) {
|
||||
return (HeapWordSize * ((x) ? (x)->size() : 0));
|
||||
return (HeapWordSize * (((x) != NULL) ? (x)->size() : 0));
|
||||
}
|
||||
|
||||
template <class T> static int count(T* x) {
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
*/
|
||||
#include "precompiled.hpp"
|
||||
#include "gc_interface/collectedHeap.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "memory/binaryTreeDictionary.hpp"
|
||||
#include "memory/freeList.hpp"
|
||||
#include "memory/collectorPolicy.hpp"
|
||||
@ -111,7 +112,7 @@ typedef class FreeList<Metachunk> ChunkList;
|
||||
// Has three lists of free chunks, and a total size and
|
||||
// count that includes all three
|
||||
|
||||
class ChunkManager VALUE_OBJ_CLASS_SPEC {
|
||||
class ChunkManager : public CHeapObj<mtInternal> {
|
||||
|
||||
// Free list of chunks of different sizes.
|
||||
// SpecializedChunk
|
||||
@ -158,7 +159,12 @@ class ChunkManager VALUE_OBJ_CLASS_SPEC {
|
||||
|
||||
public:
|
||||
|
||||
ChunkManager() : _free_chunks_total(0), _free_chunks_count(0) {}
|
||||
ChunkManager(size_t specialized_size, size_t small_size, size_t medium_size)
|
||||
: _free_chunks_total(0), _free_chunks_count(0) {
|
||||
_free_chunks[SpecializedIndex].set_size(specialized_size);
|
||||
_free_chunks[SmallIndex].set_size(small_size);
|
||||
_free_chunks[MediumIndex].set_size(medium_size);
|
||||
}
|
||||
|
||||
// add or delete (return) a chunk to the global freelist.
|
||||
Metachunk* chunk_freelist_allocate(size_t word_size);
|
||||
@ -219,7 +225,7 @@ class ChunkManager VALUE_OBJ_CLASS_SPEC {
|
||||
void locked_print_free_chunks(outputStream* st);
|
||||
void locked_print_sum_free_chunks(outputStream* st);
|
||||
|
||||
void print_on(outputStream* st);
|
||||
void print_on(outputStream* st) const;
|
||||
};
|
||||
|
||||
// Used to manage the free list of Metablocks (a block corresponds
|
||||
@ -276,11 +282,6 @@ class VirtualSpaceNode : public CHeapObj<mtClass> {
|
||||
// VirtualSpace
|
||||
Metachunk* first_chunk() { return (Metachunk*) bottom(); }
|
||||
|
||||
void inc_container_count();
|
||||
#ifdef ASSERT
|
||||
uint container_count_slow();
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
VirtualSpaceNode(size_t byte_size);
|
||||
@ -314,8 +315,10 @@ class VirtualSpaceNode : public CHeapObj<mtClass> {
|
||||
void inc_top(size_t word_size) { _top += word_size; }
|
||||
|
||||
uintx container_count() { return _container_count; }
|
||||
void inc_container_count();
|
||||
void dec_container_count();
|
||||
#ifdef ASSERT
|
||||
uint container_count_slow();
|
||||
void verify_container_count();
|
||||
#endif
|
||||
|
||||
@ -421,8 +424,6 @@ class VirtualSpaceList : public CHeapObj<mtClass> {
|
||||
VirtualSpaceNode* _virtual_space_list;
|
||||
// virtual space currently being used for allocations
|
||||
VirtualSpaceNode* _current_virtual_space;
|
||||
// Free chunk list for all other metadata
|
||||
ChunkManager _chunk_manager;
|
||||
|
||||
// Can this virtual list allocate >1 spaces? Also, used to determine
|
||||
// whether to allocate unlimited small chunks in this virtual space
|
||||
@ -475,7 +476,6 @@ class VirtualSpaceList : public CHeapObj<mtClass> {
|
||||
return _current_virtual_space;
|
||||
}
|
||||
|
||||
ChunkManager* chunk_manager() { return &_chunk_manager; }
|
||||
bool is_class() const { return _is_class; }
|
||||
|
||||
// Allocate the first virtualspace.
|
||||
@ -494,14 +494,7 @@ class VirtualSpaceList : public CHeapObj<mtClass> {
|
||||
void dec_virtual_space_count();
|
||||
|
||||
// Unlink empty VirtualSpaceNodes and free it.
|
||||
void purge();
|
||||
|
||||
// Used and capacity in the entire list of virtual spaces.
|
||||
// These are global values shared by all Metaspaces
|
||||
size_t capacity_words_sum();
|
||||
size_t capacity_bytes_sum() { return capacity_words_sum() * BytesPerWord; }
|
||||
size_t used_words_sum();
|
||||
size_t used_bytes_sum() { return used_words_sum() * BytesPerWord; }
|
||||
void purge(ChunkManager* chunk_manager);
|
||||
|
||||
bool contains(const void *ptr);
|
||||
|
||||
@ -582,18 +575,12 @@ class SpaceManager : public CHeapObj<mtClass> {
|
||||
// Type of metadata allocated.
|
||||
Metaspace::MetadataType _mdtype;
|
||||
|
||||
// Chunk related size
|
||||
size_t _medium_chunk_bunch;
|
||||
|
||||
// List of chunks in use by this SpaceManager. Allocations
|
||||
// are done from the current chunk. The list is used for deallocating
|
||||
// chunks when the SpaceManager is freed.
|
||||
Metachunk* _chunks_in_use[NumberOfInUseLists];
|
||||
Metachunk* _current_chunk;
|
||||
|
||||
// Virtual space where allocation comes from.
|
||||
VirtualSpaceList* _vs_list;
|
||||
|
||||
// Number of small chunks to allocate to a manager
|
||||
// If class space manager, small chunks are unlimited
|
||||
static uint const _small_chunk_limit;
|
||||
@ -626,7 +613,9 @@ class SpaceManager : public CHeapObj<mtClass> {
|
||||
}
|
||||
|
||||
Metaspace::MetadataType mdtype() { return _mdtype; }
|
||||
VirtualSpaceList* vs_list() const { return _vs_list; }
|
||||
|
||||
VirtualSpaceList* vs_list() const { return Metaspace::get_space_list(_mdtype); }
|
||||
ChunkManager* chunk_manager() const { return Metaspace::get_chunk_manager(_mdtype); }
|
||||
|
||||
Metachunk* current_chunk() const { return _current_chunk; }
|
||||
void set_current_chunk(Metachunk* v) {
|
||||
@ -648,18 +637,19 @@ class SpaceManager : public CHeapObj<mtClass> {
|
||||
|
||||
public:
|
||||
SpaceManager(Metaspace::MetadataType mdtype,
|
||||
Mutex* lock,
|
||||
VirtualSpaceList* vs_list);
|
||||
Mutex* lock);
|
||||
~SpaceManager();
|
||||
|
||||
enum ChunkMultiples {
|
||||
MediumChunkMultiple = 4
|
||||
};
|
||||
|
||||
bool is_class() { return _mdtype == Metaspace::ClassType; }
|
||||
|
||||
// Accessors
|
||||
size_t specialized_chunk_size() { return SpecializedChunk; }
|
||||
size_t small_chunk_size() { return (size_t) vs_list()->is_class() ? ClassSmallChunk : SmallChunk; }
|
||||
size_t medium_chunk_size() { return (size_t) vs_list()->is_class() ? ClassMediumChunk : MediumChunk; }
|
||||
size_t small_chunk_size() { return (size_t) is_class() ? ClassSmallChunk : SmallChunk; }
|
||||
size_t medium_chunk_size() { return (size_t) is_class() ? ClassMediumChunk : MediumChunk; }
|
||||
size_t medium_chunk_bunch() { return medium_chunk_size() * MediumChunkMultiple; }
|
||||
|
||||
size_t allocated_blocks_words() const { return _allocated_blocks_words; }
|
||||
@ -762,7 +752,7 @@ void VirtualSpaceNode::inc_container_count() {
|
||||
_container_count++;
|
||||
assert(_container_count == container_count_slow(),
|
||||
err_msg("Inconsistency in countainer_count _container_count " SIZE_FORMAT
|
||||
"container_count_slow() " SIZE_FORMAT,
|
||||
" container_count_slow() " SIZE_FORMAT,
|
||||
_container_count, container_count_slow()));
|
||||
}
|
||||
|
||||
@ -775,7 +765,7 @@ void VirtualSpaceNode::dec_container_count() {
|
||||
void VirtualSpaceNode::verify_container_count() {
|
||||
assert(_container_count == container_count_slow(),
|
||||
err_msg("Inconsistency in countainer_count _container_count " SIZE_FORMAT
|
||||
"container_count_slow() " SIZE_FORMAT, _container_count, container_count_slow()));
|
||||
" container_count_slow() " SIZE_FORMAT, _container_count, container_count_slow()));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1020,7 +1010,7 @@ void ChunkManager::remove_chunk(Metachunk* chunk) {
|
||||
// Walk the list of VirtualSpaceNodes and delete
|
||||
// nodes with a 0 container_count. Remove Metachunks in
|
||||
// the node from their respective freelists.
|
||||
void VirtualSpaceList::purge() {
|
||||
void VirtualSpaceList::purge(ChunkManager* chunk_manager) {
|
||||
assert_lock_strong(SpaceManager::expand_lock());
|
||||
// Don't use a VirtualSpaceListIterator because this
|
||||
// list is being changed and a straightforward use of an iterator is not safe.
|
||||
@ -1042,7 +1032,7 @@ void VirtualSpaceList::purge() {
|
||||
prev_vsl->set_next(vsl->next());
|
||||
}
|
||||
|
||||
vsl->purge(chunk_manager());
|
||||
vsl->purge(chunk_manager);
|
||||
dec_reserved_words(vsl->reserved_words());
|
||||
dec_committed_words(vsl->committed_words());
|
||||
dec_virtual_space_count();
|
||||
@ -1064,36 +1054,6 @@ void VirtualSpaceList::purge() {
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t VirtualSpaceList::used_words_sum() {
|
||||
size_t allocated_by_vs = 0;
|
||||
VirtualSpaceListIterator iter(virtual_space_list());
|
||||
while (iter.repeat()) {
|
||||
VirtualSpaceNode* vsl = iter.get_next();
|
||||
// Sum used region [bottom, top) in each virtualspace
|
||||
allocated_by_vs += vsl->used_words_in_vs();
|
||||
}
|
||||
assert(allocated_by_vs >= chunk_manager()->free_chunks_total_words(),
|
||||
err_msg("Total in free chunks " SIZE_FORMAT
|
||||
" greater than total from virtual_spaces " SIZE_FORMAT,
|
||||
allocated_by_vs, chunk_manager()->free_chunks_total_words()));
|
||||
size_t used =
|
||||
allocated_by_vs - chunk_manager()->free_chunks_total_words();
|
||||
return used;
|
||||
}
|
||||
|
||||
// Space available in all MetadataVirtualspaces allocated
|
||||
// for metadata. This is the upper limit on the capacity
|
||||
// of chunks allocated out of all the MetadataVirtualspaces.
|
||||
size_t VirtualSpaceList::capacity_words_sum() {
|
||||
size_t capacity = 0;
|
||||
VirtualSpaceListIterator iter(virtual_space_list());
|
||||
while (iter.repeat()) {
|
||||
VirtualSpaceNode* vsl = iter.get_next();
|
||||
capacity += vsl->capacity_words_in_vs();
|
||||
}
|
||||
return capacity;
|
||||
}
|
||||
|
||||
VirtualSpaceList::VirtualSpaceList(size_t word_size ) :
|
||||
_is_class(false),
|
||||
_virtual_space_list(NULL),
|
||||
@ -1104,10 +1064,6 @@ VirtualSpaceList::VirtualSpaceList(size_t word_size ) :
|
||||
MutexLockerEx cl(SpaceManager::expand_lock(),
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
bool initialization_succeeded = grow_vs(word_size);
|
||||
|
||||
_chunk_manager.free_chunks(SpecializedIndex)->set_size(SpecializedChunk);
|
||||
_chunk_manager.free_chunks(SmallIndex)->set_size(SmallChunk);
|
||||
_chunk_manager.free_chunks(MediumIndex)->set_size(MediumChunk);
|
||||
assert(initialization_succeeded,
|
||||
" VirtualSpaceList initialization should not fail");
|
||||
}
|
||||
@ -1123,9 +1079,6 @@ VirtualSpaceList::VirtualSpaceList(ReservedSpace rs) :
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
VirtualSpaceNode* class_entry = new VirtualSpaceNode(rs);
|
||||
bool succeeded = class_entry->initialize();
|
||||
_chunk_manager.free_chunks(SpecializedIndex)->set_size(SpecializedChunk);
|
||||
_chunk_manager.free_chunks(SmallIndex)->set_size(ClassSmallChunk);
|
||||
_chunk_manager.free_chunks(MediumIndex)->set_size(ClassMediumChunk);
|
||||
assert(succeeded, " VirtualSpaceList initialization should not fail");
|
||||
link_vs(class_entry);
|
||||
}
|
||||
@ -1142,7 +1095,7 @@ bool VirtualSpaceList::grow_vs(size_t vs_word_size) {
|
||||
}
|
||||
// Reserve the space
|
||||
size_t vs_byte_size = vs_word_size * BytesPerWord;
|
||||
assert(vs_byte_size % os::vm_page_size() == 0, "Not aligned");
|
||||
assert(vs_byte_size % os::vm_allocation_granularity() == 0, "Not aligned");
|
||||
|
||||
// Allocate the meta virtual space and initialize it.
|
||||
VirtualSpaceNode* new_entry = new VirtualSpaceNode(vs_byte_size);
|
||||
@ -1195,15 +1148,8 @@ Metachunk* VirtualSpaceList::get_new_chunk(size_t word_size,
|
||||
size_t grow_chunks_by_words,
|
||||
size_t medium_chunk_bunch) {
|
||||
|
||||
// Get a chunk from the chunk freelist
|
||||
Metachunk* next = chunk_manager()->chunk_freelist_allocate(grow_chunks_by_words);
|
||||
|
||||
if (next != NULL) {
|
||||
next->container()->inc_container_count();
|
||||
} else {
|
||||
// Allocate a chunk out of the current virtual space.
|
||||
next = current_virtual_space()->get_chunk_vs(grow_chunks_by_words);
|
||||
}
|
||||
// Allocate a chunk out of the current virtual space.
|
||||
Metachunk* next = current_virtual_space()->get_chunk_vs(grow_chunks_by_words);
|
||||
|
||||
if (next == NULL) {
|
||||
// Not enough room in current virtual space. Try to commit
|
||||
@ -1221,12 +1167,14 @@ Metachunk* VirtualSpaceList::get_new_chunk(size_t word_size,
|
||||
// being used for CompressedHeaders, don't allocate a new virtualspace.
|
||||
if (can_grow() && MetaspaceGC::should_expand(this, word_size)) {
|
||||
// Get another virtual space.
|
||||
size_t grow_vs_words =
|
||||
MAX2((size_t)VirtualSpaceSize, aligned_expand_vs_by_words);
|
||||
size_t allocation_aligned_expand_words =
|
||||
align_size_up(aligned_expand_vs_by_words, os::vm_allocation_granularity() / BytesPerWord);
|
||||
size_t grow_vs_words =
|
||||
MAX2((size_t)VirtualSpaceSize, allocation_aligned_expand_words);
|
||||
if (grow_vs(grow_vs_words)) {
|
||||
// Got it. It's on the list now. Get a chunk from it.
|
||||
assert(current_virtual_space()->expanded_words() == 0,
|
||||
"New virtuals space nodes should not have expanded");
|
||||
"New virtual space nodes should not have expanded");
|
||||
|
||||
size_t grow_chunks_by_words_aligned = align_size_up(grow_chunks_by_words,
|
||||
page_size_words);
|
||||
@ -1342,8 +1290,9 @@ bool MetaspaceGC::should_expand(VirtualSpaceList* vsl, size_t word_size) {
|
||||
// reserved space, because this is a larger space prereserved for compressed
|
||||
// class pointers.
|
||||
if (!FLAG_IS_DEFAULT(MaxMetaspaceSize)) {
|
||||
size_t real_allocated = Metaspace::space_list()->reserved_words() +
|
||||
MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType);
|
||||
size_t nonclass_allocated = MetaspaceAux::reserved_bytes(Metaspace::NonClassType);
|
||||
size_t class_allocated = MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType);
|
||||
size_t real_allocated = nonclass_allocated + class_allocated;
|
||||
if (real_allocated >= MaxMetaspaceSize) {
|
||||
return false;
|
||||
}
|
||||
@ -1536,15 +1485,15 @@ void Metadebug::deallocate_chunk_a_lot(SpaceManager* sm,
|
||||
if (dummy_chunk == NULL) {
|
||||
break;
|
||||
}
|
||||
vsl->chunk_manager()->chunk_freelist_deallocate(dummy_chunk);
|
||||
sm->chunk_manager()->chunk_freelist_deallocate(dummy_chunk);
|
||||
|
||||
if (TraceMetadataChunkAllocation && Verbose) {
|
||||
gclog_or_tty->print("Metadebug::deallocate_chunk_a_lot: %d) ",
|
||||
sm->sum_count_in_chunks_in_use());
|
||||
dummy_chunk->print_on(gclog_or_tty);
|
||||
gclog_or_tty->print_cr(" Free chunks total %d count %d",
|
||||
vsl->chunk_manager()->free_chunks_total_words(),
|
||||
vsl->chunk_manager()->free_chunks_count());
|
||||
sm->chunk_manager()->free_chunks_total_words(),
|
||||
sm->chunk_manager()->free_chunks_count());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -1796,6 +1745,8 @@ Metachunk* ChunkManager::free_chunks_get(size_t word_size) {
|
||||
// work.
|
||||
chunk->set_is_free(false);
|
||||
#endif
|
||||
chunk->container()->inc_container_count();
|
||||
|
||||
slow_locked_verify();
|
||||
return chunk;
|
||||
}
|
||||
@ -1830,9 +1781,9 @@ Metachunk* ChunkManager::chunk_freelist_allocate(size_t word_size) {
|
||||
return chunk;
|
||||
}
|
||||
|
||||
void ChunkManager::print_on(outputStream* out) {
|
||||
void ChunkManager::print_on(outputStream* out) const {
|
||||
if (PrintFLSStatistics != 0) {
|
||||
humongous_dictionary()->report_statistics();
|
||||
const_cast<ChunkManager *>(this)->humongous_dictionary()->report_statistics();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1979,8 +1930,8 @@ void SpaceManager::locked_print_chunks_in_use_on(outputStream* st) const {
|
||||
}
|
||||
}
|
||||
|
||||
vs_list()->chunk_manager()->locked_print_free_chunks(st);
|
||||
vs_list()->chunk_manager()->locked_print_sum_free_chunks(st);
|
||||
chunk_manager()->locked_print_free_chunks(st);
|
||||
chunk_manager()->locked_print_sum_free_chunks(st);
|
||||
}
|
||||
|
||||
size_t SpaceManager::calc_chunk_size(size_t word_size) {
|
||||
@ -2084,9 +2035,7 @@ void SpaceManager::print_on(outputStream* st) const {
|
||||
}
|
||||
|
||||
SpaceManager::SpaceManager(Metaspace::MetadataType mdtype,
|
||||
Mutex* lock,
|
||||
VirtualSpaceList* vs_list) :
|
||||
_vs_list(vs_list),
|
||||
Mutex* lock) :
|
||||
_mdtype(mdtype),
|
||||
_allocated_blocks_words(0),
|
||||
_allocated_chunks_words(0),
|
||||
@ -2172,9 +2121,7 @@ SpaceManager::~SpaceManager() {
|
||||
MutexLockerEx fcl(SpaceManager::expand_lock(),
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
|
||||
ChunkManager* chunk_manager = vs_list()->chunk_manager();
|
||||
|
||||
chunk_manager->slow_locked_verify();
|
||||
chunk_manager()->slow_locked_verify();
|
||||
|
||||
dec_total_from_size_metrics();
|
||||
|
||||
@ -2188,8 +2135,8 @@ SpaceManager::~SpaceManager() {
|
||||
|
||||
// Have to update before the chunks_in_use lists are emptied
|
||||
// below.
|
||||
chunk_manager->inc_free_chunks_total(allocated_chunks_words(),
|
||||
sum_count_in_chunks_in_use());
|
||||
chunk_manager()->inc_free_chunks_total(allocated_chunks_words(),
|
||||
sum_count_in_chunks_in_use());
|
||||
|
||||
// Add all the chunks in use by this space manager
|
||||
// to the global list of free chunks.
|
||||
@ -2204,11 +2151,11 @@ SpaceManager::~SpaceManager() {
|
||||
chunk_size_name(i));
|
||||
}
|
||||
Metachunk* chunks = chunks_in_use(i);
|
||||
chunk_manager->return_chunks(i, chunks);
|
||||
chunk_manager()->return_chunks(i, chunks);
|
||||
set_chunks_in_use(i, NULL);
|
||||
if (TraceMetadataChunkAllocation && Verbose) {
|
||||
gclog_or_tty->print_cr("updated freelist count %d %s",
|
||||
chunk_manager->free_chunks(i)->count(),
|
||||
chunk_manager()->free_chunks(i)->count(),
|
||||
chunk_size_name(i));
|
||||
}
|
||||
assert(i != HumongousIndex, "Humongous chunks are handled explicitly later");
|
||||
@ -2245,16 +2192,16 @@ SpaceManager::~SpaceManager() {
|
||||
humongous_chunks->word_size(), HumongousChunkGranularity));
|
||||
Metachunk* next_humongous_chunks = humongous_chunks->next();
|
||||
humongous_chunks->container()->dec_container_count();
|
||||
chunk_manager->humongous_dictionary()->return_chunk(humongous_chunks);
|
||||
chunk_manager()->humongous_dictionary()->return_chunk(humongous_chunks);
|
||||
humongous_chunks = next_humongous_chunks;
|
||||
}
|
||||
if (TraceMetadataChunkAllocation && Verbose) {
|
||||
gclog_or_tty->print_cr("");
|
||||
gclog_or_tty->print_cr("updated dictionary count %d %s",
|
||||
chunk_manager->humongous_dictionary()->total_count(),
|
||||
chunk_manager()->humongous_dictionary()->total_count(),
|
||||
chunk_size_name(HumongousIndex));
|
||||
}
|
||||
chunk_manager->slow_locked_verify();
|
||||
chunk_manager()->slow_locked_verify();
|
||||
}
|
||||
|
||||
const char* SpaceManager::chunk_size_name(ChunkIndex index) const {
|
||||
@ -2343,9 +2290,7 @@ void SpaceManager::add_chunk(Metachunk* new_chunk, bool make_current) {
|
||||
gclog_or_tty->print("SpaceManager::add_chunk: %d) ",
|
||||
sum_count_in_chunks_in_use());
|
||||
new_chunk->print_on(gclog_or_tty);
|
||||
if (vs_list() != NULL) {
|
||||
vs_list()->chunk_manager()->locked_print_free_chunks(gclog_or_tty);
|
||||
}
|
||||
chunk_manager()->locked_print_free_chunks(gclog_or_tty);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2361,10 +2306,14 @@ void SpaceManager::retire_current_chunk() {
|
||||
|
||||
Metachunk* SpaceManager::get_new_chunk(size_t word_size,
|
||||
size_t grow_chunks_by_words) {
|
||||
// Get a chunk from the chunk freelist
|
||||
Metachunk* next = chunk_manager()->chunk_freelist_allocate(grow_chunks_by_words);
|
||||
|
||||
Metachunk* next = vs_list()->get_new_chunk(word_size,
|
||||
grow_chunks_by_words,
|
||||
medium_chunk_bunch());
|
||||
if (next == NULL) {
|
||||
next = vs_list()->get_new_chunk(word_size,
|
||||
grow_chunks_by_words,
|
||||
medium_chunk_bunch());
|
||||
}
|
||||
|
||||
if (TraceMetadataHumongousAllocation && next != NULL &&
|
||||
SpaceManager::is_humongous(next->word_size())) {
|
||||
@ -2644,13 +2593,12 @@ size_t MetaspaceAux::committed_bytes(Metaspace::MetadataType mdtype) {
|
||||
size_t MetaspaceAux::min_chunk_size_words() { return Metaspace::first_chunk_word_size(); }
|
||||
|
||||
size_t MetaspaceAux::free_chunks_total_words(Metaspace::MetadataType mdtype) {
|
||||
VirtualSpaceList* list = Metaspace::get_space_list(mdtype);
|
||||
if (list == NULL) {
|
||||
ChunkManager* chunk_manager = Metaspace::get_chunk_manager(mdtype);
|
||||
if (chunk_manager == NULL) {
|
||||
return 0;
|
||||
}
|
||||
ChunkManager* chunk = list->chunk_manager();
|
||||
chunk->slow_verify();
|
||||
return chunk->free_chunks_total_words();
|
||||
chunk_manager->slow_verify();
|
||||
return chunk_manager->free_chunks_total_words();
|
||||
}
|
||||
|
||||
size_t MetaspaceAux::free_chunks_total_bytes(Metaspace::MetadataType mdtype) {
|
||||
@ -2801,9 +2749,9 @@ void MetaspaceAux::dump(outputStream* out) {
|
||||
}
|
||||
|
||||
void MetaspaceAux::verify_free_chunks() {
|
||||
Metaspace::space_list()->chunk_manager()->verify();
|
||||
Metaspace::chunk_manager_metadata()->verify();
|
||||
if (Metaspace::using_class_space()) {
|
||||
Metaspace::class_space_list()->chunk_manager()->verify();
|
||||
Metaspace::chunk_manager_class()->verify();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2874,6 +2822,9 @@ Metaspace::~Metaspace() {
|
||||
VirtualSpaceList* Metaspace::_space_list = NULL;
|
||||
VirtualSpaceList* Metaspace::_class_space_list = NULL;
|
||||
|
||||
ChunkManager* Metaspace::_chunk_manager_metadata = NULL;
|
||||
ChunkManager* Metaspace::_chunk_manager_class = NULL;
|
||||
|
||||
#define VIRTUALSPACEMULTIPLIER 2
|
||||
|
||||
#ifdef _LP64
|
||||
@ -2981,6 +2932,7 @@ void Metaspace::initialize_class_space(ReservedSpace rs) {
|
||||
err_msg(SIZE_FORMAT " != " UINTX_FORMAT, rs.size(), CompressedClassSpaceSize));
|
||||
assert(using_class_space(), "Must be using class space");
|
||||
_class_space_list = new VirtualSpaceList(rs);
|
||||
_chunk_manager_class = new ChunkManager(SpecializedChunk, ClassSmallChunk, ClassMediumChunk);
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -3006,6 +2958,7 @@ void Metaspace::global_initialize() {
|
||||
// remainder is the misc code and data chunks.
|
||||
cds_total = FileMapInfo::shared_spaces_size();
|
||||
_space_list = new VirtualSpaceList(cds_total/wordSize);
|
||||
_chunk_manager_metadata = new ChunkManager(SpecializedChunk, SmallChunk, MediumChunk);
|
||||
|
||||
#ifdef _LP64
|
||||
// Set the compressed klass pointer base so that decoding of these pointers works
|
||||
@ -3073,15 +3026,30 @@ void Metaspace::global_initialize() {
|
||||
size_t word_size = VIRTUALSPACEMULTIPLIER * first_chunk_word_size();
|
||||
// Initialize the list of virtual spaces.
|
||||
_space_list = new VirtualSpaceList(word_size);
|
||||
_chunk_manager_metadata = new ChunkManager(SpecializedChunk, SmallChunk, MediumChunk);
|
||||
}
|
||||
}
|
||||
|
||||
Metachunk* Metaspace::get_initialization_chunk(MetadataType mdtype,
|
||||
size_t chunk_word_size,
|
||||
size_t chunk_bunch) {
|
||||
// Get a chunk from the chunk freelist
|
||||
Metachunk* chunk = get_chunk_manager(mdtype)->chunk_freelist_allocate(chunk_word_size);
|
||||
if (chunk != NULL) {
|
||||
return chunk;
|
||||
}
|
||||
|
||||
return get_space_list(mdtype)->get_initialization_chunk(chunk_word_size, chunk_bunch);
|
||||
}
|
||||
|
||||
void Metaspace::initialize(Mutex* lock, MetaspaceType type) {
|
||||
|
||||
assert(space_list() != NULL,
|
||||
"Metadata VirtualSpaceList has not been initialized");
|
||||
assert(chunk_manager_metadata() != NULL,
|
||||
"Metadata ChunkManager has not been initialized");
|
||||
|
||||
_vsm = new SpaceManager(NonClassType, lock, space_list());
|
||||
_vsm = new SpaceManager(NonClassType, lock);
|
||||
if (_vsm == NULL) {
|
||||
return;
|
||||
}
|
||||
@ -3090,11 +3058,13 @@ void Metaspace::initialize(Mutex* lock, MetaspaceType type) {
|
||||
vsm()->get_initial_chunk_sizes(type, &word_size, &class_word_size);
|
||||
|
||||
if (using_class_space()) {
|
||||
assert(class_space_list() != NULL,
|
||||
"Class VirtualSpaceList has not been initialized");
|
||||
assert(class_space_list() != NULL,
|
||||
"Class VirtualSpaceList has not been initialized");
|
||||
assert(chunk_manager_class() != NULL,
|
||||
"Class ChunkManager has not been initialized");
|
||||
|
||||
// Allocate SpaceManager for classes.
|
||||
_class_vsm = new SpaceManager(ClassType, lock, class_space_list());
|
||||
_class_vsm = new SpaceManager(ClassType, lock);
|
||||
if (_class_vsm == NULL) {
|
||||
return;
|
||||
}
|
||||
@ -3103,9 +3073,9 @@ void Metaspace::initialize(Mutex* lock, MetaspaceType type) {
|
||||
MutexLockerEx cl(SpaceManager::expand_lock(), Mutex::_no_safepoint_check_flag);
|
||||
|
||||
// Allocate chunk for metadata objects
|
||||
Metachunk* new_chunk =
|
||||
space_list()->get_initialization_chunk(word_size,
|
||||
vsm()->medium_chunk_bunch());
|
||||
Metachunk* new_chunk = get_initialization_chunk(NonClassType,
|
||||
word_size,
|
||||
vsm()->medium_chunk_bunch());
|
||||
assert(!DumpSharedSpaces || new_chunk != NULL, "should have enough space for both chunks");
|
||||
if (new_chunk != NULL) {
|
||||
// Add to this manager's list of chunks in use and current_chunk().
|
||||
@ -3114,9 +3084,9 @@ void Metaspace::initialize(Mutex* lock, MetaspaceType type) {
|
||||
|
||||
// Allocate chunk for class metadata objects
|
||||
if (using_class_space()) {
|
||||
Metachunk* class_chunk =
|
||||
class_space_list()->get_initialization_chunk(class_word_size,
|
||||
class_vsm()->medium_chunk_bunch());
|
||||
Metachunk* class_chunk = get_initialization_chunk(ClassType,
|
||||
class_word_size,
|
||||
class_vsm()->medium_chunk_bunch());
|
||||
if (class_chunk != NULL) {
|
||||
class_vsm()->add_chunk(class_chunk, true);
|
||||
}
|
||||
@ -3333,12 +3303,16 @@ void Metaspace::iterate(Metaspace::AllocRecordClosure *closure) {
|
||||
}
|
||||
}
|
||||
|
||||
void Metaspace::purge(MetadataType mdtype) {
|
||||
get_space_list(mdtype)->purge(get_chunk_manager(mdtype));
|
||||
}
|
||||
|
||||
void Metaspace::purge() {
|
||||
MutexLockerEx cl(SpaceManager::expand_lock(),
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
space_list()->purge();
|
||||
purge(NonClassType);
|
||||
if (using_class_space()) {
|
||||
class_space_list()->purge();
|
||||
purge(ClassType);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3385,7 +3359,7 @@ void Metaspace::dump(outputStream* const out) const {
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
class MetaspaceAuxTest : AllStatic {
|
||||
class TestMetaspaceAuxTest : AllStatic {
|
||||
public:
|
||||
static void test_reserved() {
|
||||
size_t reserved = MetaspaceAux::reserved_bytes();
|
||||
@ -3425,14 +3399,25 @@ class MetaspaceAuxTest : AllStatic {
|
||||
}
|
||||
}
|
||||
|
||||
static void test_virtual_space_list_large_chunk() {
|
||||
VirtualSpaceList* vs_list = new VirtualSpaceList(os::vm_allocation_granularity());
|
||||
MutexLockerEx cl(SpaceManager::expand_lock(), Mutex::_no_safepoint_check_flag);
|
||||
// A size larger than VirtualSpaceSize (256k) and add one page to make it _not_ be
|
||||
// vm_allocation_granularity aligned on Windows.
|
||||
size_t large_size = (size_t)(2*256*K + (os::vm_page_size()/BytesPerWord));
|
||||
large_size += (os::vm_page_size()/BytesPerWord);
|
||||
vs_list->get_new_chunk(large_size, large_size, 0);
|
||||
}
|
||||
|
||||
static void test() {
|
||||
test_reserved();
|
||||
test_committed();
|
||||
test_virtual_space_list_large_chunk();
|
||||
}
|
||||
};
|
||||
|
||||
void MetaspaceAux_test() {
|
||||
MetaspaceAuxTest::test();
|
||||
void TestMetaspaceAux_test() {
|
||||
TestMetaspaceAuxTest::test();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -56,12 +56,15 @@
|
||||
// +-------------------+
|
||||
//
|
||||
|
||||
class ChunkManager;
|
||||
class ClassLoaderData;
|
||||
class Metablock;
|
||||
class Metachunk;
|
||||
class MetaWord;
|
||||
class Mutex;
|
||||
class outputStream;
|
||||
class SpaceManager;
|
||||
class VirtualSpaceList;
|
||||
|
||||
// Metaspaces each have a SpaceManager and allocations
|
||||
// are done by the SpaceManager. Allocations are done
|
||||
@ -76,8 +79,6 @@ class SpaceManager;
|
||||
// allocate() method returns a block for use as a
|
||||
// quantum of metadata.
|
||||
|
||||
class VirtualSpaceList;
|
||||
|
||||
class Metaspace : public CHeapObj<mtClass> {
|
||||
friend class VMStructs;
|
||||
friend class SpaceManager;
|
||||
@ -102,6 +103,10 @@ class Metaspace : public CHeapObj<mtClass> {
|
||||
private:
|
||||
void initialize(Mutex* lock, MetaspaceType type);
|
||||
|
||||
Metachunk* get_initialization_chunk(MetadataType mdtype,
|
||||
size_t chunk_word_size,
|
||||
size_t chunk_bunch);
|
||||
|
||||
// Align up the word size to the allocation word size
|
||||
static size_t align_word_size_up(size_t);
|
||||
|
||||
@ -134,6 +139,10 @@ class Metaspace : public CHeapObj<mtClass> {
|
||||
static VirtualSpaceList* _space_list;
|
||||
static VirtualSpaceList* _class_space_list;
|
||||
|
||||
static ChunkManager* _chunk_manager_metadata;
|
||||
static ChunkManager* _chunk_manager_class;
|
||||
|
||||
public:
|
||||
static VirtualSpaceList* space_list() { return _space_list; }
|
||||
static VirtualSpaceList* class_space_list() { return _class_space_list; }
|
||||
static VirtualSpaceList* get_space_list(MetadataType mdtype) {
|
||||
@ -141,6 +150,14 @@ class Metaspace : public CHeapObj<mtClass> {
|
||||
return mdtype == ClassType ? class_space_list() : space_list();
|
||||
}
|
||||
|
||||
static ChunkManager* chunk_manager_metadata() { return _chunk_manager_metadata; }
|
||||
static ChunkManager* chunk_manager_class() { return _chunk_manager_class; }
|
||||
static ChunkManager* get_chunk_manager(MetadataType mdtype) {
|
||||
assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype");
|
||||
return mdtype == ClassType ? chunk_manager_class() : chunk_manager_metadata();
|
||||
}
|
||||
|
||||
private:
|
||||
// This is used by DumpSharedSpaces only, where only _vsm is used. So we will
|
||||
// maintain a single list for now.
|
||||
void record_allocation(void* ptr, MetaspaceObj::Type type, size_t word_size);
|
||||
@ -199,6 +216,7 @@ class Metaspace : public CHeapObj<mtClass> {
|
||||
void dump(outputStream* const out) const;
|
||||
|
||||
// Free empty virtualspaces
|
||||
static void purge(MetadataType mdtype);
|
||||
static void purge();
|
||||
|
||||
void print_on(outputStream* st) const;
|
||||
|
||||
@ -367,7 +367,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list,
|
||||
next_d = java_lang_ref_Reference::discovered(obj);
|
||||
if (TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT,
|
||||
obj, next_d);
|
||||
(void *)obj, (void *)next_d);
|
||||
}
|
||||
assert(java_lang_ref_Reference::next(obj) == NULL,
|
||||
"Reference not active; should not be discovered");
|
||||
@ -392,7 +392,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list,
|
||||
next_d = java_lang_ref_Reference::discovered(obj);
|
||||
if (TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT,
|
||||
obj, next_d);
|
||||
(void *)obj, (void *)next_d);
|
||||
}
|
||||
assert(java_lang_ref_Reference::next(obj) == NULL,
|
||||
"The reference should not be enqueued");
|
||||
@ -562,7 +562,7 @@ ReferenceProcessor::process_phase1(DiscoveredList& refs_list,
|
||||
!policy->should_clear_reference(iter.obj(), _soft_ref_timestamp_clock)) {
|
||||
if (TraceReferenceGC) {
|
||||
gclog_or_tty->print_cr("Dropping reference (" INTPTR_FORMAT ": %s" ") by policy",
|
||||
iter.obj(), iter.obj()->klass()->internal_name());
|
||||
(void *)iter.obj(), iter.obj()->klass()->internal_name());
|
||||
}
|
||||
// Remove Reference object from list
|
||||
iter.remove();
|
||||
@ -601,7 +601,7 @@ ReferenceProcessor::pp2_work(DiscoveredList& refs_list,
|
||||
if (iter.is_referent_alive()) {
|
||||
if (TraceReferenceGC) {
|
||||
gclog_or_tty->print_cr("Dropping strongly reachable reference (" INTPTR_FORMAT ": %s)",
|
||||
iter.obj(), iter.obj()->klass()->internal_name());
|
||||
(void *)iter.obj(), iter.obj()->klass()->internal_name());
|
||||
}
|
||||
// The referent is reachable after all.
|
||||
// Remove Reference object from list.
|
||||
@ -687,7 +687,7 @@ ReferenceProcessor::process_phase3(DiscoveredList& refs_list,
|
||||
if (TraceReferenceGC) {
|
||||
gclog_or_tty->print_cr("Adding %sreference (" INTPTR_FORMAT ": %s) as pending",
|
||||
clear_referent ? "cleared " : "",
|
||||
iter.obj(), iter.obj()->klass()->internal_name());
|
||||
(void *)iter.obj(), iter.obj()->klass()->internal_name());
|
||||
}
|
||||
assert(iter.obj()->is_oop(UseConcMarkSweepGC), "Adding a bad reference");
|
||||
iter.next();
|
||||
@ -1003,7 +1003,7 @@ void ReferenceProcessor::clean_up_discovered_reflist(DiscoveredList& refs_list)
|
||||
gclog_or_tty->print_cr("clean_up_discovered_list: Dropping Reference: "
|
||||
INTPTR_FORMAT " with next field: " INTPTR_FORMAT
|
||||
" and referent: " INTPTR_FORMAT,
|
||||
iter.obj(), next, iter.referent());
|
||||
(void *)iter.obj(), (void *)next, (void *)iter.referent());
|
||||
}
|
||||
)
|
||||
// Remove Reference object from list
|
||||
@ -1103,14 +1103,14 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list,
|
||||
|
||||
if (TraceReferenceGC) {
|
||||
gclog_or_tty->print_cr("Discovered reference (mt) (" INTPTR_FORMAT ": %s)",
|
||||
obj, obj->klass()->internal_name());
|
||||
(void *)obj, obj->klass()->internal_name());
|
||||
}
|
||||
} else {
|
||||
// If retest was non NULL, another thread beat us to it:
|
||||
// The reference has already been discovered...
|
||||
if (TraceReferenceGC) {
|
||||
gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)",
|
||||
obj, obj->klass()->internal_name());
|
||||
(void *)obj, obj->klass()->internal_name());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1125,7 +1125,7 @@ void ReferenceProcessor::verify_referent(oop obj) {
|
||||
assert(da ? referent->is_oop() : referent->is_oop_or_null(),
|
||||
err_msg("Bad referent " INTPTR_FORMAT " found in Reference "
|
||||
INTPTR_FORMAT " during %satomic discovery ",
|
||||
(intptr_t)referent, (intptr_t)obj, da ? "" : "non-"));
|
||||
(void *)referent, (void *)obj, da ? "" : "non-"));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1205,7 +1205,7 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) {
|
||||
// The reference has already been discovered...
|
||||
if (TraceReferenceGC) {
|
||||
gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)",
|
||||
obj, obj->klass()->internal_name());
|
||||
(void *)obj, obj->klass()->internal_name());
|
||||
}
|
||||
if (RefDiscoveryPolicy == ReferentBasedDiscovery) {
|
||||
// assumes that an object is not processed twice;
|
||||
@ -1273,7 +1273,7 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) {
|
||||
|
||||
if (TraceReferenceGC) {
|
||||
gclog_or_tty->print_cr("Discovered reference (" INTPTR_FORMAT ": %s)",
|
||||
obj, obj->klass()->internal_name());
|
||||
(void *)obj, obj->klass()->internal_name());
|
||||
}
|
||||
}
|
||||
assert(obj->is_oop(), "Discovered a bad reference");
|
||||
@ -1372,7 +1372,7 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list,
|
||||
// active; we need to trace and mark its cohort.
|
||||
if (TraceReferenceGC) {
|
||||
gclog_or_tty->print_cr("Precleaning Reference (" INTPTR_FORMAT ": %s)",
|
||||
iter.obj(), iter.obj()->klass()->internal_name());
|
||||
(void *)iter.obj(), iter.obj()->klass()->internal_name());
|
||||
}
|
||||
// Remove Reference object from list
|
||||
iter.remove();
|
||||
|
||||
@ -1918,7 +1918,7 @@ void ConstantPool::print_on(outputStream* st) const {
|
||||
st->print_cr(" - holder: " INTPTR_FORMAT, pool_holder());
|
||||
}
|
||||
st->print_cr(" - cache: " INTPTR_FORMAT, cache());
|
||||
st->print_cr(" - resolved_references: " INTPTR_FORMAT, resolved_references());
|
||||
st->print_cr(" - resolved_references: " INTPTR_FORMAT, (void *)resolved_references());
|
||||
st->print_cr(" - reference_map: " INTPTR_FORMAT, reference_map());
|
||||
|
||||
for (int index = 1; index < length(); index++) { // Index 0 is unused
|
||||
|
||||
@ -306,8 +306,8 @@ void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
|
||||
if (TraceInvokeDynamic) {
|
||||
tty->print_cr("set_method_handle bc=%d appendix="PTR_FORMAT"%s method_type="PTR_FORMAT"%s method="PTR_FORMAT" ",
|
||||
invoke_code,
|
||||
(intptr_t)appendix(), (has_appendix ? "" : " (unused)"),
|
||||
(intptr_t)method_type(), (has_method_type ? "" : " (unused)"),
|
||||
(void *)appendix(), (has_appendix ? "" : " (unused)"),
|
||||
(void *)method_type(), (has_method_type ? "" : " (unused)"),
|
||||
(intptr_t)adapter());
|
||||
adapter->print();
|
||||
if (has_appendix) appendix()->print();
|
||||
|
||||
@ -106,7 +106,7 @@ HS_DTRACE_PROBE_DECL5(hotspot, class__initialization__end,
|
||||
len = name->utf8_length(); \
|
||||
} \
|
||||
HS_DTRACE_PROBE4(hotspot, class__initialization__##type, \
|
||||
data, len, (clss)->class_loader(), thread_type); \
|
||||
data, len, SOLARIS_ONLY((void *))(clss)->class_loader(), thread_type); \
|
||||
}
|
||||
|
||||
#define DTRACE_CLASSINIT_PROBE_WAIT(type, clss, thread_type, wait) \
|
||||
@ -119,7 +119,7 @@ HS_DTRACE_PROBE_DECL5(hotspot, class__initialization__end,
|
||||
len = name->utf8_length(); \
|
||||
} \
|
||||
HS_DTRACE_PROBE5(hotspot, class__initialization__##type, \
|
||||
data, len, (clss)->class_loader(), thread_type, wait); \
|
||||
data, len, SOLARIS_ONLY((void *))(clss)->class_loader(), thread_type, wait); \
|
||||
}
|
||||
#else /* USDT2 */
|
||||
|
||||
@ -2303,7 +2303,7 @@ void InstanceKlass::set_source_debug_extension(char* array, int length) {
|
||||
}
|
||||
|
||||
address InstanceKlass::static_field_addr(int offset) {
|
||||
return (address)(offset + InstanceMirrorKlass::offset_of_static_fields() + (intptr_t)java_mirror());
|
||||
return (address)(offset + InstanceMirrorKlass::offset_of_static_fields() + cast_from_oop<intptr_t>(java_mirror()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 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
|
||||
@ -66,7 +66,7 @@ class InstanceMirrorKlass: public InstanceKlass {
|
||||
// Static field offset is an offset into the Heap, should be converted by
|
||||
// based on UseCompressedOop for traversal
|
||||
static HeapWord* start_of_static_fields(oop obj) {
|
||||
return (HeapWord*)((intptr_t)obj + offset_of_static_fields());
|
||||
return (HeapWord*)(cast_from_oop<intptr_t>(obj) + offset_of_static_fields());
|
||||
}
|
||||
|
||||
static void init_offset_of_static_fields() {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -51,7 +51,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) {
|
||||
T heap_oop = oopDesc::load_heap_oop(referent_addr);
|
||||
debug_only(
|
||||
if(TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj);
|
||||
gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, (void *)obj);
|
||||
}
|
||||
)
|
||||
if (!oopDesc::is_null(heap_oop)) {
|
||||
@ -62,7 +62,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) {
|
||||
ref->InstanceKlass::oop_follow_contents(obj);
|
||||
debug_only(
|
||||
if(TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr(" Non NULL enqueued " INTPTR_FORMAT, obj);
|
||||
gclog_or_tty->print_cr(" Non NULL enqueued " INTPTR_FORMAT, (void *)obj);
|
||||
}
|
||||
)
|
||||
return;
|
||||
@ -70,7 +70,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) {
|
||||
// treat referent as normal oop
|
||||
debug_only(
|
||||
if(TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr(" Non NULL normal " INTPTR_FORMAT, obj);
|
||||
gclog_or_tty->print_cr(" Non NULL normal " INTPTR_FORMAT, (void *)obj);
|
||||
}
|
||||
)
|
||||
MarkSweep::mark_and_push(referent_addr);
|
||||
@ -130,7 +130,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref,
|
||||
T heap_oop = oopDesc::load_heap_oop(referent_addr);
|
||||
debug_only(
|
||||
if(TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj);
|
||||
gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, (void *)obj);
|
||||
}
|
||||
)
|
||||
if (!oopDesc::is_null(heap_oop)) {
|
||||
@ -142,7 +142,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref,
|
||||
ref->InstanceKlass::oop_follow_contents(cm, obj);
|
||||
debug_only(
|
||||
if(TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr(" Non NULL enqueued " INTPTR_FORMAT, obj);
|
||||
gclog_or_tty->print_cr(" Non NULL enqueued " INTPTR_FORMAT, (void *)obj);
|
||||
}
|
||||
)
|
||||
return;
|
||||
@ -150,7 +150,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref,
|
||||
// treat referent as normal oop
|
||||
debug_only(
|
||||
if(TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr(" Non NULL normal " INTPTR_FORMAT, obj);
|
||||
gclog_or_tty->print_cr(" Non NULL normal " INTPTR_FORMAT, (void *)obj);
|
||||
}
|
||||
)
|
||||
PSParallelCompact::mark_and_push(cm, referent_addr);
|
||||
|
||||
@ -333,10 +333,10 @@ protected:
|
||||
return (int)data()->cell_at(index);
|
||||
}
|
||||
void set_oop_at(int index, oop value) {
|
||||
set_intptr_at(index, (intptr_t) value);
|
||||
set_intptr_at(index, cast_from_oop<intptr_t>(value));
|
||||
}
|
||||
oop oop_at(int index) {
|
||||
return (oop)intptr_at(index);
|
||||
return cast_to_oop(intptr_at(index));
|
||||
}
|
||||
|
||||
void set_flag_at(int flag_number) {
|
||||
|
||||
@ -183,7 +183,7 @@ inline bool oopDesc::is_null(narrowOop obj) { return obj == 0; }
|
||||
// in inner GC loops so these are separated.
|
||||
|
||||
inline bool check_obj_alignment(oop obj) {
|
||||
return (intptr_t)obj % MinObjAlignmentInBytes == 0;
|
||||
return cast_from_oop<intptr_t>(obj) % MinObjAlignmentInBytes == 0;
|
||||
}
|
||||
|
||||
inline narrowOop oopDesc::encode_heap_oop_not_null(oop v) {
|
||||
|
||||
@ -55,11 +55,16 @@ typedef class typeArrayOopDesc* typeArrayOop;
|
||||
// to and from the underlying oopDesc pointer type.
|
||||
//
|
||||
// Because oop and its subclasses <type>Oop are class types, arbitrary
|
||||
// conversions are not accepted by the compiler, and you may get a message
|
||||
// about overloading ambiguity (between long and int is common when converting
|
||||
// from a constant in 64 bit mode), or unable to convert from type to 'oop'.
|
||||
// Applying a cast to one of these conversion operators first will get to the
|
||||
// underlying oopDesc* type if appropriate.
|
||||
// conversions are not accepted by the compiler. Applying a cast to
|
||||
// an oop will cause the best matched conversion operator to be
|
||||
// invoked returning the underlying oopDesc* type if appropriate.
|
||||
// No copy constructors, explicit user conversions or operators of
|
||||
// numerical type should be defined within the oop class. Most C++
|
||||
// compilers will issue a compile time error concerning the overloading
|
||||
// ambiguity between operators of numerical and pointer types. If
|
||||
// a conversion to or from an oop to a numerical type is needed,
|
||||
// use the inline template methods, cast_*_oop, defined below.
|
||||
//
|
||||
// Converting NULL to oop to Handle implicit is no longer accepted by the
|
||||
// compiler because there are too many steps in the conversion. Use Handle()
|
||||
// instead, which generates less code anyway.
|
||||
@ -83,12 +88,9 @@ public:
|
||||
void raw_set_obj(const void* p) { _o = (oopDesc*)p; }
|
||||
|
||||
oop() { set_obj(NULL); }
|
||||
oop(const oop& o) { set_obj(o.obj()); }
|
||||
oop(const volatile oop& o) { set_obj(o.obj()); }
|
||||
oop(const void* p) { set_obj(p); }
|
||||
oop(intptr_t i) { set_obj((void *)i); }
|
||||
#ifdef _LP64
|
||||
oop(int i) { set_obj((void *)i); }
|
||||
#endif
|
||||
~oop() {
|
||||
if (CheckUnhandledOops) unregister_oop();
|
||||
}
|
||||
@ -101,8 +103,6 @@ public:
|
||||
bool operator==(void *p) const { return obj() == p; }
|
||||
bool operator!=(const volatile oop o) const { return obj() != o.obj(); }
|
||||
bool operator!=(void *p) const { return obj() != p; }
|
||||
bool operator==(intptr_t p) const { return obj() == (oopDesc*)p; }
|
||||
bool operator!=(intptr_t p) const { return obj() != (oopDesc*)p; }
|
||||
|
||||
bool operator<(oop o) const { return obj() < o.obj(); }
|
||||
bool operator>(oop o) const { return obj() > o.obj(); }
|
||||
@ -110,8 +110,18 @@ public:
|
||||
bool operator>=(oop o) const { return obj() >= o.obj(); }
|
||||
bool operator!() const { return !obj(); }
|
||||
|
||||
// Cast
|
||||
// Assignment
|
||||
oop& operator=(const oop& o) { _o = o.obj(); return *this; }
|
||||
#ifndef SOLARIS
|
||||
volatile oop& operator=(const oop& o) volatile { _o = o.obj(); return *this; }
|
||||
#endif
|
||||
volatile oop& operator=(const volatile oop& o) volatile { _o = o.obj(); return *this; }
|
||||
|
||||
// Explict user conversions
|
||||
operator void* () const { return (void *)obj(); }
|
||||
#ifndef SOLARIS
|
||||
operator void* () const volatile { return (void *)obj(); }
|
||||
#endif
|
||||
operator HeapWord* () const { return (HeapWord*)obj(); }
|
||||
operator oopDesc* () const { return obj(); }
|
||||
operator intptr_t* () const { return (intptr_t*)obj(); }
|
||||
@ -119,7 +129,6 @@ public:
|
||||
operator markOop () const { return markOop(obj()); }
|
||||
|
||||
operator address () const { return (address)obj(); }
|
||||
operator intptr_t () const volatile { return (intptr_t)obj(); }
|
||||
|
||||
// from javaCalls.cpp
|
||||
operator jobject () const { return (jobject)obj(); }
|
||||
@ -141,12 +150,26 @@ public:
|
||||
class type##Oop : public oop { \
|
||||
public: \
|
||||
type##Oop() : oop() {} \
|
||||
type##Oop(const oop& o) : oop(o) {} \
|
||||
type##Oop(const volatile oop& o) : oop(o) {} \
|
||||
type##Oop(const void* p) : oop(p) {} \
|
||||
operator type##OopDesc* () const { return (type##OopDesc*)obj(); } \
|
||||
type##OopDesc* operator->() const { \
|
||||
return (type##OopDesc*)obj(); \
|
||||
} \
|
||||
type##Oop& operator=(const type##Oop& o) { \
|
||||
oop::operator=(o); \
|
||||
return *this; \
|
||||
} \
|
||||
NOT_SOLARIS( \
|
||||
volatile type##Oop& operator=(const type##Oop& o) volatile { \
|
||||
(void)const_cast<oop&>(oop::operator=(o)); \
|
||||
return *this; \
|
||||
}) \
|
||||
volatile type##Oop& operator=(const volatile type##Oop& o) volatile {\
|
||||
(void)const_cast<oop&>(oop::operator=(o)); \
|
||||
return *this; \
|
||||
} \
|
||||
};
|
||||
|
||||
DEF_OOP(instance);
|
||||
@ -156,6 +179,16 @@ DEF_OOP(typeArray);
|
||||
|
||||
#endif // CHECK_UNHANDLED_OOPS
|
||||
|
||||
// For CHECK_UNHANDLED_OOPS, it is ambiguous C++ behavior to have the oop
|
||||
// structure contain explicit user defined conversions of both numerical
|
||||
// and pointer type. Define inline methods to provide the numerical conversions.
|
||||
template <class T> inline oop cast_to_oop(T value) {
|
||||
return (oop)(CHECK_UNHANDLED_OOPS_ONLY((void *))(value));
|
||||
}
|
||||
template <class T> inline T cast_from_oop(oop o) {
|
||||
return (T)(CHECK_UNHANDLED_OOPS_ONLY((void*))o);
|
||||
}
|
||||
|
||||
// The metadata hierarchy is separate from the oop hierarchy
|
||||
|
||||
// class MetaspaceObj
|
||||
|
||||
@ -123,7 +123,7 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
|
||||
// Allows targeted inlining
|
||||
if(callee_method->should_inline()) {
|
||||
*wci_result = *(WarmCallInfo::always_hot());
|
||||
if (PrintInlining && Verbose) {
|
||||
if (C->print_inlining() && Verbose) {
|
||||
CompileTask::print_inline_indent(inline_level());
|
||||
tty->print_cr("Inlined method is hot: ");
|
||||
}
|
||||
@ -137,7 +137,7 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
|
||||
if(callee_method->interpreter_throwout_count() > InlineThrowCount &&
|
||||
size < InlineThrowMaxSize ) {
|
||||
wci_result->set_profit(wci_result->profit() * 100);
|
||||
if (PrintInlining && Verbose) {
|
||||
if (C->print_inlining() && Verbose) {
|
||||
CompileTask::print_inline_indent(inline_level());
|
||||
tty->print_cr("Inlined method with many throws (throws=%d):", callee_method->interpreter_throwout_count());
|
||||
}
|
||||
@ -491,7 +491,7 @@ void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci,
|
||||
C->log()->inline_fail(inline_msg);
|
||||
}
|
||||
}
|
||||
if (PrintInlining) {
|
||||
if (C->print_inlining()) {
|
||||
C->print_inlining(callee_method, inline_level(), caller_bci, inline_msg);
|
||||
if (callee_method == NULL) tty->print(" callee not monotonic or profiled");
|
||||
if (Verbose && callee_method) {
|
||||
@ -540,7 +540,7 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms,
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (UseOldInlining && InlineWarmCalls
|
||||
&& (PrintOpto || PrintOptoInlining || PrintInlining)) {
|
||||
&& (PrintOpto || C->print_inlining())) {
|
||||
bool cold = wci.is_cold();
|
||||
bool hot = !cold && wci.is_hot();
|
||||
bool old_cold = !success;
|
||||
@ -617,7 +617,7 @@ InlineTree *InlineTree::build_inline_tree_for_callee( ciMethod* callee_method, J
|
||||
callee_method->is_compiled_lambda_form()) {
|
||||
max_inline_level_adjust += 1; // don't count method handle calls from java.lang.invoke implem
|
||||
}
|
||||
if (max_inline_level_adjust != 0 && PrintInlining && (Verbose || WizardMode)) {
|
||||
if (max_inline_level_adjust != 0 && C->print_inlining() && (Verbose || WizardMode)) {
|
||||
CompileTask::print_inline_indent(inline_level());
|
||||
tty->print_cr(" \\-> discounting inline depth");
|
||||
}
|
||||
|
||||
@ -159,8 +159,9 @@ class CallGenerator : public ResourceObj {
|
||||
virtual void print_inlining_late(const char* msg) { ShouldNotReachHere(); }
|
||||
|
||||
static void print_inlining(Compile* C, ciMethod* callee, int inline_level, int bci, const char* msg) {
|
||||
if (PrintInlining)
|
||||
if (C->print_inlining()) {
|
||||
C->print_inlining(callee, inline_level, bci, msg);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -654,7 +654,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr
|
||||
_inlining_progress(false),
|
||||
_inlining_incrementally(false),
|
||||
_print_inlining_list(NULL),
|
||||
_print_inlining(0) {
|
||||
_print_inlining_idx(0) {
|
||||
C = this;
|
||||
|
||||
CompileWrapper cw(this);
|
||||
@ -679,6 +679,8 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr
|
||||
set_print_assembly(print_opto_assembly);
|
||||
set_parsed_irreducible_loop(false);
|
||||
#endif
|
||||
set_print_inlining(PrintInlining || method()->has_option("PrintInlining") NOT_PRODUCT( || PrintOptoInlining));
|
||||
set_print_intrinsics(PrintIntrinsics || method()->has_option("PrintIntrinsics"));
|
||||
|
||||
if (ProfileTraps) {
|
||||
// Make sure the method being compiled gets its own MDO,
|
||||
@ -710,7 +712,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr
|
||||
PhaseGVN gvn(node_arena(), estimated_size);
|
||||
set_initial_gvn(&gvn);
|
||||
|
||||
if (PrintInlining || PrintIntrinsics NOT_PRODUCT( || PrintOptoInlining)) {
|
||||
if (print_inlining() || print_intrinsics()) {
|
||||
_print_inlining_list = new (comp_arena())GrowableArray<PrintInliningBuffer>(comp_arena(), 1, 1, PrintInliningBuffer());
|
||||
}
|
||||
{ // Scope for timing the parser
|
||||
@ -937,7 +939,7 @@ Compile::Compile( ciEnv* ci_env,
|
||||
_inlining_progress(false),
|
||||
_inlining_incrementally(false),
|
||||
_print_inlining_list(NULL),
|
||||
_print_inlining(0) {
|
||||
_print_inlining_idx(0) {
|
||||
C = this;
|
||||
|
||||
#ifndef PRODUCT
|
||||
@ -3611,7 +3613,7 @@ void Compile::ConstantTable::fill_jump_table(CodeBuffer& cb, MachConstantNode* n
|
||||
}
|
||||
|
||||
void Compile::dump_inlining() {
|
||||
if (PrintInlining || PrintIntrinsics NOT_PRODUCT( || PrintOptoInlining)) {
|
||||
if (print_inlining() || print_intrinsics()) {
|
||||
// Print inlining message for candidates that we couldn't inline
|
||||
// for lack of space or non constant receiver
|
||||
for (int i = 0; i < _late_inlines.length(); i++) {
|
||||
@ -3635,7 +3637,7 @@ void Compile::dump_inlining() {
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < _print_inlining_list->length(); i++) {
|
||||
tty->print(_print_inlining_list->at(i).ss()->as_string());
|
||||
tty->print(_print_inlining_list->adr_at(i)->ss()->as_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,6 +312,8 @@ class Compile : public Phase {
|
||||
bool _do_method_data_update; // True if we generate code to update MethodData*s
|
||||
int _AliasLevel; // Locally-adjusted version of AliasLevel flag.
|
||||
bool _print_assembly; // True if we should dump assembly code for this compilation
|
||||
bool _print_inlining; // True if we should print inlining for this compilation
|
||||
bool _print_intrinsics; // True if we should print intrinsics for this compilation
|
||||
#ifndef PRODUCT
|
||||
bool _trace_opto_output;
|
||||
bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing
|
||||
@ -414,7 +416,7 @@ class Compile : public Phase {
|
||||
};
|
||||
|
||||
GrowableArray<PrintInliningBuffer>* _print_inlining_list;
|
||||
int _print_inlining;
|
||||
int _print_inlining_idx;
|
||||
|
||||
// Only keep nodes in the expensive node list that need to be optimized
|
||||
void cleanup_expensive_nodes(PhaseIterGVN &igvn);
|
||||
@ -426,24 +428,24 @@ class Compile : public Phase {
|
||||
public:
|
||||
|
||||
outputStream* print_inlining_stream() const {
|
||||
return _print_inlining_list->at(_print_inlining).ss();
|
||||
return _print_inlining_list->adr_at(_print_inlining_idx)->ss();
|
||||
}
|
||||
|
||||
void print_inlining_skip(CallGenerator* cg) {
|
||||
if (PrintInlining) {
|
||||
_print_inlining_list->at(_print_inlining).set_cg(cg);
|
||||
_print_inlining++;
|
||||
_print_inlining_list->insert_before(_print_inlining, PrintInliningBuffer());
|
||||
if (_print_inlining) {
|
||||
_print_inlining_list->adr_at(_print_inlining_idx)->set_cg(cg);
|
||||
_print_inlining_idx++;
|
||||
_print_inlining_list->insert_before(_print_inlining_idx, PrintInliningBuffer());
|
||||
}
|
||||
}
|
||||
|
||||
void print_inlining_insert(CallGenerator* cg) {
|
||||
if (PrintInlining) {
|
||||
if (_print_inlining) {
|
||||
for (int i = 0; i < _print_inlining_list->length(); i++) {
|
||||
if (_print_inlining_list->at(i).cg() == cg) {
|
||||
if (_print_inlining_list->adr_at(i)->cg() == cg) {
|
||||
_print_inlining_list->insert_before(i+1, PrintInliningBuffer());
|
||||
_print_inlining = i+1;
|
||||
_print_inlining_list->at(i).set_cg(NULL);
|
||||
_print_inlining_idx = i+1;
|
||||
_print_inlining_list->adr_at(i)->set_cg(NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -572,6 +574,10 @@ class Compile : public Phase {
|
||||
int AliasLevel() const { return _AliasLevel; }
|
||||
bool print_assembly() const { return _print_assembly; }
|
||||
void set_print_assembly(bool z) { _print_assembly = z; }
|
||||
bool print_inlining() const { return _print_inlining; }
|
||||
void set_print_inlining(bool z) { _print_inlining = z; }
|
||||
bool print_intrinsics() const { return _print_intrinsics; }
|
||||
void set_print_intrinsics(bool z) { _print_intrinsics = z; }
|
||||
// check the CompilerOracle for special behaviours for this compile
|
||||
bool method_has_option(const char * option) {
|
||||
return method() != NULL && method()->has_option(option);
|
||||
|
||||
@ -41,9 +41,9 @@
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
|
||||
void trace_type_profile(Compile* C, ciMethod *method, int depth, int bci, ciMethod *prof_method, ciKlass *prof_klass, int site_count, int receiver_count) {
|
||||
if (TraceTypeProfile || PrintInlining NOT_PRODUCT(|| PrintOptoInlining)) {
|
||||
if (TraceTypeProfile || C->print_inlining()) {
|
||||
outputStream* out = tty;
|
||||
if (!PrintInlining) {
|
||||
if (!C->print_inlining()) {
|
||||
if (NOT_PRODUCT(!PrintOpto &&) !PrintCompilation) {
|
||||
method->print_short_name();
|
||||
tty->cr();
|
||||
|
||||
@ -543,7 +543,7 @@ JVMState* LibraryIntrinsic::generate(JVMState* jvms) {
|
||||
Compile* C = kit.C;
|
||||
int nodes = C->unique();
|
||||
#ifndef PRODUCT
|
||||
if ((PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) && Verbose) {
|
||||
if ((C->print_intrinsics() || C->print_inlining()) && Verbose) {
|
||||
char buf[1000];
|
||||
const char* str = vmIntrinsics::short_name_as_C_string(intrinsic_id(), buf, sizeof(buf));
|
||||
tty->print_cr("Intrinsic %s", str);
|
||||
@ -554,7 +554,7 @@ JVMState* LibraryIntrinsic::generate(JVMState* jvms) {
|
||||
|
||||
// Try to inline the intrinsic.
|
||||
if (kit.try_to_inline()) {
|
||||
if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) {
|
||||
if (C->print_intrinsics() || C->print_inlining()) {
|
||||
C->print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
|
||||
}
|
||||
C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked);
|
||||
@ -570,7 +570,7 @@ JVMState* LibraryIntrinsic::generate(JVMState* jvms) {
|
||||
}
|
||||
|
||||
// The intrinsic bailed out
|
||||
if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) {
|
||||
if (C->print_intrinsics() || C->print_inlining()) {
|
||||
if (jvms->has_method()) {
|
||||
// Not a root compile.
|
||||
const char* msg = is_virtual() ? "failed to inline (intrinsic, virtual)" : "failed to inline (intrinsic)";
|
||||
@ -592,7 +592,7 @@ Node* LibraryIntrinsic::generate_predicate(JVMState* jvms) {
|
||||
int nodes = C->unique();
|
||||
#ifndef PRODUCT
|
||||
assert(is_predicted(), "sanity");
|
||||
if ((PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) && Verbose) {
|
||||
if ((C->print_intrinsics() || C->print_inlining()) && Verbose) {
|
||||
char buf[1000];
|
||||
const char* str = vmIntrinsics::short_name_as_C_string(intrinsic_id(), buf, sizeof(buf));
|
||||
tty->print_cr("Predicate for intrinsic %s", str);
|
||||
@ -603,7 +603,7 @@ Node* LibraryIntrinsic::generate_predicate(JVMState* jvms) {
|
||||
|
||||
Node* slow_ctl = kit.try_to_predicate();
|
||||
if (!kit.failing()) {
|
||||
if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) {
|
||||
if (C->print_intrinsics() || C->print_inlining()) {
|
||||
C->print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
|
||||
}
|
||||
C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked);
|
||||
@ -617,7 +617,7 @@ Node* LibraryIntrinsic::generate_predicate(JVMState* jvms) {
|
||||
}
|
||||
|
||||
// The intrinsic bailed out
|
||||
if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) {
|
||||
if (C->print_intrinsics() || C->print_inlining()) {
|
||||
if (jvms->has_method()) {
|
||||
// Not a root compile.
|
||||
const char* msg = "failed to generate predicate for intrinsic";
|
||||
@ -2299,7 +2299,7 @@ const TypeOopPtr* LibraryCallKit::sharpen_unsafe_type(Compile::AliasType* alias_
|
||||
const TypeOopPtr* tjp = TypeOopPtr::make_from_klass(sharpened_klass);
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (PrintIntrinsics || PrintInlining || PrintOptoInlining) {
|
||||
if (C->print_intrinsics() || C->print_inlining()) {
|
||||
tty->print(" from base type: "); adr_type->dump();
|
||||
tty->print(" sharpened value: "); tjp->dump();
|
||||
}
|
||||
@ -3260,7 +3260,7 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) {
|
||||
if (mirror_con == NULL) return false; // cannot happen?
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (PrintIntrinsics || PrintInlining || PrintOptoInlining) {
|
||||
if (C->print_intrinsics() || C->print_inlining()) {
|
||||
ciType* k = mirror_con->java_mirror_type();
|
||||
if (k) {
|
||||
tty->print("Inlining %s on constant Class ", vmIntrinsics::name_at(intrinsic_id()));
|
||||
@ -3952,14 +3952,14 @@ bool LibraryCallKit::inline_native_getClass() {
|
||||
// caller sensitive methods.
|
||||
bool LibraryCallKit::inline_native_Reflection_getCallerClass() {
|
||||
#ifndef PRODUCT
|
||||
if ((PrintIntrinsics || PrintInlining || PrintOptoInlining) && Verbose) {
|
||||
if ((C->print_intrinsics() || C->print_inlining()) && Verbose) {
|
||||
tty->print_cr("Attempting to inline sun.reflect.Reflection.getCallerClass");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!jvms()->has_method()) {
|
||||
#ifndef PRODUCT
|
||||
if ((PrintIntrinsics || PrintInlining || PrintOptoInlining) && Verbose) {
|
||||
if ((C->print_intrinsics() || C->print_inlining()) && Verbose) {
|
||||
tty->print_cr(" Bailing out because intrinsic was inlined at top level");
|
||||
}
|
||||
#endif
|
||||
@ -3983,7 +3983,7 @@ bool LibraryCallKit::inline_native_Reflection_getCallerClass() {
|
||||
// Frame 0 and 1 must be caller sensitive (see JVM_GetCallerClass).
|
||||
if (!m->caller_sensitive()) {
|
||||
#ifndef PRODUCT
|
||||
if ((PrintIntrinsics || PrintInlining || PrintOptoInlining) && Verbose) {
|
||||
if ((C->print_intrinsics() || C->print_inlining()) && Verbose) {
|
||||
tty->print_cr(" Bailing out: CallerSensitive annotation expected at frame %d", n);
|
||||
}
|
||||
#endif
|
||||
@ -3999,7 +3999,7 @@ bool LibraryCallKit::inline_native_Reflection_getCallerClass() {
|
||||
set_result(makecon(TypeInstPtr::make(caller_mirror)));
|
||||
|
||||
#ifndef PRODUCT
|
||||
if ((PrintIntrinsics || PrintInlining || PrintOptoInlining) && Verbose) {
|
||||
if ((C->print_intrinsics() || C->print_inlining()) && Verbose) {
|
||||
tty->print_cr(" Succeeded: caller = %d) %s.%s, JVMS depth = %d", n, caller_klass->name()->as_utf8(), caller_jvms->method()->name()->as_utf8(), jvms()->depth());
|
||||
tty->print_cr(" JVM state at this point:");
|
||||
for (int i = jvms()->depth(), n = 1; i >= 1; i--, n++) {
|
||||
@ -4015,7 +4015,7 @@ bool LibraryCallKit::inline_native_Reflection_getCallerClass() {
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
if ((PrintIntrinsics || PrintInlining || PrintOptoInlining) && Verbose) {
|
||||
if ((C->print_intrinsics() || C->print_inlining()) && Verbose) {
|
||||
tty->print_cr(" Bailing out because caller depth exceeded inlining depth = %d", jvms()->depth());
|
||||
tty->print_cr(" JVM state at this point:");
|
||||
for (int i = jvms()->depth(), n = 1; i >= 1; i--, n++) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -341,7 +341,7 @@ const class TypePtr *MachNode::adr_type() const {
|
||||
return TypePtr::BOTTOM;
|
||||
}
|
||||
// %%% make offset be intptr_t
|
||||
assert(!Universe::heap()->is_in_reserved((oop)offset), "must be a raw ptr");
|
||||
assert(!Universe::heap()->is_in_reserved(cast_to_oop(offset)), "must be a raw ptr");
|
||||
return TypeRawPtr::BOTTOM;
|
||||
}
|
||||
|
||||
|
||||
@ -5046,7 +5046,10 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *args_) {
|
||||
void TestReservedSpace_test();
|
||||
void TestReserveMemorySpecial_test();
|
||||
void TestVirtualSpace_test();
|
||||
void MetaspaceAux_test();
|
||||
void TestMetaspaceAux_test();
|
||||
#if INCLUDE_ALL_GCS
|
||||
void TestG1BiasedArray_test();
|
||||
#endif
|
||||
|
||||
void execute_internal_vm_tests() {
|
||||
if (ExecuteInternalVMTests) {
|
||||
@ -5054,7 +5057,7 @@ void execute_internal_vm_tests() {
|
||||
run_unit_test(TestReservedSpace_test());
|
||||
run_unit_test(TestReserveMemorySpecial_test());
|
||||
run_unit_test(TestVirtualSpace_test());
|
||||
run_unit_test(MetaspaceAux_test());
|
||||
run_unit_test(TestMetaspaceAux_test());
|
||||
run_unit_test(GlobalDefinitions::test_globals());
|
||||
run_unit_test(GCTimerAllTest::all());
|
||||
run_unit_test(arrayOopDesc::test_max_array_length());
|
||||
@ -5066,6 +5069,7 @@ void execute_internal_vm_tests() {
|
||||
run_unit_test(VMStructs::test());
|
||||
#endif
|
||||
#if INCLUDE_ALL_GCS
|
||||
run_unit_test(TestG1BiasedArray_test());
|
||||
run_unit_test(HeapRegionRemSet::test_prt());
|
||||
#endif
|
||||
tty->print_cr("All internal VM tests passed");
|
||||
|
||||
@ -165,7 +165,7 @@ class JvmtiTagHashmap : public CHeapObj<mtInternal> {
|
||||
static unsigned int hash(oop key, int size) {
|
||||
// shift right to get better distribution (as these bits will be zero
|
||||
// with aligned addresses)
|
||||
unsigned int addr = (unsigned int)((intptr_t)key);
|
||||
unsigned int addr = (unsigned int)(cast_from_oop<intptr_t>(key));
|
||||
#ifdef _LP64
|
||||
return (addr >> 3) % size;
|
||||
#else
|
||||
|
||||
@ -292,9 +292,9 @@ UNSAFE_ENTRY(jobject, Unsafe_GetObjectVolatile(JNIEnv *env, jobject unsafe, jobj
|
||||
volatile oop v;
|
||||
if (UseCompressedOops) {
|
||||
volatile narrowOop n = *(volatile narrowOop*) addr;
|
||||
v = oopDesc::decode_heap_oop(n);
|
||||
(void)const_cast<oop&>(v = oopDesc::decode_heap_oop(n));
|
||||
} else {
|
||||
v = *(volatile oop*) addr;
|
||||
(void)const_cast<oop&>(v = *(volatile oop*) addr);
|
||||
}
|
||||
OrderAccess::acquire();
|
||||
return JNIHandles::make_local(env, v);
|
||||
@ -1222,9 +1222,9 @@ UNSAFE_ENTRY(void, Unsafe_Park(JNIEnv *env, jobject unsafe, jboolean isAbsolute,
|
||||
#endif /* USDT2 */
|
||||
if (event.should_commit()) {
|
||||
oop obj = thread->current_park_blocker();
|
||||
event.set_klass(obj ? obj->klass() : NULL);
|
||||
event.set_klass((obj != NULL) ? obj->klass() : NULL);
|
||||
event.set_timeout(time);
|
||||
event.set_address(obj ? (TYPE_ADDRESS) (uintptr_t) obj : 0);
|
||||
event.set_address((obj != NULL) ? (TYPE_ADDRESS) cast_from_oop<uintptr_t>(obj) : 0);
|
||||
event.commit();
|
||||
}
|
||||
UNSAFE_END
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 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
|
||||
@ -161,7 +161,7 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_
|
||||
if (TraceBiasedLocking && (Verbose || !is_bulk)) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr("Revoking bias of object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s , prototype header " INTPTR_FORMAT " , allow rebias %d , requesting thread " INTPTR_FORMAT,
|
||||
(intptr_t) obj, (intptr_t) mark, obj->klass()->external_name(), (intptr_t) obj->klass()->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread);
|
||||
(void *)obj, (intptr_t) mark, obj->klass()->external_name(), (intptr_t) obj->klass()->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread);
|
||||
}
|
||||
|
||||
JavaThread* biased_thread = mark->biased_locker();
|
||||
@ -214,8 +214,8 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_
|
||||
if (mon_info->owner() == obj) {
|
||||
if (TraceBiasedLocking && Verbose) {
|
||||
tty->print_cr(" mon_info->owner (" PTR_FORMAT ") == obj (" PTR_FORMAT ")",
|
||||
(intptr_t) mon_info->owner(),
|
||||
(intptr_t) obj);
|
||||
(void *) mon_info->owner(),
|
||||
(void *) obj);
|
||||
}
|
||||
// Assume recursive case and fix up highest lock later
|
||||
markOop mark = markOopDesc::encode((BasicLock*) NULL);
|
||||
@ -224,8 +224,8 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_
|
||||
} else {
|
||||
if (TraceBiasedLocking && Verbose) {
|
||||
tty->print_cr(" mon_info->owner (" PTR_FORMAT ") != obj (" PTR_FORMAT ")",
|
||||
(intptr_t) mon_info->owner(),
|
||||
(intptr_t) obj);
|
||||
(void *) mon_info->owner(),
|
||||
(void *) obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -326,7 +326,7 @@ static BiasedLocking::Condition bulk_revoke_or_rebias_at_safepoint(oop o,
|
||||
tty->print_cr("* Beginning bulk revocation (kind == %s) because of object "
|
||||
INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
||||
(bulk_rebias ? "rebias" : "revoke"),
|
||||
(intptr_t) o, (intptr_t) o->mark(), o->klass()->external_name());
|
||||
(void *) o, (intptr_t) o->mark(), o->klass()->external_name());
|
||||
}
|
||||
|
||||
jlong cur_time = os::javaTimeMillis();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -234,7 +234,7 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread
|
||||
assert(Universe::heap()->is_in_or_null(result), "must be heap pointer");
|
||||
if (TraceDeoptimization) {
|
||||
ttyLocker ttyl;
|
||||
tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, result, thread);
|
||||
tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, (void *)result, thread);
|
||||
}
|
||||
}
|
||||
bool reallocated = false;
|
||||
@ -278,7 +278,7 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread
|
||||
first = false;
|
||||
tty->print_cr("RELOCK OBJECTS in thread " INTPTR_FORMAT, thread);
|
||||
}
|
||||
tty->print_cr(" object <" INTPTR_FORMAT "> locked", mi->owner());
|
||||
tty->print_cr(" object <" INTPTR_FORMAT "> locked", (void *)mi->owner());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -977,7 +977,7 @@ void Deoptimization::print_objects(GrowableArray<ScopeValue*>* objects) {
|
||||
KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
|
||||
Handle obj = sv->value();
|
||||
|
||||
tty->print(" object <" INTPTR_FORMAT "> of type ", sv->value()());
|
||||
tty->print(" object <" INTPTR_FORMAT "> of type ", (void *)sv->value()());
|
||||
k->print_value();
|
||||
tty->print(" allocated (%d bytes)", obj->size() * HeapWordSize);
|
||||
tty->cr();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -1097,7 +1097,7 @@ oop frame::retrieve_receiver(RegisterMap* reg_map) {
|
||||
return NULL;
|
||||
}
|
||||
oop r = *oop_adr;
|
||||
assert(Universe::heap()->is_in_or_null(r), err_msg("bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (intptr_t) r, (intptr_t) r));
|
||||
assert(Universe::heap()->is_in_or_null(r), err_msg("bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (void *) r, (void *) r));
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -1228,9 +1228,7 @@ void frame::check_derived_oop(oop* base, oop* derived) {
|
||||
|
||||
void frame::ZapDeadClosure::do_oop(oop* p) {
|
||||
if (TraceZapDeadLocals) tty->print_cr("zapping @ " INTPTR_FORMAT " containing " INTPTR_FORMAT, p, (address)*p);
|
||||
// Need cast because on _LP64 the conversion to oop is ambiguous. Constant
|
||||
// can be either long or int.
|
||||
*p = (oop)(int)0xbabebabe;
|
||||
*p = cast_to_oop<intptr_t>(0xbabebabe);
|
||||
}
|
||||
frame::ZapDeadClosure frame::_zap_dead;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -430,7 +430,7 @@ intptr_t* JavaCallArguments::parameters() {
|
||||
for(int i = 0; i < _size; i++) {
|
||||
if (_is_oop[i]) {
|
||||
// Handle conversion
|
||||
_value[i] = (intptr_t)Handle::raw_resolve((oop *)_value[i]);
|
||||
_value[i] = cast_from_oop<intptr_t>(Handle::raw_resolve((oop *)_value[i]));
|
||||
}
|
||||
}
|
||||
// Return argument vector
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -745,14 +745,14 @@ void SafepointSynchronize::block(JavaThread *thread) {
|
||||
#endif
|
||||
|
||||
static void print_ptrs(intptr_t oldptr, intptr_t newptr, bool wasoop) {
|
||||
bool is_oop = newptr ? ((oop)newptr)->is_oop() : false;
|
||||
bool is_oop = newptr ? (cast_to_oop(newptr))->is_oop() : false;
|
||||
tty->print_cr(PTR_FORMAT PTR_PAD " %s %c " PTR_FORMAT PTR_PAD " %s %s",
|
||||
oldptr, wasoop?"oop":" ", oldptr == newptr ? ' ' : '!',
|
||||
newptr, is_oop?"oop":" ", (wasoop && !is_oop) ? "STALE" : ((wasoop==false&&is_oop==false&&oldptr !=newptr)?"STOMP":" "));
|
||||
}
|
||||
|
||||
static void print_longs(jlong oldptr, jlong newptr, bool wasoop) {
|
||||
bool is_oop = newptr ? ((oop)(intptr_t)newptr)->is_oop() : false;
|
||||
bool is_oop = newptr ? (cast_to_oop(newptr))->is_oop() : false;
|
||||
tty->print_cr(PTR64_FORMAT " %s %c " PTR64_FORMAT " %s %s",
|
||||
oldptr, wasoop?"oop":" ", oldptr == newptr ? ' ' : '!',
|
||||
newptr, is_oop?"oop":" ", (wasoop && !is_oop) ? "STALE" : ((wasoop==false&&is_oop==false&&oldptr !=newptr)?"STOMP":" "));
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -577,7 +577,7 @@ oop SharedRuntime::retrieve_receiver( Symbol* sig, frame caller ) {
|
||||
assert(caller.is_interpreted_frame(), "");
|
||||
int args_size = ArgumentSizeComputer(sig).size() + 1;
|
||||
assert(args_size <= caller.interpreter_frame_expression_stack_size(), "receiver must be on interpreter stack");
|
||||
oop result = (oop) *caller.interpreter_frame_tos_at(args_size - 1);
|
||||
oop result = cast_to_oop(*caller.interpreter_frame_tos_at(args_size - 1));
|
||||
assert(Universe::heap()->is_in(result) && result->is_oop(), "receiver must be an oop");
|
||||
return result;
|
||||
}
|
||||
@ -1506,8 +1506,11 @@ methodHandle SharedRuntime::handle_ic_miss_helper(JavaThread *thread, TRAPS) {
|
||||
info, CHECK_(methodHandle()));
|
||||
inline_cache->set_to_monomorphic(info);
|
||||
} else if (!inline_cache->is_megamorphic() && !inline_cache->is_clean()) {
|
||||
// Change to megamorphic
|
||||
inline_cache->set_to_megamorphic(&call_info, bc, CHECK_(methodHandle()));
|
||||
// Potential change to megamorphic
|
||||
bool successful = inline_cache->set_to_megamorphic(&call_info, bc, CHECK_(methodHandle()));
|
||||
if (!successful) {
|
||||
inline_cache->set_to_clean();
|
||||
}
|
||||
} else {
|
||||
// Either clean or megamorphic
|
||||
}
|
||||
@ -2872,7 +2875,7 @@ JRT_LEAF(intptr_t*, SharedRuntime::OSR_migration_begin( JavaThread *thread) )
|
||||
ObjectSynchronizer::inflate_helper(kptr2->obj());
|
||||
// Now the displaced header is free to move
|
||||
buf[i++] = (intptr_t)lock->displaced_header();
|
||||
buf[i++] = (intptr_t)kptr2->obj();
|
||||
buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
|
||||
}
|
||||
}
|
||||
assert( i - max_locals == active_monitor_count*2, "found the expected number of monitors" );
|
||||
|
||||
@ -154,7 +154,7 @@ int ObjectSynchronizer::gOmInUseCount = 0;
|
||||
static volatile intptr_t ListLock = 0 ; // protects global monitor free-list cache
|
||||
static volatile int MonitorFreeCount = 0 ; // # on gFreeList
|
||||
static volatile int MonitorPopulation = 0 ; // # Extant -- in circulation
|
||||
#define CHAINMARKER ((oop)-1)
|
||||
#define CHAINMARKER (cast_to_oop<intptr_t>(-1))
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Fast Monitor Enter/Exit
|
||||
@ -510,7 +510,7 @@ static markOop ReadStableMark (oop obj) {
|
||||
// then for each thread on the list, set the flag and unpark() the thread.
|
||||
// This is conceptually similar to muxAcquire-muxRelease, except that muxRelease
|
||||
// wakes at most one thread whereas we need to wake the entire list.
|
||||
int ix = (intptr_t(obj) >> 5) & (NINFLATIONLOCKS-1) ;
|
||||
int ix = (cast_from_oop<intptr_t>(obj) >> 5) & (NINFLATIONLOCKS-1) ;
|
||||
int YieldThenBlock = 0 ;
|
||||
assert (ix >= 0 && ix < NINFLATIONLOCKS, "invariant") ;
|
||||
assert ((NINFLATIONLOCKS & (NINFLATIONLOCKS-1)) == 0, "invariant") ;
|
||||
@ -565,7 +565,7 @@ static inline intptr_t get_next_hash(Thread * Self, oop obj) {
|
||||
// This variation has the property of being stable (idempotent)
|
||||
// between STW operations. This can be useful in some of the 1-0
|
||||
// synchronization schemes.
|
||||
intptr_t addrBits = intptr_t(obj) >> 3 ;
|
||||
intptr_t addrBits = cast_from_oop<intptr_t>(obj) >> 3 ;
|
||||
value = addrBits ^ (addrBits >> 5) ^ GVars.stwRandom ;
|
||||
} else
|
||||
if (hashCode == 2) {
|
||||
@ -575,7 +575,7 @@ static inline intptr_t get_next_hash(Thread * Self, oop obj) {
|
||||
value = ++GVars.hcSequence ;
|
||||
} else
|
||||
if (hashCode == 4) {
|
||||
value = intptr_t(obj) ;
|
||||
value = cast_from_oop<intptr_t>(obj) ;
|
||||
} else {
|
||||
// Marsaglia's xor-shift scheme with thread-specific state
|
||||
// This is probably the best overall implementation -- we'll
|
||||
@ -1321,7 +1321,7 @@ ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) {
|
||||
if (object->is_instance()) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
||||
(intptr_t) object, (intptr_t) object->mark(),
|
||||
(void *) object, (intptr_t) object->mark(),
|
||||
object->klass()->external_name());
|
||||
}
|
||||
}
|
||||
@ -1371,7 +1371,7 @@ ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) {
|
||||
if (object->is_instance()) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
||||
(intptr_t) object, (intptr_t) object->mark(),
|
||||
(void *) object, (intptr_t) object->mark(),
|
||||
object->klass()->external_name());
|
||||
}
|
||||
}
|
||||
@ -1439,7 +1439,7 @@ bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj,
|
||||
if (obj->is_instance()) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr("Deflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
||||
(intptr_t) obj, (intptr_t) obj->mark(), obj->klass()->external_name());
|
||||
(void *) obj, (intptr_t) obj->mark(), obj->klass()->external_name());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1444,7 +1444,7 @@ void JavaThread::initialize() {
|
||||
_in_deopt_handler = 0;
|
||||
_doing_unsafe_access = false;
|
||||
_stack_guard_state = stack_guard_unused;
|
||||
_exception_oop = NULL;
|
||||
(void)const_cast<oop&>(_exception_oop = NULL);
|
||||
_exception_pc = 0;
|
||||
_exception_handler_pc = 0;
|
||||
_is_method_handle_return = 0;
|
||||
|
||||
@ -1278,7 +1278,7 @@ class JavaThread: public Thread {
|
||||
address exception_handler_pc() const { return _exception_handler_pc; }
|
||||
bool is_method_handle_return() const { return _is_method_handle_return == 1; }
|
||||
|
||||
void set_exception_oop(oop o) { _exception_oop = o; }
|
||||
void set_exception_oop(oop o) { (void)const_cast<oop&>(_exception_oop = o); }
|
||||
void set_exception_pc(address a) { _exception_pc = a; }
|
||||
void set_exception_handler_pc(address a) { _exception_handler_pc = a; }
|
||||
void set_is_method_handle_return(bool value) { _is_method_handle_return = value ? 1 : 0; }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -111,7 +111,7 @@ void vframeArrayElement::fill_in(compiledVFrame* vf) {
|
||||
case T_OBJECT:
|
||||
assert(!value->obj_is_scalar_replaced(), "object should be reallocated already");
|
||||
// preserve object type
|
||||
_locals->add( new StackValue((intptr_t) (value->get_obj()()), T_OBJECT ));
|
||||
_locals->add( new StackValue(cast_from_oop<intptr_t>((value->get_obj()())), T_OBJECT ));
|
||||
break;
|
||||
case T_CONFLICT:
|
||||
// A dead local. Will be initialized to null/zero.
|
||||
@ -136,7 +136,7 @@ void vframeArrayElement::fill_in(compiledVFrame* vf) {
|
||||
case T_OBJECT:
|
||||
assert(!value->obj_is_scalar_replaced(), "object should be reallocated already");
|
||||
// preserve object type
|
||||
_expressions->add( new StackValue((intptr_t) (value->get_obj()()), T_OBJECT ));
|
||||
_expressions->add( new StackValue(cast_from_oop<intptr_t>((value->get_obj()())), T_OBJECT ));
|
||||
break;
|
||||
case T_CONFLICT:
|
||||
// A dead stack element. Will be initialized to null/zero.
|
||||
|
||||
@ -78,7 +78,13 @@ class Abstract_VM_Version: AllStatic {
|
||||
static const char* jre_release_version();
|
||||
|
||||
// does HW support an 8-byte compare-exchange operation?
|
||||
static bool supports_cx8() {return _supports_cx8;}
|
||||
static bool supports_cx8() {
|
||||
#ifdef SUPPORTS_NATIVE_CX8
|
||||
return true;
|
||||
#else
|
||||
return _supports_cx8;
|
||||
#endif
|
||||
}
|
||||
// does HW support atomic get-and-set or atomic get-and-add? Used
|
||||
// to guide intrinsification decisions for Unsafe atomic ops
|
||||
static bool supports_atomic_getset4() {return _supports_atomic_getset4;}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -52,7 +52,7 @@ HS_DTRACE_PROBE_DECL4(hotspot, class__unloaded, char*, int, oop, bool);
|
||||
len = name->utf8_length(); \
|
||||
} \
|
||||
HS_DTRACE_PROBE4(hotspot, class__##type, \
|
||||
data, len, (clss)->class_loader(), (shared)); \
|
||||
data, len, SOLARIS_ONLY((void *))(clss)->class_loader(), (shared)); \
|
||||
}
|
||||
|
||||
#else /* USDT2 */
|
||||
|
||||
@ -563,7 +563,7 @@ void DumpWriter::write_u8(u8 x) {
|
||||
}
|
||||
|
||||
void DumpWriter::write_objectID(oop o) {
|
||||
address a = (address)((uintptr_t)o);
|
||||
address a = (address)o;
|
||||
#ifdef _LP64
|
||||
write_u8((u8)a);
|
||||
#else
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -45,7 +45,7 @@ HS_DTRACE_PROBE_DECL8(hotspot, mem__pool__gc__end, char*, int, char*, int,
|
||||
|
||||
MemoryManager::MemoryManager() {
|
||||
_num_pools = 0;
|
||||
_memory_mgr_obj = NULL;
|
||||
(void)const_cast<instanceOop&>(_memory_mgr_obj = NULL);
|
||||
}
|
||||
|
||||
void MemoryManager::add_pool(MemoryPool* pool) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -45,7 +45,7 @@ MemoryPool::MemoryPool(const char* name,
|
||||
_name = name;
|
||||
_initial_size = init_size;
|
||||
_max_size = max_size;
|
||||
_memory_pool_obj = NULL;
|
||||
(void)const_cast<instanceOop&>(_memory_pool_obj = NULL);
|
||||
_available_for_allocation = true;
|
||||
_num_managers = 0;
|
||||
_type = type;
|
||||
|
||||
@ -967,9 +967,9 @@ const int badCodeHeapFreeVal = 0xDD; // value used to zap
|
||||
// (These must be implemented as #defines because C++ compilers are
|
||||
// not obligated to inline non-integral constants!)
|
||||
#define badAddress ((address)::badAddressVal)
|
||||
#define badOop ((oop)::badOopVal)
|
||||
#define badOop (cast_to_oop(::badOopVal))
|
||||
#define badHeapWord (::badHeapWordVal)
|
||||
#define badJNIHandle ((oop)::badJNIHandleVal)
|
||||
#define badJNIHandle (cast_to_oop(::badJNIHandleVal))
|
||||
|
||||
// Default TaskQueue size is 16K (32-bit) or 128K (64-bit)
|
||||
#define TASKQUEUE_SIZE (NOT_LP64(1<<14) LP64_ONLY(1<<17))
|
||||
|
||||
@ -189,6 +189,10 @@ const jlong max_jlong = CONST64(0x7fffffffffffffff);
|
||||
#pragma warning( disable : 4201 ) // nonstandard extension used : nameless struct/union (needed in windows.h)
|
||||
#pragma warning( disable : 4511 ) // copy constructor could not be generated
|
||||
#pragma warning( disable : 4291 ) // no matching operator delete found; memory will not be freed if initialization thows an exception
|
||||
#ifdef CHECK_UNHANDLED_OOPS
|
||||
#pragma warning( disable : 4521 ) // class has multiple copy ctors of a single type
|
||||
#pragma warning( disable : 4522 ) // class has multiple assignment operators of a single type
|
||||
#endif // CHECK_UNHANDLED_OOPS
|
||||
#if _MSC_VER >= 1400
|
||||
#pragma warning( disable : 4996 ) // unsafe string functions. Same as define _CRT_SECURE_NO_WARNINGS/_CRT_SECURE_NO_DEPRICATE
|
||||
#endif
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -356,9 +356,9 @@ template class Hashtable<ConstantPool*, mtClass>;
|
||||
template class Hashtable<Symbol*, mtSymbol>;
|
||||
template class Hashtable<Klass*, mtClass>;
|
||||
template class Hashtable<oop, mtClass>;
|
||||
#ifdef SOLARIS
|
||||
#if defined(SOLARIS) || defined(CHECK_UNHANDLED_OOPS)
|
||||
template class Hashtable<oop, mtSymbol>;
|
||||
#endif
|
||||
#endif // SOLARIS || CHECK_UNHANDLED_OOPS
|
||||
template class Hashtable<oopDesc*, mtSymbol>;
|
||||
template class Hashtable<Symbol*, mtClass>;
|
||||
template class HashtableEntry<Symbol*, mtSymbol>;
|
||||
|
||||
@ -322,11 +322,11 @@ public:
|
||||
// Attempts to claim a task from the "local" end of the queue (the most
|
||||
// recently pushed). If successful, returns true and sets t to the task;
|
||||
// otherwise, returns false (the queue is empty).
|
||||
inline bool pop_local(E& t);
|
||||
inline bool pop_local(volatile E& t);
|
||||
|
||||
// Like pop_local(), but uses the "global" end of the queue (the least
|
||||
// recently pushed).
|
||||
bool pop_global(E& t);
|
||||
bool pop_global(volatile E& t);
|
||||
|
||||
// Delete any resource associated with the queue.
|
||||
~GenericTaskQueue();
|
||||
@ -424,7 +424,7 @@ bool GenericTaskQueue<E, F, N>::pop_local_slow(uint localBot, Age oldAge) {
|
||||
}
|
||||
|
||||
template<class E, MEMFLAGS F, unsigned int N>
|
||||
bool GenericTaskQueue<E, F, N>::pop_global(E& t) {
|
||||
bool GenericTaskQueue<E, F, N>::pop_global(volatile E& t) {
|
||||
Age oldAge = _age.get();
|
||||
// Architectures with weak memory model require a barrier here
|
||||
// to guarantee that bottom is not older than age,
|
||||
@ -701,7 +701,7 @@ GenericTaskQueue<E, F, N>::push(E t) {
|
||||
}
|
||||
|
||||
template<class E, MEMFLAGS F, unsigned int N> inline bool
|
||||
GenericTaskQueue<E, F, N>::pop_local(E& t) {
|
||||
GenericTaskQueue<E, F, N>::pop_local(volatile E& t) {
|
||||
uint localBot = _bottom;
|
||||
// This value cannot be N-1. That can only occur as a result of
|
||||
// the assignment to bottom in this method. If it does, this method
|
||||
@ -799,7 +799,7 @@ public:
|
||||
}
|
||||
volatile ObjArrayTask&
|
||||
operator =(const volatile ObjArrayTask& t) volatile {
|
||||
_obj = t._obj;
|
||||
(void)const_cast<oop&>(_obj = t._obj);
|
||||
_index = t._index;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
* 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
|
||||
@ -23,12 +21,16 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.lwawt;
|
||||
|
||||
/*
|
||||
* Every time the TextField (or TextArea) change selection, every other text components
|
||||
* must immediately clear their selections.
|
||||
* @test
|
||||
* @bug 8022585
|
||||
* @summary VM crashes when ran with -XX:+PrintInlining
|
||||
* @run main/othervm -Xcomp -XX:+PrintInlining PrintInlining
|
||||
*
|
||||
*/
|
||||
interface SelectionClearListener {
|
||||
void clearSelection();
|
||||
|
||||
public class PrintInlining {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Passed");
|
||||
}
|
||||
}
|
||||
@ -229,3 +229,5 @@ a22fe9bd01e6c7e7ddc7995dfc9471711692b8d1 jdk8-b104
|
||||
09a46ec11f880154886c70be03aff5ab2ddf0ab7 jdk8-b105
|
||||
d3be8e3b429df917e72c1c23e7920c651219b587 jdk8-b106
|
||||
d6a32e3831aab20a9a3bc78cdc0a60aaad725c6c jdk8-b107
|
||||
8ade3eed63da87067a7137c111f684a821e9e531 jdk8-b108
|
||||
02bfab2aa93899e0f02584f1e85537485a196553 jdk8-b109
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user