Commit 3adcbaeb authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][gc] Zap code of unused WasmCode objects

This is the next step to test the GC better: We zap the code region of
{WasmCode} objects which are detected to be unused. This is tested in
the future variant, so ClusterFuzz has a chance to catch missing
references.

R=titzer@chromium.org

Bug: v8:8217
Change-Id: I75a63384a2a8e2ed68b9447e6ee4faa24037da93
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1571622Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60945}
parent 64d7300d
......@@ -1383,7 +1383,14 @@ std::vector<WasmCode*> NativeModule::AddCompiledCode(
}
void NativeModule::FreeCode(Vector<WasmCode* const> codes) {
// TODO(clemensh): Implement.
// For now, we neither free the {WasmCode} objects, nor do we free any code.
// We just zap the code to ensure it's not executed any more.
// TODO(clemensh): Actually free the {WasmCode} objects and the code pages.
for (WasmCode* code : codes) {
ZapCode(code->instruction_start(), code->instructions().size());
FlushInstructionCache(code->instruction_start(),
code->instructions().size());
}
}
void WasmCodeManager::FreeNativeModule(NativeModule* native_module) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment