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 10:49:54 UTC
[groovy] branch master updated: Check spread calls in advance
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 dbac220ad9 Check spread calls in advance
dbac220ad9 is described below
commit dbac220ad935a61734cc7e348aa4e5084f5ad45d
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();
}