mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-24 00:49:46 +00:00
LibWasm: Move the interpreter IP out of the configuration object
This, along with moving the sources and destination out of the config object, makes it so we don't have to double-deref to get to them on each instruction, leading to a ~15% perf improvement on dispatch.
This commit is contained in:
parent
3e62cae2ad
commit
22448b0c35
Notes:
github-actions[bot]
2025-08-26 13:21:41 +00:00
Author: https://github.com/alimpfard
Commit: 22448b0c35
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5784
11 changed files with 2182 additions and 2172 deletions
|
|
@ -978,8 +978,10 @@ ParseResult<Expression> Expression::parse(ConstrainedStream& stream, Optional<si
|
|||
stack.append(ip);
|
||||
break;
|
||||
case Instructions::structured_end.value(): {
|
||||
if (stack.is_empty())
|
||||
if (stack.is_empty()) {
|
||||
instructions.empend(Instructions::synthetic_end_expression); // Synthetic noop to mark the end of the expression.
|
||||
return Expression { move(instructions) };
|
||||
}
|
||||
auto entry = stack.take_last();
|
||||
auto& args = instructions[entry.value()].arguments().get<Instruction::StructuredInstructionArgs>();
|
||||
// Patch the end_ip of the last structured instruction
|
||||
|
|
@ -999,6 +1001,8 @@ ParseResult<Expression> Expression::parse(ConstrainedStream& stream, Optional<si
|
|||
++ip;
|
||||
}
|
||||
|
||||
instructions.empend(Instructions::synthetic_end_expression); // Synthetic noop to mark the end of the expression.
|
||||
|
||||
return Expression { move(instructions) };
|
||||
}
|
||||
|
||||
|
|
@ -1106,7 +1110,10 @@ ParseResult<ElementSection::Element> ElementSection::Element::parse(ConstrainedS
|
|||
if (!has_exprs) {
|
||||
auto indices = TRY(parse_vector<GenericIndexParser<FunctionIndex>>(stream));
|
||||
for (auto& index : indices) {
|
||||
Vector<Instruction> instructions { Instruction(Instructions::ref_func, index) };
|
||||
Vector<Instruction> instructions {
|
||||
Instruction(Instructions::ref_func, index),
|
||||
Instruction(Instructions::synthetic_end_expression),
|
||||
};
|
||||
items.empend(move(instructions));
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue