mirror of
https://github.com/LSPosed/LSPlant.git
synced 2025-05-04 20:42:02 +08:00
Fix GarbageCollectCache got removed
Co-authored-by: JingMatrix <jingmatrix@gmail.com>
This commit is contained in:
parent
5121a21064
commit
0d9faca38d
@ -22,14 +22,23 @@ export class JitCodeCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MoveObsoleteMethods() {
|
||||||
|
auto movements = GetJitMovements();
|
||||||
|
LOGD("Before jit cache collection, moving %zu hooked methods", movements.size());
|
||||||
|
for (auto [target, backup] : movements) {
|
||||||
|
MoveObsoleteMethod(this, target, backup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CREATE_MEM_HOOK_STUB_ENTRY("_ZN3art3jit12JitCodeCache19GarbageCollectCacheEPNS_6ThreadE", void,
|
CREATE_MEM_HOOK_STUB_ENTRY("_ZN3art3jit12JitCodeCache19GarbageCollectCacheEPNS_6ThreadE", void,
|
||||||
GarbageCollectCache, (JitCodeCache * thiz, Thread *self), {
|
GarbageCollectCache, (JitCodeCache * thiz, Thread *self), {
|
||||||
auto movements = GetJitMovements();
|
thiz->MoveObsoleteMethods();
|
||||||
LOGD("Before jit cache gc, moving %zu hooked methods",
|
backup(thiz, self);
|
||||||
movements.size());
|
});
|
||||||
for (auto [target, backup] : movements) {
|
|
||||||
MoveObsoleteMethod(thiz, target, backup);
|
CREATE_MEM_HOOK_STUB_ENTRY("_ZN3art3jit12JitCodeCache12DoCollectionEPNS_6ThreadE", void,
|
||||||
}
|
DoCollection, (JitCodeCache * thiz, Thread *self), {
|
||||||
|
thiz->MoveObsoleteMethods();
|
||||||
backup(thiz, self);
|
backup(thiz, self);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -45,7 +54,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sdk_int >= __ANDROID_API_N__) [[likely]] {
|
if (sdk_int >= __ANDROID_API_N__) [[likely]] {
|
||||||
if (!HookSyms(handler, GarbageCollectCache)) [[unlikely]] {
|
if (!HookSyms(handler, GarbageCollectCache, DoCollection)) [[unlikely]] {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user