mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS: Make bytecode generation infallible
Remove CodeGenerationError and make all bytecode generation functions return their results directly instead of wrapping them in CodeGenerationErrorOr. For the few remaining sites where codegen encounters an unimplemented or unexpected AST node, we now use a new emit_todo() helper that emits a NewTypeError + Throw sequence at compile time (preserving the runtime behavior) and then switches to a dead basic block so subsequent codegen for the same function can continue without issue. This allows us to remove error handling from all callers of the bytecode compiler, simplifying the code significantly.
This commit is contained in:
committed by
Andreas Kling
parent
20f50d1f71
commit
7281091fdb
Notes:
github-actions[bot]
2026-02-12 10:39:25 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/7281091fdb7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7903
@@ -22,7 +22,7 @@ public:
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
virtual ThrowCompletionOr<void> get_stack_frame_size(size_t& registers_and_locals_count, size_t& constants_count, size_t& argument_count) override;
|
||||
virtual void get_stack_frame_size(size_t& registers_and_locals_count, size_t& constants_count, size_t& argument_count) override;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user