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:45 UTC
[groovy] 01/01: Tweak guards for receiver and parameters further
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)