This commit is contained in:
Daniel D. Daugherty 2013-03-08 17:49:52 -08:00
commit fc336457e7
47 changed files with 1204 additions and 428 deletions

View file

@ -201,3 +201,4 @@ f407160c280d1c5b00d314c535441ac26f195fee jdk8-b76
d17eb2e13e362085e866d46235314c50cc4661cc jdk8-b77 d17eb2e13e362085e866d46235314c50cc4661cc jdk8-b77
6d3dcd34b5b962ea1ef9eed0dafdee9e812401bc jdk8-b78 6d3dcd34b5b962ea1ef9eed0dafdee9e812401bc jdk8-b78
a1313a8d90d17d363a3b2a645dc4030ec204b168 jdk8-b79 a1313a8d90d17d363a3b2a645dc4030ec204b168 jdk8-b79
3fa21fbf9be7e6b482af43aacb6a09acfa30bdb6 jdk8-b80

View file

@ -201,3 +201,4 @@ b43aa5bd8ca5c8121336495382d35ecfa7a71536 jdk8-b74
3933eebc659d58c597aa8cb4b3e58f2250ce3e1a jdk8-b77 3933eebc659d58c597aa8cb4b3e58f2250ce3e1a jdk8-b77
fd1a5574cf68af24bfd52decc37ac6361afb278a jdk8-b78 fd1a5574cf68af24bfd52decc37ac6361afb278a jdk8-b78
91d35211e74464dca5edf9b66ab01d0d0d8cded7 jdk8-b79 91d35211e74464dca5edf9b66ab01d0d0d8cded7 jdk8-b79
907a926d3c96472f357617b48b6b968ea855c23c jdk8-b80

File diff suppressed because it is too large Load diff

View file

@ -285,6 +285,10 @@ X_CFLAGS:=@X_CFLAGS@
X_LIBS:=@X_LIBS@ X_LIBS:=@X_LIBS@
OPENWIN_HOME:=@OPENWIN_HOME@ OPENWIN_HOME:=@OPENWIN_HOME@
# DirectX SDK
DXSDK_LIB_PATH=@DXSDK_LIB_PATH@
DXSDK_INCLUDE_PATH=@DXSDK_INCLUDE_PATH@
# The lowest required version of macosx to enforce compatiblity for # The lowest required version of macosx to enforce compatiblity for
MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@ MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@

View file

@ -176,6 +176,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_PATHS],
[ [
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
TOOLCHAIN_SETUP_DXSDK
fi fi
AC_SUBST(MSVCR_DLL) AC_SUBST(MSVCR_DLL)

View file

@ -262,3 +262,61 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
AC_MSG_RESULT([$MSVCR_DLL]) AC_MSG_RESULT([$MSVCR_DLL])
BASIC_FIXUP_PATH(MSVCR_DLL) BASIC_FIXUP_PATH(MSVCR_DLL)
]) ])
# Setup the DXSDK paths
AC_DEFUN([TOOLCHAIN_SETUP_DXSDK],
[
AC_ARG_WITH(dxsdk, [AS_HELP_STRING([--with-dxsdk],
[the DirectX SDK (Windows only) @<:@probed@:>@])])
AC_ARG_WITH(dxsdk-lib, [AS_HELP_STRING([--with-dxsdk-lib],
[the DirectX SDK lib directory (Windows only) @<:@probed@:>@])])
AC_ARG_WITH(dxsdk-include, [AS_HELP_STRING([--with-dxsdk-include],
[the DirectX SDK include directory (Windows only) @<:@probed@:>@])])
AC_MSG_CHECKING([for DirectX SDK])
if test "x$with_dxsdk" != x; then
dxsdk_path="$with_dxsdk"
elif test "x$DXSDK_DIR" != x; then
dxsdk_path="$DXSDK_DIR"
elif test -d "C:/DXSDK"; then
dxsdk_path="C:/DXSDK"
else
AC_MSG_ERROR([Could not find the DirectX SDK])
fi
AC_MSG_RESULT([$dxsdk_path])
BASIC_FIXUP_PATH(dxsdk_path)
AC_MSG_CHECKING([for DirectX SDK lib dir])
if test "x$with_dxsdk_lib" != x; then
DXSDK_LIB_PATH="$with_dxsdk_lib"
elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
DXSDK_LIB_PATH="$dxsdk_path/Lib/x64"
else
DXSDK_LIB_PATH="$dxsdk_path/Lib"
fi
# dsound.lib is linked to in jsoundds
if test ! -f "$DXSDK_LIB_PATH/dsound.lib"; then
AC_MSG_ERROR([Invalid DirectX SDK lib dir])
fi
AC_MSG_RESULT([$DXSDK_LIB_PATH])
BASIC_FIXUP_PATH(DXSDK_LIB_PATH)
AC_MSG_CHECKING([for DirectX SDK include dir])
if test "x$with_dxsdk_include" != x; then
DXSDK_INCLUDE_PATH="$with_dxsdk_include"
else
DXSDK_INCLUDE_PATH="$dxsdk_path/Include"
fi
# dsound.h is included in jsoundds
if test ! -f "$DXSDK_INCLUDE_PATH/dsound.h"; then
AC_MSG_ERROR([Invalid DirectX SDK lib dir])
fi
AC_MSG_RESULT([$DXSDK_INCLUDE_PATH])
BASIC_FIXUP_PATH(DXSDK_INCLUDE_PATH)
AC_SUBST(DXSDK_LIB_PATH)
AC_SUBST(DXSDK_INCLUDE_PATH)
LDFLAGS_JDK="$LDFLAGS_JDK -libpath:$DXSDK_LIB_PATH"
])

View file

@ -201,3 +201,4 @@ d4e68ce17795601017ac2f952baad7272942c36e jdk8-b75
35684a40c5845782324dbcc9ac8969528020ff61 jdk8-b77 35684a40c5845782324dbcc9ac8969528020ff61 jdk8-b77
27d6368ae8ba570c31c2f0e696d39c99fa2f4538 jdk8-b78 27d6368ae8ba570c31c2f0e696d39c99fa2f4538 jdk8-b78
e41fb1aa0329767b2737303c994e38bede1baa07 jdk8-b79 e41fb1aa0329767b2737303c994e38bede1baa07 jdk8-b79
5f3d4a6bdd027a1631d97e2dfff63fd5e46987a4 jdk8-b80

View file

@ -320,3 +320,5 @@ d5e12e7d2f719144d84903d9151455661c47b476 jdk8-b78
555ec35a250783110aa070dbc8a8603f6cabe41f hs25-b20 555ec35a250783110aa070dbc8a8603f6cabe41f hs25-b20
6691814929b606fe0e7954fd6e485dd876505c83 jdk8-b79 6691814929b606fe0e7954fd6e485dd876505c83 jdk8-b79
df5396524152118535c36da5801d828b560d19a2 hs25-b21 df5396524152118535c36da5801d828b560d19a2 hs25-b21
4a198b201f3ce84433fa94a3ca65d061473e7c4c jdk8-b80
dd6350b4abc4a6c19c89dd982cc0e4f3d119885c hs25-b22

View file

@ -160,7 +160,7 @@ Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0(
CHECK_EXCEPTION_(0); CHECK_EXCEPTION_(0);
unsigned long alignedAddress; unsigned long alignedAddress;
unsigned long alignedLength; unsigned long alignedLength = 0;
kern_return_t result; kern_return_t result;
vm_offset_t *pages; vm_offset_t *pages;
int *mapped; int *mapped;
@ -630,7 +630,7 @@ Java_sun_jvm_hotspot_asm_Disassembler_load_1library(
/* Couldn't find entry point. error_message should contain some /* Couldn't find entry point. error_message should contain some
* platform dependent error message. * platform dependent error message.
*/ */
THROW_NEW_DEBUGGER_EXCEPTION(error_message); THROW_NEW_DEBUGGER_EXCEPTION_(error_message, (jlong)func);
} }
return (jlong)func; return (jlong)func;
} }

View file

@ -229,6 +229,20 @@ ifeq ($(USE_PRECOMPILED_HEADER),0)
CFLAGS += -DDONT_USE_PRECOMPILED_HEADER CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
endif endif
ifeq ($(OS_VENDOR), Darwin)
# Setting these parameters makes it an error to link to macosx APIs that are
# newer than the given OS version and makes the linked binaries compatible even
# if built on a newer version of the OS.
# The expected format is X.Y.Z
ifeq ($(MACOSX_VERSION_MIN),)
MACOSX_VERSION_MIN=10.7.0
endif
# The macro takes the version with no dots, ex: 1070
CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \
-mmacosx-version-min=$(MACOSX_VERSION_MIN)
LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
endif
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# Linker flags # Linker flags

View file

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
HS_MAJOR_VER=25 HS_MAJOR_VER=25
HS_MINOR_VER=0 HS_MINOR_VER=0
HS_BUILD_NUMBER=22 HS_BUILD_NUMBER=23
JDK_MAJOR_VER=1 JDK_MAJOR_VER=1
JDK_MINOR_VER=8 JDK_MINOR_VER=8

View file

@ -3916,15 +3916,27 @@ bool os::pd_unmap_memory(char* addr, size_t bytes) {
jlong os::current_thread_cpu_time() { jlong os::current_thread_cpu_time() {
#ifdef __APPLE__ #ifdef __APPLE__
return os::thread_cpu_time(Thread::current(), true /* user + sys */); return os::thread_cpu_time(Thread::current(), true /* user + sys */);
#else
Unimplemented();
return 0;
#endif #endif
} }
jlong os::thread_cpu_time(Thread* thread) { jlong os::thread_cpu_time(Thread* thread) {
#ifdef __APPLE__
return os::thread_cpu_time(thread, true /* user + sys */);
#else
Unimplemented();
return 0;
#endif
} }
jlong os::current_thread_cpu_time(bool user_sys_cpu_time) { jlong os::current_thread_cpu_time(bool user_sys_cpu_time) {
#ifdef __APPLE__ #ifdef __APPLE__
return os::thread_cpu_time(Thread::current(), user_sys_cpu_time); return os::thread_cpu_time(Thread::current(), user_sys_cpu_time);
#else
Unimplemented();
return 0;
#endif #endif
} }
@ -3948,6 +3960,9 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
} else { } else {
return ((jlong)tinfo.user_time.seconds * 1000000000) + ((jlong)tinfo.user_time.microseconds * (jlong)1000); return ((jlong)tinfo.user_time.seconds * 1000000000) + ((jlong)tinfo.user_time.microseconds * (jlong)1000);
} }
#else
Unimplemented();
return 0;
#endif #endif
} }

View file

@ -300,8 +300,7 @@ void ConcurrentMarkSweepThread::desynchronize(bool is_cms_thread) {
} }
} }
// Wait until the next synchronous GC, a concurrent full gc request, // Wait until any cms_lock event
// or a timeout, whichever is earlier.
void ConcurrentMarkSweepThread::wait_on_cms_lock(long t_millis) { void ConcurrentMarkSweepThread::wait_on_cms_lock(long t_millis) {
MutexLockerEx x(CGC_lock, MutexLockerEx x(CGC_lock,
Mutex::_no_safepoint_check_flag); Mutex::_no_safepoint_check_flag);
@ -315,15 +314,100 @@ void ConcurrentMarkSweepThread::wait_on_cms_lock(long t_millis) {
"Should not be set"); "Should not be set");
} }
// Wait until the next synchronous GC, a concurrent full gc request,
// or a timeout, whichever is earlier.
void ConcurrentMarkSweepThread::wait_on_cms_lock_for_scavenge(long t_millis) {
// Wait time in millis or 0 value representing infinite wait for a scavenge
assert(t_millis >= 0, "Wait time for scavenge should be 0 or positive");
GenCollectedHeap* gch = GenCollectedHeap::heap();
double start_time_secs = os::elapsedTime();
double end_time_secs = start_time_secs + (t_millis / ((double) MILLIUNITS));
// Total collections count before waiting loop
unsigned int before_count;
{
MutexLockerEx hl(Heap_lock, Mutex::_no_safepoint_check_flag);
before_count = gch->total_collections();
}
unsigned int loop_count = 0;
while(!_should_terminate) {
double now_time = os::elapsedTime();
long wait_time_millis;
if(t_millis != 0) {
// New wait limit
wait_time_millis = (long) ((end_time_secs - now_time) * MILLIUNITS);
if(wait_time_millis <= 0) {
// Wait time is over
break;
}
} else {
// No wait limit, wait if necessary forever
wait_time_millis = 0;
}
// Wait until the next event or the remaining timeout
{
MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag);
if (_should_terminate || _collector->_full_gc_requested) {
return;
}
set_CMS_flag(CMS_cms_wants_token); // to provoke notifies
assert(t_millis == 0 || wait_time_millis > 0, "Sanity");
CGC_lock->wait(Mutex::_no_safepoint_check_flag, wait_time_millis);
clear_CMS_flag(CMS_cms_wants_token);
assert(!CMS_flag_is_set(CMS_cms_has_token | CMS_cms_wants_token),
"Should not be set");
}
// Extra wait time check before entering the heap lock to get the collection count
if(t_millis != 0 && os::elapsedTime() >= end_time_secs) {
// Wait time is over
break;
}
// Total collections count after the event
unsigned int after_count;
{
MutexLockerEx hl(Heap_lock, Mutex::_no_safepoint_check_flag);
after_count = gch->total_collections();
}
if(before_count != after_count) {
// There was a collection - success
break;
}
// Too many loops warning
if(++loop_count == 0) {
warning("wait_on_cms_lock_for_scavenge() has looped %u times", loop_count - 1);
}
}
}
void ConcurrentMarkSweepThread::sleepBeforeNextCycle() { void ConcurrentMarkSweepThread::sleepBeforeNextCycle() {
while (!_should_terminate) { while (!_should_terminate) {
if (CMSIncrementalMode) { if (CMSIncrementalMode) {
icms_wait(); icms_wait();
return; if(CMSWaitDuration >= 0) {
} else {
// Wait until the next synchronous GC, a concurrent full gc // Wait until the next synchronous GC, a concurrent full gc
// request or a timeout, whichever is earlier. // request or a timeout, whichever is earlier.
wait_on_cms_lock(CMSWaitDuration); wait_on_cms_lock_for_scavenge(CMSWaitDuration);
}
return;
} else {
if(CMSWaitDuration >= 0) {
// Wait until the next synchronous GC, a concurrent full gc
// request or a timeout, whichever is earlier.
wait_on_cms_lock_for_scavenge(CMSWaitDuration);
} else {
// Wait until any cms_lock event or check interval not to call shouldConcurrentCollect permanently
wait_on_cms_lock(CMSCheckInterval);
}
} }
// Check if we should start a CMS collection cycle // Check if we should start a CMS collection cycle
if (_collector->shouldConcurrentCollect()) { if (_collector->shouldConcurrentCollect()) {

View file

@ -130,6 +130,12 @@ class ConcurrentMarkSweepThread: public ConcurrentGCThread {
// A concurrent full gc request terminates the wait. // A concurrent full gc request terminates the wait.
void wait_on_cms_lock(long t_millis); void wait_on_cms_lock(long t_millis);
// Wait on CMS lock until the next synchronous GC
// or given timeout, whichever is earlier. A timeout value
// of 0 indicates that there is no upper bound on the wait time.
// A concurrent full gc request terminates the wait.
void wait_on_cms_lock_for_scavenge(long t_millis);
// The CMS thread will yield during the work portion of its cycle // The CMS thread will yield during the work portion of its cycle
// only when requested to. Both synchronous and asychronous requests // only when requested to. Both synchronous and asychronous requests
// are provided: // are provided:

View file

@ -146,43 +146,6 @@ void CollectionSetChooser::sort_regions() {
verify(); verify();
} }
uint CollectionSetChooser::calc_min_old_cset_length() {
// The min old CSet region bound is based on the maximum desired
// number of mixed GCs after a cycle. I.e., even if some old regions
// look expensive, we should add them to the CSet anyway to make
// sure we go through the available old regions in no more than the
// maximum desired number of mixed GCs.
//
// The calculation is based on the number of marked regions we added
// to the CSet chooser in the first place, not how many remain, so
// that the result is the same during all mixed GCs that follow a cycle.
const size_t region_num = (size_t) _length;
const size_t gc_num = (size_t) G1MixedGCCountTarget;
size_t result = region_num / gc_num;
// emulate ceiling
if (result * gc_num < region_num) {
result += 1;
}
return (uint) result;
}
uint CollectionSetChooser::calc_max_old_cset_length() {
// The max old CSet region bound is based on the threshold expressed
// as a percentage of the heap size. I.e., it should bound the
// number of old regions added to the CSet irrespective of how many
// of them are available.
G1CollectedHeap* g1h = G1CollectedHeap::heap();
const size_t region_num = g1h->n_regions();
const size_t perc = (size_t) G1OldCSetRegionThresholdPercent;
size_t result = region_num * perc / 100;
// emulate ceiling
if (100 * result < region_num * perc) {
result += 1;
}
return (uint) result;
}
void CollectionSetChooser::add_region(HeapRegion* hr) { void CollectionSetChooser::add_region(HeapRegion* hr) {
assert(!hr->isHumongous(), assert(!hr->isHumongous(),

View file

@ -51,6 +51,8 @@ class CollectionSetChooser: public CHeapObj<mtGC> {
uint _curr_index; uint _curr_index;
// The number of candidate old regions added to the CSet chooser. // The number of candidate old regions added to the CSet chooser.
// Note: this is not updated when removing a region using
// remove_and_move_to_next() below.
uint _length; uint _length;
// Keeps track of the start of the next array chunk to be claimed by // Keeps track of the start of the next array chunk to be claimed by
@ -111,13 +113,8 @@ public:
hr->live_bytes() < _region_live_threshold_bytes; hr->live_bytes() < _region_live_threshold_bytes;
} }
// Calculate the minimum number of old regions we'll add to the CSet // Returns the number candidate old regions added
// during a mixed GC. uint length() { return _length; }
uint calc_min_old_cset_length();
// Calculate the maximum number of old regions we'll add to the CSet
// during a mixed GC.
uint calc_max_old_cset_length();
// Serial version. // Serial version.
void add_region(HeapRegion *hr); void add_region(HeapRegion *hr);

View file

@ -1806,6 +1806,14 @@ void G1CollectorPolicy::print_collection_set(HeapRegion* list_head, outputStream
} }
#endif // !PRODUCT #endif // !PRODUCT
double G1CollectorPolicy::reclaimable_bytes_perc(size_t reclaimable_bytes) {
// Returns the given amount of reclaimable bytes (that represents
// the amount of reclaimable space still to be collected) as a
// percentage of the current heap capacity.
size_t capacity_bytes = _g1->capacity();
return (double) reclaimable_bytes * 100.0 / (double) capacity_bytes;
}
bool G1CollectorPolicy::next_gc_should_be_mixed(const char* true_action_str, bool G1CollectorPolicy::next_gc_should_be_mixed(const char* true_action_str,
const char* false_action_str) { const char* false_action_str) {
CollectionSetChooser* cset_chooser = _collectionSetChooser; CollectionSetChooser* cset_chooser = _collectionSetChooser;
@ -1815,19 +1823,21 @@ bool G1CollectorPolicy::next_gc_should_be_mixed(const char* true_action_str,
ergo_format_reason("candidate old regions not available")); ergo_format_reason("candidate old regions not available"));
return false; return false;
} }
// Is the amount of uncollected reclaimable space above G1HeapWastePercent?
size_t reclaimable_bytes = cset_chooser->remaining_reclaimable_bytes(); size_t reclaimable_bytes = cset_chooser->remaining_reclaimable_bytes();
size_t capacity_bytes = _g1->capacity(); double reclaimable_perc = reclaimable_bytes_perc(reclaimable_bytes);
double perc = (double) reclaimable_bytes * 100.0 / (double) capacity_bytes;
double threshold = (double) G1HeapWastePercent; double threshold = (double) G1HeapWastePercent;
if (perc < threshold) { if (reclaimable_perc <= threshold) {
ergo_verbose4(ErgoMixedGCs, ergo_verbose4(ErgoMixedGCs,
false_action_str, false_action_str,
ergo_format_reason("reclaimable percentage lower than threshold") ergo_format_reason("reclaimable percentage not over threshold")
ergo_format_region("candidate old regions") ergo_format_region("candidate old regions")
ergo_format_byte_perc("reclaimable") ergo_format_byte_perc("reclaimable")
ergo_format_perc("threshold"), ergo_format_perc("threshold"),
cset_chooser->remaining_regions(), cset_chooser->remaining_regions(),
reclaimable_bytes, perc, threshold); reclaimable_bytes,
reclaimable_perc, threshold);
return false; return false;
} }
@ -1838,10 +1848,50 @@ bool G1CollectorPolicy::next_gc_should_be_mixed(const char* true_action_str,
ergo_format_byte_perc("reclaimable") ergo_format_byte_perc("reclaimable")
ergo_format_perc("threshold"), ergo_format_perc("threshold"),
cset_chooser->remaining_regions(), cset_chooser->remaining_regions(),
reclaimable_bytes, perc, threshold); reclaimable_bytes,
reclaimable_perc, threshold);
return true; return true;
} }
uint G1CollectorPolicy::calc_min_old_cset_length() {
// The min old CSet region bound is based on the maximum desired
// number of mixed GCs after a cycle. I.e., even if some old regions
// look expensive, we should add them to the CSet anyway to make
// sure we go through the available old regions in no more than the
// maximum desired number of mixed GCs.
//
// The calculation is based on the number of marked regions we added
// to the CSet chooser in the first place, not how many remain, so
// that the result is the same during all mixed GCs that follow a cycle.
const size_t region_num = (size_t) _collectionSetChooser->length();
const size_t gc_num = (size_t) MAX2(G1MixedGCCountTarget, (uintx) 1);
size_t result = region_num / gc_num;
// emulate ceiling
if (result * gc_num < region_num) {
result += 1;
}
return (uint) result;
}
uint G1CollectorPolicy::calc_max_old_cset_length() {
// The max old CSet region bound is based on the threshold expressed
// as a percentage of the heap size. I.e., it should bound the
// number of old regions added to the CSet irrespective of how many
// of them are available.
G1CollectedHeap* g1h = G1CollectedHeap::heap();
const size_t region_num = g1h->n_regions();
const size_t perc = (size_t) G1OldCSetRegionThresholdPercent;
size_t result = region_num * perc / 100;
// emulate ceiling
if (100 * result < region_num * perc) {
result += 1;
}
return (uint) result;
}
void G1CollectorPolicy::finalize_cset(double target_pause_time_ms) { void G1CollectorPolicy::finalize_cset(double target_pause_time_ms) {
double young_start_time_sec = os::elapsedTime(); double young_start_time_sec = os::elapsedTime();
@ -1855,7 +1905,7 @@ void G1CollectorPolicy::finalize_cset(double target_pause_time_ms) {
double base_time_ms = predict_base_elapsed_time_ms(_pending_cards); double base_time_ms = predict_base_elapsed_time_ms(_pending_cards);
double predicted_pause_time_ms = base_time_ms; double predicted_pause_time_ms = base_time_ms;
double time_remaining_ms = target_pause_time_ms - base_time_ms; double time_remaining_ms = MAX2(target_pause_time_ms - base_time_ms, 0.0);
ergo_verbose4(ErgoCSetConstruction | ErgoHigh, ergo_verbose4(ErgoCSetConstruction | ErgoHigh,
"start choosing CSet", "start choosing CSet",
@ -1893,7 +1943,7 @@ void G1CollectorPolicy::finalize_cset(double target_pause_time_ms) {
_collection_set = _inc_cset_head; _collection_set = _inc_cset_head;
_collection_set_bytes_used_before = _inc_cset_bytes_used_before; _collection_set_bytes_used_before = _inc_cset_bytes_used_before;
time_remaining_ms -= _inc_cset_predicted_elapsed_time_ms; time_remaining_ms = MAX2(time_remaining_ms - _inc_cset_predicted_elapsed_time_ms, 0.0);
predicted_pause_time_ms += _inc_cset_predicted_elapsed_time_ms; predicted_pause_time_ms += _inc_cset_predicted_elapsed_time_ms;
ergo_verbose3(ErgoCSetConstruction | ErgoHigh, ergo_verbose3(ErgoCSetConstruction | ErgoHigh,
@ -1917,8 +1967,8 @@ void G1CollectorPolicy::finalize_cset(double target_pause_time_ms) {
if (!gcs_are_young()) { if (!gcs_are_young()) {
CollectionSetChooser* cset_chooser = _collectionSetChooser; CollectionSetChooser* cset_chooser = _collectionSetChooser;
cset_chooser->verify(); cset_chooser->verify();
const uint min_old_cset_length = cset_chooser->calc_min_old_cset_length(); const uint min_old_cset_length = calc_min_old_cset_length();
const uint max_old_cset_length = cset_chooser->calc_max_old_cset_length(); const uint max_old_cset_length = calc_max_old_cset_length();
uint expensive_region_num = 0; uint expensive_region_num = 0;
bool check_time_remaining = adaptive_young_list_length(); bool check_time_remaining = adaptive_young_list_length();
@ -1936,6 +1986,30 @@ void G1CollectorPolicy::finalize_cset(double target_pause_time_ms) {
break; break;
} }
// Stop adding regions if the remaining reclaimable space is
// not above G1HeapWastePercent.
size_t reclaimable_bytes = cset_chooser->remaining_reclaimable_bytes();
double reclaimable_perc = reclaimable_bytes_perc(reclaimable_bytes);
double threshold = (double) G1HeapWastePercent;
if (reclaimable_perc <= threshold) {
// We've added enough old regions that the amount of uncollected
// reclaimable space is at or below the waste threshold. Stop
// adding old regions to the CSet.
ergo_verbose5(ErgoCSetConstruction,
"finish adding old regions to CSet",
ergo_format_reason("reclaimable percentage not over threshold")
ergo_format_region("old")
ergo_format_region("max")
ergo_format_byte_perc("reclaimable")
ergo_format_perc("threshold"),
old_cset_region_length(),
max_old_cset_length,
reclaimable_bytes,
reclaimable_perc, threshold);
break;
}
double predicted_time_ms = predict_region_elapsed_time_ms(hr, gcs_are_young()); double predicted_time_ms = predict_region_elapsed_time_ms(hr, gcs_are_young());
if (check_time_remaining) { if (check_time_remaining) {
if (predicted_time_ms > time_remaining_ms) { if (predicted_time_ms > time_remaining_ms) {
@ -1975,7 +2049,7 @@ void G1CollectorPolicy::finalize_cset(double target_pause_time_ms) {
} }
// We will add this region to the CSet. // We will add this region to the CSet.
time_remaining_ms -= predicted_time_ms; time_remaining_ms = MAX2(time_remaining_ms - predicted_time_ms, 0.0);
predicted_pause_time_ms += predicted_time_ms; predicted_pause_time_ms += predicted_time_ms;
cset_chooser->remove_and_move_to_next(hr); cset_chooser->remove_and_move_to_next(hr);
_g1->old_set_remove(hr); _g1->old_set_remove(hr);

View file

@ -619,6 +619,18 @@ private:
bool predict_will_fit(uint young_length, double base_time_ms, bool predict_will_fit(uint young_length, double base_time_ms,
uint base_free_regions, double target_pause_time_ms); uint base_free_regions, double target_pause_time_ms);
// Calculate the minimum number of old regions we'll add to the CSet
// during a mixed GC.
uint calc_min_old_cset_length();
// Calculate the maximum number of old regions we'll add to the CSet
// during a mixed GC.
uint calc_max_old_cset_length();
// Returns the given amount of uncollected reclaimable space
// as a percentage of the current heap capacity.
double reclaimable_bytes_perc(size_t reclaimable_bytes);
public: public:
G1CollectorPolicy(); G1CollectorPolicy();

View file

@ -25,12 +25,14 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "memory/metaspaceCounters.hpp" #include "memory/metaspaceCounters.hpp"
#include "memory/resourceArea.hpp" #include "memory/resourceArea.hpp"
#include "utilities/exceptions.hpp"
#define METASPACE_NAME "perm"
MetaspaceCounters* MetaspaceCounters::_metaspace_counters = NULL; MetaspaceCounters* MetaspaceCounters::_metaspace_counters = NULL;
MetaspaceCounters::MetaspaceCounters() { MetaspaceCounters::MetaspaceCounters() :
_capacity(NULL),
_used(NULL),
_max_capacity(NULL) {
if (UsePerfData) { if (UsePerfData) {
size_t min_capacity = MetaspaceAux::min_chunk_size(); size_t min_capacity = MetaspaceAux::min_chunk_size();
size_t max_capacity = MetaspaceAux::reserved_in_bytes(); size_t max_capacity = MetaspaceAux::reserved_in_bytes();
@ -41,6 +43,25 @@ MetaspaceCounters::MetaspaceCounters() {
} }
} }
static PerfVariable* create_ms_variable(const char *ns,
const char *name,
size_t value,
TRAPS) {
const char *path = PerfDataManager::counter_name(ns, name);
PerfVariable *result =
PerfDataManager::create_variable(SUN_GC, path, PerfData::U_Bytes, value,
CHECK_NULL);
return result;
}
static void create_ms_constant(const char *ns,
const char *name,
size_t value,
TRAPS) {
const char *path = PerfDataManager::counter_name(ns, name);
PerfDataManager::create_constant(SUN_GC, path, PerfData::U_Bytes, value, CHECK);
}
void MetaspaceCounters::initialize(size_t min_capacity, void MetaspaceCounters::initialize(size_t min_capacity,
size_t max_capacity, size_t max_capacity,
size_t curr_capacity, size_t curr_capacity,
@ -50,93 +71,32 @@ void MetaspaceCounters::initialize(size_t min_capacity,
EXCEPTION_MARK; EXCEPTION_MARK;
ResourceMark rm; ResourceMark rm;
// Create a name that will be recognized by jstat tools as const char *ms = "metaspace";
// the perm gen. Change this to a Metaspace name when the
// tools are fixed.
// name to recognize "sun.gc.generation.2.*"
const char* name = METASPACE_NAME; create_ms_constant(ms, "minCapacity", min_capacity, CHECK);
const int ordinal = 2; _max_capacity = create_ms_variable(ms, "maxCapacity", max_capacity, CHECK);
const int spaces = 1; _capacity = create_ms_variable(ms, "capacity", curr_capacity, CHECK);
_used = create_ms_variable(ms, "used", used, CHECK);
const char* cns = PerfDataManager::name_space("generation", ordinal);
_name_space = NEW_C_HEAP_ARRAY(char, strlen(cns)+1, mtClass);
strcpy(_name_space, cns);
const char* cname = PerfDataManager::counter_name(_name_space, "name");
PerfDataManager::create_string_constant(SUN_GC, cname, name, CHECK);
// End of perm gen like name creation
cname = PerfDataManager::counter_name(_name_space, "spaces");
PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_None,
spaces, CHECK);
cname = PerfDataManager::counter_name(_name_space, "minCapacity");
PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_Bytes,
min_capacity, CHECK);
cname = PerfDataManager::counter_name(_name_space, "maxCapacity");
PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_Bytes,
max_capacity, CHECK);
cname = PerfDataManager::counter_name(_name_space, "capacity");
_current_size =
PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
curr_capacity, CHECK);
// SpaceCounter like counters
// name to recognize "sun.gc.generation.2.space.0.*"
{
const int space_ordinal = 0;
const char* cns = PerfDataManager::name_space(_name_space, "space",
space_ordinal);
char* space_name_space = NEW_C_HEAP_ARRAY(char, strlen(cns)+1, mtClass);
strcpy(space_name_space, cns);
const char* cname = PerfDataManager::counter_name(space_name_space, "name");
PerfDataManager::create_string_constant(SUN_GC, cname, name, CHECK);
cname = PerfDataManager::counter_name(space_name_space, "maxCapacity");
_max_capacity = PerfDataManager::create_variable(SUN_GC, cname,
PerfData::U_Bytes,
(jlong)max_capacity, CHECK);
cname = PerfDataManager::counter_name(space_name_space, "capacity");
_capacity = PerfDataManager::create_variable(SUN_GC, cname,
PerfData::U_Bytes,
curr_capacity, CHECK);
cname = PerfDataManager::counter_name(space_name_space, "used");
_used = PerfDataManager::create_variable(SUN_GC,
cname,
PerfData::U_Bytes,
used,
CHECK);
cname = PerfDataManager::counter_name(space_name_space, "initCapacity");
PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_Bytes,
min_capacity, CHECK);
}
} }
} }
void MetaspaceCounters::update_capacity() { void MetaspaceCounters::update_capacity() {
assert(UsePerfData, "Should not be called unless being used"); assert(UsePerfData, "Should not be called unless being used");
assert(_capacity != NULL, "Should be initialized");
size_t capacity_in_bytes = MetaspaceAux::capacity_in_bytes(); size_t capacity_in_bytes = MetaspaceAux::capacity_in_bytes();
_capacity->set_value(capacity_in_bytes); _capacity->set_value(capacity_in_bytes);
} }
void MetaspaceCounters::update_used() { void MetaspaceCounters::update_used() {
assert(UsePerfData, "Should not be called unless being used"); assert(UsePerfData, "Should not be called unless being used");
assert(_used != NULL, "Should be initialized");
size_t used_in_bytes = MetaspaceAux::used_in_bytes(); size_t used_in_bytes = MetaspaceAux::used_in_bytes();
_used->set_value(used_in_bytes); _used->set_value(used_in_bytes);
} }
void MetaspaceCounters::update_max_capacity() { void MetaspaceCounters::update_max_capacity() {
assert(UsePerfData, "Should not be called unless being used"); assert(UsePerfData, "Should not be called unless being used");
assert(_max_capacity != NULL, "Should be initialized");
size_t reserved_in_bytes = MetaspaceAux::reserved_in_bytes(); size_t reserved_in_bytes = MetaspaceAux::reserved_in_bytes();
_max_capacity->set_value(reserved_in_bytes); _max_capacity->set_value(reserved_in_bytes);
} }
@ -146,18 +106,19 @@ void MetaspaceCounters::update_all() {
update_used(); update_used();
update_capacity(); update_capacity();
update_max_capacity(); update_max_capacity();
_current_size->set_value(MetaspaceAux::reserved_in_bytes());
} }
} }
void MetaspaceCounters::initialize_performance_counters() { void MetaspaceCounters::initialize_performance_counters() {
if (UsePerfData) { if (UsePerfData) {
assert(_metaspace_counters == NULL, "Should only be initialized once");
_metaspace_counters = new MetaspaceCounters(); _metaspace_counters = new MetaspaceCounters();
} }
} }
void MetaspaceCounters::update_performance_counters() { void MetaspaceCounters::update_performance_counters() {
if (UsePerfData) { if (UsePerfData) {
assert(_metaspace_counters != NULL, "Should be initialized");
_metaspace_counters->update_all(); _metaspace_counters->update_all();
} }
} }

View file

@ -29,11 +29,9 @@
class MetaspaceCounters: public CHeapObj<mtClass> { class MetaspaceCounters: public CHeapObj<mtClass> {
friend class VMStructs; friend class VMStructs;
PerfVariable* _current_size;
PerfVariable* _capacity; PerfVariable* _capacity;
PerfVariable* _used; PerfVariable* _used;
PerfVariable* _max_capacity; PerfVariable* _max_capacity;
char* _name_space;
static MetaspaceCounters* _metaspace_counters; static MetaspaceCounters* _metaspace_counters;
void initialize(size_t min_capacity, void initialize(size_t min_capacity,
size_t max_capacity, size_t max_capacity,

View file

@ -2178,7 +2178,11 @@ void InstanceKlass::clean_implementors_list(BoolObjectClosure* is_alive) {
if (impl != NULL) { if (impl != NULL) {
if (!impl->is_loader_alive(is_alive)) { if (!impl->is_loader_alive(is_alive)) {
// remove this guy // remove this guy
*adr_implementor() = NULL; Klass** klass = adr_implementor();
assert(klass != NULL, "null klass");
if (klass != NULL) {
*klass = NULL;
}
} }
} }
} }
@ -3159,9 +3163,10 @@ void InstanceKlass::verify_on(outputStream* st) {
if (protection_domain() != NULL) { if (protection_domain() != NULL) {
guarantee(protection_domain()->is_oop(), "should be oop"); guarantee(protection_domain()->is_oop(), "should be oop");
} }
if (host_klass() != NULL) { const Klass* host = host_klass();
guarantee(host_klass()->is_metadata(), "should be in metaspace"); if (host != NULL) {
guarantee(host_klass()->is_klass(), "should be klass"); guarantee(host->is_metadata(), "should be in metaspace");
guarantee(host->is_klass(), "should be klass");
} }
if (signers() != NULL) { if (signers() != NULL) {
guarantee(signers()->is_objArray(), "should be obj array"); guarantee(signers()->is_objArray(), "should be obj array");

View file

@ -538,8 +538,10 @@ class InstanceKlass: public Klass {
assert(is_anonymous(), "not anonymous"); assert(is_anonymous(), "not anonymous");
Klass** addr = (Klass**)adr_host_klass(); Klass** addr = (Klass**)adr_host_klass();
assert(addr != NULL, "no reversed space"); assert(addr != NULL, "no reversed space");
if (addr != NULL) {
*addr = host; *addr = host;
} }
}
bool is_anonymous() const { bool is_anonymous() const {
return (_misc_flags & _misc_is_anonymous) != 0; return (_misc_flags & _misc_is_anonymous) != 0;
} }
@ -760,8 +762,11 @@ class InstanceKlass: public Klass {
void set_implementor(Klass* k) { void set_implementor(Klass* k) {
assert(is_interface(), "not interface"); assert(is_interface(), "not interface");
Klass** addr = adr_implementor(); Klass** addr = adr_implementor();
assert(addr != NULL, "null addr");
if (addr != NULL) {
*addr = k; *addr = k;
} }
}
int nof_implementors() const { int nof_implementors() const {
Klass* k = implementor(); Klass* k = implementor();

View file

@ -54,6 +54,12 @@
#define C2_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct) \ #define C2_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct) \
\ \
develop(bool, StressLCM, false, \
"Randomize instruction scheduling in LCM") \
\
develop(bool, StressGCM, false, \
"Randomize instruction scheduling in GCM") \
\
notproduct(intx, CompileZapFirst, 0, \ notproduct(intx, CompileZapFirst, 0, \
"If +ZapDeadCompiledLocals, " \ "If +ZapDeadCompiledLocals, " \
"skip this many before compiling in zap calls") \ "skip this many before compiling in zap calls") \

View file

@ -2899,6 +2899,13 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) {
} }
} }
break; break;
case Op_MemBarStoreStore:
// Break the link with AllocateNode: it is no longer useful and
// confuses register allocation.
if (n->req() > MemBarNode::Precedent) {
n->set_req(MemBarNode::Precedent, top());
}
break;
default: default:
assert( !n->is_Call(), "" ); assert( !n->is_Call(), "" );
assert( !n->is_Mem(), "" ); assert( !n->is_Mem(), "" );
@ -3669,3 +3676,38 @@ void Compile::add_expensive_node(Node * n) {
n->set_req(0, NULL); n->set_req(0, NULL);
} }
} }
// Auxiliary method to support randomized stressing/fuzzing.
//
// This method can be called the arbitrary number of times, with current count
// as the argument. The logic allows selecting a single candidate from the
// running list of candidates as follows:
// int count = 0;
// Cand* selected = null;
// while(cand = cand->next()) {
// if (randomized_select(++count)) {
// selected = cand;
// }
// }
//
// Including count equalizes the chances any candidate is "selected".
// This is useful when we don't have the complete list of candidates to choose
// from uniformly. In this case, we need to adjust the randomicity of the
// selection, or else we will end up biasing the selection towards the latter
// candidates.
//
// Quick back-envelope calculation shows that for the list of n candidates
// the equal probability for the candidate to persist as "best" can be
// achieved by replacing it with "next" k-th candidate with the probability
// of 1/k. It can be easily shown that by the end of the run, the
// probability for any candidate is converged to 1/n, thus giving the
// uniform distribution among all the candidates.
//
// We don't care about the domain size as long as (RANDOMIZED_DOMAIN / count) is large.
#define RANDOMIZED_DOMAIN_POW 29
#define RANDOMIZED_DOMAIN (1 << RANDOMIZED_DOMAIN_POW)
#define RANDOMIZED_DOMAIN_MASK ((1 << (RANDOMIZED_DOMAIN_POW + 1)) - 1)
bool Compile::randomized_select(int count) {
assert(count > 0, "only positive");
return (os::random() & RANDOMIZED_DOMAIN_MASK) < (RANDOMIZED_DOMAIN / count);
}

View file

@ -678,6 +678,7 @@ class Compile : public Phase {
void record_dead_node(uint idx) { if (_dead_node_list.test_set(idx)) return; void record_dead_node(uint idx) { if (_dead_node_list.test_set(idx)) return;
_dead_node_count++; _dead_node_count++;
} }
bool is_dead_node(uint idx) { return _dead_node_list.test(idx) != 0; }
uint dead_node_count() { return _dead_node_count; } uint dead_node_count() { return _dead_node_count; }
void reset_dead_node_list() { _dead_node_list.Reset(); void reset_dead_node_list() { _dead_node_list.Reset();
_dead_node_count = 0; _dead_node_count = 0;
@ -1086,6 +1087,9 @@ class Compile : public Phase {
// Definitions of pd methods // Definitions of pd methods
static void pd_compiler2_init(); static void pd_compiler2_init();
// Auxiliary method for randomized fuzzing/stressing
static bool randomized_select(int count);
}; };
#endif // SHARE_VM_OPTO_COMPILE_HPP #endif // SHARE_VM_OPTO_COMPILE_HPP

View file

@ -1046,6 +1046,8 @@ Block* PhaseCFG::hoist_to_cheaper_block(Block* LCA, Block* early, Node* self) {
} }
#endif #endif
int cand_cnt = 0; // number of candidates tried
// Walk up the dominator tree from LCA (Lowest common ancestor) to // Walk up the dominator tree from LCA (Lowest common ancestor) to
// the earliest legal location. Capture the least execution frequency. // the earliest legal location. Capture the least execution frequency.
while (LCA != early) { while (LCA != early) {
@ -1071,8 +1073,11 @@ Block* PhaseCFG::hoist_to_cheaper_block(Block* LCA, Block* early, Node* self) {
LCA->_pre_order, LCA->_nodes[0]->_idx, start_lat, end_idx, end_lat, LCA_freq); LCA->_pre_order, LCA->_nodes[0]->_idx, start_lat, end_idx, end_lat, LCA_freq);
} }
#endif #endif
cand_cnt++;
if (LCA_freq < least_freq || // Better Frequency if (LCA_freq < least_freq || // Better Frequency
( !in_latency && // No block containing latency (StressGCM && Compile::randomized_select(cand_cnt)) || // Should be randomly accepted in stress mode
(!StressGCM && // Otherwise, choose with latency
!in_latency && // No block containing latency
LCA_freq < least_freq * delta && // No worse frequency LCA_freq < least_freq * delta && // No worse frequency
target >= end_lat && // within latency range target >= end_lat && // within latency range
!self->is_iteratively_computed() ) // But don't hoist IV increments !self->is_iteratively_computed() ) // But don't hoist IV increments
@ -1210,7 +1215,8 @@ void PhaseCFG::schedule_late(VectorSet &visited, Node_List &stack) {
} }
// If there is no opportunity to hoist, then we're done. // If there is no opportunity to hoist, then we're done.
bool try_to_hoist = (LCA != early); // In stress mode, try to hoist even the single operations.
bool try_to_hoist = StressGCM || (LCA != early);
// Must clone guys stay next to use; no hoisting allowed. // Must clone guys stay next to use; no hoisting allowed.
// Also cannot hoist guys that alter memory or are otherwise not // Also cannot hoist guys that alter memory or are otherwise not

View file

@ -421,6 +421,7 @@ Node *Block::select(PhaseCFG *cfg, Node_List &worklist, GrowableArray<int> &read
uint latency = 0; // Bigger is scheduled first uint latency = 0; // Bigger is scheduled first
uint score = 0; // Bigger is better uint score = 0; // Bigger is better
int idx = -1; // Index in worklist int idx = -1; // Index in worklist
int cand_cnt = 0; // Candidate count
for( uint i=0; i<cnt; i++ ) { // Inspect entire worklist for( uint i=0; i<cnt; i++ ) { // Inspect entire worklist
// Order in worklist is used to break ties. // Order in worklist is used to break ties.
@ -503,11 +504,14 @@ Node *Block::select(PhaseCFG *cfg, Node_List &worklist, GrowableArray<int> &read
uint n_score = n->req(); // Many inputs get high score to break ties uint n_score = n->req(); // Many inputs get high score to break ties
// Keep best latency found // Keep best latency found
if( choice < n_choice || cand_cnt++;
( choice == n_choice && if (choice < n_choice ||
( latency < n_latency || (choice == n_choice &&
( latency == n_latency && ((StressLCM && Compile::randomized_select(cand_cnt)) ||
( score < n_score ))))) { (!StressLCM &&
(latency < n_latency ||
(latency == n_latency &&
(score < n_score))))))) {
choice = n_choice; choice = n_choice;
latency = n_latency; latency = n_latency;
score = n_score; score = n_score;

View file

@ -1101,12 +1101,6 @@ void PhaseMacroExpand::expand_allocate_common(
Node* klass_node = alloc->in(AllocateNode::KlassNode); Node* klass_node = alloc->in(AllocateNode::KlassNode);
Node* initial_slow_test = alloc->in(AllocateNode::InitialTest); Node* initial_slow_test = alloc->in(AllocateNode::InitialTest);
Node* storestore = alloc->storestore();
if (storestore != NULL) {
// Break this link that is no longer useful and confuses register allocation
storestore->set_req(MemBarNode::Precedent, top());
}
assert(ctrl != NULL, "must have control"); assert(ctrl != NULL, "must have control");
// We need a Region and corresponding Phi's to merge the slow-path and fast-path results. // We need a Region and corresponding Phi's to merge the slow-path and fast-path results.
// they will not be used if "always_slow" is set // they will not be used if "always_slow" is set
@ -1324,7 +1318,7 @@ void PhaseMacroExpand::expand_allocate_common(
// No InitializeNode or no stores captured by zeroing // No InitializeNode or no stores captured by zeroing
// elimination. Simply add the MemBarStoreStore after object // elimination. Simply add the MemBarStoreStore after object
// initialization. // initialization.
MemBarNode* mb = MemBarNode::make(C, Op_MemBarStoreStore, Compile::AliasIdxBot, fast_oop_rawmem); MemBarNode* mb = MemBarNode::make(C, Op_MemBarStoreStore, Compile::AliasIdxBot);
transform_later(mb); transform_later(mb);
mb->init_req(TypeFunc::Memory, fast_oop_rawmem); mb->init_req(TypeFunc::Memory, fast_oop_rawmem);

View file

@ -238,7 +238,7 @@ Node *MemNode::Ideal_common(PhaseGVN *phase, bool can_reshape) {
return this; return this;
ctl = in(MemNode::Control); ctl = in(MemNode::Control);
// Don't bother trying to transform a dead node // Don't bother trying to transform a dead node
if( ctl && ctl->is_top() ) return NodeSentinel; if (ctl && ctl->is_top()) return NodeSentinel;
PhaseIterGVN *igvn = phase->is_IterGVN(); PhaseIterGVN *igvn = phase->is_IterGVN();
// Wait if control on the worklist. // Wait if control on the worklist.
@ -262,8 +262,8 @@ Node *MemNode::Ideal_common(PhaseGVN *phase, bool can_reshape) {
} }
// Ignore if memory is dead, or self-loop // Ignore if memory is dead, or self-loop
Node *mem = in(MemNode::Memory); Node *mem = in(MemNode::Memory);
if( phase->type( mem ) == Type::TOP ) return NodeSentinel; // caller will return NULL if (phase->type( mem ) == Type::TOP) return NodeSentinel; // caller will return NULL
assert( mem != this, "dead loop in MemNode::Ideal" ); assert(mem != this, "dead loop in MemNode::Ideal");
if (can_reshape && igvn != NULL && igvn->_worklist.member(mem)) { if (can_reshape && igvn != NULL && igvn->_worklist.member(mem)) {
// This memory slice may be dead. // This memory slice may be dead.
@ -273,12 +273,12 @@ Node *MemNode::Ideal_common(PhaseGVN *phase, bool can_reshape) {
} }
Node *address = in(MemNode::Address); Node *address = in(MemNode::Address);
const Type *t_adr = phase->type( address ); const Type *t_adr = phase->type(address);
if( t_adr == Type::TOP ) return NodeSentinel; // caller will return NULL if (t_adr == Type::TOP) return NodeSentinel; // caller will return NULL
if( can_reshape && igvn != NULL && if (can_reshape && igvn != NULL &&
(igvn->_worklist.member(address) || (igvn->_worklist.member(address) ||
igvn->_worklist.size() > 0 && (phase->type(address) != adr_type())) ) { igvn->_worklist.size() > 0 && (t_adr != adr_type())) ) {
// The address's base and type may change when the address is processed. // The address's base and type may change when the address is processed.
// Delay this mem node transformation until the address is processed. // Delay this mem node transformation until the address is processed.
phase->is_IterGVN()->_worklist.push(this); phase->is_IterGVN()->_worklist.push(this);
@ -288,7 +288,7 @@ Node *MemNode::Ideal_common(PhaseGVN *phase, bool can_reshape) {
// Do NOT remove or optimize the next lines: ensure a new alias index // Do NOT remove or optimize the next lines: ensure a new alias index
// is allocated for an oop pointer type before Escape Analysis. // is allocated for an oop pointer type before Escape Analysis.
// Note: C++ will not remove it since the call has side effect. // Note: C++ will not remove it since the call has side effect.
if ( t_adr->isa_oopptr() ) { if (t_adr->isa_oopptr()) {
int alias_idx = phase->C->get_alias_index(t_adr->is_ptr()); int alias_idx = phase->C->get_alias_index(t_adr->is_ptr());
} }
@ -296,6 +296,26 @@ Node *MemNode::Ideal_common(PhaseGVN *phase, bool can_reshape) {
Node* base = NULL; Node* base = NULL;
if (address->is_AddP()) if (address->is_AddP())
base = address->in(AddPNode::Base); base = address->in(AddPNode::Base);
if (base != NULL && phase->type(base)->higher_equal(TypePtr::NULL_PTR) &&
!t_adr->isa_rawptr()) {
// Note: raw address has TOP base and top->higher_equal(TypePtr::NULL_PTR) is true.
Compile* C = phase->C;
tty->cr();
tty->print_cr("===== NULL+offs not RAW address =====");
if (C->is_dead_node(this->_idx)) tty->print_cr("'this' is dead");
if ((ctl != NULL) && C->is_dead_node(ctl->_idx)) tty->print_cr("'ctl' is dead");
if (C->is_dead_node(mem->_idx)) tty->print_cr("'mem' is dead");
if (C->is_dead_node(address->_idx)) tty->print_cr("'address' is dead");
if (C->is_dead_node(base->_idx)) tty->print_cr("'base' is dead");
tty->cr();
base->dump(1);
tty->cr();
this->dump(2);
tty->print("this->adr_type(): "); adr_type()->dump(); tty->cr();
tty->print("phase->type(address): "); t_adr->dump(); tty->cr();
tty->print("phase->type(base): "); phase->type(address)->dump(); tty->cr();
tty->cr();
}
assert(base == NULL || t_adr->isa_rawptr() || assert(base == NULL || t_adr->isa_rawptr() ||
!phase->type(base)->higher_equal(TypePtr::NULL_PTR), "NULL+offs not RAW address?"); !phase->type(base)->higher_equal(TypePtr::NULL_PTR), "NULL+offs not RAW address?");
#endif #endif

View file

@ -1070,7 +1070,12 @@ oop frame::retrieve_receiver(RegisterMap* reg_map) {
// First consult the ADLC on where it puts parameter 0 for this signature. // First consult the ADLC on where it puts parameter 0 for this signature.
VMReg reg = SharedRuntime::name_for_receiver(); VMReg reg = SharedRuntime::name_for_receiver();
oop r = *caller.oopmapreg_to_location(reg, reg_map); oop* oop_adr = caller.oopmapreg_to_location(reg, reg_map);
if (oop_adr == NULL) {
guarantee(oop_adr != NULL, "bad register save location");
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 ")", (intptr_t) r, (intptr_t) r));
return r; return r;
} }

View file

@ -1751,6 +1751,10 @@ class CommandLineFlags {
manageable(intx, CMSWaitDuration, 2000, \ manageable(intx, CMSWaitDuration, 2000, \
"Time in milliseconds that CMS thread waits for young GC") \ "Time in milliseconds that CMS thread waits for young GC") \
\ \
develop(uintx, CMSCheckInterval, 1000, \
"Interval in milliseconds that CMS thread checks if it " \
"should start a collection cycle") \
\
product(bool, CMSYield, true, \ product(bool, CMSYield, true, \
"Yield between steps of concurrent mark & sweep") \ "Yield between steps of concurrent mark & sweep") \
\ \

View file

@ -25,7 +25,7 @@
/* /*
* @test * @test
* @bug 6431242 * @bug 6431242
* @run main/othervm -server -XX:+PrintCompilation Test * @run main Test
*/ */
public class Test{ public class Test{

View file

@ -26,7 +26,7 @@
* @bug 6589834 * @bug 6589834
* @summary deoptimization problem with -XX:+DeoptimizeALot * @summary deoptimization problem with -XX:+DeoptimizeALot
* *
* @run main/othervm -server Test_ia32 * @run main Test_ia32
*/ */
/*************************************************************************************** /***************************************************************************************

View file

@ -26,7 +26,7 @@
* @bug 6636138 * @bug 6636138
* @summary SuperWord::co_locate_pack(Node_List* p) generates memory graph that leads to memory order violation. * @summary SuperWord::co_locate_pack(Node_List* p) generates memory graph that leads to memory order violation.
* *
* @run main/othervm -server -Xbatch -XX:CompileOnly=Test1.init Test1 * @run main/othervm -Xbatch -XX:CompileOnly=Test1.init Test1
*/ */
public class Test1 { public class Test1 {

View file

@ -26,7 +26,7 @@
* @bug 6636138 * @bug 6636138
* @summary SuperWord::co_locate_pack(Node_List* p) generates memory graph that leads to memory order violation. * @summary SuperWord::co_locate_pack(Node_List* p) generates memory graph that leads to memory order violation.
* *
* @run main/othervm -server -Xbatch -XX:CompileOnly=Test2.shift Test2 * @run main/othervm -Xbatch -XX:CompileOnly=Test2.shift Test2
*/ */
public class Test2 { public class Test2 {

View file

@ -26,7 +26,7 @@
* @test * @test
* @bug 6795161 * @bug 6795161
* @summary Escape analysis leads to data corruption * @summary Escape analysis leads to data corruption
* @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:CompileOnly=Test -XX:+DoEscapeAnalysis Test * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:CompileOnly=Test -XX:+DoEscapeAnalysis Test
*/ */
class Test_Class_1 { class Test_Class_1 {

View file

@ -26,7 +26,7 @@
* @test * @test
* @bug 6946040 * @bug 6946040
* @summary Tests Character/Short.reverseBytes and their intrinsics implementation in the server compiler * @summary Tests Character/Short.reverseBytes and their intrinsics implementation in the server compiler
* @run main/othervm -Xbatch -server -XX:CompileOnly=.testChar,.testShort TestCharShortByteSwap * @run main/othervm -Xbatch -XX:CompileOnly=.testChar,.testShort TestCharShortByteSwap
*/ */
// This test must run without any command line arguments. // This test must run without any command line arguments.

View file

@ -45,5 +45,5 @@ ${TESTJAVA}/bin/jar -uf0 foo.jar Test7068051.java
${TESTJAVA}/bin/javac -d . Test7068051.java ${TESTJAVA}/bin/javac -d . Test7068051.java
${TESTJAVA}/bin/java -showversion -Xbatch ${TESTVMOPTS} Test7068051 foo.jar ${TESTJAVA}/bin/java ${TESTVMOPTS} -showversion -Xbatch Test7068051 foo.jar

View file

@ -26,7 +26,7 @@
* @bug 8000805 * @bug 8000805
* @summary JMM issue: short loads are non-atomic * @summary JMM issue: short loads are non-atomic
* *
* @run main/othervm -server -XX:-TieredCompilation -Xcomp -XX:+PrintCompilation -XX:CompileOnly=Test8000805.loadS2LmaskFF,Test8000805.loadS2Lmask16,Test8000805.loadS2Lmask13,Test8000805.loadUS_signExt,Test8000805.loadB2L_mask8 Test8000805 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -Xcomp -XX:+PrintCompilation -XX:CompileOnly=Test8000805.loadS2LmaskFF,Test8000805.loadS2Lmask16,Test8000805.loadS2Lmask13,Test8000805.loadUS_signExt,Test8000805.loadB2L_mask8 Test8000805
*/ */
public class Test8000805 { public class Test8000805 {

View file

@ -201,3 +201,4 @@ ff0b73a6b3f6cea644d37d56d746a37743419fa7 jdk8-b75
573e789c187a69a3ae00bffd26eb35c0f4a60636 jdk8-b77 573e789c187a69a3ae00bffd26eb35c0f4a60636 jdk8-b77
00958c5a7070bd578aa8b70773cb3f204a9c1be1 jdk8-b78 00958c5a7070bd578aa8b70773cb3f204a9c1be1 jdk8-b78
58fa065dd5d663d62f85402461388fb7a92656fa jdk8-b79 58fa065dd5d663d62f85402461388fb7a92656fa jdk8-b79
4873a0499bc3bd263b7dd3b551a2b4e275ab5a0b jdk8-b80

View file

@ -201,3 +201,4 @@ c4853f3f0e89ac60aa5b517f5f224f0f60e08577 jdk8-b76
64dfba1bad16433f609f17a42c3c5990367c5c0b jdk8-b77 64dfba1bad16433f609f17a42c3c5990367c5c0b jdk8-b77
391de4c992d1960a09cdd340362ff936bac69323 jdk8-b78 391de4c992d1960a09cdd340362ff936bac69323 jdk8-b78
70d8658d2a3063bc13127f3452af017d838f1362 jdk8-b79 70d8658d2a3063bc13127f3452af017d838f1362 jdk8-b79
b0224010e2f0c2474055ac592c8d3f37b9264690 jdk8-b80

View file

@ -201,3 +201,4 @@ a996b57e554198f4592a5f3c30f2f9f4075e545d jdk8-b70
b2fc8e31cecc35b76188e821d4c5dc0e0b74ac24 jdk8-b77 b2fc8e31cecc35b76188e821d4c5dc0e0b74ac24 jdk8-b77
00b7535d743f83eda763c10b3c9ea19ba4b67f55 jdk8-b78 00b7535d743f83eda763c10b3c9ea19ba4b67f55 jdk8-b78
c933505d75c2a0a671f06d6dac5d2237a9228d2d jdk8-b79 c933505d75c2a0a671f06d6dac5d2237a9228d2d jdk8-b79
dfb40f066c6ce129822f0f5dc2ac89173808781a jdk8-b80

View file

@ -74,24 +74,24 @@ ifeq ($(PLATFORM),macosx)
UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH) UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH)
endif endif
# Utilities ifndef CONFIGURE_BUILD
ifdef CROSS_COMPILE_ARCH # Utilities
ifdef CROSS_COMPILE_ARCH
AR = $(COMPILER_PATH)ar AR = $(COMPILER_PATH)ar
AS = $(COMPILER_PATH)as AS = $(COMPILER_PATH)as
LD = $(COMPILER_PATH)ld LD = $(COMPILER_PATH)ld
MCS = $(COMPILER_PATH)mcs MCS = $(COMPILER_PATH)mcs
NM = $(COMPILER_PATH)nm NM = $(COMPILER_PATH)nm
STRIP = $(COMPILER_PATH)strip STRIP = $(COMPILER_PATH)strip
endif else
ifeq ($(PLATFORM),solaris)
AR = $(UTILS_CCS_BIN_PATH)ar AR = $(UTILS_CCS_BIN_PATH)ar
AS = $(UTILS_CCS_BIN_PATH)as AS = $(UTILS_CCS_BIN_PATH)as
LD = $(UTILS_CCS_BIN_PATH)ld LD = $(UTILS_CCS_BIN_PATH)ld
MCS = $(UTILS_CCS_BIN_PATH)mcs MCS = $(UTILS_CCS_BIN_PATH)mcs
NM = $(UTILS_CCS_BIN_PATH)nm NM = $(UTILS_CCS_BIN_PATH)nm
STRIP = $(UTILS_CCS_BIN_PATH)strip STRIP = $(UTILS_CCS_BIN_PATH)strip
endif endif
endif # CONFIGURE_BUILD
ADB = $(UTILS_COMMAND_PATH)adb ADB = $(UTILS_COMMAND_PATH)adb
BASENAME = $(UTILS_COMMAND_PATH)basename BASENAME = $(UTILS_COMMAND_PATH)basename

View file

@ -464,12 +464,13 @@ ifeq ($(OPENJDK_TARGET_OS),windows)
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d
LIBAWT_CFLAGS+=-I$(DXSDK_INCLUDE_PATH)
else else
LIBAWT_DIRS+=\ LIBAWT_DIRS+=\
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11
endif endif
LIBAWT_CFLAGS:=-D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \ LIBAWT_CFLAGS+=-D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \
$(X_CFLAGS) \ $(X_CFLAGS) \
$(foreach dir,$(LIBAWT_DIRS),-I$(dir)) $(foreach dir,$(LIBAWT_DIRS),-I$(dir))
@ -1461,7 +1462,8 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
-I$(JDK_TOPDIR)/src/share/native/sun/java2d \ -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \ -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows, \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \
-I$(DXSDK_INCLUDE_PATH), \
LDFLAGS:=$(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \ LDFLAGS:=$(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \
advapi32.lib $(WIN_AWT_LIB),\ advapi32.lib $(WIN_AWT_LIB),\
LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\ LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
@ -2907,7 +2909,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS,\
OPTIMIZATION:=LOW, \ OPTIMIZATION:=LOW, \
CFLAGS:=$(CFLAGS_JDKLIB) \ CFLAGS:=$(CFLAGS_JDKLIB) \
$(LIBJSOUND_CFLAGS) \ $(LIBJSOUND_CFLAGS) \
-DUSE_DAUDIO=TRUE, \ -DUSE_DAUDIO=TRUE \
-I$(DXSDK_INCLUDE_PATH), \
LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_ORIGIN),\ $(call SET_SHARED_LIBRARY_ORIGIN),\
LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib,\ LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib,\

View file

@ -264,6 +264,13 @@ $(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDK_JD
$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDKJRE_JDKOUT_LIB_LIST)),\ $(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDKJRE_JDKOUT_LIB_LIST)),\
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_OVERLAY_LIB_TARGETS))) $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_OVERLAY_LIB_TARGETS)))
ifneq ($(PROFILE),)
# Files in lib$(PROFILE) are excluded from the generic copying routines so
# we have to add them back in here
$(foreach f,$(CUSTOM_PROFILE_JARS),\
$(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR)/lib$(PROFILE),$(JRE_IMAGE_DIR)/lib,$f,JRE_LIB_TARGETS)))
endif
# CTE plugin security change require new empty directory lib/applet # CTE plugin security change require new empty directory lib/applet
$(JRE_IMAGE_DIR)/lib/applet: $(JRE_IMAGE_DIR)/lib/applet:
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
@ -738,11 +745,6 @@ jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \
$(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST) $(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST)
ifneq ($(PROFILE),) ifneq ($(PROFILE),)
# Files in lib$(PROFILE) are excluded from the generic copying routines so
# we have to add them back in here
$(foreach f,$(CUSTOM_PROFILE_JARS),\
$(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR)/lib$(PROFILE),$(JRE_IMAGE_DIR)/lib,$f,JRE_LIB_TARGETS)))
PROFILE_IMAGE_JARS := $(filter %.jar, $(JRE_LIB_TARGETS)) PROFILE_IMAGE_JARS := $(filter %.jar, $(JRE_LIB_TARGETS))
PROFILE_IMAGE_JARS_CHECKED := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_jars_checked PROFILE_IMAGE_JARS_CHECKED := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_jars_checked

View file

@ -330,6 +330,23 @@ tools/launcher/I18NJarTest.java macosx-all
# 8007410 # 8007410
tools/launcher/FXLauncherTest.java linux-all tools/launcher/FXLauncherTest.java linux-all
# 8004172
sun/tools/jstat/jstatGcCapacityOutput1.sh generic-all
sun/tools/jstat/jstatGcCauseOutput1.sh generic-all
sun/tools/jstat/jstatGcOldOutput1.sh generic-all
sun/tools/jstat/jstatGcOutput1.sh generic-all
sun/tools/jstat/jstatGcPermCapacityOutput1.sh generic-all
sun/tools/jstat/jstatLineCounts1.sh generic-all
sun/tools/jstat/jstatLineCounts2.sh generic-all
sun/tools/jstat/jstatLineCounts3.sh generic-all
sun/tools/jstat/jstatLineCounts4.sh generic-all
sun/tools/jstat/jstatOptions1.sh generic-all
sun/tools/jstat/jstatTimeStamp1.sh generic-all
sun/tools/jstatd/jstatdExternalRegistry.sh generic-all
sun/tools/jstatd/jstatdDefaults.sh generic-all
sun/tools/jstatd/jstatdPort.sh generic-all
sun/tools/jstatd/jstatdServerName.sh generic-all
############################################################################ ############################################################################
# jdk_jdi # jdk_jdi

View file

@ -201,3 +201,4 @@ e81839b3233792415daaab051698edc6067f1a16 jdk8-b76
89c66415168925dffe492356ff893ff248bb5603 jdk8-b77 89c66415168925dffe492356ff893ff248bb5603 jdk8-b77
af8417e590f4e76e0dfed09e71239fb102ef0d43 jdk8-b78 af8417e590f4e76e0dfed09e71239fb102ef0d43 jdk8-b78
56dfafbb9e1ad7548a4415316dc003296fb498cb jdk8-b79 56dfafbb9e1ad7548a4415316dc003296fb498cb jdk8-b79
a8227c61768499dac847ea718af6719027c949f2 jdk8-b80