Commit 80e18ce3 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[wasm] Remove InitializeMemoryProtectionKeyForTesting

After https://crrev.com/c/3315446 we allocate the memory protection key
unconditionally, so the method is redundant.

R=ahaas@chromium.org

Bug: v8:11974
Change-Id: I205a0cda86dfaf394c68788a662241d76a3f8510
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3347562Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78412}
parent 10bbbf13
......@@ -2127,12 +2127,6 @@ bool WasmCodeManager::MemoryProtectionKeyWritable() const {
return wasm::MemoryProtectionKeyWritable(memory_protection_key_);
}
void WasmCodeManager::InitializeMemoryProtectionKeyForTesting() {
if (memory_protection_key_ == kNoMemoryProtectionKey) {
memory_protection_key_ = AllocateMemoryProtectionKey();
}
}
std::shared_ptr<NativeModule> WasmCodeManager::NewNativeModule(
Isolate* isolate, const WasmFeatures& enabled, size_t code_size_estimate,
std::shared_ptr<const WasmModule> module) {
......
......@@ -1058,10 +1058,6 @@ class V8_EXPORT_PRIVATE WasmCodeManager final {
// Can only be called if {HasMemoryProtectionKeySupport()} is {true}.
bool MemoryProtectionKeyWritable() const;
// This allocates a memory protection key (if none was allocated before),
// independent of the --wasm-memory-protection-keys flag.
void InitializeMemoryProtectionKeyForTesting();
private:
friend class WasmCodeAllocator;
friend class WasmEngine;
......
......@@ -51,12 +51,9 @@ class MemoryProtectionTest : public TestWithNativeContext {
mode_ = mode;
bool enable_pku = mode == kPku || mode == kPkuWithMprotectFallback;
FLAG_wasm_memory_protection_keys = enable_pku;
if (enable_pku) {
GetWasmCodeManager()->InitializeMemoryProtectionKeyForTesting();
// The key is initially write-protected.
CHECK_IMPLIES(GetWasmCodeManager()->HasMemoryProtectionKeySupport(),
!GetWasmCodeManager()->MemoryProtectionKeyWritable());
}
// The key is initially write-protected.
CHECK_IMPLIES(GetWasmCodeManager()->HasMemoryProtectionKeySupport(),
!GetWasmCodeManager()->MemoryProtectionKeyWritable());
bool enable_mprotect =
mode == kMprotect || mode == kPkuWithMprotectFallback;
......
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