From 370fb4a4d44032d8495a3cfca1df50e1ba9e834a Mon Sep 17 00:00:00 2001 From: vlivanov Date: Thu, 23 Apr 2015 18:01:38 +0300 Subject: [PATCH] 8059455: LambdaForm.prepare() does unnecessary work for cached LambdaForms Reviewed-by: psandoz --- src/share/classes/java/lang/invoke/LambdaForm.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/share/classes/java/lang/invoke/LambdaForm.java b/src/share/classes/java/lang/invoke/LambdaForm.java index 5c441071b..09a742f55 100644 --- a/src/share/classes/java/lang/invoke/LambdaForm.java +++ b/src/share/classes/java/lang/invoke/LambdaForm.java @@ -631,7 +631,7 @@ class LambdaForm { * as a sort of pre-invocation linkage step.) */ public void prepare() { - if (COMPILE_THRESHOLD == 0) { + if (COMPILE_THRESHOLD == 0 && !isCompiled) { compileToBytecode(); } if (this.vmentry != null) { @@ -645,11 +645,11 @@ class LambdaForm { /** Generate optimizable bytecode for this form. */ MemberName compileToBytecode() { - MethodType invokerType = methodType(); - assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType)); if (vmentry != null && isCompiled) { return vmentry; // already compiled somehow } + MethodType invokerType = methodType(); + assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType)); try { vmentry = InvokerBytecodeGenerator.generateCustomizedCode(this, invokerType); if (TRACE_INTERPRETER) -- GitLab