1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 17:37:35 +00:00

LibJS/JIT: Let Compiler keep per-BasicBlock state internally

Compiler now has a BasicBlockData struct for each BasicBlock. The struct
contains all the stuff that we previously stored with the
Bytecode::BasicBlock.
This commit is contained in:
Andreas Kling 2023-10-26 15:05:33 +02:00
parent 8a24d00b1a
commit 022974a43a
3 changed files with 42 additions and 19 deletions

View file

@ -188,7 +188,12 @@ struct Assembler {
void link(Assembler& assembler)
{
offset_of_label_in_instruction_stream = assembler.m_output.size();
link_to(assembler, assembler.m_output.size());
}
void link_to(Assembler& assembler, size_t link_offset)
{
offset_of_label_in_instruction_stream = link_offset;
for (auto offset_in_instruction_stream : jump_slot_offsets_in_instruction_stream) {
auto offset = offset_of_label_in_instruction_stream - offset_in_instruction_stream;
auto jump_slot = offset_in_instruction_stream - 4;