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/05/15 12:44:44 UTC

[groovy] branch danielsun/lab-indy-20220515 created (now 88a43a93cc)

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

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


      at 88a43a93cc Tweak guards for receiver and parameters further

This branch includes the following new commits:

     new 88a43a93cc Tweak guards for receiver and parameters further

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: Tweak guards for receiver and parameters further

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

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

commit 88a43a93cc69feb47cf36ed2b427ef116fc5f782
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun May 15 20:44:05 2022 +0800

    Tweak guards for receiver and parameters further
---
 src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java b/src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java
index 12b45d4f3b..2352a1c21b 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java
@@ -949,7 +949,7 @@ public abstract class Selector {
                     test = MethodHandles.dropArguments(test, 0, drops);
                     handle = MethodHandles.guardWithTest(test, handle, fallback);
                 }
-            } else {
+            } else if (Arrays.stream(pt).anyMatch(paramType -> !Modifier.isFinal(paramType.getModifiers()))) {
                 // Avoid guards as possible as we could
                 MethodHandle test = SAME_CLASSES.bindTo(args)
                         .asCollector(Object[].class, pt.length)