/hg/icedtea7-forest/hotspot: 7 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Wed Jul 20 02:17:39 UTC 2016


changeset 593d79437219 in /hg/icedtea7-forest/hotspot
details: http://icedtea.classpath.org/hg/icedtea7-forest/hotspot?cmd=changeset;node=593d79437219
author: andrew
date: Fri Jul 08 01:58:45 2016 +0100

	8151841, PR3098: Build needs additional flags to compile with GCC 6
	Summary: C++ standard needs to be explicitly set and some optimisations turned off to build on GCC 6
	Reviewed-by: erikj, dholmes, kbarrett


changeset 3a73f17ce6aa in /hg/icedtea7-forest/hotspot
details: http://icedtea.classpath.org/hg/icedtea7-forest/hotspot?cmd=changeset;node=3a73f17ce6aa
author: kvn
date: Tue Jul 19 21:22:43 2016 +0100

	6934604, PR3075: enable parts of EliminateAutoBox by default
	Summary: Resurrected autobox elimination code and enabled part of it by default.
	Reviewed-by: roland, twisti


changeset fb3eed72e790 in /hg/icedtea7-forest/hotspot
details: http://icedtea.classpath.org/hg/icedtea7-forest/hotspot?cmd=changeset;node=fb3eed72e790
author: kvn
date: Mon May 13 14:36:39 2013 -0700

	8014286, PR3075: failed java/lang/Math/DivModTests.java after 6934604 changes
	Summary: Corrected escape state for the result of boxing method. Added force inlining executed boxing methods.
	Reviewed-by: twisti


changeset 8304de95e902 in /hg/icedtea7-forest/hotspot
details: http://icedtea.classpath.org/hg/icedtea7-forest/hotspot?cmd=changeset;node=8304de95e902
author: kvn
date: Tue Jul 02 10:30:49 2013 -0700

	8019247, PR3075: SIGSEGV in compiled method c8e.e.t_.getArray(Ljava/lang/Class;)[Ljava/lang/Object
	Summary: Undo recent changes (and add more comments) in Ideal_allocation().
	Reviewed-by: roland


changeset e501d3e296e3 in /hg/icedtea7-forest/hotspot
details: http://icedtea.classpath.org/hg/icedtea7-forest/hotspot?cmd=changeset;node=e501d3e296e3
author: drchase
date: Tue Jul 19 23:13:01 2016 +0100

	8014959, PR3075: assert(Compile::current()->live_nodes() < (uint)MaxNodeLimit) failed: Live Node limit exceeded limit
	Summary: Insert extra checks and bailouts for too many nodes
	Reviewed-by: kvn


changeset dbe5bbcb8a41 in /hg/icedtea7-forest/hotspot
details: http://icedtea.classpath.org/hg/icedtea7-forest/hotspot?cmd=changeset;node=dbe5bbcb8a41
author: thartmann
date: Tue Jul 19 23:59:47 2016 +0100

	8159244, PR3075: Partially initialized string object created by C2's string concat optimization may escape
	Summary: Emit release barrier after String creation to prevent partially initialized object from escaping.
	Reviewed-by: kvn


changeset 601fbf4bf8c1 in /hg/icedtea7-forest/hotspot
details: http://icedtea.classpath.org/hg/icedtea7-forest/hotspot?cmd=changeset;node=601fbf4bf8c1
author: simonis
date: Wed Jul 20 03:15:59 2016 +0100

	8158260, PR2992, RH1341258: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
	Summary: Adjust instruction generation. Includes portions of 8026049 for test case.
	Reviewed-by: goetz
	Contributed-by: gromero at linux.vnet.ibm.com, horii at jp.ibm.com


diffstat:

 make/linux/makefiles/gcc.make                                  |    7 +
 src/cpu/aarch64/vm/vm_version_aarch64.cpp                      |    8 +-
 src/cpu/ppc/vm/ppc.ad                                          |    4 +-
 src/cpu/ppc/vm/vm_version_ppc.cpp                              |    9 +-
 src/cpu/sparc/vm/vm_version_sparc.cpp                          |    9 +-
 src/cpu/x86/vm/vm_version_x86.cpp                              |    5 +
 src/cpu/zero/vm/vm_version_zero.cpp                            |   12 +-
 src/cpu/zero/vm/vm_version_zero.hpp                            |    6 +-
 src/share/vm/ci/ciInstanceKlass.cpp                            |   31 +-
 src/share/vm/ci/ciInstanceKlass.hpp                            |    6 +-
 src/share/vm/ci/ciMethod.cpp                                   |   38 +
 src/share/vm/ci/ciMethod.hpp                                   |    2 +
 src/share/vm/classfile/vmSymbols.hpp                           |    2 +-
 src/share/vm/compiler/compileBroker.cpp                        |    6 +-
 src/share/vm/opto/bytecodeInfo.cpp                             |   44 +-
 src/share/vm/opto/c2_globals.hpp                               |   13 +-
 src/share/vm/opto/c2compiler.cpp                               |    9 +-
 src/share/vm/opto/callGenerator.cpp                            |   62 +-
 src/share/vm/opto/callGenerator.hpp                            |    1 +
 src/share/vm/opto/callnode.cpp                                 |   81 +-
 src/share/vm/opto/callnode.hpp                                 |   68 +-
 src/share/vm/opto/cfgnode.cpp                                  |    4 +-
 src/share/vm/opto/chaitin.cpp                                  |    5 +-
 src/share/vm/opto/coalesce.cpp                                 |    4 +-
 src/share/vm/opto/compile.cpp                                  |   64 +-
 src/share/vm/opto/compile.hpp                                  |   39 +-
 src/share/vm/opto/doCall.cpp                                   |   14 +-
 src/share/vm/opto/escape.cpp                                   |   80 +-
 src/share/vm/opto/graphKit.cpp                                 |   35 +-
 src/share/vm/opto/ifnode.cpp                                   |    2 +-
 src/share/vm/opto/library_call.cpp                             |    4 +-
 src/share/vm/opto/loopPredicate.cpp                            |    4 +-
 src/share/vm/opto/macro.cpp                                    |   95 +-
 src/share/vm/opto/macro.hpp                                    |    3 +-
 src/share/vm/opto/matcher.cpp                                  |    2 +
 src/share/vm/opto/memnode.cpp                                  |  644 ++++---
 src/share/vm/opto/memnode.hpp                                  |    6 +-
 src/share/vm/opto/multnode.cpp                                 |   33 +-
 src/share/vm/opto/multnode.hpp                                 |    2 +
 src/share/vm/opto/node.cpp                                     |   35 +-
 src/share/vm/opto/node.hpp                                     |    1 +
 src/share/vm/opto/parse.hpp                                    |    8 +-
 src/share/vm/opto/parse1.cpp                                   |    6 +-
 src/share/vm/opto/parse2.cpp                                   |   12 +-
 src/share/vm/opto/parse3.cpp                                   |   28 +-
 src/share/vm/opto/parseHelper.cpp                              |    5 +
 src/share/vm/opto/phase.cpp                                    |    2 +
 src/share/vm/opto/phase.hpp                                    |    1 +
 src/share/vm/opto/phaseX.cpp                                   |    2 +-
 src/share/vm/opto/phasetype.hpp                                |    8 +-
 src/share/vm/opto/stringopts.cpp                               |    8 +-
 src/share/vm/opto/type.cpp                                     |   64 +-
 src/share/vm/opto/type.hpp                                     |   32 +-
 src/share/vm/prims/unsafe.cpp                                  |   32 +
 src/share/vm/runtime/arguments.cpp                             |   18 +
 src/share/vm/runtime/globals.hpp                               |    6 +-
 src/share/vm/runtime/vmStructs.cpp                             |    1 +
 test/compiler/6934604/TestByteBoxing.java                      |  777 ++++++++++
 test/compiler/6934604/TestDoubleBoxing.java                    |  777 ++++++++++
 test/compiler/6934604/TestFloatBoxing.java                     |  777 ++++++++++
 test/compiler/6934604/TestIntBoxing.java                       |  777 ++++++++++
 test/compiler/6934604/TestLongBoxing.java                      |  777 ++++++++++
 test/compiler/6934604/TestShortBoxing.java                     |  777 ++++++++++
 test/compiler/stringopts/TestStringObjectInitialization.java   |   78 +
 test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java |  315 ++++
 65 files changed, 6285 insertions(+), 502 deletions(-)

diffs (truncated from 8702 to 500 lines):

diff -r a778398a0cdb -r 601fbf4bf8c1 make/linux/makefiles/gcc.make
--- a/make/linux/makefiles/gcc.make	Fri Jun 10 17:51:24 2016 +0100
+++ b/make/linux/makefiles/gcc.make	Wed Jul 20 03:15:59 2016 +0100
@@ -83,6 +83,7 @@
 CFLAGS += $(LIBFFI_CFLAGS)
 CFLAGS += $(LLVM_CFLAGS)
 endif
+CFLAGS += -std=gnu++98
 CFLAGS += $(VM_PICFLAG)
 CFLAGS += -fno-rtti
 CFLAGS += -fno-exceptions
@@ -93,6 +94,12 @@
 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
 CFLAGS += -fvisibility=hidden
 endif
+# GCC 6 has more aggressive dead-store elimination which causes the VM to crash
+# It also optimises away null pointer checks which are still needed.
+# We turn both of these optimisations off.
+ifneq "$(shell expr \( $(CC_VER_MAJOR) \>= 6 \))" "0"
+CFLAGS += -fno-delete-null-pointer-checks -fno-lifetime-dse
+endif
 
 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
 ARCHFLAG/i486    = -m32 -march=i586
diff -r a778398a0cdb -r 601fbf4bf8c1 src/cpu/aarch64/vm/vm_version_aarch64.cpp
--- a/src/cpu/aarch64/vm/vm_version_aarch64.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/cpu/aarch64/vm/vm_version_aarch64.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2013, Red Hat Inc.
  * Copyright (c) 1997, 2012, Oracle and/or its affiliates.
+ * Copyright (c) 2015, Red Hat Inc. All rights reserved.
  * All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -183,6 +183,12 @@
   if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) {
     UseCRC32Intrinsics = true;
   }
+  
+  // This machine allows unaligned memory accesses
+  if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
+    FLAG_SET_DEFAULT(UseUnalignedAccesses, true);
+  }
+
 #ifdef COMPILER2
   if (FLAG_IS_DEFAULT(OptoScheduling)) {
     OptoScheduling = true;
diff -r a778398a0cdb -r 601fbf4bf8c1 src/cpu/ppc/vm/ppc.ad
--- a/src/cpu/ppc/vm/ppc.ad	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/cpu/ppc/vm/ppc.ad	Wed Jul 20 03:15:59 2016 +0100
@@ -7653,7 +7653,7 @@
 
 // SAPJVM GL 2013-10-29 Match ConvI2L(LoadI)
 // Match loading integer and casting it to long.
-instruct loadI2L(iRegLdst dst, memory mem) %{
+instruct loadI2L(iRegLdst dst, memoryAlg4 mem) %{
   match(Set dst (ConvI2L (LoadI mem)));
   predicate(_kids[0]->_leaf->as_Load()->is_unordered());
   ins_cost(MEMORY_REF_COST);
@@ -7665,7 +7665,7 @@
 %}
 
 // Match loading integer and casting it to long - acquire.
-instruct loadI2L_ac(iRegLdst dst, memory mem) %{
+instruct loadI2L_ac(iRegLdst dst, memoryAlg4 mem) %{
   match(Set dst (ConvI2L (LoadI mem)));
   ins_cost(3*MEMORY_REF_COST);
 
diff -r a778398a0cdb -r 601fbf4bf8c1 src/cpu/ppc/vm/vm_version_ppc.cpp
--- a/src/cpu/ppc/vm/vm_version_ppc.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/cpu/ppc/vm/vm_version_ppc.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2014 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2015 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
@@ -142,6 +142,11 @@
     AllocatePrefetchStyle = 1; // Fall back if inappropriate.
 
   assert(AllocatePrefetchStyle >= 0, "AllocatePrefetchStyle should be positive");
+  
+  // This machine allows unaligned memory accesses
+  if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
+    FLAG_SET_DEFAULT(UseUnalignedAccesses, true);
+  }
 }
 
 void VM_Version::print_features() {
diff -r a778398a0cdb -r 601fbf4bf8c1 src/cpu/sparc/vm/vm_version_sparc.cpp
--- a/src/cpu/sparc/vm/vm_version_sparc.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/cpu/sparc/vm/vm_version_sparc.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -274,6 +274,13 @@
   if (!has_vis1()) // Drop to 0 if no VIS1 support
     UseVIS = 0;
 
+  // This machine does not allow unaligned memory accesses
+  if (UseUnalignedAccesses) {
+    if (!FLAG_IS_DEFAULT(UseUnalignedAccesses))
+      warning("Unaligned memory access is not available on this CPU");
+    FLAG_SET_DEFAULT(UseUnalignedAccesses, false);
+  }
+
 #ifndef PRODUCT
   if (PrintMiscellaneous && Verbose) {
     tty->print_cr("L2 data cache line size: %u", L2_data_cache_line_size());
diff -r a778398a0cdb -r 601fbf4bf8c1 src/cpu/x86/vm/vm_version_x86.cpp
--- a/src/cpu/x86/vm/vm_version_x86.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/cpu/x86/vm/vm_version_x86.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -752,6 +752,11 @@
   PrefetchFieldsAhead         = prefetch_fields_ahead();
 #endif
 
+  // This machine allows unaligned memory accesses
+  if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
+    FLAG_SET_DEFAULT(UseUnalignedAccesses, true);
+  }
+
 #ifndef PRODUCT
   if (PrintMiscellaneous && Verbose) {
     tty->print_cr("Logical CPUs per core: %u",
diff -r a778398a0cdb -r 601fbf4bf8c1 src/cpu/zero/vm/vm_version_zero.cpp
--- a/src/cpu/zero/vm/vm_version_zero.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/cpu/zero/vm/vm_version_zero.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -36,4 +36,12 @@
 # include "os_bsd.inline.hpp"
 #endif
 
-// This file is intentionally empty
+
+void VM_Version::initialize() {
+  get_processor_features();
+  // This machine does not allow unaligned memory accesses
+  if (! FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
+    warning("Unaligned memory access is not available on this CPU");
+    FLAG_SET_DEFAULT(UseUnalignedAccesses, false);
+  }
+}
diff -r a778398a0cdb -r 601fbf4bf8c1 src/cpu/zero/vm/vm_version_zero.hpp
--- a/src/cpu/zero/vm/vm_version_zero.hpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/cpu/zero/vm/vm_version_zero.hpp	Wed Jul 20 03:15:59 2016 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2007 Red Hat, Inc.
+ * Copyright 2015 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,9 +38,7 @@
 #endif
   }
 
-  static void initialize() {
-    get_processor_features();
-  }
+  static void initialize();
 
   static const char* cpu_features() {
     return "";
diff -r a778398a0cdb -r 601fbf4bf8c1 src/share/vm/ci/ciInstanceKlass.cpp
--- a/src/share/vm/ci/ciInstanceKlass.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/share/vm/ci/ciInstanceKlass.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -211,13 +211,42 @@
 
 // ------------------------------------------------------------------
 // ciInstanceKlass::uses_default_loader
-bool ciInstanceKlass::uses_default_loader() {
+bool ciInstanceKlass::uses_default_loader() const {
   // Note:  We do not need to resolve the handle or enter the VM
   // in order to test null-ness.
   return _loader == NULL;
 }
 
 // ------------------------------------------------------------------
+
+/**
+ * Return basic type of boxed value for box klass or T_OBJECT if not.
+ */
+BasicType ciInstanceKlass::box_klass_type() const {
+  if (uses_default_loader() && is_loaded()) {
+    return SystemDictionary::box_klass_type(get_klassOop());
+  } else {
+    return T_OBJECT;
+  }
+}
+
+/**
+ * Is this boxing klass?
+ */
+bool ciInstanceKlass::is_box_klass() const {
+  return is_java_primitive(box_klass_type());
+}
+
+/**
+ *  Is this boxed value offset?
+ */
+bool ciInstanceKlass::is_boxed_value_offset(int offset) const {
+  BasicType bt = box_klass_type();
+  return is_java_primitive(bt) &&
+         (offset == java_lang_boxing_object::value_offset_in_bytes(bt));
+}
+
+// ------------------------------------------------------------------
 // ciInstanceKlass::is_in_package
 //
 // Is this klass in the given package?
diff -r a778398a0cdb -r 601fbf4bf8c1 src/share/vm/ci/ciInstanceKlass.hpp
--- a/src/share/vm/ci/ciInstanceKlass.hpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/share/vm/ci/ciInstanceKlass.hpp	Wed Jul 20 03:15:59 2016 +0100
@@ -218,10 +218,14 @@
   ciInstanceKlass* implementor();
 
   // Is the defining class loader of this class the default loader?
-  bool uses_default_loader();
+  bool uses_default_loader() const;
 
   bool is_java_lang_Object();
 
+  BasicType box_klass_type() const;
+  bool is_box_klass() const;
+  bool is_boxed_value_offset(int offset) const;
+
   // Is this klass in the given package?
   bool is_in_package(const char* packagename) {
     return is_in_package(packagename, (int) strlen(packagename));
diff -r a778398a0cdb -r 601fbf4bf8c1 src/share/vm/ci/ciMethod.cpp
--- a/src/share/vm/ci/ciMethod.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/share/vm/ci/ciMethod.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -1144,6 +1144,44 @@
 bool ciMethod::is_accessor    () const {         FETCH_FLAG_FROM_VM(is_accessor); }
 bool ciMethod::is_initializer () const {         FETCH_FLAG_FROM_VM(is_initializer); }
 
+bool ciMethod::is_boxing_method() const {
+  if (holder()->is_box_klass()) {
+    switch (intrinsic_id()) {
+      case vmIntrinsics::_Boolean_valueOf:
+      case vmIntrinsics::_Byte_valueOf:
+      case vmIntrinsics::_Character_valueOf:
+      case vmIntrinsics::_Short_valueOf:
+      case vmIntrinsics::_Integer_valueOf:
+      case vmIntrinsics::_Long_valueOf:
+      case vmIntrinsics::_Float_valueOf:
+      case vmIntrinsics::_Double_valueOf:
+        return true;
+      default:
+        return false;
+    }
+  }
+  return false;
+}
+
+bool ciMethod::is_unboxing_method() const {
+  if (holder()->is_box_klass()) {
+    switch (intrinsic_id()) {
+      case vmIntrinsics::_booleanValue:
+      case vmIntrinsics::_byteValue:
+      case vmIntrinsics::_charValue:
+      case vmIntrinsics::_shortValue:
+      case vmIntrinsics::_intValue:
+      case vmIntrinsics::_longValue:
+      case vmIntrinsics::_floatValue:
+      case vmIntrinsics::_doubleValue:
+        return true;
+      default:
+        return false;
+    }
+  }
+  return false;
+}
+
 BCEscapeAnalyzer  *ciMethod::get_bcea() {
 #ifdef COMPILER2
   if (_bcea == NULL) {
diff -r a778398a0cdb -r 601fbf4bf8c1 src/share/vm/ci/ciMethod.hpp
--- a/src/share/vm/ci/ciMethod.hpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/share/vm/ci/ciMethod.hpp	Wed Jul 20 03:15:59 2016 +0100
@@ -291,6 +291,8 @@
   bool is_accessor    () const;
   bool is_initializer () const;
   bool can_be_statically_bound() const           { return _can_be_statically_bound; }
+  bool is_boxing_method() const;
+  bool is_unboxing_method() const;
 
   // Print the bytecodes of this method.
   void print_codes_on(outputStream* st);
diff -r a778398a0cdb -r 601fbf4bf8c1 src/share/vm/classfile/vmSymbols.hpp
--- a/src/share/vm/classfile/vmSymbols.hpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/share/vm/classfile/vmSymbols.hpp	Wed Jul 20 03:15:59 2016 +0100
@@ -68,7 +68,7 @@
   template(java_lang_Float,                           "java/lang/Float")                          \
   template(java_lang_Double,                          "java/lang/Double")                         \
   template(java_lang_Byte,                            "java/lang/Byte")                           \
-  template(java_lang_Byte_Cache,                      "java/lang/Byte$ByteCache")                 \
+  template(java_lang_Byte_ByteCache,                  "java/lang/Byte$ByteCache")                 \
   template(java_lang_Short,                           "java/lang/Short")                          \
   template(java_lang_Short_ShortCache,                "java/lang/Short$ShortCache")               \
   template(java_lang_Integer,                         "java/lang/Integer")                        \
diff -r a778398a0cdb -r 601fbf4bf8c1 src/share/vm/compiler/compileBroker.cpp
--- a/src/share/vm/compiler/compileBroker.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/share/vm/compiler/compileBroker.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -1815,8 +1815,10 @@
     tty->print("%7d ", (int) tty->time_stamp().milliseconds());  // print timestamp
     tty->print("%4d ", compile_id);    // print compilation number
     tty->print("%s ", (is_osr ? "%" : " "));
-    int code_size = (task->code() == NULL) ? 0 : task->code()->total_size();
-    tty->print_cr("size: %d time: %d inlined: %d bytes", code_size, (int)time.milliseconds(), task->num_inlined_bytecodes());
+    if (task->code() != NULL) {
+      tty->print("size: %d(%d) ", task->code()->total_size(), task->code()->insts_size());
+    }
+    tty->print_cr("time: %d inlined: %d bytes", (int)time.milliseconds(), task->num_inlined_bytecodes());
   }
 
   // Disable compilation, if required.
diff -r a778398a0cdb -r 601fbf4bf8c1 src/share/vm/opto/bytecodeInfo.cpp
--- a/src/share/vm/opto/bytecodeInfo.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/share/vm/opto/bytecodeInfo.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -84,16 +84,35 @@
   assert(!UseOldInlining, "do not use for old stuff");
 }
 
+/**
+ *  Return true when EA is ON and a java constructor is called or
+ *  a super constructor is called from an inlined java constructor.
+ *  Also return true for boxing methods.
+ */
 static bool is_init_with_ea(ciMethod* callee_method,
                             ciMethod* caller_method, Compile* C) {
-  // True when EA is ON and a java constructor is called or
-  // a super constructor is called from an inlined java constructor.
-  return C->do_escape_analysis() && EliminateAllocations &&
-         ( callee_method->is_initializer() ||
-           (caller_method->is_initializer() &&
-            caller_method != C->method() &&
-            caller_method->holder()->is_subclass_of(callee_method->holder()))
-         );
+  if (!C->do_escape_analysis() || !EliminateAllocations) {
+    return false; // EA is off
+  }
+  if (callee_method->is_initializer()) {
+    return true; // constuctor
+  }
+  if (caller_method->is_initializer() &&
+      caller_method != C->method() &&
+      caller_method->holder()->is_subclass_of(callee_method->holder())) {
+    return true; // super constructor is called from inlined constructor
+  }
+  if (C->eliminate_boxing() && callee_method->is_boxing_method()) {
+    return true;
+  }
+  return false;
+}
+
+/**
+ *  Force inlining unboxing accessor.
+ */
+static bool is_unboxing_method(ciMethod* callee_method, Compile* C) {
+  return C->eliminate_boxing() && callee_method->is_unboxing_method();
 }
 
 // positive filter: should callee be inlined?
@@ -143,6 +162,7 @@
   // bump the max size if the call is frequent
   if ((freq >= InlineFrequencyRatio) ||
       (call_site_count >= InlineFrequencyCount) ||
+      is_unboxing_method(callee_method, C) ||
       is_init_with_ea(callee_method, caller_method, C)) {
 
     max_inline_size = C->freq_inline_size();
@@ -238,6 +258,11 @@
 
   // Now perform checks which are heuristic
 
+  if (is_unboxing_method(callee_method, C)) {
+    // Inline unboxing methods.
+    return false;
+  }
+
   if (!callee_method->force_inline()) {
     if (callee_method->has_compiled_code() &&
         callee_method->instructions_size(CompLevel_full_optimization) > InlineSmallCode) {
@@ -288,9 +313,8 @@
     }
 
     if (is_init_with_ea(callee_method, caller_method, C)) {
-
       // Escape Analysis: inline all executed constructors
-
+      return false;
     } else if (!callee_method->was_executed_more_than(MIN2(MinInliningThreshold,
                                                            CompileThreshold >> 1))) {
       set_msg("executed < MinInliningThreshold times");
diff -r a778398a0cdb -r 601fbf4bf8c1 src/share/vm/opto/c2_globals.hpp
--- a/src/share/vm/opto/c2_globals.hpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/share/vm/opto/c2_globals.hpp	Wed Jul 20 03:15:59 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -414,10 +414,10 @@
   develop(intx, WarmCallMaxSize, 999999,                                    \
           "size of the largest inlinable method")                           \
                                                                             \
-  product(intx, MaxNodeLimit, 65000,                                        \
+  product(intx, MaxNodeLimit, 80000,                                        \
           "Maximum number of nodes")                                        \
                                                                             \
-  product(intx, NodeLimitFudgeFactor, 1000,                                 \
+  product(intx, NodeLimitFudgeFactor, 2000,                                 \
           "Fudge Factor for certain optimizations")                         \
                                                                             \
   product(bool, UseJumpTables, true,                                        \
@@ -450,12 +450,15 @@
   notproduct(bool, PrintEliminateLocks, false,                              \
           "Print out when locks are eliminated")                            \
                                                                             \
-  diagnostic(bool, EliminateAutoBox, false,                                 \
-          "Private flag to control optimizations for autobox elimination")  \
+  product(bool, EliminateAutoBox, true,                                     \
+          "Control optimizations for autobox elimination")                  \
                                                                             \
   product(intx, AutoBoxCacheMax, 128,                                       \
           "Sets max value cached by the java.lang.Integer autobox cache")   \
                                                                             \
+  experimental(bool, AggressiveUnboxing, false,                             \
+          "Control optimizations for aggressive boxing elimination")        \
+                                                                            \
   develop(bool, TraceLateExpand, false, "Trace late expand of nodes.")      \
                                                                             \
   product(bool, DoEscapeAnalysis, true,                                     \
diff -r a778398a0cdb -r 601fbf4bf8c1 src/share/vm/opto/c2compiler.cpp
--- a/src/share/vm/opto/c2compiler.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/share/vm/opto/c2compiler.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -131,9 +131,10 @@
   bool subsume_loads = SubsumeLoads;
   bool do_escape_analysis = DoEscapeAnalysis &&
     !env->jvmti_can_access_local_variables();
+  bool eliminate_boxing = EliminateAutoBox;
   while (!env->failing()) {
     // Attempt to compile while subsuming loads into machine instructions.
-    Compile C(env, this, target, entry_bci, subsume_loads, do_escape_analysis);
+    Compile C(env, this, target, entry_bci, subsume_loads, do_escape_analysis, eliminate_boxing);
 
 
     // Check result and retry if appropriate.
@@ -148,6 +149,12 @@
         do_escape_analysis = false;
         continue;  // retry
       }
+      if (C.has_boxed_value()) {
+        // Recompile without boxing elimination regardless failure reason.
+        assert(eliminate_boxing, "must make progress");
+        eliminate_boxing = false;
+        continue;  // retry
+      }
       // Pass any other failure reason up to the ciEnv.
       // Note that serious, irreversible failures are already logged
       // on the ciEnv via env->record_method_not_compilable().
diff -r a778398a0cdb -r 601fbf4bf8c1 src/share/vm/opto/callGenerator.cpp
--- a/src/share/vm/opto/callGenerator.cpp	Fri Jun 10 17:51:24 2016 +0100
+++ b/src/share/vm/opto/callGenerator.cpp	Wed Jul 20 03:15:59 2016 +0100
@@ -134,7 +134,7 @@
     kit.C->log()->elem("direct_call bci='%d'", jvms->bci());
   }
 
-  CallStaticJavaNode *call = new (kit.C) CallStaticJavaNode(tf(), target, method(), kit.bci());
+  CallStaticJavaNode *call = new (kit.C) CallStaticJavaNode(kit.C, tf(), target, method(), kit.bci());
   _call_node = call;  // Save the call node in case we need it later
   if (!is_static) {
     // Make an explicit receiver null_check as part of this call.
@@ -304,29 +304,34 @@
 
 void LateInlineCallGenerator::do_late_inline() {
   // Can't inline it
-  if (call_node() == NULL || call_node()->outcnt() == 0 ||
-      call_node()->in(0) == NULL || call_node()->in(0)->is_top()) {
+  CallStaticJavaNode* call = call_node();
+  if (call == NULL || call->outcnt() == 0 ||
+      call->in(0) == NULL || call->in(0)->is_top()) {


More information about the distro-pkg-dev mailing list