mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
Perf & Fix: reduce ClassFileLoadHook overhead and fix retransform patch path
- Skip mutable event dispatch when no mutable listeners exist (hot path) - Wire retransformClass bytecode into pendingRetransform so patches are applied - Guard pendingRetransform with its mutex; check jvmti Allocate result - Store global refs in captured ClassFileData and release on re-capture - Add null/exception checks in defineClass/getLoadedClasses - Extract shared find_class_by_internal_name helper - Use CONFIGURE_DEPENDS for CMake globs; guard InitLogger; delete leaked jArgs
This commit is contained in:
1 parent
8cf2b8330c
commit
bb5b215a33
10 files changed
+198
-130
No files matched your search
@@ -34,5 +34,10 @@ void JNICALL ClassFileLoadHook(
|
||||
|
||||
agent.get_eventbus().post(event);
|
||||
|
||||
agent.get_eventbus().post_mutable(event);
|
||||
}
|
||||
// Only dispatch the mutable variant when there are actual mutable listeners.
|
||||
// Avoids a redundant map lookup + vector copy on every class load (hot path).
|
||||
if (agent.get_eventbus().has_mutable_listeners<EventClassFileLoadHook>()) {
|
||||
agent.get_eventbus().post_mutable(event);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user