You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2022/12/18 09:55:44 UTC

[groovy] branch danielsun/tweak_indy created (now 44ea1b0592)

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a change to branch danielsun/tweak_indy
in repository https://gitbox.apache.org/repos/asf/groovy.git


      at 44ea1b0592 Check spread calls in advance

This branch includes the following new commits:

     new 44ea1b0592 Check spread calls in advance

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[groovy] 01/01: Check spread calls in advance

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 44ea1b059217f716e0f1961bc0996cbc3c2d7d4a
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Dec 18 17:55:16 2022 +0800

    Check spread calls in advance
---
 src/main/java/org/codehaus/groovy/vmplugin/v8/IndyInterface.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/vmplugin/v8/IndyInterface.java b/src/main/java/org/codehaus/groovy/vmplugin/v8/IndyInterface.java
index 4d2ae2b300..4cb6c545c7 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v8/IndyInterface.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v8/IndyInterface.java
@@ -293,7 +293,7 @@ public class IndyInterface {
         FallbackSupplier fallbackSupplier = new FallbackSupplier(callSite, sender, methodName, callID, safeNavigation, thisCall, spreadCall, dummyReceiver, arguments);
 
         MethodHandleWrapper mhw =
-                bypassCache(arguments)
+                bypassCache(spreadCall, arguments)
                     ? NULL_METHOD_HANDLE_WRAPPER
                     : doWithCallSite(
                             callSite, arguments,
@@ -321,7 +321,8 @@ public class IndyInterface {
         return mhw.getCachedMethodHandle().invokeExact(arguments);
     }
 
-    private static boolean bypassCache(Object[] arguments) {
+    private static boolean bypassCache(Boolean spreadCall, Object[] arguments) {
+        if (spreadCall) return true;
         final Object receiver = arguments[0];
         return null != receiver && ClassInfo.getClassInfo(receiver.getClass()).hasPerInstanceMetaClasses();
     }