Commit 73811dad authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Register win64 unwind info for each code space

We need to register the unwind info for each code space (it was just
done for the first one). Otherwise we fail when freeing the native
module, where we try to unregister the unwind info again for each code
space.

This CL moves the call to {RegisterNonABICompliantCodeRange} from
{NewNativeModule} to {AddCodeSpace}, so it happens whenever a new code
space is added.

R=jgruber@chromium.org
CC=​paolosev@microsoft.com

Bug: chromium:1008597, v8:9477, v8:9795
Change-Id: I20121b2a2fde4d37432dd7e13b19cdf99129e6a4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1832178
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64078}
parent a12bfa9e
......@@ -1217,6 +1217,8 @@ void NativeModule::AddCodeSpace(base::AddressRegion region) {
Vector<byte> padding =
code_allocator_.AllocateForCodeInRegion(this, size, region);
CHECK_EQ(reinterpret_cast<Address>(padding.begin()), region.begin());
win64_unwindinfo::RegisterNonABICompliantCodeRange(
reinterpret_cast<void*>(region.begin()), region.size());
}
#endif // V8_OS_WIN64
......@@ -1604,13 +1606,6 @@ std::shared_ptr<NativeModule> WasmCodeManager::NewNativeModule(
TRACE_HEAP("New NativeModule %p: Mem: %" PRIuPTR ",+%zu\n", ret.get(), start,
size);
#if defined(V8_OS_WIN64)
if (CanRegisterUnwindInfoForNonABICompliantCodeRange()) {
win64_unwindinfo::RegisterNonABICompliantCodeRange(
reinterpret_cast<void*>(start), size);
}
#endif // V8_OS_WIN64
base::MutexGuard lock(&native_modules_mutex_);
lookup_map_.insert(std::make_pair(start, std::make_pair(end, ret.get())));
return ret;
......
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