groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] branch master updated: Trivial refactoring: Extract common variable
Date Sat, 04 Jan 2020 12:54:26 GMT
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 82b06b4  Trivial refactoring: Extract common variable
82b06b4 is described below

commit 82b06b459af71e6b7d1b1283b5c775e8aac25f2a
Author: Daniel Sun <sunlan@apache.org>
AuthorDate: Sat Jan 4 20:53:51 2020 +0800

    Trivial refactoring: Extract common variable
---
 .../groovy/classgen/asm/indy/InvokeDynamicWriter.java     | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/indy/InvokeDynamicWriter.java
b/src/main/java/org/codehaus/groovy/classgen/asm/indy/InvokeDynamicWriter.java
index a1c2876..64c67d7 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/indy/InvokeDynamicWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/indy/InvokeDynamicWriter.java
@@ -121,25 +121,26 @@ public class InvokeDynamicWriter extends InvocationWriter {
         operandStack.replace(ClassHelper.OBJECT_TYPE, numberOfArguments);
         compileStack.popLHS();
     }
-    
+
     private void makeIndyCall(MethodCallerMultiAdapter adapter, Expression receiver, boolean
implicitThis, boolean safe, String methodName, Expression arguments) {
         OperandStack operandStack = controller.getOperandStack();
-        
+
         StringBuilder sig = new StringBuilder(prepareIndyCall(receiver, implicitThis));
-        
+
         // load arguments
         int numberOfArguments = 1;
         ArgumentListExpression ae = makeArgumentList(arguments);
         boolean containsSpreadExpression = AsmClassGenerator.containsSpreadExpression(arguments);
+        AsmClassGenerator acg = controller.getAcg();
         if (containsSpreadExpression) {
-            controller.getAcg().despreadList(ae.getExpressions(), true);
+            acg.despreadList(ae.getExpressions(), true);
             sig.append(getTypeDescription(Object[].class));
         } else {
             for (Expression arg : ae.getExpressions()) {
-                arg.visit(controller.getAcg());
+                arg.visit(acg);
                 if (arg instanceof CastExpression) {
                     operandStack.box();
-                    controller.getAcg().loadWrapper(arg);
+                    acg.loadWrapper(arg);
                     sig.append(getTypeDescription(Wrapper.class));
                 } else {
                     sig.append(getTypeDescription(operandStack.getTopOperand()));
@@ -150,7 +151,7 @@ public class InvokeDynamicWriter extends InvocationWriter {
 
         sig.append(")Ljava/lang/Object;");
         String callSiteName = METHOD.getCallSiteName();
-        if (adapter==null) callSiteName = INIT.getCallSiteName();
+        if (adapter == null) callSiteName = INIT.getCallSiteName();
         int flags = getMethodCallFlags(adapter, safe, containsSpreadExpression);
         finishIndyCall(BSM, callSiteName, sig.toString(), numberOfArguments, methodName,
flags);
     }


Mime
View raw message