1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 08:24:58 +00:00
Commit graph

115 commits

Author SHA1 Message Date
Andreas Kling
12898f5aef LibJS/JIT: Compile the Decrement bytecode instruction 2023-10-27 19:07:22 +02:00
Andreas Kling
966b6f78a6 LibJS/JIT: Compile the GetByValue bytecode instruction 2023-10-27 19:07:22 +02:00
Andreas Kling
1c0efbec6b LibJS/JIT: Compile the ResolveThisBinding bytecode instruction 2023-10-27 19:07:22 +02:00
Andreas Kling
b2602a4bae LibJS/JIT: Compile the ToNumeric bytecode instruction 2023-10-27 19:07:22 +02:00
Andreas Kling
6a6ef6670c LibJS/JIT: Support the GetById bytecode op
We can now do basic property (get) access in jitted code! :^)
2023-10-27 19:07:22 +02:00
Andreas Kling
b923ca392d LibJS/JIT: Support all the binary bytecode ops :^)
(And use the X macro to avoid repeating ourselves!)
2023-10-27 19:07:22 +02:00
Andreas Kling
c2fe7af095 LibJS/JIT: Support the NewString bytecode op
This necessitated making the JIT::Compiler aware of the current
Bytecode::Executable, since that's where all the string literals are
held, but that seems like a good thing.
2023-10-27 19:07:22 +02:00
Andreas Kling
efe58ebf2f LibJS/JIT: Support the Return bytecode op 2023-10-27 19:07:22 +02:00
Andreas Kling
45be2a8f72 LibJS/JIT: Add support for Add/Sub/Mul/Div bytecode ops 2023-10-27 19:07:22 +02:00
Geo25rey
891b071654 LibJS/JIT: Add support for "throw" keyword 2023-10-27 19:07:22 +02:00
Andreas Kling
9dd5be0186 LibJS/JIT: Compile the EnterUnwindContext and LeaveUnwindContext ops
These push a "valid" unwind context on the stack and check_exception()
now knows how to jump to the (catch) handler if present.

(finally) finalizers will require some more work, but with this change,
we now have basic support for try...catch. :^)
2023-10-27 19:07:22 +02:00
Andreas Kling
e3560c2545 LibJS/JIT: Propagate exceptions in the simplest case :^)
We now establish a stack of "unwind contexts" similar to what the
bytecode interpreter does, but here, it's a stack of structs with
addresses to the catch and finally blocks.

Unwind contexts also have a "valid" flag, and the root unwind context
(always present, pushed on JIT code entry) has valid=false, which we
interpret in check_exception() as "return and let our caller deal with
the exception".

Anything in Compiler that may generate an exception should now also
call check_exception() ASAP to emit the code for handling this.
2023-10-27 19:07:22 +02:00
Andreas Kling
acece9057e LibJS/JIT: Make Assembler::Reg represent X86 registers
And move the generic register aliases to JIT::Compiler.
2023-10-27 19:07:22 +02:00
Andreas Kling
f9041c7b31 LibJS/JIT: Fast path for boolean JS::Value in compile_to_boolean() 2023-10-27 19:07:22 +02:00
Andreas Kling
babdc0a25b LibJS: Work-in-progress JIT compiler :^) 2023-10-27 19:07:22 +02:00