Return-Path: X-Original-To: apmail-groovy-commits-archive@minotaur.apache.org Delivered-To: apmail-groovy-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 69E92187D4 for ; Fri, 15 Jan 2016 19:06:55 +0000 (UTC) Received: (qmail 46685 invoked by uid 500); 15 Jan 2016 19:06:55 -0000 Delivered-To: apmail-groovy-commits-archive@groovy.apache.org Received: (qmail 46655 invoked by uid 500); 15 Jan 2016 19:06:55 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 46646 invoked by uid 99); 15 Jan 2016 19:06:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jan 2016 19:06:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0F865E042F; Fri, 15 Jan 2016 19:06:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pascalschumacher@apache.org To: commits@groovy.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: groovy git commit: Provide static reference for indy setting (closes #118) Date: Fri, 15 Jan 2016 19:06:55 +0000 (UTC) Repository: groovy Updated Branches: refs/heads/master b7cb15839 -> a0c40f1fc Provide static reference for indy setting (closes #118) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a0c40f1f Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a0c40f1f Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a0c40f1f Branch: refs/heads/master Commit: a0c40f1fc7e5778c460b43577f7141dc3d794ef6 Parents: b7cb158 Author: Chris Earle Authored: Thu Sep 17 15:49:19 2015 -0400 Committer: pascalschumacher Committed: Fri Jan 15 20:05:32 2016 +0100 ---------------------------------------------------------------------- .../org/codehaus/groovy/classgen/asm/WriterController.java | 2 +- .../org/codehaus/groovy/control/CompilerConfiguration.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/a0c40f1f/src/main/org/codehaus/groovy/classgen/asm/WriterController.java ---------------------------------------------------------------------- diff --git a/src/main/org/codehaus/groovy/classgen/asm/WriterController.java b/src/main/org/codehaus/groovy/classgen/asm/WriterController.java index 7aaafd1..e6246b4 100644 --- a/src/main/org/codehaus/groovy/classgen/asm/WriterController.java +++ b/src/main/org/codehaus/groovy/classgen/asm/WriterController.java @@ -94,7 +94,7 @@ public class WriterController { optimizeForInt=false; // set other optimizations options to false here } else { - if (Boolean.TRUE.equals(optOptions.get("indy"))) invokedynamic=true; + if (Boolean.TRUE.equals(optOptions.get(CompilerConfiguration.INVOKEDYNAMIC))) invokedynamic=true; if (Boolean.FALSE.equals(optOptions.get("int"))) optimizeForInt=false; if (invokedynamic) optimizeForInt=false; // set other optimizations options to false here http://git-wip-us.apache.org/repos/asf/groovy/blob/a0c40f1f/src/main/org/codehaus/groovy/control/CompilerConfiguration.java ---------------------------------------------------------------------- diff --git a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java index 156d953..f71808f 100644 --- a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java +++ b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java @@ -39,6 +39,9 @@ public class CompilerConfiguration { private static final String JDK5_CLASSNAME_CHECK = "java.lang.annotation.Annotation"; + /** This ("indy") is the Optimization Option value for enabling invokedynamic complilation. */ + public static final String INVOKEDYNAMIC = "indy"; + /** This ("1.4") is the value for targetBytecode to compile for a JDK 1.4. **/ public static final String JDK4 = "1.4"; /** This ("1.5") is the value for targetBytecode to compile for a JDK 1.5. **/ @@ -214,12 +217,12 @@ public class CompilerConfiguration { } catch (Exception e) { // IGNORE } - if (DEFAULT!=null && Boolean.TRUE.equals(DEFAULT.getOptimizationOptions().get("indy"))) { + if (DEFAULT!=null && Boolean.TRUE.equals(DEFAULT.getOptimizationOptions().get(INVOKEDYNAMIC))) { indy = true; } Map options = new HashMap(3); if (indy) { - options.put("indy", Boolean.TRUE); + options.put(INVOKEDYNAMIC, Boolean.TRUE); } setOptimizationOptions(options); }