Commit 9d1b87ef authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm][debug] Remove interpreter redirection information

We don't redirect to the interpreter for debugging any more, hence we
can remove methods and data structures for storing and accessing
information about functions redirected to the interpreter.

R=thibaudm@chromium.org

Bug: v8:10389
Change-Id: I31ce1ef09748eb65d62910269548bc66eb02e01c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2164795Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67449}
parent 9827c716
......@@ -1103,21 +1103,7 @@ WasmCode* NativeModule::PublishCodeLocked(std::unique_ptr<WasmCode> code) {
// count cannot drop to zero here.
CHECK(!prior_code->DecRef());
}
}
// Populate optimized code to the jump table unless there is an active
// redirection to the interpreter that should be preserved.
DCHECK_NOT_NULL(main_jump_table_);
bool update_jump_table =
update_code_table && !has_interpreter_redirection(code->index());
// Ensure that interpreter entries always populate to the jump table.
if (code->kind() == WasmCode::Kind::kInterpreterEntry) {
SetInterpreterRedirection(code->index());
update_jump_table = true;
}
if (update_jump_table) {
PatchJumpTablesLocked(slot_idx, code->instruction_start());
}
}
......@@ -1851,11 +1837,6 @@ std::vector<std::unique_ptr<WasmCode>> NativeModule::AddCompiledCode(
return generated_code;
}
bool NativeModule::IsRedirectedToInterpreter(uint32_t func_index) {
base::MutexGuard lock(&allocation_mutex_);
return has_interpreter_redirection(func_index);
}
bool NativeModule::SetTieredDown() {
// Do not tier down asm.js.
if (module()->origin != kWasmOrigin) return true;
......
......@@ -595,10 +595,6 @@ class V8_EXPORT_PRIVATE NativeModule final {
V8_WARN_UNUSED_RESULT std::vector<std::unique_ptr<WasmCode>> AddCompiledCode(
Vector<WasmCompilationResult>);
// Allows to check whether a function has been redirected to the interpreter
// by publishing an entry stub with the {Kind::kInterpreterEntry} code kind.
bool IsRedirectedToInterpreter(uint32_t func_index);
// Set to tiered down state. Returns {true} if this caused a change, {false}
// otherwise.
bool SetTieredDown();
......@@ -667,30 +663,6 @@ class V8_EXPORT_PRIVATE NativeModule final {
// Hold the {allocation_mutex_} when calling {PublishCodeLocked}.
WasmCode* PublishCodeLocked(std::unique_ptr<WasmCode>);
// Hold the {allocation_mutex_} when calling this method.
bool has_interpreter_redirection(uint32_t func_index) {
DCHECK_LT(func_index, num_functions());
DCHECK_LE(module_->num_imported_functions, func_index);
if (!interpreter_redirections_) return false;
uint32_t bitset_idx = declared_function_index(module(), func_index);
uint8_t byte = interpreter_redirections_[bitset_idx / kBitsPerByte];
return byte & (1 << (bitset_idx % kBitsPerByte));
}
// Hold the {allocation_mutex_} when calling this method.
void SetInterpreterRedirection(uint32_t func_index) {
DCHECK_LT(func_index, num_functions());
DCHECK_LE(module_->num_imported_functions, func_index);
if (!interpreter_redirections_) {
interpreter_redirections_.reset(
new uint8_t[RoundUp<kBitsPerByte>(module_->num_declared_functions) /
kBitsPerByte]{});
}
uint32_t bitset_idx = declared_function_index(module(), func_index);
uint8_t& byte = interpreter_redirections_[bitset_idx / kBitsPerByte];
byte |= 1 << (bitset_idx % kBitsPerByte);
}
// {WasmCodeAllocator} manages all code reservations and allocations for this
// {NativeModule}.
WasmCodeAllocator code_allocator_;
......@@ -746,10 +718,6 @@ class V8_EXPORT_PRIVATE NativeModule final {
// imported functions.
std::unique_ptr<WasmCode*[]> code_table_;
// Null if no redirections exist, otherwise a bitset over all functions in
// this module marking those functions that have been redirected.
std::unique_ptr<uint8_t[]> interpreter_redirections_;
// Data (especially jump table) per code space.
std::vector<CodeSpaceData> code_space_data_;
......
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