summaryrefslogtreecommitdiff
path: root/CLAUDE.md
diff options
context:
space:
mode:
Diffstat (limited to 'CLAUDE.md')
-rw-r--r--CLAUDE.md20
1 files changed, 14 insertions, 6 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
index 19b963e..1bfdfac 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -25,6 +25,8 @@ table). Read it before changing generation behavior.
stub calls into.
- `stubs/src/kotlin/proxy/KotlinProxyOverrides.java` — per-method custom return
values: the extension point for actually *implementing* stub methods.
+- `stubs/src/kotlin/proxy/ProxyPerformanceManager.java` — override support
+ class (per-compiler-instance perf manager) returned by the overrides.
- `jars/defs.txt`, `jars/scan.txt`, `jars/fallback.txt` — jar list files feeding
the generator (one jar path per line, `#` = comment).
- `dist/kotlin-proxy-compiler-stubs.jar` — the build artifact (gitignored).
@@ -46,14 +48,16 @@ python3 tools/gen_class.py \
javac -nowarn -proc:none -d stubs/classes_min \
-cp "$(grep -v '^[[:space:]]*#' jars/defs.txt | tr '\n' ':')" \
stubs/src/kotlin/proxy/KotlinProxyLog.java \
- stubs/src/kotlin/proxy/KotlinProxyOverrides.java
+ stubs/src/kotlin/proxy/KotlinProxyOverrides.java \
+ stubs/src/kotlin/proxy/ProxyPerformanceManager.java
# 3. Package
jar cf dist/kotlin-proxy-compiler-stubs.jar -C stubs/classes_min .
```
-The result is 5 class files + manifest: the three seeded stubs plus
-`kotlin/proxy/KotlinProxyLog` and `kotlin/proxy/KotlinProxyOverrides`. The
+The result is 6 class files + manifest: the three seeded stubs plus
+`kotlin/proxy/KotlinProxyLog`, `kotlin/proxy/KotlinProxyOverrides`, and
+`kotlin/proxy/ProxyPerformanceManager`. The
seed trio are **the only** classes stubbed (the "trio" mode); their
superclasses/interfaces (`CLICompiler`, `K2JVMCompilerArguments`, …) are
*not* stubbed and resolve from the real jars on the daemon classpath.
@@ -71,8 +75,10 @@ machinery NPEs after calling into the stub). That is the intended state. To
confirm the stub actually ran *inside the out-of-process daemon*, read the marker
file `/tmp/kotlin-proxy-marker.txt` — a daemon run shows thread names
`RMI TCP Connection(N)` and `LOAD …/dist/kotlin-proxy-compiler-stubs.jar` lines.
-An `OVERRIDE <owner>.<member> -> <dump>` line shows a
-`KotlinProxyOverrides.invoke` implementation supplied the return value.
+An `OVERRIDE <owner>.<member> inst=0x… -> <dump>` line shows a
+`KotlinProxyOverrides.invoke` implementation supplied the return value
+(`inst` is the receiver instance the method was called on — omitted for
+statics).
The marker path is fixed regardless of the daemon's working dir or missing
`-Dkotlin.proxy.log`, so it is the reliable proof.
@@ -95,7 +101,9 @@ Sanity-check generated bytecode with `javap -c stubs/classes_min/org/jetbrains/k
boxed; `null` when param-less) and ask `KotlinProxyLog.returnValue`, which
consults `KotlinProxyOverrides.invoke` first (per-method custom
implementations — the hook for actually *implementing* a stub method with
- real arguments) and falls back to materializing a *real* instance of the
+ real arguments and the receiver — the stub instance the method was called
+ on, `null` for statics — so overrides can keep per-instance state) and
+ falls back to materializing a *real* instance of the
declared return type so the daemon can proceed (e.g. `createArguments()`
yields a real `K2JVMCompilerArguments`).
Param-less erasure bridges forward to their concrete sibling instead of