8067247: Crash: assert(method_holder->data() == 0 ...) failed: a) MT-unsafe modification of inline cache
authorjcm
Mon, 04 Apr 2016 02:07:28 -0700
changeset 37334 1169e9593135
parent 37333 774ed0e5e01b
child 37335 f218fd1bb19e
8067247: Crash: assert(method_holder->data() == 0 ...) failed: a) MT-unsafe modification of inline cache Summary: Made invoker LambdaForm instance & its compiled form lifetime tightly coupled. Reviewed-by: vlivanov
jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
--- a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Wed Mar 30 11:40:57 2016 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Mon Apr 04 02:07:28 2016 -0700
@@ -655,6 +655,8 @@
             mv.visitAnnotation(DONTINLINE_SIG, true);
         }
 
+        constantPlaceholder(lambdaForm); // keep LambdaForm instance & its compiled form lifetime tightly coupled.
+
         if (lambdaForm.customized != null) {
             // Since LambdaForm is customized for a particular MethodHandle, it's safe to substitute
             // receiver MethodHandle (at slot #0) with an embedded constant and use it instead.