mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:18:12 +00:00
Revert "LibWasm: Some more performance stuff (#8812)"
This reverts commit 35394dbfaa
.
I pushed the wrong button again, hopefully this will be the last of
such incidents.
This commit is contained in:
parent
35394dbfaa
commit
23b48f8fe1
8 changed files with 27 additions and 49 deletions
|
@ -37,15 +37,12 @@ void BytecodeInterpreter::interpret(Configuration& configuration)
|
|||
auto& instructions = configuration.frame().expression().instructions();
|
||||
auto max_ip_value = InstructionPointer { instructions.size() };
|
||||
auto& current_ip_value = configuration.ip();
|
||||
auto const should_limit_instruction_count = configuration.should_limit_instruction_count();
|
||||
u64 executed_instructions = 0;
|
||||
|
||||
while (current_ip_value < max_ip_value) {
|
||||
if (should_limit_instruction_count) {
|
||||
if (executed_instructions++ >= Constants::max_allowed_executed_instructions_per_call) [[unlikely]] {
|
||||
m_trap = Trap { "Exceeded maximum allowed number of instructions" };
|
||||
return;
|
||||
}
|
||||
if (executed_instructions++ >= Constants::max_allowed_executed_instructions_per_call) [[unlikely]] {
|
||||
m_trap = Trap { "Exceeded maximum allowed number of instructions" };
|
||||
return;
|
||||
}
|
||||
auto& instruction = instructions[current_ip_value.value()];
|
||||
auto old_ip = current_ip_value;
|
||||
|
@ -1126,15 +1123,17 @@ void DebuggerBytecodeInterpreter::interpret(Configuration& configuration, Instru
|
|||
}
|
||||
}
|
||||
|
||||
BytecodeInterpreter::interpret(configuration, ip, instruction);
|
||||
|
||||
if (post_interpret_hook) {
|
||||
auto result = post_interpret_hook(configuration, ip, instruction, *this);
|
||||
if (!result) {
|
||||
m_trap = Trap { "Trapped by user request" };
|
||||
return;
|
||||
ScopeGuard guard { [&] {
|
||||
if (post_interpret_hook) {
|
||||
auto result = post_interpret_hook(configuration, ip, instruction, *this);
|
||||
if (!result) {
|
||||
m_trap = Trap { "Trapped by user request" };
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} };
|
||||
|
||||
BytecodeInterpreter::interpret(configuration, ip, instruction);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue