[ 
https://issues.apache.org/jira/browse/GROOVY-12325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18110898#comment-18110898
 ] 

ASF GitHub Bot commented on GROOVY-12325:
-----------------------------------------

testlens-app[bot] commented on PR #2852:
URL: https://github.com/apache/groovy/pull/2852#issuecomment-5517520353

   ## 🚨 TestLens detected 3 failed tests 🚨
   
   Here is what you can do:
   
   1) Inspect the test failures carefully.
   2) If you are convinced that some of the tests are flaky, you can mute them 
below.
   3) Finally, trigger a rerun by checking the rerun checkbox.
   
   ### Test Summary
   
   #### [Build and test / lts \(17, windows-latest, 
1\)](https://github.com/apache/groovy/actions/runs/33690247923/job/100447108661?pr=2852)
 > :groovy-groovysh:test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | GroovyPosixCommandsTest > 
headAndGrepAndWcStripControlCharactersFromNames\(\) | ❌ | 20% 🔴 |
   | GroovyPosixCommandsTest > lsStripsControlCharactersFromFileNames\(\) | ❌ | 
20% 🔴 |
   | GroovyPosixCommandsTest > lsStripsControlCharactersFromSymlinkTargets\(\) 
| ❌ | 20% 🔴 |
   
   🏷️ Commit: e2767e19554985c2e03a0c002e23c614f944c790
   ▶️ Tests:  70650 executed
   🟡 Checks: 8/29 completed
   
   ### Test Failures
   
   <details><summary><strong>GroovyPosixCommandsTest > 
headAndGrepAndWcStripControlCharactersFromNames()</strong> 
(:groovy-groovysh:test in <a 
href="https://github.com/apache/groovy/actions/runs/33690247923/job/100447108661?pr=2852";>Build
 and test / lts (17, windows-latest, 1)</a>)</summary>
   
   ```
   java.nio.file.InvalidPathException: Illegal char <> at index 2: 
oktrap.txt
        at 
java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at 
java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at 
java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at 
java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
        at java.base/java.nio.file.Path.resolve(Path.java:515)
        at 
java.base/jdk.internal.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at 
org.codehaus.groovy.reflection.CachedMethod.invokeReflective(CachedMethod.java:505)
        at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:455)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:298)
        at 
org.codehaus.groovy.vmplugin.v8.IndyInterface.invokeColdReflective(IndyInterface.java:648)
        at 
org.apache.groovy.groovysh.jline.GroovyPosixCommandsTest.headAndGrepAndWcStripControlCharactersFromNames(GroovyPosixCommandsTest.groovy:123)
   ```
   
   </details>
   <details><summary><strong>GroovyPosixCommandsTest > 
lsStripsControlCharactersFromFileNames()</strong> (:groovy-groovysh:test in <a 
href="https://github.com/apache/groovy/actions/runs/33690247923/job/100447108661?pr=2852";>Build
 and test / lts (17, windows-latest, 1)</a>)</summary>
   
   ```
   java.nio.file.InvalidPathException: Illegal char <> at index 2: 
oktrap.txt
        at 
java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at 
java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at 
java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at 
java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
        at java.base/java.nio.file.Path.resolve(Path.java:515)
        at 
java.base/jdk.internal.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at 
org.codehaus.groovy.reflection.CachedMethod.invokeReflective(CachedMethod.java:505)
        at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:455)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:298)
        at 
org.codehaus.groovy.vmplugin.v8.IndyInterface.invokeColdReflective(IndyInterface.java:648)
        at 
org.apache.groovy.groovysh.jline.GroovyPosixCommandsTest.lsStripsControlCharactersFromFileNames(GroovyPosixCommandsTest.groovy:97)
   ```
   
   </details>
   <details><summary><strong>GroovyPosixCommandsTest > 
lsStripsControlCharactersFromSymlinkTargets()</strong> (:groovy-groovysh:test 
in <a 
href="https://github.com/apache/groovy/actions/runs/33690247923/job/100447108661?pr=2852";>Build
 and test / lts (17, windows-latest, 1)</a>)</summary>
   
   ```
   java.nio.file.InvalidPathException: Illegal char <> at index 2: 
oktrap.txt
        at 
java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at 
java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at 
java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at 
java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
        at java.base/java.nio.file.Path.resolve(Path.java:515)
        at 
java.base/jdk.internal.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at 
org.codehaus.groovy.reflection.CachedMethod.invokeReflective(CachedMethod.java:505)
        at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:455)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:298)
        at 
org.codehaus.groovy.vmplugin.v8.IndyInterface.invokeColdReflective(IndyInterface.java:648)
        at 
org.apache.groovy.groovysh.jline.GroovyPosixCommandsTest.lsStripsControlCharactersFromSymlinkTargets(GroovyPosixCommandsTest.groovy:108)
   ```
   
   </details>
   
   ### Rerun Controls
   > [!NOTE]
   > Checks are currently running using the configuration below.
   
   Select tests to mute in this pull request:
   
   🔲 GroovyPosixCommandsTest > 
headAndGrepAndWcStripControlCharactersFromNames\(\) <!

> Speed up CachedMethod.invoke with a generated JIT-constant trampoline
> ---------------------------------------------------------------------
>
>                 Key: GROOVY-12325
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12325
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Priority: Major
>
> h2. Problem
> {{CachedMethod.invoke}} is the MOP/Java fallback used by {{MetaClassImpl}}, 
> classic uncompiled call sites, and the default indy cold tier 
> ({{invokeColdReflective}} -> {{doMethodInvoke}}).
> That path still calls {{java.lang.reflect.Method.invoke}}. A {{MethodHandle}} 
> held in an instance field is in the same performance band. After C2, only a 
> JIT-constant callee (direct {{invokevirtual}} / {{invokestatic}} / 
> {{invokeinterface}} in generated bytecode, or {{invokeExact}} of a {{static 
> final}} / classData handle, or a linked {{invokedynamic}} CallSite) runs like 
> a Java direct call.
> Hot monomorphic indy and {{@CompileStatic}} already have that shape. 
> {{CachedMethod.invoke}} does not.
> h2. Approach
> After {{groovy.cachedmethod.invoker.threshold}} hits (default 100, below 
> {{groovy.indy.optimize.threshold}} of 1000 so cold indy is still on 
> {{doMethodInvoke}} when the trampoline appears), install a generated 
> {{DirectInvoker}} behind {{CachedMethod.invoke}} only.
> Internal types live in {{org.apache.groovy.internal.runtime.invoke}} 
> (japicmp-excluded). Definition reuses {{HiddenClassDefiner}} (GROOVY-12223) 
> and {{ClassLoaderForClassArtifacts}}.
> Define order:
> # InvokerFactory nestmate + direct invoke when the member is publicly 
> invocable from that class ({{String.startsWith}}).
> # Declaring-class nestmate + direct invoke when {{privateLookupIn}} is 
> possible. Private class methods use {{invokevirtual}}; private interface 
> methods use {{invokeinterface}} (hidden nestmates do not subclass the host, 
> so {{invokespecial}} fails verification).
> # InvokerFactory nestmate + classData {{MethodHandle}} + {{invokeExact}} when 
> types are still resolvable from the runtime loader.
> # {{ClassLoaderForClassArtifacts}} when the host loader can resolve 
> {{DirectInvoker}} — never for bootstrap types.
> Failures sticky-return {{null}}; {{CachedMethod.invoke}} keeps 
> {{Method.invoke}}. Generation is skipped for caller-sensitive and abstract 
> methods, Android, native image, and when hidden classes are disabled.
> This is the MOP "Groovy as caller" path ({{makeAccessible}}). Indy continues 
> to {{unreflect}} with the call-site {{Lookup}} and must not be fed the 
> trampoline.
> h2. Configuration
> {noformat}
> -Dgroovy.cachedmethod.invoker.threshold=100
> -Dgroovy.cachedmethod.invoker.disable=true
> {noformat}
> The existing {{-Dgroovy.hidden.classes.disable=true}} also turns generation 
> off.
> h2. Compatibility
> * No change to the {{MetaMethod.invoke}} / {{CachedMethod.invoke}} signatures.
> * Selection (categories, EMC, interceptable, per-instance MetaClass) is 
> unchanged; the trampoline is bound to the Java {{Method}}, not to a 
> {{MetaMethod}} wrapper.
> * Wrong-argument type on the generated path is {{ClassCastException}} 
> (rethrown), matching DGM / {{CallSiteGenerator}}. The reflective path still 
> wraps {{IllegalArgumentException}} in {{InvokerInvocationException}}.
> * Opt-out: {{-Dgroovy.cachedmethod.invoker.disable=true}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to