Merge JDK-8200758-branch
authorherrick
Tue, 08 Jan 2019 17:20:28 -0500
branchJDK-8200758-branch
changeset 57104 57fead34cce2
parent 57103 fe6bf39ac415 (current diff)
parent 53201 28ec06beb091 (diff)
child 57105 3409e81fb3cb
Merge
--- a/src/hotspot/os/linux/osContainer_linux.cpp	Tue Jan 08 17:14:14 2019 -0500
+++ b/src/hotspot/os/linux/osContainer_linux.cpp	Tue Jan 08 17:20:28 2019 -0500
@@ -31,6 +31,24 @@
 #include "logging/log.hpp"
 #include "osContainer_linux.hpp"
 
+/*
+ * PER_CPU_SHARES has been set to 1024 because CPU shares' quota
+ * is commonly used in cloud frameworks like Kubernetes[1],
+ * AWS[2] and Mesos[3] in a similar way. They spawn containers with
+ * --cpu-shares option values scaled by PER_CPU_SHARES. Thus, we do
+ * the inverse for determining the number of possible available
+ * CPUs to the JVM inside a container. See JDK-8216366.
+ *
+ * [1] https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
+ *     In particular:
+ *        When using Docker:
+ *          The spec.containers[].resources.requests.cpu is converted to its core value, which is potentially
+ *          fractional, and multiplied by 1024. The greater of this number or 2 is used as the value of the
+ *          --cpu-shares flag in the docker run command.
+ * [2] https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html
+ * [3] https://github.com/apache/mesos/blob/3478e344fb77d931f6122980c6e94cd3913c441d/src/docker/docker.cpp#L648
+ *     https://github.com/apache/mesos/blob/3478e344fb77d931f6122980c6e94cd3913c441d/src/slave/containerizer/mesos/isolators/cgroups/constants.hpp#L30
+ */
 #define PER_CPU_SHARES 1024
 
 bool  OSContainer::_is_initialized   = false;
--- a/src/hotspot/share/ci/bcEscapeAnalyzer.cpp	Tue Jan 08 17:14:14 2019 -0500
+++ b/src/hotspot/share/ci/bcEscapeAnalyzer.cpp	Tue Jan 08 17:20:28 2019 -0500
@@ -79,7 +79,6 @@
   void add_unknown()                    { _bits = UNKNOWN; }
   void add_allocated()                  { _bits = ALLOCATED; }
   void set_union(const ArgumentMap &am)     { _bits |= am._bits; }
-  void set_intersect(const ArgumentMap &am) { _bits |= am._bits; }
   void set_difference(const ArgumentMap &am) { _bits &=  ~am._bits; }
   void operator=(const ArgumentMap &am) { _bits = am._bits; }
   bool operator==(const ArgumentMap &am) { return _bits == am._bits; }
@@ -1219,8 +1218,6 @@
 }
 
 bool BCEscapeAnalyzer::compute_escape_for_intrinsic(vmIntrinsics::ID iid) {
-  ArgumentMap arg;
-  arg.clear();
   switch (iid) {
   case vmIntrinsics::_getClass:
     _return_local = false;
--- a/src/hotspot/share/prims/jni.cpp	Tue Jan 08 17:14:14 2019 -0500
+++ b/src/hotspot/share/prims/jni.cpp	Tue Jan 08 17:20:28 2019 -0500
@@ -2709,6 +2709,9 @@
   ElementType* result; \
   int len = a->length(); \
   if (len == 0) { \
+    if (isCopy != NULL) { \
+      *isCopy = JNI_FALSE; \
+    } \
     /* Empty array: legal but useless, can't return NULL. \
      * Return a pointer to something useless. \
      * Avoid asserts in typeArrayOop. */ \
--- a/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java	Tue Jan 08 17:14:14 2019 -0500
+++ b/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java	Tue Jan 08 17:20:28 2019 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -92,10 +92,10 @@
      * same set of strings as the annotation.  If the class is not so
      * annotated, an empty set is returned.
      *
-     * If the {@link ProcessingEnvironment#getSourceVersion source
+     * If the {@linkplain ProcessingEnvironment#getSourceVersion source
      * version} does not support modules, in other words if it is less
      * than or equal to {@link SourceVersion#RELEASE_8 RELEASE_8},
-     * then any leading {@link Processor#getSupportedAnnotationTypes
+     * then any leading {@linkplain Processor#getSupportedAnnotationTypes
      * module prefixes} are stripped from the names.
      *
      * @return the names of the annotation types supported by this
--- a/src/java.compiler/share/classes/javax/annotation/processing/Filer.java	Tue Jan 08 17:14:14 2019 -0500
+++ b/src/java.compiler/share/classes/javax/annotation/processing/Filer.java	Tue Jan 08 17:20:28 2019 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -60,7 +60,7 @@
  * by {@code '/'}; {@code '.'} and {@code '..'} are invalid path
  * segments.  A valid relative name must match the
  * &quot;path-rootless&quot; rule of <a
- * href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>, section
+ * href="http://www.ietf.org/html/rfc3986.txt">RFC 3986</a>, section
  * 3.3.
  *
  * <p>The file creation methods take a variable number of arguments to
--- a/src/java.compiler/share/classes/javax/annotation/processing/Processor.java	Tue Jan 08 17:14:14 2019 -0500
+++ b/src/java.compiler/share/classes/javax/annotation/processing/Processor.java	Tue Jan 08 17:20:28 2019 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -59,7 +59,7 @@
  * constructor of the processor class.
  *
  * <li>Next, the tool calls the {@link #init init} method with
- * an appropriate {@code ProcessingEnvironment}.
+ * an appropriate {@link ProcessingEnvironment}.
  *
  * <li>Afterwards, the tool calls {@link #getSupportedAnnotationTypes
  * getSupportedAnnotationTypes}, {@link #getSupportedOptions
--- a/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java	Tue Jan 08 17:14:14 2019 -0500
+++ b/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java	Tue Jan 08 17:20:28 2019 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -317,7 +317,7 @@
 
         /**
          * Returns the specific modules to which the package is being exported,
-         * or null, if the package is exported to all modules which
+         * or {@code null}, if the package is exported to all modules which
          * have readability to this module.
          * @return the specific modules to which the package is being exported
          */
@@ -339,7 +339,7 @@
 
         /**
          * Returns the specific modules to which the package is being open
-         * or null, if the package is open all modules which
+         * or {@code null}, if the package is open all modules which
          * have readability to this module.
          * @return the specific modules to which the package is being opened
          */
--- a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java	Tue Jan 08 17:14:14 2019 -0500
+++ b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java	Tue Jan 08 17:20:28 2019 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -511,6 +511,7 @@
      * @param hidden  the second element
      * @return {@code true} if and only if the first element hides
      *          the second
+     * @jls 8.4.8 Inheritance, Overriding, and Hiding
      */
     boolean hides(Element hider, Element hidden);