Merge epsilon-gc-branch
authorshade
Mon, 11 Jun 2018 21:08:01 +0200
branchepsilon-gc-branch
changeset 56740 d6b3c3658d3d
parent 56737 24339b23a56b (current diff)
parent 50507 e5cdf2569510 (diff)
child 56741 f21420b61fd2
Merge
src/hotspot/share/runtime/arguments.cpp
--- a/make/InitSupport.gmk	Mon Jun 11 20:40:30 2018 +0200
+++ b/make/InitSupport.gmk	Mon Jun 11 21:08:01 2018 +0200
@@ -34,6 +34,9 @@
 
 ifeq ($(HAS_SPEC),)
 
+  # COMMA is defined in spec.gmk, but that is not included yet
+  COMMA := ,
+
   # Include the corresponding closed file, if present.
   ifneq ($(CUSTOM_MAKE_DIR), )
     -include $(CUSTOM_MAKE_DIR)/InitSupport.gmk
@@ -531,8 +534,6 @@
 define ParseLogOption
   ifneq ($$(findstring $1, $$(LOG)),)
     override $2 := true
-    # COMMA is defined in spec.gmk, but that is not included yet
-    COMMA := ,
     # First try to remove ",<option>" if it exists, otherwise just remove "<option>"
     LOG_STRIPPED := $$(subst $1,, $$(subst $$(COMMA)$$(strip $1),, $$(LOG)))
     # We might have ended up with a leading comma. Remove it. Need override
@@ -550,8 +551,6 @@
     # Make words of out comma-separated list and find the one with opt=val
     value := $$(strip $$(subst $$(strip $1)=,, $$(filter $$(strip $1)=%, $$(subst $$(COMMA), , $$(LOG)))))
     override $2 := $$(value)
-    # COMMA is defined in spec.gmk, but that is not included yet
-    COMMA := ,
     # First try to remove ",<option>" if it exists, otherwise just remove "<option>"
     LOG_STRIPPED := $$(subst $$(strip $1)=$$(value),, \
         $$(subst $$(COMMA)$$(strip $1)=$$(value),, $$(LOG)))
--- a/make/lib/CoreLibraries.gmk	Mon Jun 11 20:40:30 2018 +0200
+++ b/make/lib/CoreLibraries.gmk	Mon Jun 11 21:08:01 2018 +0200
@@ -347,7 +347,8 @@
       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
       OPTIMIZATION := HIGH, \
-      CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
+      CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
+          $(addprefix -I, $(LIBJLI_SRC_DIRS)), \
       ARFLAGS := $(ARFLAGS), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
 
--- a/src/hotspot/os/aix/os_aix.cpp	Mon Jun 11 20:40:30 2018 +0200
+++ b/src/hotspot/os/aix/os_aix.cpp	Mon Jun 11 21:08:01 2018 +0200
@@ -899,8 +899,12 @@
   // guard pages might not fit on the tiny stack created.
   int ret = pthread_attr_setstacksize(&attr, stack_size);
   if (ret != 0) {
-    log_warning(os, thread)("The thread stack size specified is invalid: " SIZE_FORMAT "k",
+    log_warning(os, thread)("The %sthread stack size specified is invalid: " SIZE_FORMAT "k",
+                            (thr_type == compiler_thread) ? "compiler " : ((thr_type == java_thread) ? "" : "VM "),
                             stack_size / K);
+    thread->set_osthread(NULL);
+    delete osthread;
+    return false;
   }
 
   // Save some cycles and a page by disabling OS guard pages where we have our own
--- a/src/hotspot/os/linux/os_linux.cpp	Mon Jun 11 20:40:30 2018 +0200
+++ b/src/hotspot/os/linux/os_linux.cpp	Mon Jun 11 21:08:01 2018 +0200
@@ -1988,6 +1988,8 @@
 
   os::Linux::print_full_memory_info(st);
 
+  os::Linux::print_proc_sys_info(st);
+
   os::Linux::print_container_info(st);
 }
 
@@ -2120,6 +2122,24 @@
   st->cr();
 }
 
+void os::Linux::print_proc_sys_info(outputStream* st) {
+  st->cr();
+  st->print_cr("/proc/sys/kernel/threads-max (system-wide limit on the number of threads):");
+  _print_ascii_file("/proc/sys/kernel/threads-max", st);
+  st->cr();
+  st->cr();
+
+  st->print_cr("/proc/sys/vm/max_map_count (maximum number of memory map areas a process may have):");
+  _print_ascii_file("/proc/sys/vm/max_map_count", st);
+  st->cr();
+  st->cr();
+
+  st->print_cr("/proc/sys/kernel/pid_max (system-wide limit on number of process identifiers):");
+  _print_ascii_file("/proc/sys/kernel/pid_max", st);
+  st->cr();
+  st->cr();
+}
+
 void os::Linux::print_full_memory_info(outputStream* st) {
   st->print("\n/proc/meminfo:\n");
   _print_ascii_file("/proc/meminfo", st);
--- a/src/hotspot/os/linux/os_linux.hpp	Mon Jun 11 20:40:30 2018 +0200
+++ b/src/hotspot/os/linux/os_linux.hpp	Mon Jun 11 21:08:01 2018 +0200
@@ -113,6 +113,7 @@
   static void print_container_info(outputStream* st);
   static void print_distro_info(outputStream* st);
   static void print_libversion_info(outputStream* st);
+  static void print_proc_sys_info(outputStream* st);
 
  public:
   static bool _stack_is_executable;
--- a/src/hotspot/share/gc/parallel/pcTasks.cpp	Mon Jun 11 20:40:30 2018 +0200
+++ b/src/hotspot/share/gc/parallel/pcTasks.cpp	Mon Jun 11 21:08:01 2018 +0200
@@ -149,19 +149,16 @@
 void RefProcTaskExecutor::execute(ProcessTask& task)
 {
   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
-  uint parallel_gc_threads = heap->gc_task_manager()->workers();
   uint active_gc_threads = heap->gc_task_manager()->active_workers();
   OopTaskQueueSet* qset = ParCompactionManager::stack_array();
   ParallelTaskTerminator terminator(active_gc_threads, qset);
   GCTaskQueue* q = GCTaskQueue::create();
-  for(uint i=0; i<parallel_gc_threads; i++) {
+  for(uint i=0; i<active_gc_threads; i++) {
     q->enqueue(new RefProcTaskProxy(task, i));
   }
-  if (task.marks_oops_alive()) {
-    if (parallel_gc_threads>1) {
-      for (uint j=0; j<active_gc_threads; j++) {
-        q->enqueue(new StealMarkingTask(&terminator));
-      }
+  if (task.marks_oops_alive() && (active_gc_threads>1)) {
+    for (uint j=0; j<active_gc_threads; j++) {
+      q->enqueue(new StealMarkingTask(&terminator));
     }
   }
   PSParallelCompact::gc_task_manager()->execute_and_wait(q);
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Mon Jun 11 20:40:30 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Mon Jun 11 21:08:01 2018 +0200
@@ -2112,7 +2112,10 @@
 
     ReferenceProcessorStats stats;
     ReferenceProcessorPhaseTimes pt(&_gc_timer, ref_processor()->max_num_queues());
+
     if (ref_processor()->processing_is_mt()) {
+      ref_processor()->set_active_mt_degree(active_gc_threads);
+
       RefProcTaskExecutor task_executor;
       stats = ref_processor()->process_discovered_references(
         is_alive_closure(), &mark_and_push_closure, &follow_stack_closure,
--- a/src/hotspot/share/opto/loopopts.cpp	Mon Jun 11 20:40:30 2018 +0200
+++ b/src/hotspot/share/opto/loopopts.cpp	Mon Jun 11 21:08:01 2018 +0200
@@ -1743,6 +1743,23 @@
   }
 }
 
+static void clone_outer_loop_helper(Node* n, const IdealLoopTree *loop, const IdealLoopTree* outer_loop,
+                                    const Node_List &old_new, Unique_Node_List& wq, PhaseIdealLoop* phase,
+                                    bool check_old_new) {
+  for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
+    Node* u = n->fast_out(j);
+    assert(check_old_new || old_new[u->_idx] == NULL, "shouldn't have been cloned");
+    if (!u->is_CFG() && (!check_old_new || old_new[u->_idx] == NULL)) {
+      Node* c = phase->get_ctrl(u);
+      IdealLoopTree* u_loop = phase->get_loop(c);
+      assert(!loop->is_member(u_loop), "can be in outer loop or out of both loops only");
+      if (outer_loop->is_member(u_loop)) {
+        wq.push(u);
+      }
+    }
+  }
+}
+
 void PhaseIdealLoop::clone_outer_loop(LoopNode* head, CloneLoopMode mode, IdealLoopTree *loop,
                                       IdealLoopTree* outer_loop, int dd, Node_List &old_new,
                                       Node_List& extra_data_nodes) {
@@ -1847,6 +1864,22 @@
       _igvn.register_new_node_with_optimizer(new_sfpt);
       _igvn.register_new_node_with_optimizer(new_cle_out);
     }
+    // Some other transformation may have pessimistically assign some
+    // data nodes to the outer loop. Set their control so they are out
+    // of the outer loop.
+    ResourceMark rm;
+    Unique_Node_List wq;
+    for (uint i = 0; i < extra_data_nodes.size(); i++) {
+      Node* old = extra_data_nodes.at(i);
+      clone_outer_loop_helper(old, loop, outer_loop, old_new, wq, this, true);
+    }
+    Node* new_ctrl = cl->outer_loop_exit();
+    assert(get_loop(new_ctrl) != outer_loop, "must be out of the loop nest");
+    for (uint i = 0; i < wq.size(); i++) {
+      Node* n = wq.at(i);
+      set_ctrl(n, new_ctrl);
+      clone_outer_loop_helper(n, loop, outer_loop, old_new, wq, this, false);
+    }
   } else {
     Node *newhead = old_new[loop->_head->_idx];
     set_idom(newhead, newhead->in(LoopNode::EntryControl), dd);
@@ -1947,7 +1980,7 @@
   }
 
   ResourceArea *area = Thread::current()->resource_area();
-  Node_List extra_data_nodes(area);
+  Node_List extra_data_nodes(area); // data nodes in the outer strip mined loop
   clone_outer_loop(head, mode, loop, outer_loop, dd, old_new, extra_data_nodes);
 
   // Step 3: Now fix control uses.  Loop varying control uses have already
--- a/src/hotspot/share/runtime/arguments.cpp	Mon Jun 11 20:40:30 2018 +0200
+++ b/src/hotspot/share/runtime/arguments.cpp	Mon Jun 11 21:08:01 2018 +0200
@@ -1266,9 +1266,13 @@
     char stripped_argname[BUFLEN+1]; // +1 for '\0'
     jio_snprintf(stripped_argname, arg_len+1, "%s", argname); // +1 for '\0'
     if (is_obsolete_flag(stripped_argname, &since)) {
-      char version[256];
-      since.to_string(version, sizeof(version));
-      warning("Ignoring option %s; support was removed in %s", stripped_argname, version);
+      if (strcmp(stripped_argname, "UseAppCDS") != 0) {
+        char version[256];
+        since.to_string(version, sizeof(version));
+        warning("Ignoring option %s; support was removed in %s", stripped_argname, version);
+      } else {
+        warning("Ignoring obsolete option UseAppCDS; AppCDS is automatically enabled");
+      }
       return true;
     }
 #ifndef PRODUCT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/loopstripmining/UnexpectedNodeInOuterLoopWhenCloning.java	Mon Jun 11 21:08:01 2018 +0200
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. 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 8202747
+ * @summary C2: assert(mode == ControlAroundStripMined && use == sfpt) failed: missed a node
+ *
+ * @run main/othervm -Xcomp -Xbatch -XX:CompileOnly=UnexpectedNodeInOuterLoopWhenCloning -XX:-TieredCompilation UnexpectedNodeInOuterLoopWhenCloning
+ *
+ */
+
+public class UnexpectedNodeInOuterLoopWhenCloning {
+
+    public static final int N = 400;
+
+    public static double dFld=0.37026;
+    public static int iArrFld[]=new int[N];
+
+    public static void vMeth() {
+
+        int i5=6, i6=-42538, i7=-209, i8=163, i10=-4, i11=191;
+        boolean b=true;
+        double dArr[]=new double[N];
+
+        for (i5 = 3; i5 < 245; i5++) {
+            i7 = 7;
+            while (--i7 > 0) {
+                iArrFld[i7] = -11995;
+                if (b) continue;
+            }
+            for (i8 = 1; i8 < 7; ++i8) {
+                for (i10 = 1; i10 < 2; i10++) {
+                    dFld -= i6;
+                    i11 += i7;
+                }
+            }
+        }
+    }
+
+    public static void main(String[] strArr) {
+        UnexpectedNodeInOuterLoopWhenCloning _instance = new UnexpectedNodeInOuterLoopWhenCloning();
+        _instance.vMeth();
+    }
+}
--- a/test/hotspot/jtreg/runtime/appcds/CommandLineFlagComboNegative.java	Mon Jun 11 20:40:30 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/CommandLineFlagComboNegative.java	Mon Jun 11 21:08:01 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -71,6 +71,8 @@
                 "Class data sharing is inconsistent with other specified options", 1) );
             testTable.add( new TestVector("-XX:+UseCompressedClassPointers", "-XX:-UseCompressedClassPointers",
                 "Class data sharing is inconsistent with other specified options", 1) );
+            testTable.add( new TestVector("-XX:-UseAppCDS", "-XX:+UseAppCDS",
+                "Ignoring obsolete option UseAppCDS; AppCDS is automatically enabled", 0) );
         }
     }