Merge
authorehelin
Tue, 18 Oct 2016 16:21:43 +0200
changeset 41724 fa9d08eaaa8a
parent 41722 07042d1b3876 (diff)
parent 41723 88393c6dd24e (current diff)
child 41726 e0747416c678
child 41733 e7d1e585f95c
Merge
--- a/hotspot/src/cpu/aarch64/vm/jvmciCodeInstaller_aarch64.cpp	Wed Oct 05 16:00:10 2016 +0200
+++ b/hotspot/src/cpu/aarch64/vm/jvmciCodeInstaller_aarch64.cpp	Tue Oct 18 16:21:43 2016 +0200
@@ -60,12 +60,12 @@
 void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, TRAPS) {
   address pc = _instructions->start() + pc_offset;
   if (HotSpotMetaspaceConstantImpl::compressed(constant)) {
-    narrowKlass narrowOop = record_narrow_metadata_reference(constant, CHECK);
+    narrowKlass narrowOop = record_narrow_metadata_reference(_instructions, pc, constant, CHECK);
     TRACE_jvmci_3("relocating (narrow metaspace constant) at " PTR_FORMAT "/0x%x", p2i(pc), narrowOop);
     Unimplemented();
   } else {
     NativeMovConstReg* move = nativeMovConstReg_at(pc);
-    void* reference = record_metadata_reference(constant, CHECK);
+    void* reference = record_metadata_reference(_instructions, pc, constant, CHECK);
     move->set_data((intptr_t) reference);
     TRACE_jvmci_3("relocating (metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(reference));
   }
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Wed Oct 05 16:00:10 2016 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Tue Oct 18 16:21:43 2016 +0200
@@ -784,7 +784,7 @@
 
   __try {
     RaiseException (MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (const ULONG_PTR*)&info );
-  } __except(EXCEPTION_CONTINUE_EXECUTION) {}
+  } __except(EXCEPTION_EXECUTE_HANDLER) {}
 }
 
 bool os::distribute_processes(uint length, uint* distribution) {
--- a/hotspot/src/os/windows/vm/perfMemory_windows.cpp	Wed Oct 05 16:00:10 2016 +0200
+++ b/hotspot/src/os/windows/vm/perfMemory_windows.cpp	Tue Oct 18 16:21:43 2016 +0200
@@ -1404,12 +1404,14 @@
                objectname);      /* name for object */
 
   if (fmh == NULL) {
+    DWORD lasterror = GetLastError();
     if (PrintMiscellaneous && Verbose) {
       warning("OpenFileMapping failed for shared memory object %s:"
-              " lasterror = %d\n", objectname, GetLastError());
+              " lasterror = %d\n", objectname, lasterror);
     }
-    THROW_MSG_(vmSymbols::java_lang_Exception(),
-               "Could not open PerfMemory", INVALID_HANDLE_VALUE);
+    THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
+               err_msg("Could not open PerfMemory, error %d", lasterror),
+               INVALID_HANDLE_VALUE);
   }
 
   return fmh;;
--- a/hotspot/test/Makefile	Wed Oct 05 16:00:10 2016 +0200
+++ b/hotspot/test/Makefile	Tue Oct 18 16:21:43 2016 +0200
@@ -66,6 +66,7 @@
   ifeq ($(ARCH), i386)
     ARCH=i586
   endif
+  NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line)
 endif
 ifeq ($(UNAME_S), Linux)
   PLATFORM = linux
@@ -74,6 +75,7 @@
   ifeq ($(ARCH), i386)
     ARCH = i586
   endif
+  NUM_CORES := $(shell cat /proc/cpuinfo  | grep -c processor)
 endif
 ifeq ($(UNAME_S), Darwin)
   PLATFORM = bsd
@@ -82,6 +84,7 @@
   ifeq ($(ARCH), i386)
     ARCH = i586
   endif
+  NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
 endif
 ifeq ($(findstring BSD,$(UNAME_S)), BSD)
   PLATFORM = bsd
@@ -115,6 +118,13 @@
     endif
   endif
   EXESUFFIX = .exe
+  ifneq ($(NUMBER_OF_PROCESSORS), )
+    NUM_CORES := $(NUMBER_OF_PROCESSORS)
+  else
+    ifneq ($(HOTSPOT_BUILD_JOBS), )
+      NUM_CORES := $(HOTSPOT_BUILD_JOBS)
+    endif
+  endif
 endif
 
 ifdef ALT_SLASH_JAVA
@@ -308,9 +318,22 @@
   TEST_SELECTION = $(TESTDIRS)
 endif
 
-ifdef CONCURRENCY
-  JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
+# Concurrency based on min(cores / 2, 12)
+ifdef NUM_CORES
+  CONCURRENCY := $(shell expr $(NUM_CORES) / 2)
+  ifeq ($(CONCURRENCY), 0)
+    CONCURRENCY := 1
+  else ifeq ($(shell expr $(CONCURRENCY) \> 12), 1)
+    CONCURRENCY := 12
+  endif
+else 
+  CONCURRENCY := 1
 endif
+JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
+
+# Make sure MaxRAMFraction is high enough to not cause OOM or swapping since we may end up with a lot of JVM's
+JTREG_BASIC_OPTIONS += -vmoption:-XX:MaxRAMFraction=$(shell expr $(CONCURRENCY) \* 4)
+
 ifdef EXTRA_JTREG_OPTIONS
   JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
 endif