This commit is contained in:
Abhijit Saha 2013-07-25 15:38:00 -07:00
commit 3c80b6dcf9
68 changed files with 1088 additions and 212 deletions

View File

@ -288,7 +288,9 @@ a2e0099b4cf70be026a7a0ba7918fcd71d57fdce jdk7u21-b09
602ad1a5b09fb9136e8bf1b708e0524fbdb35324 jdk7u21-b10
fa322ca378324750ea049f2e92357e51eca27ae4 jdk7u21-b11
450e8dde919df278fe75ae95e0eb0a6464f5bc41 jdk7u21-b30
170520883597f90771aca8251a8d089e7566e4bf jdk7u21-b50
170520883597f90771aca8251a8d089e7566e4bf jdk7u21-b12
da9a0cdf4afcfae3a7c47565e9acfd9170ba5a30 jdk7u21-b31
50bfbd21bf42f6ae4167226ac45cd79e0ab7758c jdk7u25-b03
a94c9aa356bbed13c1e2b4a9a380117ddff1668f jdk7u25-b04
29a789ae14dc09a50eb45d3445075642e77490a2 jdk7u25-b05
@ -318,6 +320,9 @@ dbe42a627813892d1bb59a4240c24f60ef22930a jdk7u40-b29
37c4268341d79b16165bdaf7e1fad489d692bc83 jdk7u25-b13
9de1fc3635def64c19c51f272f09b51d8cf0ca98 jdk7u25-b14
2197dde877124579204c5266fa9d89166760b44f jdk7u25-b15
eeb29025d52ab4ea9bc4f5afa37c3a4fbcaf0011 jdk7u25-b31
e571b5c75bd194c1aaad6e8e75b1d40f6208391c jdk7u25-b33
161e4656fea4720ececade6892247a73a2e31a42 jdk7u25-b34
9846c505054fb91762f3fd9b817d1a9760322029 jdk7u25-b30
12c2f4ce55d074f0be94781d98cbbbcf8299b666 jdk7u25-b16
40fde76d9b89f5acc63f4eeeccdc261d9999bf39 jdk7u25-b32
@ -342,6 +347,7 @@ e51f24701c608e57ba7ae69ba28bbc2daab02c4c jdk7u45-b01
da376fd5e4d68f8a45003a6e175267dc840711cc jdk7u40-b32
3fdfe7f1b06354e11e8af51b7c653c8a0adb3987 jdk7u40-b33
a1ae13479e8767329fa20774b5cea5976aaeb37b jdk7u40-b34
af755d12719e898e3af917e8a56b64ebf83019bc jdk7u40-b35
07e41ff8674c9438cb1124cf78eed8636ed5d4fa jdk7u45-b02
23c983c352a170d7a5fb7d703081daf1816d257a jdk7u45-b03
1018a8ab686da6c1be22bec3ab9d01b2dc206333 jdk7u45-b04

View File

@ -263,7 +263,7 @@ generic_debug_build:
ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/$(REL_JDK_OUTPUTDIR) \
DEBUG_NAME=$(DEBUG_NAME) \
GENERATE_DOCS=false \
BUILD_INSTALL_BUNDLES=true \
$(if $(findstring true,$(BUILD_INSTALL)),BUILD_INSTALL_BUNDLES=true,) \
CREATE_DEBUGINFO_BUNDLES=true \
$(BOOT_CYCLE_DEBUG_SETTINGS) \
generic_build_repo_series

View File

@ -327,3 +327,4 @@ c8b9201f88f4ce417df7a40efcb7fef656d94512 jdk7u40-b28
3d2b811b8a798ff3b619f8330b08f551f7fdfd80 jdk7u40-b31
c5f85903c49aa716ee3cb93361dd60a3e88d866d jdk7u40-b32
1b7fbfdc31b859097d6a365ad0ba0e8ef92b4063 jdk7u40-b33
ddd543ddf33017a15623cdf6908ae4ef2958e24e jdk7u40-b34

View File

@ -515,3 +515,5 @@ d74376b0f20be7982d824e9af6105a75cc24e020 jdk7u40-b29
15706a73a506943059a6bbf59e2ec8866a026114 hs24-b52
0b9149d22ee08fe13b4f198ff258a1348e27b8b2 jdk7u40-b33
1118c5d38ac0693d98f913485ceb3c57366cfbab hs24-b53
1274c4750118bbdb3f3aa6dbf79af4568a2cca93 jdk7u40-b34
f969880098fda55589cae8efaea5eff2c044e81e hs24-b54

View File

@ -40,8 +40,8 @@ public class BinaryTreeDictionary extends VMObject {
}
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("BinaryTreeDictionary");
totalSizeField = type.getCIntegerField("_totalSize");
Type type = db.lookupType("BinaryTreeDictionary<FreeChunk>");
totalSizeField = type.getCIntegerField("_total_size");
}
// Fields

View File

@ -41,7 +41,7 @@ public class FreeList extends VMObject {
}
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("FreeList");
Type type = db.lookupType("FreeList<FreeChunk>");
sizeField = type.getCIntegerField("_size");
countField = type.getCIntegerField("_count");
headerSize = type.getSize();

View File

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
HS_MAJOR_VER=24
HS_MINOR_VER=0
HS_BUILD_NUMBER=53
HS_BUILD_NUMBER=54
JDK_MAJOR_VER=1
JDK_MINOR_VER=7

View File

@ -46,6 +46,7 @@ ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
include $(MAKEFILES_DIR)/zeroshark.make
else
include $(MAKEFILES_DIR)/$(BUILDARCH).make
-include $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make
endif
# set VPATH so make knows where to look for source files
@ -388,4 +389,5 @@ build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) dtraceChe
install: install_jvm install_jsig install_saproc
.PHONY: default build install install_jvm
.PHONY: default build install install_jvm $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make

View File

@ -231,10 +231,10 @@ inline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const {
#endif // CC_INTERP
inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
// note: adjust this code if the link argument in StubGenerator::call_stub() changes!
const Argument link = Argument(0, false);
return (JavaCallWrapper*)sp()[link.as_in().as_register()->sp_offset_in_saved_window()];
return (JavaCallWrapper**)&sp()[link.as_in().as_register()->sp_offset_in_saved_window()];
}

View File

@ -270,11 +270,10 @@ inline jint frame::interpreter_frame_expression_stack_direction() { return -1; }
// Entry frames
inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
return (JavaCallWrapper*)at(entry_frame_call_wrapper_offset);
inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
return (JavaCallWrapper**)addr_at(entry_frame_call_wrapper_offset);
}
// Compiled frames
inline int frame::local_offset_for_compiler(int local_index, int nof_args, int max_nof_locals, int max_nof_monitors) {

View File

@ -290,7 +290,7 @@ class StubGenerator: public StubCodeGenerator {
__ stmxcsr(mxcsr_save);
__ movl(rax, mxcsr_save);
__ andl(rax, MXCSR_MASK); // Only check control and mask bits
ExternalAddress mxcsr_std(StubRoutines::x86::mxcsr_std());
ExternalAddress mxcsr_std(StubRoutines::addr_mxcsr_std());
__ cmp32(rax, mxcsr_std);
__ jcc(Assembler::equal, skip_ldmx);
__ ldmxcsr(mxcsr_std);
@ -740,17 +740,18 @@ class StubGenerator: public StubCodeGenerator {
if (CheckJNICalls) {
Label ok_ret;
ExternalAddress mxcsr_std(StubRoutines::addr_mxcsr_std());
__ push(rax);
__ subptr(rsp, wordSize); // allocate a temp location
__ stmxcsr(mxcsr_save);
__ movl(rax, mxcsr_save);
__ andl(rax, MXCSR_MASK); // Only check control and mask bits
__ cmpl(rax, *(int *)(StubRoutines::x86::mxcsr_std()));
__ cmp32(rax, mxcsr_std);
__ jcc(Assembler::equal, ok_ret);
__ warn("MXCSR changed by native JNI code, use -XX:+RestoreMXCSROnJNICall");
__ ldmxcsr(ExternalAddress(StubRoutines::x86::mxcsr_std()));
__ ldmxcsr(mxcsr_std);
__ bind(ok_ret);
__ addptr(rsp, wordSize);
@ -3719,12 +3720,35 @@ class StubGenerator: public StubCodeGenerator {
return stub->entry_point();
}
void create_control_words() {
// Round to nearest, 53-bit mode, exceptions masked
StubRoutines::_fpu_cntrl_wrd_std = 0x027F;
// Round to zero, 53-bit mode, exception mased
StubRoutines::_fpu_cntrl_wrd_trunc = 0x0D7F;
// Round to nearest, 24-bit mode, exceptions masked
StubRoutines::_fpu_cntrl_wrd_24 = 0x007F;
// Round to nearest, 64-bit mode, exceptions masked
StubRoutines::_fpu_cntrl_wrd_64 = 0x037F;
// Round to nearest, 64-bit mode, exceptions masked
StubRoutines::_mxcsr_std = 0x1F80;
// Note: the following two constants are 80-bit values
// layout is critical for correct loading by FPU.
// Bias for strict fp multiply/divide
StubRoutines::_fpu_subnormal_bias1[0]= 0x00000000; // 2^(-15360) == 0x03ff 8000 0000 0000 0000
StubRoutines::_fpu_subnormal_bias1[1]= 0x80000000;
StubRoutines::_fpu_subnormal_bias1[2]= 0x03ff;
// Un-Bias for strict fp multiply/divide
StubRoutines::_fpu_subnormal_bias2[0]= 0x00000000; // 2^(+15360) == 0x7bff 8000 0000 0000 0000
StubRoutines::_fpu_subnormal_bias2[1]= 0x80000000;
StubRoutines::_fpu_subnormal_bias2[2]= 0x7bff;
}
// Initialization
void generate_initial() {
// Generates all stubs and initializes the entry points
// This platform-specific stub is needed by generate_call_stub()
StubRoutines::x86::_mxcsr_std = generate_fp_mask("mxcsr_std", 0x0000000000001F80);
// This platform-specific settings are needed by generate_call_stub()
create_control_words();
// entry points that exist in all platforms Note: This is code
// that could be shared among different platforms - however the

View File

@ -55,5 +55,4 @@ address StubRoutines::x86::_float_sign_mask = NULL;
address StubRoutines::x86::_float_sign_flip = NULL;
address StubRoutines::x86::_double_sign_mask = NULL;
address StubRoutines::x86::_double_sign_flip = NULL;
address StubRoutines::x86::_mxcsr_std = NULL;
address StubRoutines::x86::_key_shuffle_mask_addr = NULL;

View File

@ -53,7 +53,6 @@ class x86 {
static address _float_sign_flip;
static address _double_sign_mask;
static address _double_sign_flip;
static address _mxcsr_std;
// shuffle mask for fixing up 128-bit words consisting of big-endian 32-bit integers
static address _key_shuffle_mask_addr;
@ -114,11 +113,6 @@ class x86 {
return _double_sign_flip;
}
static address mxcsr_std()
{
return _mxcsr_std;
}
static address key_shuffle_mask_addr() { return _key_shuffle_mask_addr; }
};

View File

@ -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
@ -452,6 +452,30 @@ AttachOperation* AttachListener::dequeue() {
return op;
}
// Performs initialization at vm startup
// For BSD we remove any stale .java_pid file which could cause
// an attaching process to think we are ready to receive on the
// domain socket before we are properly initialized
void AttachListener::vm_start() {
char fn[UNIX_PATH_MAX];
struct stat64 st;
int ret;
int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d",
os::get_temp_directory(), os::current_process_id());
assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow");
RESTARTABLE(::stat64(fn, &st), ret);
if (ret == 0) {
ret = ::unlink(fn);
if (ret == -1) {
debug_only(warning("failed to remove stale attach pid file at %s", fn));
}
}
}
int AttachListener::pd_init() {
JavaThread* thread = JavaThread::current();
ThreadBlockInVM tbivm(thread);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2010, 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
@ -435,6 +435,30 @@ AttachOperation* AttachListener::dequeue() {
return op;
}
// Performs initialization at vm startup
// For Linux we remove any stale .java_pid file which could cause
// an attaching process to think we are ready to receive on the
// domain socket before we are properly initialized
void AttachListener::vm_start() {
char fn[UNIX_PATH_MAX];
struct stat64 st;
int ret;
int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d",
os::get_temp_directory(), os::current_process_id());
assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow");
RESTARTABLE(::stat64(fn, &st), ret);
if (ret == 0) {
ret = ::unlink(fn);
if (ret == -1) {
debug_only(warning("failed to remove stale attach pid file at %s", fn));
}
}
}
int AttachListener::pd_init() {
JavaThread* thread = JavaThread::current();
ThreadBlockInVM tbivm(thread);

View File

@ -192,4 +192,53 @@ void os::Posix::print_uname_info(outputStream* st) {
st->cr();
}
os::WatcherThreadCrashProtection::WatcherThreadCrashProtection() {
assert(Thread::current()->is_Watcher_thread(), "Must be WatcherThread");
}
/*
* See the caveats for this class in os_posix.hpp
* Protects the callback call so that SIGSEGV / SIGBUS jumps back into this
* method and returns false. If none of the signals are raised, returns true.
* The callback is supposed to provide the method that should be protected.
*/
bool os::WatcherThreadCrashProtection::call(os::CrashProtectionCallback& cb) {
assert(Thread::current()->is_Watcher_thread(), "Only for WatcherThread");
assert(!WatcherThread::watcher_thread()->has_crash_protection(),
"crash_protection already set?");
if (sigsetjmp(_jmpbuf, 1) == 0) {
// make sure we can see in the signal handler that we have crash protection
// installed
WatcherThread::watcher_thread()->set_crash_protection(this);
cb.call();
// and clear the crash protection
WatcherThread::watcher_thread()->set_crash_protection(NULL);
return true;
}
// this happens when we siglongjmp() back
WatcherThread::watcher_thread()->set_crash_protection(NULL);
return false;
}
void os::WatcherThreadCrashProtection::restore() {
assert(WatcherThread::watcher_thread()->has_crash_protection(),
"must have crash protection");
siglongjmp(_jmpbuf, 1);
}
void os::WatcherThreadCrashProtection::check_crash_protection(int sig,
Thread* thread) {
if (thread != NULL &&
thread->is_Watcher_thread() &&
WatcherThread::watcher_thread()->has_crash_protection()) {
if (sig == SIGSEGV || sig == SIGBUS) {
WatcherThread::watcher_thread()->crash_protection()->restore();
}
}
}

View File

@ -37,5 +37,24 @@ protected:
};
/*
* Crash protection for the watcher thread. Wrap the callback
* with a sigsetjmp and in case of a SIGSEGV/SIGBUS we siglongjmp
* back.
* To be able to use this - don't take locks, don't rely on destructors,
* don't make OS library calls, don't allocate memory, don't print,
* don't call code that could leave the heap / memory in an inconsistent state,
* or anything else where we are not in control if we suddenly jump out.
*/
class WatcherThreadCrashProtection : public StackObj {
public:
WatcherThreadCrashProtection();
bool call(os::CrashProtectionCallback& cb);
static void check_crash_protection(int signal, Thread* thread);
private:
void restore();
sigjmp_buf _jmpbuf;
};
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2010, 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
@ -576,6 +576,30 @@ AttachOperation* AttachListener::dequeue() {
return op;
}
// Performs initialization at vm startup
// For Solaris we remove any stale .java_pid file which could cause
// an attaching process to think we are ready to receive a door_call
// before we are properly initialized
void AttachListener::vm_start() {
char fn[PATH_MAX+1];
struct stat64 st;
int ret;
int n = snprintf(fn, sizeof(fn), "%s/.java_pid%d",
os::get_temp_directory(), os::current_process_id());
assert(n < sizeof(fn), "java_pid file name buffer overflow");
RESTARTABLE(::stat64(fn, &st), ret);
if (ret == 0) {
ret = ::unlink(fn);
if (ret == -1) {
debug_only(warning("failed to remove stale attach pid file at %s", fn));
}
}
}
int AttachListener::pd_init() {
JavaThread* thread = JavaThread::current();
ThreadBlockInVM tbivm(thread);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2010, 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
@ -358,6 +358,10 @@ AttachOperation* AttachListener::dequeue() {
return op;
}
void AttachListener::vm_start() {
// nothing to do
}
int AttachListener::pd_init() {
return Win32AttachListener::init();
}

View File

@ -4627,6 +4627,34 @@ void os::pause() {
}
}
os::WatcherThreadCrashProtection::WatcherThreadCrashProtection() {
assert(Thread::current()->is_Watcher_thread(), "Must be WatcherThread");
}
/*
* See the caveats for this class in os_windows.hpp
* Protects the callback call so that raised OS EXCEPTIONS causes a jump back
* into this method and returns false. If no OS EXCEPTION was raised, returns
* true.
* The callback is supposed to provide the method that should be protected.
*/
bool os::WatcherThreadCrashProtection::call(os::CrashProtectionCallback& cb) {
assert(Thread::current()->is_Watcher_thread(), "Only for WatcherThread");
assert(!WatcherThread::watcher_thread()->has_crash_protection(),
"crash_protection already set?");
bool success = true;
__try {
WatcherThread::watcher_thread()->set_crash_protection(this);
cb.call();
} __except(EXCEPTION_EXECUTE_HANDLER) {
// only for protection, nothing to do
success = false;
}
WatcherThread::watcher_thread()->set_crash_protection(NULL);
return success;
}
// An Event wraps a win32 "CreateEvent" kernel handle.
//
// We have a number of choices regarding "CreateEvent" win32 handle leakage:

View File

@ -102,6 +102,20 @@ class win32 {
static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e);
};
/*
* Crash protection for the watcher thread. Wrap the callback
* with a __try { call() }
* To be able to use this - don't take locks, don't rely on destructors,
* don't make OS library calls, don't allocate memory, don't print,
* don't call code that could leave the heap / memory in an inconsistent state,
* or anything else where we are not in control if we suddenly jump out.
*/
class WatcherThreadCrashProtection : public StackObj {
public:
WatcherThreadCrashProtection();
bool call(os::CrashProtectionCallback& cb);
};
class PlatformEvent : public CHeapObj<mtInternal> {
private:
double CachePad [4] ; // increase odds that _Event is sole occupant of cache line

View File

@ -402,6 +402,10 @@ JVM_handle_bsd_signal(int sig,
Thread* t = ThreadLocalStorage::get_thread_slow();
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
// (no destructors can be run)
os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
SignalHandlerMark shm(t);
// Note: it's not uncommon that JNI code uses signal/sigset to install

View File

@ -553,6 +553,10 @@ JVM_handle_linux_signal(int sig,
Thread* t = ThreadLocalStorage::get_thread_slow();
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
// (no destructors can be run)
os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
SignalHandlerMark shm(t);
// Note: it's not uncommon that JNI code uses signal/sigset to install

View File

@ -219,6 +219,10 @@ JVM_handle_linux_signal(int sig,
Thread* t = ThreadLocalStorage::get_thread_slow();
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
// (no destructors can be run)
os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
SignalHandlerMark shm(t);
// Note: it's not uncommon that JNI code uses signal/sigset to install

View File

@ -315,6 +315,10 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
Thread* t = ThreadLocalStorage::get_thread_slow();
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
// (no destructors can be run)
os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
SignalHandlerMark shm(t);
if(sig == SIGPIPE || sig == SIGXFSZ) {

View File

@ -375,6 +375,10 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
Thread* t = ThreadLocalStorage::get_thread_slow(); // slow & steady
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
// (no destructors can be run)
os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
SignalHandlerMark shm(t);
if(sig == SIGPIPE || sig == SIGXFSZ) {

View File

@ -138,6 +138,16 @@ bool BCEscapeAnalyzer::is_arg_stack(ArgumentMap vars){
return false;
}
// return true if all argument elements of vars are returned
bool BCEscapeAnalyzer::returns_all(ArgumentMap vars) {
for (int i = 0; i < _arg_size; i++) {
if (vars.contains(i) && !_arg_returned.test(i)) {
return false;
}
}
return true;
}
void BCEscapeAnalyzer::clear_bits(ArgumentMap vars, VectorSet &bm) {
for (int i = 0; i < _arg_size; i++) {
if (vars.contains(i)) {
@ -166,6 +176,11 @@ void BCEscapeAnalyzer::set_global_escape(ArgumentMap vars, bool merge) {
if (vars.contains_unknown() || vars.contains_vars()) {
_return_allocated = false;
}
if (_return_local && vars.contains_vars() && !returns_all(vars)) {
// Return result should be invalidated if args in new
// state are not recorded in return state.
_return_local = false;
}
}
}

View File

@ -79,6 +79,7 @@ class BCEscapeAnalyzer : public ResourceObj {
void set_returned(ArgumentMap vars);
bool is_argument(ArgumentMap vars);
bool is_arg_stack(ArgumentMap vars);
bool returns_all(ArgumentMap vars);
void clear_bits(ArgumentMap vars, VectorSet &bs);
void set_method_escape(ArgumentMap vars);
void set_global_escape(ArgumentMap vars, bool merge = false);

View File

@ -870,7 +870,7 @@ bool G1CollectorPolicy::need_to_start_conc_mark(const char* source, size_t alloc
size_t alloc_byte_size = alloc_word_size * HeapWordSize;
if ((cur_used_bytes + alloc_byte_size) > marking_initiating_used_threshold) {
if (gcs_are_young()) {
if (gcs_are_young() && !_last_young_gc) {
ergo_verbose5(ErgoConcCycles,
"request concurrent cycle initiation",
ergo_format_reason("occupancy higher than threshold")
@ -928,7 +928,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua
last_pause_included_initial_mark = during_initial_mark_pause();
if (last_pause_included_initial_mark) {
record_concurrent_mark_init_end(0.0);
} else if (!_last_young_gc && need_to_start_conc_mark("end of GC")) {
} else if (need_to_start_conc_mark("end of GC")) {
// Note: this might have already been set, if during the last
// pause we decided to start a cycle but at the beginning of
// this pause we decided to postpone it. That's OK.

View File

@ -2303,26 +2303,26 @@ void Matcher::validate_null_checks( ) {
// atomic instruction acting as a store_load barrier without any
// intervening volatile load, and thus we don't need a barrier here.
// We retain the Node to act as a compiler ordering barrier.
bool Matcher::post_store_load_barrier(const Node *vmb) {
Compile *C = Compile::current();
assert( vmb->is_MemBar(), "" );
assert( vmb->Opcode() != Op_MemBarAcquire, "" );
const MemBarNode *mem = (const MemBarNode*)vmb;
bool Matcher::post_store_load_barrier(const Node* vmb) {
Compile* C = Compile::current();
assert(vmb->is_MemBar(), "");
assert(vmb->Opcode() != Op_MemBarAcquire, "");
const MemBarNode* membar = vmb->as_MemBar();
// Get the Proj node, ctrl, that can be used to iterate forward
Node *ctrl = NULL;
DUIterator_Fast imax, i = mem->fast_outs(imax);
while( true ) {
ctrl = mem->fast_out(i); // Throw out-of-bounds if proj not found
assert( ctrl->is_Proj(), "only projections here" );
ProjNode *proj = (ProjNode*)ctrl;
if( proj->_con == TypeFunc::Control &&
!C->node_arena()->contains(ctrl) ) // Unmatched old-space only
// Get the Ideal Proj node, ctrl, that can be used to iterate forward
Node* ctrl = NULL;
for (DUIterator_Fast imax, i = membar->fast_outs(imax); i < imax; i++) {
Node* p = membar->fast_out(i);
assert(p->is_Proj(), "only projections here");
if ((p->as_Proj()->_con == TypeFunc::Control) &&
!C->node_arena()->contains(p)) { // Unmatched old-space only
ctrl = p;
break;
i++;
}
}
assert((ctrl != NULL), "missing control projection");
for( DUIterator_Fast jmax, j = ctrl->fast_outs(jmax); j < jmax; j++ ) {
for (DUIterator_Fast jmax, j = ctrl->fast_outs(jmax); j < jmax; j++) {
Node *x = ctrl->fast_out(j);
int xop = x->Opcode();
@ -2334,37 +2334,36 @@ bool Matcher::post_store_load_barrier(const Node *vmb) {
// that a monitor exit operation contains a serializing instruction.
if (xop == Op_MemBarVolatile ||
xop == Op_FastLock ||
xop == Op_CompareAndSwapL ||
xop == Op_CompareAndSwapP ||
xop == Op_CompareAndSwapN ||
xop == Op_CompareAndSwapI)
xop == Op_CompareAndSwapI) {
return true;
}
// Op_FastLock previously appeared in the Op_* list above.
// With biased locking we're no longer guaranteed that a monitor
// enter operation contains a serializing instruction.
if ((xop == Op_FastLock) && !UseBiasedLocking) {
return true;
}
if (x->is_MemBar()) {
// We must retain this membar if there is an upcoming volatile
// load, which will be preceded by acquire membar.
if (xop == Op_MemBarAcquire)
// load, which will be followed by acquire membar.
if (xop == Op_MemBarAcquire) {
return false;
// For other kinds of barriers, check by pretending we
// are them, and seeing if we can be removed.
else
return post_store_load_barrier((const MemBarNode*)x);
} else {
// For other kinds of barriers, check by pretending we
// are them, and seeing if we can be removed.
return post_store_load_barrier(x->as_MemBar());
}
}
// Delicate code to detect case of an upcoming fastlock block
if( x->is_If() && x->req() > 1 &&
!C->node_arena()->contains(x) ) { // Unmatched old-space only
Node *iff = x;
Node *bol = iff->in(1);
// The iff might be some random subclass of If or bol might be Con-Top
if (!bol->is_Bool()) return false;
assert( bol->req() > 1, "" );
return (bol->in(1)->Opcode() == Op_FastUnlock);
}
// probably not necessary to check for these
if (x->is_Call() || x->is_SafePoint() || x->is_block_proj())
if (x->is_Call() || x->is_SafePoint() || x->is_block_proj()) {
return false;
}
}
return false;
}

View File

@ -277,25 +277,7 @@ void Parse::do_put_xxx(Node* obj, ciField* field, bool is_field) {
// If reference is volatile, prevent following volatiles ops from
// floating up before the volatile write.
if (is_vol) {
// First place the specific membar for THIS volatile index. This first
// membar is dependent on the store, keeping any other membars generated
// below from floating up past the store.
int adr_idx = C->get_alias_index(adr_type);
insert_mem_bar_volatile(Op_MemBarVolatile, adr_idx, store);
// Now place a membar for AliasIdxBot for the unknown yet-to-be-parsed
// volatile alias indices. Skip this if the membar is redundant.
if (adr_idx != Compile::AliasIdxBot) {
insert_mem_bar_volatile(Op_MemBarVolatile, Compile::AliasIdxBot, store);
}
// Finally, place alias-index-specific membars for each volatile index
// that isn't the adr_idx membar. Typically there's only 1 or 2.
for( int i = Compile::AliasIdxRaw; i < C->num_alias_types(); i++ ) {
if (i != adr_idx && C->alias_type(i)->is_volatile()) {
insert_mem_bar_volatile(Op_MemBarVolatile, i, store);
}
}
insert_mem_bar(Op_MemBarVolatile); // Use fat membar
}
// If the field is final, the rules of Java say we are in <init> or <clinit>.

View File

@ -31,6 +31,7 @@
#include "oops/oop.inline.hpp"
#include "oops/oop.inline2.hpp"
#include "prims/forte.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/thread.hpp"
#include "runtime/vframe.hpp"
#include "runtime/vframeArray.hpp"
@ -296,10 +297,14 @@ static bool find_initial_Java_frame(JavaThread* thread,
for (loop_count = 0; loop_count < loop_max; loop_count++) {
if (candidate.is_first_frame()) {
if (candidate.is_entry_frame()) {
// jcw is NULL if the java call wrapper couldn't be found
JavaCallWrapper *jcw = candidate.entry_frame_call_wrapper_if_safe(thread);
// If initial frame is frame from StubGenerator and there is no
// previous anchor, there are no java frames associated with a method
return false;
if (jcw == NULL || jcw->is_first_frame()) {
return false;
}
}
if (candidate.is_interpreted_frame()) {

View File

@ -245,6 +245,27 @@ static ObsoleteFlag obsolete_jvm_flags[] = {
JDK_Version::jdk_update(6,27), JDK_Version::jdk(8) },
{ "AllowTransitionalJSR292", JDK_Version::jdk(7), JDK_Version::jdk(8) },
{ "UseCompressedStrings", JDK_Version::jdk(7), JDK_Version::jdk(8) },
{ "AlwaysInflate", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "AnonymousClasses", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "CMSOldPLABReactivityCeiling",
JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "EventLogLength", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "GCOverheadReporting", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "GCOverheadReportingPeriodMS",
JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "HPILibPath", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "PreSpinYield", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "PreBlockSpin", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "PostSpinYield", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "PreserveMarkStackSize",
JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "ReadSpinIterations", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "StressTieredRuntime", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "Tier1Inline", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "Tier1FreqInlineSize", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "Tier1MaxInlineSize", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "Tier1LoopOptsCount", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
{ "UseSpinning", JDK_Version::jdk_update(7,40), JDK_Version::jdk(8) },
#ifdef PRODUCT
{ "DesiredMethodLimit",
JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },

View File

@ -220,9 +220,20 @@ bool frame::is_first_java_frame() const {
bool frame::entry_frame_is_first() const {
return entry_frame_call_wrapper()->anchor()->last_Java_sp() == NULL;
return entry_frame_call_wrapper()->is_first_frame();
}
JavaCallWrapper* frame::entry_frame_call_wrapper_if_safe(JavaThread* thread) const {
JavaCallWrapper** jcw = entry_frame_call_wrapper_addr();
address addr = (address) jcw;
// addr must be within the usable part of the stack
if (thread->is_in_usable_stack(addr)) {
return *jcw;
}
return NULL;
}
bool frame::should_be_deoptimized() const {
if (_deopt_state == is_deoptimized ||

View File

@ -354,7 +354,9 @@ class frame VALUE_OBJ_CLASS_SPEC {
public:
// Entry frames
JavaCallWrapper* entry_frame_call_wrapper() const;
JavaCallWrapper* entry_frame_call_wrapper() const { return *entry_frame_call_wrapper_addr(); }
JavaCallWrapper* entry_frame_call_wrapper_if_safe(JavaThread* thread) const;
JavaCallWrapper** entry_frame_call_wrapper_addr() const;
intptr_t* entry_frame_argument_at(int offset) const;
// tells whether there is another chunk of Delta stack above

View File

@ -91,6 +91,8 @@ class JavaCallWrapper: StackObj {
oop receiver() { return _receiver; }
void oops_do(OopClosure* f);
bool is_first_frame() const { return _anchor.last_Java_sp() == NULL; }
};

View File

@ -1373,6 +1373,10 @@ void Monitor::check_prelock_state(Thread *thread) {
debug_only(if (rank() != Mutex::special) \
thread->check_for_valid_safepoint_state(false);)
}
if (thread->is_Watcher_thread()) {
assert(!WatcherThread::watcher_thread()->has_crash_protection(),
"locking not allowed when crash protection is set");
}
}
void Monitor::check_block_state(Thread *thread) {

View File

@ -564,6 +564,22 @@ void* os::malloc(size_t size, MEMFLAGS memflags, address caller) {
NOT_PRODUCT(inc_stat_counter(&num_mallocs, 1));
NOT_PRODUCT(inc_stat_counter(&alloc_bytes, size));
#ifdef ASSERT
// checking for the WatcherThread and crash_protection first
// since os::malloc can be called when the libjvm.{dll,so} is
// first loaded and we don't have a thread yet.
// try to find the thread after we see that the watcher thread
// exists and has crash protection.
WatcherThread *wt = WatcherThread::watcher_thread();
if (wt != NULL && wt->has_crash_protection()) {
Thread* thread = ThreadLocalStorage::get_thread_slow();
if (thread == wt) {
assert(!wt->has_crash_protection(),
"Can't malloc with crash protection from WatcherThread");
}
}
#endif
if (size == 0) {
// return a valid pointer if size is zero
// if NULL is returned the calling functions assume out of memory.

View File

@ -32,15 +32,18 @@
#include "utilities/top.hpp"
#ifdef TARGET_OS_FAMILY_linux
# include "jvm_linux.h"
# include <setjmp.h>
#endif
#ifdef TARGET_OS_FAMILY_solaris
# include "jvm_solaris.h"
# include <setjmp.h>
#endif
#ifdef TARGET_OS_FAMILY_windows
# include "jvm_windows.h"
#endif
#ifdef TARGET_OS_FAMILY_bsd
# include "jvm_bsd.h"
# include <setjmp.h>
#endif
// os defines the interface to operating system; this includes traditional
@ -734,6 +737,10 @@ class os: AllStatic {
#include "runtime/os_ext.hpp"
public:
class CrashProtectionCallback : public StackObj {
public:
virtual void call() = 0;
};
// Platform dependent stuff
#ifdef TARGET_OS_FAMILY_linux
@ -919,6 +926,7 @@ class os: AllStatic {
char pathSep);
static bool set_boot_path(char fileSep, char pathSep);
static char** split_path(const char* path, int* n);
};
// Note that "PAUSE" is almost always used with synchronization

View File

@ -936,6 +936,14 @@ bool Thread::is_in_stack(address adr) const {
}
bool Thread::is_in_usable_stack(address adr) const {
size_t stack_guard_size = os::uses_stack_guard_pages() ? (StackYellowPages + StackRedPages) * os::vm_page_size() : 0;
size_t usable_stack_size = _stack_size - stack_guard_size;
return ((adr < stack_base()) && (adr >= stack_base() - usable_stack_size));
}
// We had to move these methods here, because vm threads get into ObjectSynchronizer::enter
// However, there is a note in JavaThread::is_lock_owned() about the VM threads not being
// used for compilation in the future. If that change is made, the need for these methods
@ -1200,7 +1208,7 @@ WatcherThread* WatcherThread::_watcher_thread = NULL;
bool WatcherThread::_startable = false;
volatile bool WatcherThread::_should_terminate = false;
WatcherThread::WatcherThread() : Thread() {
WatcherThread::WatcherThread() : Thread(), _crash_protection(NULL) {
assert(watcher_thread() == NULL, "we can only allocate one WatcherThread");
if (os::create_thread(this, os::watcher_thread)) {
_watcher_thread = this;
@ -3608,6 +3616,7 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
// Start Attach Listener if +StartAttachListener or it can't be started lazily
if (!DisableAttachMechanism) {
AttachListener::vm_start();
if (StartAttachListener || AttachListener::init_at_startup()) {
AttachListener::init();
}

View File

@ -506,6 +506,9 @@ public:
// Check if address is in the stack of the thread (not just for locks).
// Warning: the method can only be used on the running thread
bool is_in_stack(address adr) const;
// Check if address is in the usable part of the stack (excludes protected
// guard pages)
bool is_in_usable_stack(address adr) const;
// Sets this thread as starting thread. Returns failure if thread
// creation fails due to lack of memory, too many threads etc.
@ -713,6 +716,8 @@ class WatcherThread: public Thread {
static bool _startable;
volatile static bool _should_terminate; // updated without holding lock
os::WatcherThreadCrashProtection* _crash_protection;
public:
enum SomeConstants {
delay_interval = 10 // interrupt delay in milliseconds
@ -740,6 +745,14 @@ class WatcherThread: public Thread {
// Otherwise the first task to enroll will trigger the start
static void make_startable();
void set_crash_protection(os::WatcherThreadCrashProtection* crash_protection) {
assert(Thread::current()->is_Watcher_thread(), "Can only be set by WatcherThread");
_crash_protection = crash_protection;
}
bool has_crash_protection() const { return _crash_protection != NULL; }
os::WatcherThreadCrashProtection* crash_protection() const { return _crash_protection; }
private:
int sleep() const;
};

View File

@ -49,6 +49,7 @@ struct AttachOperationFunctionInfo {
class AttachListener: AllStatic {
public:
static void vm_start();
static void init();
static void abort();

View File

@ -83,13 +83,13 @@ void MemTracker::init_tracking_options(const char* option_line) {
} else if (strcmp(option_line, "=detail") == 0) {
// detail relies on a stack-walking ability that may not
// be available depending on platform and/or compiler flags
if (PLATFORM_NMT_DETAIL_SUPPORTED) {
#if PLATFORM_NATIVE_STACK_WALKING_SUPPORTED
_tracking_level = NMT_detail;
} else {
#else
jio_fprintf(defaultStream::error_stream(),
"NMT detail is not supported on this platform. Using NMT summary instead.\n");
_tracking_level = NMT_summary;
}
#endif
} else if (strcmp(option_line, "=off") != 0) {
vm_exit_during_initialization("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL);
}
@ -387,6 +387,7 @@ void MemTracker::enqueue_pending_recorder(MemRecorder* rec) {
#define SAFE_SEQUENCE_THRESHOLD 30
#define HIGH_GENERATION_THRESHOLD 60
#define MAX_RECORDER_THREAD_RATIO 30
#define MAX_RECORDER_PER_THREAD 100
void MemTracker::sync() {
assert(_tracking_level > NMT_off, "NMT is not enabled");
@ -439,8 +440,14 @@ void MemTracker::sync() {
// means that worker thread is lagging behind in processing them.
if (!AutoShutdownNMT) {
_slowdown_calling_thread = (MemRecorder::_instance_count > MAX_RECORDER_THREAD_RATIO * _thread_count);
} else {
// If auto shutdown is on, enforce MAX_RECORDER_PER_THREAD threshold to prevent OOM
if (MemRecorder::_instance_count >= _thread_count * MAX_RECORDER_PER_THREAD) {
shutdown(NMT_out_of_memory);
}
}
// check _worker_thread with lock to avoid racing condition
if (_worker_thread != NULL) {
_worker_thread->at_sync_point(pending_recorders, instanceKlass::number_of_instance_classes());

View File

@ -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
@ -63,5 +63,7 @@ typedef u8 stacktraceid;
typedef u8 methodid;
typedef u8 fieldid;
class TraceUnicodeString;
#endif // SHARE_VM_TRACE_TRACEDATATYPES_HPP

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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
@ -55,18 +55,6 @@ Before we can use it we need also define a primary field data type:
type="u8" sizeop="sizeof(u1)"/>
Now we can use the content + data type in declaring event fields.
Remember however, that for us to be able to resolve the value later we must also add
creating the constant pool data in VM_JFRCheckpoint::write_checkpoint
...
//CGMODE
w->be_uint(CONTENT_TYPE_GCMODE);
w->be_uint(MM_GC_MODE_UNINITIALIZED);
for (i = 0; i < MM_GC_MODE_UNINITIALIZED; i++) {
w->uchar(i);
w->write_utf8(gcModeGetName(i));
}
-->
<types>
@ -81,10 +69,6 @@ creating the constant pool data in VM_JFRCheckpoint::write_checkpoint
<value type="OSTHREAD" field="thread" label="VM Thread"/>
</content_type>
<!-- The first argument ("JavaThread") is misleading, it's really a
java.lang.Thread id (long), but Mission Control depends on the name
being "JavaThread" so it shouldn't be changed.
-->
<content_type id="JavaThread" hr_name="Java thread"
type="U8" builtin_type="JAVALANGTHREAD">
<value type="OSTHREAD" field="thread" label="OS Thread ID"/>
@ -285,6 +269,10 @@ creating the constant pool data in VM_JFRCheckpoint::write_checkpoint
<primary_type symbol="UTF8" datatype="UTF8" contenttype="NONE"
type="const char *" sizeop="sizeof_utf(%)"/>
<!-- UTF-16 encoded (Unicode) string, max length maxjuint -->
<primary_type symbol="STRING" datatype="STRING" contenttype="NONE"
type="TraceUnicodeString*" sizeop="sizeof_unicode(%)"/>
<!-- Symbol* constant. Note that this may currently ONLY be used by
classes, methods fields. This restriction might be lifted. -->
<primary_type symbol="SYMBOL" datatype="U8" contenttype="SYMBOL"

View File

@ -1,28 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 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.
-->
<!--
Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.

View File

@ -354,12 +354,12 @@ extern int LogMinObjAlignmentInBytes;
#endif
/*
* If a platform does not support NMT_detail
* If a platform does not support native stack walking
* the platform specific globalDefinitions (above)
* can set PLATFORM_NMT_DETAIL_SUPPORTED to false
* can set PLATFORM_NATIVE_STACK_WALKING_SUPPORTED to 0
*/
#ifndef PLATFORM_NMT_DETAIL_SUPPORTED
#define PLATFORM_NMT_DETAIL_SUPPORTED true
#ifndef PLATFORM_NATIVE_STACK_WALKING_SUPPORTED
#define PLATFORM_NATIVE_STACK_WALKING_SUPPORTED 1
#endif
// The byte alignment to be used by Arena::Amalloc. See bugid 4169348.

View File

@ -0,0 +1,82 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8020215
* @summary Different execution plan when using JIT vs interpreter
* @run main Test8020215
*/
import java.util.ArrayList;
import java.util.List;
public class Test8020215 {
public static class NamedObject {
public int id;
public String name;
public NamedObject(int id, String name) {
this.id = id;
this.name = name;
}
}
public static class NamedObjectList {
public List<NamedObject> namedObjectList = new ArrayList<NamedObject>();
public NamedObject getBest(int id) {
NamedObject bestObject = null;
for (NamedObject o : namedObjectList) {
bestObject = id==o.id ? getBetter(bestObject, o) : bestObject;
}
return (bestObject != null) ? bestObject : null;
}
private static NamedObject getBetter(NamedObject p1, NamedObject p2) {
return (p1 == null) ? p2 : (p2 == null) ? p1 : (p2.name.compareTo(p1.name) >= 0) ? p2 : p1;
}
}
static void test(NamedObjectList b, int i) {
NamedObject x = b.getBest(2);
// test
if (x == null) {
throw new RuntimeException("x should never be null here! (i=" + i + ")");
}
}
public static void main(String[] args) {
// setup
NamedObjectList b = new NamedObjectList();
for (int i = 0; i < 10000; i++) {
b.namedObjectList.add(new NamedObject(1, "2012-12-31"));
}
b.namedObjectList.add(new NamedObject(2, "2013-12-31"));
// execution
for (int i = 0; i < 12000; i++) {
test(b, i);
}
System.out.println("PASSED");
}
}

View File

@ -0,0 +1,42 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8020433
* @summary Crash when using -XX:+RestoreMXCSROnJNICalls
* @library /testlibrary
*
*/
import com.oracle.java.testlibrary.*;
public class RestoreMXCSR {
public static void main(String[] args) throws Exception {
ProcessBuilder pb;
OutputAnalyzer out;
pb = ProcessTools.createJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version");
out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
}
}

View File

@ -0,0 +1,163 @@
/*
* Copyright 2013 SAP AG. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 8007898
* @summary Incorrect optimization of Memory Barriers in Matcher::post_store_load_barrier().
* @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest
* @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest
* @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest
* @author Martin Doerr martin DOT doerr AT sap DOT com
*
* Run 3 times since the failure is intermittent.
*/
public class DekkerTest {
/*
Read After Write Test (basically a simple Dekker test with volatile variables)
Derived from the original jcstress test, available at:
http://hg.openjdk.java.net/code-tools/jcstress/file/6c339a5aa00d/
tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/DekkerTest.java
*/
static final int ITERATIONS = 1000000;
static class TestData {
public volatile int a;
public volatile int b;
}
static class ResultData {
public int a;
public int b;
}
TestData[] testDataArray;
ResultData[] results;
volatile boolean start;
public DekkerTest() {
testDataArray = new TestData[ITERATIONS];
results = new ResultData[ITERATIONS];
for (int i = 0; i < ITERATIONS; ++i) {
testDataArray[i] = new TestData();
results[i] = new ResultData();
}
start = false;
}
public void reset() {
for (int i = 0; i < ITERATIONS; ++i) {
testDataArray[i].a = 0;
testDataArray[i].b = 0;
results[i].a = 0;
results[i].b = 0;
}
start = false;
}
int actor1(TestData t) {
t.a = 1;
return t.b;
}
int actor2(TestData t) {
t.b = 1;
return t.a;
}
class Runner1 extends Thread {
public void run() {
do {} while (!start);
for (int i = 0; i < ITERATIONS; ++i) {
results[i].a = actor1(testDataArray[i]);
}
}
}
class Runner2 extends Thread {
public void run() {
do {} while (!start);
for (int i = 0; i < ITERATIONS; ++i) {
results[i].b = actor2(testDataArray[i]);
}
}
}
void testRunner() {
Thread thread1 = new Runner1();
Thread thread2 = new Runner2();
thread1.start();
thread2.start();
do {} while (!thread1.isAlive());
do {} while (!thread2.isAlive());
start = true;
Thread.yield();
try {
thread1.join();
thread2.join();
} catch (InterruptedException e) {
System.out.println("interrupted!");
System.exit(1);
}
}
boolean printResult() {
int[] count = new int[4];
for (int i = 0; i < ITERATIONS; ++i) {
int event_kind = (results[i].a << 1) + results[i].b;
++count[event_kind];
}
if (count[0] == 0 && count[3] == 0) {
System.out.println("[not interesting]");
return false; // not interesting
}
String error = (count[0] == 0) ? " ok" : " disallowed!";
System.out.println("[0,0] " + count[0] + error);
System.out.println("[0,1] " + count[1]);
System.out.println("[1,0] " + count[2]);
System.out.println("[1,1] " + count[3]);
return (count[0] != 0);
}
public static void main(String args[]) {
DekkerTest test = new DekkerTest();
final int runs = 30;
int failed = 0;
for (int c = 0; c < runs; ++c) {
test.testRunner();
if (test.printResult()) {
failed++;
}
test.reset();
}
if (failed > 0) {
throw new InternalError("FAILED. Got " + failed + " failed ITERATIONS");
}
System.out.println("PASSED.");
}
}

View File

@ -0,0 +1,139 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7162400
* @key regression
* @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues
* @library /testlibrary
* @compile AttachWithStalePidFileTarget.java
* @run main AttachWithStalePidFile
*/
import com.oracle.java.testlibrary.*;
import com.sun.tools.attach.VirtualMachine;
import sun.tools.attach.HotSpotVirtualMachine;
import java.lang.reflect.Field;
import java.nio.file.*;
import java.nio.file.attribute.*;
import java.io.*;
public class AttachWithStalePidFile {
public static void main(String... args) throws Exception {
// this test is only valid on non-Windows platforms
if(Platform.isWindows()) {
System.out.println("This test is only valid on non-Windows platforms.");
return;
}
// Since there might be stale pid-files owned by different
// users on the system we may need to retry the test in case we
// are unable to remove the existing file.
int retries = 5;
while(!runTest() && --retries > 0);
if(retries == 0) {
throw new RuntimeException("Test failed after 5 retries. " +
"Remove any /tmp/.java_pid* files and retry.");
}
}
public static boolean runTest() throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-XX:+UnlockDiagnosticVMOptions", "-XX:+PauseAtStartup", "AttachWithStalePidFileTarget");
Process target = pb.start();
Path pidFile = null;
try {
int pid = getUnixProcessId(target);
// create the stale .java_pid file. use hard-coded /tmp path as in th VM
pidFile = createJavaPidFile(pid);
if(pidFile == null) {
return false;
}
// wait for vm.paused file to be created and delete it once we find it.
waitForAndResumeVM(pid);
// unfortunately there's no reliable way to know the VM is ready to receive the
// attach request so we have to do an arbitrary sleep.
Thread.sleep(5000);
HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
BufferedReader remoteDataReader = new BufferedReader(new InputStreamReader(vm.remoteDataDump()));
String line = null;
while((line = remoteDataReader.readLine()) != null);
vm.detach();
return true;
}
finally {
target.destroy();
target.waitFor();
if(pidFile != null && Files.exists(pidFile)) {
Files.delete(pidFile);
}
}
}
private static Path createJavaPidFile(int pid) throws Exception {
Path pidFile = Paths.get("/tmp/.java_pid" + pid);
if(Files.exists(pidFile)) {
try {
Files.delete(pidFile);
}
catch(FileSystemException e) {
if(e.getReason().equals("Operation not permitted")) {
System.out.println("Unable to remove exisiting stale PID file" + pidFile);
return null;
}
throw e;
}
}
return Files.createFile(pidFile,
PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-------")));
}
private static void waitForAndResumeVM(int pid) throws Exception {
Path pauseFile = Paths.get("vm.paused." + pid);
int retries = 60;
while(!Files.exists(pauseFile) && --retries > 0) {
Thread.sleep(1000);
}
if(retries == 0) {
throw new RuntimeException("Timeout waiting for VM to start. " +
"vm.paused file not created within 60 seconds.");
}
Files.delete(pauseFile);
}
private static int getUnixProcessId(Process unixProcess) throws Exception {
Field pidField = unixProcess.getClass().getDeclaredField("pid");
pidField.setAccessible(true);
return (Integer)pidField.get(unixProcess);
}
}

View File

@ -0,0 +1,27 @@
/*
* 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.
*/
public class AttachWithStalePidFileTarget {
public static void main(String... args) throws Exception {
Thread.sleep(2*60*1000);
}
}

View File

@ -0,0 +1,62 @@
/*
* 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.
*/
package com.oracle.java.testlibrary;
public class Platform {
private static final String osName = System.getProperty("os.name");
private static final String dataModel = System.getProperty("sun.arch.data.model");
private static final String vmVersion = System.getProperty("java.vm.version");
public static boolean is64bit() {
return dataModel.equals("64");
}
public static boolean isSolaris() {
return osName.toLowerCase().startsWith("sunos");
}
public static boolean isWindows() {
return osName.toLowerCase().startsWith("win");
}
public static boolean isOSX() {
return osName.toLowerCase().startsWith("mac");
}
public static boolean isLinux() {
return osName.toLowerCase().startsWith("linux");
}
public static String getOsName() {
return osName;
}
public static boolean isDebugBuild() {
return vmVersion.toLowerCase().contains("debug");
}
public static String getVMVersion() {
return vmVersion;
}
}

View File

@ -327,3 +327,4 @@ cd764ada36b50e2096ba35b4c27ca8f83b3db964 jdk7u40-b26
5b31380e2e0b6f8386dcf0ca122461154f2d2704 jdk7u40-b31
75bb397c4ae26c384e1fcb75bbf4b70479f2c5f7 jdk7u40-b32
ce771024e07d2bb6521735a14ce68745a2376bd8 jdk7u40-b33
23ba797b9e78231806d837f7fb4f9feef6dcd61a jdk7u40-b34

View File

@ -327,3 +327,4 @@ aafab1efbd4ced5e05695aa1887813f9f5de9d5c jdk7u40-b25
f500fd46c18b783f7b4ab22314f64f131f50c5d5 jdk7u40-b31
83a688927f16b69690f707a6b579edbe55b01e25 jdk7u40-b32
3ceef25a8cdd9a27a7a2dea0efd8721100cfa30f jdk7u40-b33
1ef33d25dd8c776a0b76a8c5c7095f4083ad6993 jdk7u40-b34

View File

@ -326,3 +326,4 @@ d3186a0676dbc7ab80e00fa67f952b67933d5a35 jdk7u40-b29
c2522d149ff6663ed1d3602c88c286cff25a43a7 jdk7u40-b31
b9f86896cd0aa9b83e472a90b20ae7c253fba633 jdk7u40-b32
419939ecee8311c8a38ff624ae67e473f8c60e51 jdk7u40-b33
7c1d6fc3b6da19c7b7c0aad0716a2d810dbb974b jdk7u40-b34

View File

@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2013c
tzdata2013d

View File

@ -875,12 +875,18 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# announced that year's Ramadan daylight-saving transitions would be
# 2012-07-20 and 2012-08-20; see
# <http://www.mmsp.gov.ma/fr/actualites.aspx?id=288>.
#
# From Andrew Paprocki (2013-07-02):
# Morocco announced that the year's Ramadan daylight-savings
# transitions would be 2013-07-07 and 2013-08-10; see:
# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
# From Paul Eggert (2013-07-03):
# To estimate what the Moroccan government will do in future years,
# transition dates for 2013 through 2021 were determined by running
# transition dates for 2014 through 2021 were determined by running
# the following program under GNU Emacs 24.3:
#
# (let ((islamic-year 1434))
# (let ((islamic-year 1435))
# (while (< islamic-year 1444)
# (let ((a
# (calendar-gregorian-from-absolute
@ -933,8 +939,8 @@ Rule Morocco 2012 2019 - Apr lastSun 2:00 1:00 S
Rule Morocco 2012 max - Sep lastSun 3:00 0 -
Rule Morocco 2012 only - Jul 20 3:00 0 -
Rule Morocco 2012 only - Aug 20 2:00 1:00 S
Rule Morocco 2013 only - Jul 9 3:00 0 -
Rule Morocco 2013 only - Aug 8 2:00 1:00 S
Rule Morocco 2013 only - Jul 7 3:00 0 -
Rule Morocco 2013 only - Aug 10 2:00 1:00 S
Rule Morocco 2014 only - Jun 29 3:00 0 -
Rule Morocco 2014 only - Jul 29 2:00 1:00 S
Rule Morocco 2015 only - Jun 18 3:00 0 -

View File

@ -1235,39 +1235,21 @@ Rule Zion 2011 only - Oct 2 2:00 0 S
Rule Zion 2012 only - Mar Fri>=26 2:00 1:00 D
Rule Zion 2012 only - Sep 23 2:00 0 S
# From Ephraim Silverberg (2012-10-18):
# Yesterday, the Interior Ministry Committee, after more than a year
# past, approved sending the proposed June 2011 changes to the Time
# Decree Law back to the Knesset for second and third (final) votes
# before the upcoming elections on Jan. 22, 2013. Hence, although the
# changes are not yet law, they are expected to be so before February 2013.
# From Ephraim Silverberg (2013-06-27):
# On June 23, 2013, the Israeli government approved changes to the
# Time Decree Law. The next day, the changes passed the First Reading
# in the Knesset. The law is expected to pass the Second and Third
# (final) Readings by the beginning of September 2013.
#
# As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March.
# DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the
# second day of the Jewish Rosh Hashana holiday, in which case DST ends a day
# later (i.e. at 02:00 the first Monday after October 2).
# [Rosh Hashana holidays are factored in until 2100.]
# From Ephraim Silverberg (2012-11-05):
# The Knesset passed today (in second and final readings) the amendment to the
# Time Decree Law making the changes ... law.
# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
# in March. DST ends at 02:00 on the last Sunday of October.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
Rule Zion 2013 2026 - Oct Sun>=2 2:00 0 S
Rule Zion 2027 only - Oct Mon>=3 2:00 0 S
Rule Zion 2028 max - Oct Sun>=2 2:00 0 S
# The following rules are commented out for now, as they break older
# versions of zic that support only signed 32-bit timestamps, i.e.,
# through 2038-01-19 03:14:07 UTC.
#Rule Zion 2028 2053 - Oct Sun>=2 2:00 0 S
#Rule Zion 2054 only - Oct Mon>=3 2:00 0 S
#Rule Zion 2055 2080 - Oct Sun>=2 2:00 0 S
#Rule Zion 2081 only - Oct Mon>=3 2:00 0 S
#Rule Zion 2082 max - Oct Sun>=2 2:00 0 S
Rule Zion 2013 max - Oct lastSun 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Jerusalem 2:20:56 - LMT 1880
Zone Asia/Jerusalem 2:20:54 - LMT 1880
2:20:40 - JMT 1918 # Jerusalem Mean Time?
2:00 Zion I%sT
@ -2570,8 +2552,8 @@ Rule Syria 2006 only - Sep 22 0:00 0 -
Rule Syria 2007 only - Mar lastFri 0:00 1:00 S
# From Jesper Norgard (2007-10-27):
# The sister center ICARDA of my work CIMMYT is confirming that Syria DST will
# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or
# rather Midnight between Thursday and Friday. This does make more sence than
# not take place 1st November at 0:00 o'clock but 1st November at 24:00 or
# rather Midnight between Thursday and Friday. This does make more sense than
# having it between Wednesday and Thursday (two workdays in Syria) since the
# weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now
# it is implemented at midnight of the last workday before weekend...

View File

@ -253,10 +253,16 @@ Zone Australia/Lord_Howe 10:36:20 - LMT 1895 Feb
# - Macquarie Island will stay on UTC+11 for winter and therefore not
# switch back from daylight savings time when other parts of Australia do
# on 4 April.
#
# From Arthur David Olson (2013-05-23):
# The 1919 transition is overspecified below so pre-2013 zics
# will produce a binary file with an EST-type as the first 32-bit type;
# this is required for correct handling of times before 1916 by
# pre-2013 versions of localtime.
Zone Antarctica/Macquarie 0 - zzz 1899 Nov
10:00 - EST 1916 Oct 1 2:00
10:00 1:00 EST 1917 Feb
10:00 Aus EST 1919 Apr
10:00 Aus EST 1919 Apr 1 0:00s
0 - zzz 1948 Mar 25
10:00 Aus EST 1967
10:00 AT EST 2010 Apr 4 3:00
@ -1498,12 +1504,12 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# From Paul Eggert (2000-01-08):
# IATA SSIM (1999-09) says DST ends 0100 local time. Go with McDow.
# From the BBC World Service (1998-10-31 11:32 UTC):
# From the BBC World Service in
# http://news.bbc.co.uk/2/hi/asia-pacific/205226.stm (1998-10-31 16:03 UTC):
# The Fijiian government says the main reasons for the time change is to
# improve productivity and reduce road accidents. But correspondents say it
# also hopes the move will boost Fiji's ability to compete with other pacific
# islands in the effort to attract tourists to witness the dawning of the new
# millenium.
# improve productivity and reduce road accidents.... [T]he move is also
# intended to boost Fiji's ability to attract tourists to witness the dawning
# of the new millennium.
# http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13)
# reports that Fiji has discontinued DST.
@ -1648,7 +1654,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
# From Eric Ulevik (1999-05-03):
# Tonga's director of tourism, who is also secretary of the National Millenium
# Tonga's director of tourism, who is also secretary of the National Millennium
# Committee, has a plan to get Tonga back in front.
# He has proposed a one-off move to tropical daylight saving for Tonga from
# October to March, which has won approval in principle from the Tongan

View File

@ -546,7 +546,7 @@ Rule C-Eur 1944 only - Oct 2 2:00s 0 -
# It seems that Paris, Monaco, Rule France, Rule Belgium all agree on
# 2:00 standard time, e.g. 3:00 local time. However there are no
# countries that use C-Eur rules in September 1945, so the only items
# affected are apparently these ficticious zones that translates acronyms
# affected are apparently these fictitious zones that translate acronyms
# CET and MET:
#
# Zone CET 1:00 C-Eur CE%sT
@ -2802,9 +2802,9 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# Ukraine
#
# From Igor Karpov, who works for the Ukranian Ministry of Justice,
# From Igor Karpov, who works for the Ukrainian Ministry of Justice,
# via Garrett Wollman (2003-01-27):
# BTW, I've found the official document on this matter. It's goverment
# BTW, I've found the official document on this matter. It's government
# regulations number 509, May 13, 1996. In my poor translation it says:
# "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
# of March at 3am the time is changing to 4am and each last Sunday of
@ -2838,7 +2838,7 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# time this year after all.
#
# From Udo Schwedt (2011-10-18):
# As far as I understand, the recent change to the Ukranian time zone
# As far as I understand, the recent change to the Ukrainian time zone
# (Europe/Kiev) to introduce permanent daylight saving time (similar
# to Russia) was reverted today:
#

View File

@ -26,14 +26,12 @@
# 2009-05-17 by Arthur David Olson.
# ISO 3166 alpha-2 country codes
#
# From Paul Eggert (2006-09-27):
# From Paul Eggert (2013-05-27):
#
# This file contains a table with the following columns:
# 1. ISO 3166-1 alpha-2 country code, current as of
# ISO 3166-1 Newsletter VI-1 (2007-09-21). See:
# <a href="http://www.iso.org/iso/en/prods-services/iso3166ma/index.html">
# ISO 3166 Maintenance agency (ISO 3166/MA)
# </a>.
# ISO 3166-1 Newsletter VI-15 (2013-05-10). See: Updates on ISO 3166
# http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm
# 2. The usual English name for the country,
# chosen so that alphabetic sorting of subsets produces helpful lists.
# This is not the same as the English name in the ISO 3166 tables.
@ -43,8 +41,9 @@
#
# Lines beginning with `#' are comments.
#
# From Arthur David Olson (2011-08-17):
# Resynchronized today with the ISO 3166 site (adding SS for South Sudan).
# This table is intended as an aid for users, to help them select time
# zone data appropriate for their practical needs. It is not intended
# to take or endorse any position on legal or territorial claims.
#
#country-
#code country name
@ -77,7 +76,7 @@ BL St Barthelemy
BM Bermuda
BN Brunei
BO Bolivia
BQ Bonaire Sint Eustatius & Saba
BQ Bonaire, St Eustatius & Saba
BR Brazil
BS Bahamas
BT Bhutan
@ -258,7 +257,7 @@ SR Suriname
SS South Sudan
ST Sao Tome & Principe
SV El Salvador
SX Sint Maarten
SX St Maarten (Dutch part)
SY Syria
SZ Swaziland
TC Turks & Caicos Is

View File

@ -994,7 +994,7 @@ Rule Brazil 2007 only - Feb 25 0:00 0 -
# adopted by the same states as before.
Rule Brazil 2007 only - Oct Sun>=8 0:00 1:00 S
# From Frederico A. C. Neves (2008-09-10):
# Acording to this decree
# According to this decree
# <a href="http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm">
# http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
# </a>
@ -1226,7 +1226,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
# </a>
#
# This is not yet reflected in the offical "cambio de hora" site, but
# This is not yet reflected in the official "cambio de hora" site, but
# probably will be soon:
# <a href="http://www.horaoficial.cl/cambio.htm">
# http://www.horaoficial.cl/cambio.htm

View File

@ -27,15 +27,19 @@
#
# TZ zone descriptions
#
# From Paul Eggert (1996-08-05):
# From Paul Eggert (2013-05-27):
#
# This file contains a table with the following columns:
# 1. ISO 3166 2-character country code. See the file `iso3166.tab'.
# This identifies a country that overlaps the zone. The country may
# overlap other zones and the zone may overlap other countries.
# 2. Latitude and longitude of the zone's principal location
# in ISO 6709 sign-degrees-minutes-seconds format,
# either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
# first latitude (+ is north), then longitude (+ is east).
# This location need not lie within the column-1 country.
# 3. Zone name used in value of TZ environment variable.
# Please see the 'Theory' file for how zone names are chosen.
# 4. Comments; present if and only if the country has multiple rows.
#
# Columns are separated by a single tab.
@ -45,6 +49,10 @@
#
# Lines beginning with `#' are comments.
#
# This table is intended as an aid for users, to help them select time
# zone data appropriate for their practical needs. It is not intended
# to take or endorse any position on legal or territorial claims.
#
#country-
#code coordinates TZ comments
AD +4230+00131 Europe/Andorra
@ -239,7 +247,7 @@ ID -0002+10920 Asia/Pontianak west & central Borneo
ID -0507+11924 Asia/Makassar east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
ID -0232+14042 Asia/Jayapura west New Guinea (Irian Jaya) & Malukus (Moluccas)
IE +5320-00615 Europe/Dublin
IL +3146+03514 Asia/Jerusalem
IL +314650+0351326 Asia/Jerusalem
IM +5409-00428 Europe/Isle_of_Man
IN +2232+08822 Asia/Kolkata
IO -0720+07225 Indian/Chagos

View File

@ -431,7 +431,7 @@ public class HashMap<K,V>
* others.
*/
private V getForNullKey() {
if (isEmpty()) {
if (size == 0) {
return null;
}
for (Entry<K,V> e = table[0]; e != null; e = e.next) {
@ -459,7 +459,7 @@ public class HashMap<K,V>
* for the key.
*/
final Entry<K,V> getEntry(Object key) {
if (isEmpty()) {
if (size == 0) {
return null;
}
@ -667,7 +667,7 @@ public class HashMap<K,V>
* for this key.
*/
final Entry<K,V> removeEntryForKey(Object key) {
if (isEmpty()) {
if (size == 0) {
return null;
}
int hash = (key == null) ? 0 : hash(key);
@ -701,7 +701,7 @@ public class HashMap<K,V>
* for matching.
*/
final Entry<K,V> removeMapping(Object o) {
if (isEmpty() || !(o instanceof Map.Entry))
if (size == 0 || !(o instanceof Map.Entry))
return null;
Map.Entry<K,V> entry = (Map.Entry<K,V>) o;

View File

@ -27,6 +27,7 @@
* @summary Basic Test for HotSpotDiagnosticMXBean.setVMOption()
* and getDiagnosticOptions().
* @author Mandy Chung
* @author Jaroslav Bachorik
*
* @run main/othervm -XX:+PrintGCDetails SetVMOption
*/
@ -36,7 +37,6 @@ import java.util.*;
import com.sun.management.HotSpotDiagnosticMXBean;
import com.sun.management.VMOption;
import com.sun.management.VMOption.Origin;
import sun.misc.Version;
public class SetVMOption {
private static String PRINT_GC_DETAILS = "PrintGCDetails";
@ -47,17 +47,8 @@ public class SetVMOption {
private static HotSpotDiagnosticMXBean mbean;
public static void main(String[] args) throws Exception {
List<HotSpotDiagnosticMXBean> list =
ManagementFactory.getPlatformMXBeans(HotSpotDiagnosticMXBean.class);
// The following test is transitional only and should be removed
// once build 52 is promoted.
int build = Version.jvmBuildNumber();
if (build > 0 && build < 52) {
// JVM support is integrated in build 52
// this test is skipped if running with VM earlier than 52
return;
}
mbean =
ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
VMOption option = findPrintGCDetailsOption();
if (!option.getValue().equalsIgnoreCase(EXPECTED_VALUE)) {

View File

@ -0,0 +1,70 @@
/*
* 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.
*/
/*
* Portions Copyright (c) 2013 IBM Corporation
*/
/**
* @test
* @bug 8019381
* @summary Verify that we do not get exception when we override isEmpty()
* in a subclass of HashMap
* @author zhangshj@linux.vnet.ibm.com
*/
import java.util.HashMap;
public class OverrideIsEmpty {
public static class NotEmptyHashMap<K,V> extends HashMap<K,V> {
private K alwaysExistingKey;
private V alwaysExistingValue;
@Override
public V get(Object key) {
if (key == alwaysExistingKey) {
return alwaysExistingValue;
}
return super.get(key);
}
@Override
public int size() {
return super.size() + 1;
}
@Override
public boolean isEmpty() {
return size() == 0;
}
}
public static void main(String[] args) {
NotEmptyHashMap<Object, Object> map = new NotEmptyHashMap<>();
Object key = new Object();
Object value = new Object();
map.get(key);
map.remove(key);
}
}

View File

@ -327,3 +327,4 @@ bfe3575143fddbf71c2e570b580afef007d171e4 jdk7u40-b29
9c343668b0a95e5510f715014884e5d45df9dfb0 jdk7u40-b31
056f998e75f87a299808671ecc0d96e270f62dca jdk7u40-b32
e36d8f754801c9d17585a9469f9b33f9799167f8 jdk7u40-b33
08c5065870ef40008711a3d3ee3230323e5f5910 jdk7u40-b34