changeset 10240:f7bd3ef62b03 jdk8u181-b31

Merge
author aefimov
date Mon, 02 Jul 2018 16:27:56 +0100
parents 9062a259cecf (current diff) a09e16537a90 (diff)
children 837064324200
files .hgtags src/share/vm/oops/klass.cpp
diffstat 5 files changed, 36 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Jun 27 05:10:43 2018 -0700
+++ b/.hgtags	Mon Jul 02 16:27:56 2018 +0100
@@ -1131,6 +1131,13 @@
 39e2895b795aded8b584626fb019d35f12e9d1e7 jdk8u162-b11
 69aec2ca5d905dde1d0f29a89076d02a531808a3 jdk8u162-b12
 caac74fe3cfa9a8c859c28c97d1046a58252af27 jdk8u162-b31
+c9b7abadf150328d2187de05b9e8a9cba2486e47 jdk8u162-b32
+e8041f2ec96eb6a41307732e6cf6ed90901438ae jdk8u162-b33
+bf2e8b1e8e8e6bc1f9b9475de54ba0329a6b24b1 jdk8u162-b34
+9b3f207379cf6ecfb8603640269e31ff4e064294 jdk8u162-b35
+d2ebd6530396b0afc700cd1a8eaf1f7a7f9fce8d jdk8u162-b36
+700ad8745f3fdc5ba3702616fc5ed6a6248dfa78 jdk8u162-b37
+405800ccc4c7b81475b01392f2145cc3675d1f86 jdk8u162-b38
 a17bab9405474602b18cd62e060a09b17d6413ac jdk8u171-b00
 ebfd57cc21e6b7f0c22b17c666b6b28c9340e207 jdk8u171-b01
 1acd7c1b80241def8fac90f70b0df16356adad47 jdk8u171-b02
@@ -1156,6 +1163,13 @@
 aafd1bb21e2636ba982d3eae162f5c635a1df03a jdk8u172-b09
 dcd3ace969fcde4eedaddba629647656289d4264 jdk8u172-b10
 083a9d6562100353708e4b73656282b21a78f714 jdk8u172-b11
+d5a33d109309138a1e9bed43d2a2bda04356dbac jdk8u172-b31
+b62c44a689e4d339b1129bffceee94119c84b1b2 jdk8u172-b32
+e8745ad08d55bb56b2ac5a70ec0a972c38fa6ca2 jdk8u172-b33
+74350ee9c013a39acb6af32049599a26e6dc3911 jdk8u172-b34
+0d1b5f9b3ab040eb9023cde206cd67d4b5a54535 jdk8u172-b35
+1e7855b1ecd3d069bcaaf35259d35f79a7c66987 jdk8u172-b36
+6a9482b43d79e3e017f58a23ec4574dd696e04db jdk8u172-b37
 6e2be123a2e1c7671086c767e79ffe8ad5d4f9ca jdk8u181-b01
 1d0b6fcff115a57ca02081da84589630ba282789 jdk8u181-b02
 1127faef22f14d56cdd6c0c8bded598f492c2611 jdk8u181-b03
--- a/src/share/vm/c1/c1_Runtime1.cpp	Wed Jun 27 05:10:43 2018 -0700
+++ b/src/share/vm/c1/c1_Runtime1.cpp	Mon Jul 02 16:27:56 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -547,9 +547,8 @@
     // normal bytecode execution.
     thread->clear_exception_oop_and_pc();
 
-    Handle original_exception(thread, exception());
-
-    continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false);
+    bool recursive_exception = false;
+    continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false, recursive_exception);
     // If an exception was thrown during exception dispatch, the exception oop may have changed
     thread->set_exception_oop(exception());
     thread->set_exception_pc(pc);
@@ -557,8 +556,9 @@
     // the exception cache is used only by non-implicit exceptions
     // Update the exception cache only when there didn't happen
     // another exception during the computation of the compiled
-    // exception handler.
-    if (continuation != NULL && original_exception() == exception()) {
+    // exception handler. Checking for exception oop equality is not
+    // sufficient because some exceptions are pre-allocated and reused.
+    if (continuation != NULL && !recursive_exception) {
       nm->add_handler_for_exception_and_pc(exception, pc, continuation);
     }
   }
--- a/src/share/vm/opto/runtime.cpp	Wed Jun 27 05:10:43 2018 -0700
+++ b/src/share/vm/opto/runtime.cpp	Mon Jul 02 16:27:56 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -1234,17 +1234,23 @@
         force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc);
 
       if (handler_address == NULL) {
-        Handle original_exception(thread, exception());
-        handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true);
+        bool recursive_exception = false;
+        handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true, recursive_exception);
         assert (handler_address != NULL, "must have compiled handler");
         // Update the exception cache only when the unwind was not forced
         // and there didn't happen another exception during the computation of the
-        // compiled exception handler.
-        if (!force_unwind && original_exception() == exception()) {
+        // compiled exception handler. Checking for exception oop equality is not
+        // sufficient because some exceptions are pre-allocated and reused.
+        if (!force_unwind && !recursive_exception) {
           nm->add_handler_for_exception_and_pc(exception,pc,handler_address);
         }
       } else {
-        assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same");
+#ifdef ASSERT
+        bool recursive_exception = false;
+        address computed_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true, recursive_exception);
+        assert(recursive_exception || (handler_address == computed_address), err_msg("Handler address inconsistency: " PTR_FORMAT " != " PTR_FORMAT,
+                 p2i(handler_address), p2i(computed_address)));
+#endif
       }
     }
 
--- a/src/share/vm/runtime/sharedRuntime.cpp	Wed Jun 27 05:10:43 2018 -0700
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Mon Jul 02 16:27:56 2018 +0100
@@ -639,7 +639,7 @@
 // ret_pc points into caller; we are returning caller's exception handler
 // for given exception
 address SharedRuntime::compute_compiled_exc_handler(nmethod* nm, address ret_pc, Handle& exception,
-                                                    bool force_unwind, bool top_frame_only) {
+                                                    bool force_unwind, bool top_frame_only, bool& recursive_exception_occurred) {
   assert(nm != NULL, "must exist");
   ResourceMark rm;
 
@@ -667,6 +667,7 @@
         // BCI of the exception handler which caused the exception to be
         // thrown (bugs 4307310 and 4546590). Set "exception" reference
         // argument to ensure that the correct exception is thrown (4870175).
+        recursive_exception_occurred = true;
         exception = Handle(THREAD, PENDING_EXCEPTION);
         CLEAR_PENDING_EXCEPTION;
         if (handler_bci >= 0) {
--- a/src/share/vm/runtime/sharedRuntime.hpp	Wed Jun 27 05:10:43 2018 -0700
+++ b/src/share/vm/runtime/sharedRuntime.hpp	Mon Jul 02 16:27:56 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -184,7 +184,7 @@
 
   // exception handling and implicit exceptions
   static address compute_compiled_exc_handler(nmethod* nm, address ret_pc, Handle& exception,
-                                              bool force_unwind, bool top_frame_only);
+                                              bool force_unwind, bool top_frame_only, bool& recursive_exception_occurred);
   enum ImplicitExceptionKind {
     IMPLICIT_NULL,
     IMPLICIT_DIVIDE_BY_ZERO,