From 8496a7c536da8534b7f135959a348148cd025650 Mon Sep 17 00:00:00 2001 From: Jamsheed Mohammed C M Date: Mon, 4 Apr 2016 02:07:28 -0700 Subject: [PATCH] 8067247: Crash: assert(method_holder->data() == 0 ...) failed: a) MT-unsafe modification of inline cache Made invoker LambdaForm instance & its compiled form lifetime tightly coupled. Reviewed-by: vlivanov --- .../classes/java/lang/invoke/InvokerBytecodeGenerator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java index adec7ad5a50..08e38987bf2 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -655,6 +655,8 @@ class InvokerBytecodeGenerator { 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.