/hg/release/icedtea7-forest-2.6/hotspot: 18 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Wed Feb 20 16:14:34 UTC 2019


changeset afddad5b59a9 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=afddad5b59a9
author: aph
date: Mon Feb 18 02:22:41 2019 +0000

	8211064, PR3669: [AArch64] Interpreter and c1 don't correctly handle jboolean results in native calls
	Contributed-by: apetushkov
	Reviewed-by: aph


changeset f796e9ab0bfd in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=f796e9ab0bfd
author: fyang
date: Fri Sep 28 08:48:26 2018 +0800

	8207838, PR3669: AArch64: Float registers incorrectly restored in JNI call
	Summary: fix the order in which float registers are restored in restore_args for aarch64
	Reviewed-by: aph
	Contributed-by: guoge1 at huawei.com


changeset 9599175faddb in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=9599175faddb
author: aph
date: Mon Feb 18 02:26:43 2019 +0000

	8209415, PR3669: Fix JVMTI test failure HS202
	Summary: Fix test for static method in exception throw handler
	Reviewed-by: adinn


changeset cb39f2849d75 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=cb39f2849d75
author: fyang
date: Mon Feb 18 02:31:41 2019 +0000

	8209414, PR3669: AArch64: method handle invocation does not respect JVMTI interp_only mode
	Reviewed-by: adinn
	Contributed-by: nick.gasson at arm.com


changeset c026104503cf in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=c026104503cf
author: andrew
date: Mon Feb 11 04:35:37 2019 +0000

	8217753, PR3686: Enable HotSpot builds on 5.x Linux kernels
	Summary: Remove OS version check on Linux as very unlikely a 2.2.x kernel is still in use


changeset 788bd17d1876 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=788bd17d1876
author: aph
date: Mon Feb 18 04:18:37 2019 +0000

	8145096, PR3700: Undefined behaviour in HotSpot
	Summary: Fix some integer overflows
	Reviewed-by: jrose, kvn, kbarrett, adinn, iklam


changeset 3e633517a887 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=3e633517a887
author: sgehwolf
date: Mon Feb 11 15:43:26 2019 +0000

	8214059, PR3701: Undefined behaviour in ADLC
	Reviewed-by: shade, kbarrett
	Contributed-by: Simon Tooke <stooke at redhat.com>


changeset a90b5cc4e1d2 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=a90b5cc4e1d2
author: hseigel
date: Mon Feb 18 05:48:28 2019 +0000

	8014138, PR3702: Add VM option to facilitate the writing of CDS tests
	Summary: Added the -XX:SharedArchiveFile option.
	Reviewed-by: coleenp, ccheung, acorn, dcubed, zgu


changeset b0ac7a3e2705 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=b0ac7a3e2705
author: zmajo
date: Fri Aug 29 15:32:16 2014 +0200

	8055286, PR3702: Extend CompileCommand=option to handle numeric parameters
	Summary: Changed CompileCommand=option to handle "extended" parameters: Klass::method,type,flag,value. Types supported are bool, intx, and uintx.
	Reviewed-by: kvn, roland


changeset b5f3f133db56 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=b5f3f133db56
author: kvn
date: Tue Sep 02 10:26:48 2014 -0700

	8056964, PR3702: JDK-8055286 changes are incomplete.
	Summary: added ccstr and ccstrlist types to compilerOracle 'option' command
	Reviewed-by: roland


changeset fbaeecf381f6 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=fbaeecf381f6
author: simonis
date: Wed Sep 03 14:39:13 2014 +0200

	8057129, PR3702: Fix AIX build after the Extend CompileCommand=option change 8055286
	Reviewed-by: kvn


changeset 64a47bb28534 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=64a47bb28534
author: anoll
date: Fri Oct 10 14:48:30 2014 +0200

	8059847, PR3702: complement JDK-8055286 and JDK-8056964 changes
	Summary: Extend scan_flag_and_value() to process flag of type double. Add regression test compiler/oracle/CheckCompileCommandOption.java.
	Reviewed-by: kvn, anoll


changeset 976e1f2aa48e in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=976e1f2aa48e
author: dholmes
date: Thu Jan 10 21:00:11 2013 -0500

	8005921, PR3702: Memory leaks in vmStructs.cpp
	Reviewed-by: dholmes, mikael, rasbold
	Contributed-by: Jeremy Manson <jeremymanson at google.com>


changeset ac58063ca713 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=ac58063ca713
author: ccheung
date: Wed Feb 20 01:05:45 2019 +0000

	8011661, PR3702: Insufficient memory message says "malloc" when sometimes it should say "mmap"
	Reviewed-by: coleenp, zgu, hseigel


changeset 0553e00f9404 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=0553e00f9404
author: zgu
date: Wed Feb 20 02:15:29 2019 +0000

	6424123, PR3702: JVM crashes on failed 'strdup' call
	Summary: Calling os::malloc()/os::strdup() and new os::strdup_check_oom() instead of ::malloc()/::strdup() for native memory tracking purpose
	Reviewed-by: coleenp, ctornqvi, kvn


changeset 62d0139577ca in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=62d0139577ca
author: stuefe
date: Wed Feb 20 14:15:55 2019 +0000

	8076475, PR3702: Misuses of strncpy/strncat
	Summary: Various small fixes around strncpy and strncat
	Reviewed-by: dsamersoff, coleenp


changeset b1fe72ea0fdd in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=b1fe72ea0fdd
author: fyang
date: Thu Jan 03 13:53:15 2019 +0800

	8215951, PR3669: AArch64: jtreg test vmTestbase/nsk/jvmti/PopFrame/popframe005 segfaults
	Reviewed-by: aph
	Contributed-by: nick.gasson at arm.com


changeset 65b809089544 in /hg/release/icedtea7-forest-2.6/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/hotspot?cmd=changeset;node=65b809089544
author: fyang
date: Wed Feb 20 14:43:02 2019 +0000

	8218185, PR3669: aarch64: missing LoadStore barrier in TemplateTable::putfield_or_static
	Reviewed-by: aph
	Contributed-by: lunliu93 at gmail.com


diffstat:

 agent/src/os/bsd/libproc_impl.c                                      |    7 +-
 agent/src/os/linux/libproc_impl.c                                    |    7 +-
 make/linux/Makefile                                                  |   15 +-
 src/cpu/aarch64/vm/assembler_aarch64.cpp                             |    9 +
 src/cpu/aarch64/vm/assembler_aarch64.hpp                             |    3 +
 src/cpu/aarch64/vm/methodHandles_aarch64.cpp                         |    4 +-
 src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp                         |    4 +-
 src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp                   |   12 +-
 src/cpu/aarch64/vm/templateTable_aarch64.cpp                         |    3 +-
 src/cpu/ppc/vm/vm_version_ppc.cpp                                    |    3 +-
 src/cpu/sparc/vm/vm_version_sparc.cpp                                |    3 +-
 src/cpu/x86/vm/vm_version_x86.cpp                                    |    3 +-
 src/os/aix/vm/os_aix.cpp                                             |    7 +-
 src/os/aix/vm/porting_aix.cpp                                        |    6 +-
 src/os/bsd/dtrace/libjvm_db.c                                        |   19 +-
 src/os/bsd/vm/decoder_machO.cpp                                      |    1 +
 src/os/bsd/vm/os_bsd.cpp                                             |    2 +-
 src/os/linux/vm/os_linux.cpp                                         |    6 +-
 src/os/posix/vm/os_posix.cpp                                         |    6 +-
 src/os/solaris/dtrace/libjvm_db.c                                    |   19 +-
 src/os/solaris/vm/os_solaris.cpp                                     |   15 +-
 src/os/windows/vm/os_windows.cpp                                     |    2 +-
 src/os/windows/vm/perfMemory_windows.cpp                             |    3 +-
 src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp                                 |    2 +-
 src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp                               |    2 +-
 src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp                     |    2 +-
 src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp                             |    2 +-
 src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp                         |    2 +-
 src/os_cpu/linux_x86/vm/os_linux_x86.cpp                             |    2 +-
 src/os_cpu/linux_zero/vm/os_linux_zero.cpp                           |    2 +-
 src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp                     |    2 +-
 src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp                         |    2 +-
 src/share/tools/hsdis/hsdis.c                                        |    1 +
 src/share/vm/adlc/adlparse.cpp                                       |    6 +-
 src/share/vm/adlc/dfa.cpp                                            |   22 +-
 src/share/vm/adlc/formssel.cpp                                       |    9 +-
 src/share/vm/asm/assembler.cpp                                       |    2 +-
 src/share/vm/c1/c1_LIRAssembler.cpp                                  |    3 +-
 src/share/vm/ci/ciMethod.cpp                                         |   17 +
 src/share/vm/ci/ciMethod.hpp                                         |    2 +
 src/share/vm/classfile/classLoader.cpp                               |    8 +-
 src/share/vm/classfile/classLoader.hpp                               |    2 +
 src/share/vm/code/stubs.cpp                                          |    2 +-
 src/share/vm/code/vtableStubs.cpp                                    |    2 +-
 src/share/vm/compiler/compileBroker.hpp                              |    3 +-
 src/share/vm/compiler/compilerOracle.cpp                             |  363 ++++++++-
 src/share/vm/compiler/compilerOracle.hpp                             |    5 +
 src/share/vm/compiler/disassembler.cpp                               |    1 +
 src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp             |    2 +-
 src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp                |    6 +-
 src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp               |    2 +-
 src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp     |    2 +-
 src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp |    2 +-
 src/share/vm/interpreter/interpreterRuntime.cpp                      |    2 +-
 src/share/vm/memory/allocation.cpp                                   |    6 +-
 src/share/vm/memory/allocation.inline.hpp                            |   12 +-
 src/share/vm/memory/blockOffsetTable.cpp                             |    2 +-
 src/share/vm/opto/addnode.cpp                                        |    8 +-
 src/share/vm/opto/compile.hpp                                        |    4 +
 src/share/vm/opto/loopTransform.cpp                                  |    4 +-
 src/share/vm/opto/mulnode.cpp                                        |   23 +-
 src/share/vm/opto/runtime.cpp                                        |    4 +-
 src/share/vm/opto/runtime.hpp                                        |    8 +-
 src/share/vm/opto/subnode.cpp                                        |    8 +-
 src/share/vm/opto/type.cpp                                           |   14 +-
 src/share/vm/prims/jvmtiTagMap.cpp                                   |    3 +-
 src/share/vm/prims/methodHandles.cpp                                 |    3 +-
 src/share/vm/runtime/advancedThresholdPolicy.cpp                     |    3 +-
 src/share/vm/runtime/arguments.cpp                                   |   51 +-
 src/share/vm/runtime/fprofiler.cpp                                   |   12 +-
 src/share/vm/runtime/globals.hpp                                     |    5 +-
 src/share/vm/runtime/objectMonitor.cpp                               |    2 +-
 src/share/vm/runtime/os.cpp                                          |    8 +-
 src/share/vm/runtime/os.hpp                                          |    2 +
 src/share/vm/runtime/stubRoutines.cpp                                |    4 +-
 src/share/vm/runtime/synchronizer.cpp                                |    3 +-
 src/share/vm/runtime/vmStructs.cpp                                   |   14 +-
 src/share/vm/services/management.cpp                                 |    4 +-
 src/share/vm/shark/sharkBuilder.cpp                                  |    2 +-
 src/share/vm/utilities/debug.cpp                                     |    6 +-
 src/share/vm/utilities/debug.hpp                                     |   14 +-
 src/share/vm/utilities/globalDefinitions.hpp                         |   26 +
 src/share/vm/utilities/ostream.cpp                                   |   14 +-
 src/share/vm/utilities/vmError.cpp                                   |   26 +-
 src/share/vm/utilities/vmError.hpp                                   |   11 +-
 src/share/vm/utilities/workgroup.cpp                                 |    5 +-
 test/compiler/floatingpoint/8165673/TestFloatJNIArgs.java            |   87 ++
 test/compiler/floatingpoint/8165673/TestFloatJNIArgs.sh              |  105 ++
 test/compiler/floatingpoint/8165673/libTestFloatJNIArgs.c            |   69 +
 test/compiler/floatingpoint/8207838/TestFloatSyncJNIArgs.java        |  103 ++
 test/compiler/floatingpoint/8207838/TestFloatSyncJNIArgs.sh          |  105 ++
 test/compiler/floatingpoint/8207838/libTestFloatSyncJNIArgs.c        |   86 ++
 test/compiler/floatingpoint/TestFloatJNIArgs.java                    |   86 --
 test/compiler/floatingpoint/TestFloatJNIArgs.sh                      |  104 --
 test/compiler/floatingpoint/libTestFloatJNIArgs.c                    |   68 -
 test/compiler/oracle/CheckCompileCommandOption.java                  |  216 +++++
 test/runtime/SharedArchiveFile/SharedArchiveFile.java                |   53 +
 97 files changed, 1512 insertions(+), 522 deletions(-)

diffs (truncated from 3576 to 500 lines):

diff -r d02c48af060b -r 65b809089544 agent/src/os/bsd/libproc_impl.c
--- a/agent/src/os/bsd/libproc_impl.c	Mon Jan 07 06:00:06 2019 +0000
+++ b/agent/src/os/bsd/libproc_impl.c	Wed Feb 20 14:43:02 2019 +0000
@@ -161,7 +161,12 @@
       return NULL;
    }
 
-   strncpy(newlib->name, libname, sizeof(newlib->name));
+   if (strlen(libname) >= sizeof(newlib->name)) {
+     print_debug("libname %s too long\n", libname);
+     return NULL;
+   }
+   strcpy(newlib->name, libname);
+
    newlib->base = base;
 
    if (fd == -1) {
diff -r d02c48af060b -r 65b809089544 agent/src/os/linux/libproc_impl.c
--- a/agent/src/os/linux/libproc_impl.c	Mon Jan 07 06:00:06 2019 +0000
+++ b/agent/src/os/linux/libproc_impl.c	Wed Feb 20 14:43:02 2019 +0000
@@ -162,7 +162,12 @@
       return NULL;
    }
 
-   strncpy(newlib->name, libname, sizeof(newlib->name));
+   if (strlen(libname) >= sizeof(newlib->name)) {
+     print_debug("libname %s too long\n", libname);
+     return NULL;
+   }
+   strcpy(newlib->name, libname);
+
    newlib->base = base;
 
    if (fd == -1) {
diff -r d02c48af060b -r 65b809089544 make/linux/Makefile
--- a/make/linux/Makefile	Mon Jan 07 06:00:06 2019 +0000
+++ b/make/linux/Makefile	Wed Feb 20 14:43:02 2019 +0000
@@ -249,20 +249,7 @@
 	@echo "  $(TARGETS_ZERO)"
 	@echo "  $(TARGETS_SHARK)"
 
-checks: check_os_version check_j2se_version
-
-# We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
-# Solaris 2.5.1, 2.6).
-# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
-
-SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 4%
-OS_VERSION := $(shell uname -r)
-EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
-
-check_os_version:
-ifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
-	$(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
-endif
+checks: check_j2se_version
 
 # jvmti.make requires XSLT (J2SE 1.4.x or newer):
 XSLT_CHECK	= $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory
diff -r d02c48af060b -r 65b809089544 src/cpu/aarch64/vm/assembler_aarch64.cpp
--- a/src/cpu/aarch64/vm/assembler_aarch64.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/cpu/aarch64/vm/assembler_aarch64.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -2259,6 +2259,15 @@
 #endif
 }
 
+void MacroAssembler::c2bool(Register x) {
+  // implements x == 0 ? 0 : 1
+  // note: must only look at least-significant byte of x
+  //       since C-style booleans are stored in one byte
+  //       only! (was bug)
+  tst(x, 0xff);
+  cset(x, Assembler::NE);
+}
+
 void MacroAssembler::ic_call(address entry) {
   RelocationHolder rh = virtual_call_Relocation::spec(pc());
   // address const_ptr = long_constant((jlong)Universe::non_oop_word());
diff -r d02c48af060b -r 65b809089544 src/cpu/aarch64/vm/assembler_aarch64.hpp
--- a/src/cpu/aarch64/vm/assembler_aarch64.hpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/cpu/aarch64/vm/assembler_aarch64.hpp	Wed Feb 20 14:43:02 2019 +0000
@@ -3008,6 +3008,9 @@
   void store_check_part_1(Register obj);
   void store_check_part_2(Register obj);
 
+  // C 'boolean' to Java boolean: x == 0 ? 0 : 1
+  void c2bool(Register x);
+
   // oop manipulations
   void load_klass(Register dst, Register src);
   void store_klass(Register dst, Register src);
diff -r d02c48af060b -r 65b809089544 src/cpu/aarch64/vm/methodHandles_aarch64.cpp
--- a/src/cpu/aarch64/vm/methodHandles_aarch64.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/cpu/aarch64/vm/methodHandles_aarch64.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -107,8 +107,8 @@
     // compiled code in threads for which the event is enabled.  Check here for
     // interp_only_mode if these events CAN be enabled.
 
-    __ ldrb(rscratch1, Address(rthread, JavaThread::interp_only_mode_offset()));
-    __ cbnz(rscratch1, run_compiled_code);
+    __ ldrw(rscratch1, Address(rthread, JavaThread::interp_only_mode_offset()));
+    __ cbzw(rscratch1, run_compiled_code);
     __ ldr(rscratch1, Address(method, methodOopDesc::interpreter_entry_offset()));
     __ br(rscratch1);
     __ BIND(run_compiled_code);
diff -r d02c48af060b -r 65b809089544 src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
--- a/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -1094,7 +1094,7 @@
     }
   }
   __ pop(x, sp);
-  for ( int i = first_arg ; i < arg_count ; i++ ) {
+  for ( int i = arg_count - 1 ; i >= first_arg ; i-- ) {
     if (args[i].first()->is_Register()) {
       ;
     } else if (args[i].first()->is_FloatRegister()) {
@@ -1926,7 +1926,7 @@
 
   // Unpack native results.
   switch (ret_type) {
-  case T_BOOLEAN: __ ubfx(r0, r0, 0, 8);            break;
+  case T_BOOLEAN: __ c2bool(r0);                     break;
   case T_CHAR   : __ ubfx(r0, r0, 0, 16);            break;
   case T_BYTE   : __ sbfx(r0, r0, 0, 8);            break;
   case T_SHORT  : __ sbfx(r0, r0, 0, 16);            break;
diff -r d02c48af060b -r 65b809089544 src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp
--- a/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -298,8 +298,8 @@
         BasicType type) {
     address entry = __ pc();
   switch (type) {
-  case T_BOOLEAN: __ uxtb(r0, r0);        break;
-  case T_CHAR   : __ uxth(r0, r0);       break;
+  case T_BOOLEAN: __ c2bool(r0);          break;
+  case T_CHAR   : __ uxth(r0, r0);        break;
   case T_BYTE   : __ sxtb(r0, r0);        break;
   case T_SHORT  : __ sxth(r0, r0);        break;
   case T_INT    : __ uxtw(r0, r0);        break;  // FIXME: We almost certainly don't need this
@@ -1867,6 +1867,7 @@
   __ restore_locals();
   __ restore_constant_pool_cache();
   __ get_method(rmethod);
+  __ get_dispatch();
 
   // The method data pointer was incremented already during
   // call profiling. We have to restore the mdp for the current bcp.
@@ -1882,8 +1883,8 @@
     Label L_done;
 
     __ ldrb(rscratch1, Address(rbcp, 0));
-    __ cmpw(r1, Bytecodes::_invokestatic);
-    __ br(Assembler::EQ, L_done);
+    __ cmpw(rscratch1, Bytecodes::_invokestatic);
+    __ br(Assembler::NE, L_done);
 
     // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
     // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
@@ -1925,9 +1926,8 @@
   //
   // r0: exception
   // lr: return address/pc that threw exception
-  // rsp: expression stack of caller
+  // esp: expression stack of caller
   // rfp: fp of caller
-  // FIXME: There's no point saving LR here because VM calls don't trash it
   __ stp(r0, lr, Address(__ pre(sp, -2 * wordSize)));  // save exception & return address
   __ super_call_VM_leaf(CAST_FROM_FN_PTR(address,
                           SharedRuntime::exception_handler_for_return_address),
diff -r d02c48af060b -r 65b809089544 src/cpu/aarch64/vm/templateTable_aarch64.cpp
--- a/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -2682,7 +2682,8 @@
   {
     Label notVolatile;
     __ tbz(r5, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-    __ membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreStore));
+    __ membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreStore |
+                                               MacroAssembler::LoadStore));
     __ bind(notVolatile);
   }
 
diff -r d02c48af060b -r 65b809089544 src/cpu/ppc/vm/vm_version_ppc.cpp
--- a/src/cpu/ppc/vm/vm_version_ppc.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/cpu/ppc/vm/vm_version_ppc.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -28,6 +28,7 @@
 #include "macroAssembler_ppc.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/java.hpp"
+#include "runtime/os.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "utilities/defaultStream.hpp"
 #include "vm_version_ppc.hpp"
@@ -110,7 +111,7 @@
                (has_vand()    ? " vand"    : "")
                // Make sure number of %s matches num_features!
               );
-  _features_str = strdup(buf);
+  _features_str = os::strdup(buf);
   NOT_PRODUCT(if (Verbose) print_features(););
 
   // PPC64 supports 8-byte compare-exchange operations (see
diff -r d02c48af060b -r 65b809089544 src/cpu/sparc/vm/vm_version_sparc.cpp
--- a/src/cpu/sparc/vm/vm_version_sparc.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/cpu/sparc/vm/vm_version_sparc.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -26,6 +26,7 @@
 #include "assembler_sparc.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/java.hpp"
+#include "runtime/os.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "vm_version_sparc.hpp"
 #ifdef TARGET_OS_FAMILY_linux
@@ -261,7 +262,7 @@
                (!has_hardware_fsmuld() ? ", no-fsmuld" : ""));
 
   // buf is started with ", " or is empty
-  _features_str = strdup(strlen(buf) > 2 ? buf + 2 : buf);
+  _features_str = os::strdup(strlen(buf) > 2 ? buf + 2 : buf);
 
   // UseVIS is set to the smallest of what hardware supports and what
   // the command line requires.  I.e., you cannot set UseVIS to 3 on
diff -r d02c48af060b -r 65b809089544 src/cpu/x86/vm/vm_version_x86.cpp
--- a/src/cpu/x86/vm/vm_version_x86.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/cpu/x86/vm/vm_version_x86.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -26,6 +26,7 @@
 #include "assembler_x86.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/java.hpp"
+#include "runtime/os.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "vm_version_x86.hpp"
 #ifdef TARGET_OS_FAMILY_linux
@@ -454,7 +455,7 @@
                (supports_tsc() ? ", tsc": ""),
                (supports_tscinv_bit() ? ", tscinvbit": ""),
                (supports_tscinv() ? ", tscinv": ""));
-  _features_str = strdup(buf);
+  _features_str = os::strdup(buf);
 
   // UseSSE is set to the smaller of what hardware supports and what
   // the command line requires.  I.e., you cannot set UseSSE to 2 on
diff -r d02c48af060b -r 65b809089544 src/os/aix/vm/os_aix.cpp
--- a/src/os/aix/vm/os_aix.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/os/aix/vm/os_aix.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -55,6 +55,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/objectMonitor.hpp"
+#include "runtime/os.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/perfMemory.hpp"
 #include "runtime/sharedRuntime.hpp"
@@ -388,9 +389,9 @@
   // default should be 4K.
   size_t data_page_size = SIZE_4K;
   {
-    void* p = ::malloc(SIZE_16M);
+    void* p = os::malloc(SIZE_16M, mtInternal);
     data_page_size = os::Aix::query_pagesize(p);
-    ::free(p);
+    os::free(p);
   }
 
   // query default shm page size (LDR_CNTRL SHMPSIZE)
@@ -2139,7 +2140,7 @@
   if (!pd_commit_memory(addr, size, exec)) {
     // add extra info in product mode for vm_exit_out_of_memory():
     PRODUCT_ONLY(warn_fail_commit_memory(addr, size, exec, errno);)
-    vm_exit_out_of_memory(size, mesg);
+    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg);
   }
 }
 
diff -r d02c48af060b -r 65b809089544 src/os/aix/vm/porting_aix.cpp
--- a/src/os/aix/vm/porting_aix.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/os/aix/vm/porting_aix.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -22,6 +22,8 @@
  *
  */
 
+#include "memory/allocation.inline.hpp"
+#include "runtime/os.hpp"
 #include "loadlib_aix.hpp"
 #include "porting_aix.hpp"
 #include "utilities/debug.hpp"
@@ -84,7 +86,7 @@
     while (n) {
       node* p = n;
       n = n->next;
-      free(p->v);
+      os::free(p->v);
       delete p;
     }
   }
@@ -96,7 +98,7 @@
       }
     }
     node* p = new node;
-    p->v = strdup(s);
+    p->v = os::strdup_check_oom(s);
     p->next = first;
     first = p;
     return p->v;
diff -r d02c48af060b -r 65b809089544 src/os/bsd/dtrace/libjvm_db.c
--- a/src/os/bsd/dtrace/libjvm_db.c	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/os/bsd/dtrace/libjvm_db.c	Wed Feb 20 14:43:02 2019 +0000
@@ -559,13 +559,14 @@
   CHECK_FAIL(err);
 
   result[0] = '\0';
-  strncat(result, klassString, size);
-  size -= strlen(klassString);
-  strncat(result, ".", size);
-  size -= 1;
-  strncat(result, nameString, size);
-  size -= strlen(nameString);
-  strncat(result, signatureString, size);
+  if (snprintf(result, size,
+    "%s.%s%s",
+    klassString,
+    nameString,
+    signatureString) >= size) {
+    // truncation
+    goto fail;
+  }
 
   if (nameString != NULL) free(nameString);
   if (klassString != NULL) free(klassString);
@@ -1072,9 +1073,9 @@
       CHECK_FAIL(err);
   }
   if (deoptimized) {
-    strncat(result + 1, " [deoptimized frame]; ", size-1);
+    strncat(result, " [deoptimized frame]; ", size - strlen(result) - 1);
   } else {
-    strncat(result + 1, " [compiled] ", size-1);
+    strncat(result, " [compiled] ", size - strlen(result) - 1);
   }
   if (debug)
       fprintf(stderr, "name_for_nmethod: END: method name: %s, vf_cnt: %d\n\n",
diff -r d02c48af060b -r 65b809089544 src/os/bsd/vm/decoder_machO.cpp
--- a/src/os/bsd/vm/decoder_machO.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/os/bsd/vm/decoder_machO.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -97,6 +97,7 @@
   char * symname = mach_find_in_stringtable((char*) ((uintptr_t)mach_base + stroff), strsize, found_strx);
   if (symname) {
       strncpy(buf, symname, buflen);
+      buf[buflen - 1] = '\0';
       return true;
   }
   DEBUG_ONLY(tty->print_cr("no string or null string found."));
diff -r d02c48af060b -r 65b809089544 src/os/bsd/vm/os_bsd.cpp
--- a/src/os/bsd/vm/os_bsd.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/os/bsd/vm/os_bsd.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -2981,7 +2981,7 @@
   if (!pd_commit_memory(addr, size, exec)) {
     // add extra info in product mode for vm_exit_out_of_memory():
     PRODUCT_ONLY(warn_fail_commit_memory(addr, size, exec, errno);)
-    vm_exit_out_of_memory(size, mesg);
+    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg);
   }
 }
 
diff -r d02c48af060b -r 65b809089544 src/os/linux/vm/os_linux.cpp
--- a/src/os/linux/vm/os_linux.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/os/linux/vm/os_linux.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -2825,7 +2825,7 @@
 
   if (!recoverable_mmap_error(err)) {
     warn_fail_commit_memory(addr, size, exec, err);
-    vm_exit_out_of_memory(size, "committing reserved memory.");
+    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, "committing reserved memory.");
   }
 
   return err;
@@ -2842,7 +2842,7 @@
   if (err != 0) {
     // the caller wants all commit errors to exit with the specified mesg:
     warn_fail_commit_memory(addr, size, exec, err);
-    vm_exit_out_of_memory(size, mesg);
+    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg);
   }
 }
 
@@ -2878,7 +2878,7 @@
   if (err != 0) {
     // the caller wants all commit errors to exit with the specified mesg:
     warn_fail_commit_memory(addr, size, alignment_hint, exec, err);
-    vm_exit_out_of_memory(size, mesg);
+    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg);
   }
 }
 
diff -r d02c48af060b -r 65b809089544 src/os/posix/vm/os_posix.cpp
--- a/src/os/posix/vm/os_posix.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/os/posix/vm/os_posix.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -523,7 +523,11 @@
   strncpy(buffer, "none", size);
 
   const struct {
-    int i;
+    // NB: i is an unsigned int here because SA_RESETHAND is on some
+    // systems 0x80000000, which is implicitly unsigned.  Assignining
+    // it to an int field would be an overflow in unsigned-to-signed
+    // conversion.
+    unsigned int i;
     const char* s;
   } flaginfo [] = {
     { SA_NOCLDSTOP, "SA_NOCLDSTOP" },
diff -r d02c48af060b -r 65b809089544 src/os/solaris/dtrace/libjvm_db.c
--- a/src/os/solaris/dtrace/libjvm_db.c	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/os/solaris/dtrace/libjvm_db.c	Wed Feb 20 14:43:02 2019 +0000
@@ -559,13 +559,14 @@
   CHECK_FAIL(err);
 
   result[0] = '\0';
-  strncat(result, klassString, size);
-  size -= strlen(klassString);
-  strncat(result, ".", size);
-  size -= 1;
-  strncat(result, nameString, size);
-  size -= strlen(nameString);
-  strncat(result, signatureString, size);
+  if (snprintf(result, size,
+    "%s.%s%s",
+    klassString,
+    nameString,
+    signatureString) >= size) {
+    // truncation
+    goto fail;
+  }
 
   if (nameString != NULL) free(nameString);
   if (klassString != NULL) free(klassString);
@@ -1072,9 +1073,9 @@
       CHECK_FAIL(err);
   }
   if (deoptimized) {
-    strncat(result + 1, " [deoptimized frame]; ", size-1);
+    strncat(result, " [deoptimized frame]; ", size - strlen(result) - 1);
   } else {
-    strncat(result + 1, " [compiled] ", size-1);
+    strncat(result, " [compiled] ", size - strlen(result) - 1);
   }
   if (debug)
       fprintf(stderr, "name_for_nmethod: END: method name: %s, vf_cnt: %d\n\n",
diff -r d02c48af060b -r 65b809089544 src/os/solaris/vm/os_solaris.cpp
--- a/src/os/solaris/vm/os_solaris.cpp	Mon Jan 07 06:00:06 2019 +0000
+++ b/src/os/solaris/vm/os_solaris.cpp	Wed Feb 20 14:43:02 2019 +0000
@@ -833,7 +833,7 @@
       // allocate new buffer and initialize
       info = (Dl_serinfo*)malloc(_info.dls_size);
       if (info == NULL) {
-        vm_exit_out_of_memory(_info.dls_size,
+        vm_exit_out_of_memory(_info.dls_size, OOM_MALLOC_ERROR,
                               "init_system_properties_values info");
       }
       info->dls_size = _info.dls_size;
@@ -875,7 +875,7 @@
       common_path = malloc(bufsize);
       if (common_path == NULL) {
         free(info);
-        vm_exit_out_of_memory(bufsize,
+        vm_exit_out_of_memory(bufsize, OOM_MALLOC_ERROR,
                               "init_system_properties_values common_path");
       }
       sprintf(common_path, COMMON_DIR "/lib/%s", cpu_arch);
@@ -888,7 +888,7 @@
       if (library_path == NULL) {
         free(info);
         free(common_path);
-        vm_exit_out_of_memory(bufsize,
+        vm_exit_out_of_memory(bufsize, OOM_MALLOC_ERROR,
                               "init_system_properties_values library_path");
       }
       library_path[0] = '\0';
@@ -1632,7 +1632,8 @@
   // %%% this is used only in threadLocalStorage.cpp
   if (thr_setspecific((thread_key_t)index, value)) {
     if (errno == ENOMEM) {
-       vm_exit_out_of_memory(SMALLINT, "thr_setspecific: out of swap space");
+       vm_exit_out_of_memory(SMALLINT, OOM_MALLOC_ERROR,
+                             "thr_setspecific: out of swap space");
     } else {
       fatal(err_msg("os::thread_local_storage_at_put: thr_setspecific failed "
                     "(%s)", strerror(errno)));
@@ -2874,7 +2875,7 @@
 
   if (!recoverable_mmap_error(err)) {
     warn_fail_commit_memory(addr, bytes, exec, err);
-    vm_exit_out_of_memory(bytes, "committing reserved memory.");
+    vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, "committing reserved memory.");
   }
 
   return err;
@@ -2891,7 +2892,7 @@
   if (err != 0) {
     // the caller wants all commit errors to exit with the specified mesg:


More information about the distro-pkg-dev mailing list