[
https://issues.apache.org/jira/browse/GROOVY-12137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18094287#comment-18094287
]
ASF GitHub Bot commented on GROOVY-12137:
-----------------------------------------
paulk-asert commented on code in PR #2673:
URL: https://github.com/apache/groovy/pull/2673#discussion_r3536515856
##########
src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java:
##########
@@ -1226,6 +1251,26 @@ void buildInvokeHandle() {
addExceptionHandler();
}
}
+
+ @Override
+ MetaMethod selectForColdReflection() {
+ if (safeNavigation || spread || args[0] == null
+ || args[0] instanceof Class || args[0] instanceof
GroovyInterceptable) {
+ return null;
+ }
Review Comment:
AI read: That hook is only reached for CallType.METHOD — the fallback gates
on it, so CastSelector/InterfaceSelector are never asked; I've added a
defensive check plus comments since that wasn't visible from the diff. The
instanceof Class test isn't about asType/cast: a Class receiver means a
static-method-style call, and those promote on their first hit anyway
(GROOVY-11935), so the reflective tier would buy nothing. Null receivers mean
NullObject MOP dispatch, which I kept out of the plain-call scope for the spike
— supportable later if the numbers justify it.
> experimental reflective cold tier for indy dispatch
> ---------------------------------------------------
>
> Key: GROOVY-12137
> URL: https://issues.apache.org/jira/browse/GROOVY-12137
> Project: Groovy
> Issue Type: Task
> Reporter: Paul King
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)