ladybird/Userland/Libraries/LibJS/Bytecode
Luke Wilde 5bc3371226 LibJS: Perform received abrupt generator completions in the generator
Previously, throw and return completions would not be executed inside
the generator. This is incorrect, as throw and return need to perform
unwinds which can potentially execute more code inside the generator,
such as finally blocks.

This is done by also passing the completion type alongside the passed
in value. The continuation block will immediately extract and type and
value and perform the appropriate operation for the given type.

For normal completions, this is continuing as normal.
For throw completions, it will perform `throw <value>`.
For return completions, it will perform `return <value>`, which is a
`Yield return` in this case due to being inside a generator.

This also refactors GeneratorObject to properly send across the
completion type and value to the generator inside of trying to operate
on the completions itself.

This is a prerequisite for yield*, as it performs special iterator
operations when receiving a throw/return completion and does not
complete the generator like the regular yield would.

There's still more work to be done to make GeneratorObject::execute
be closer to the spec. It's mostly a restructuring of the existing
GeneratorObject::next_impl.
2022-11-26 12:55:59 +01:00
..
Pass LibJS: Add a note about inaccuracies to UnifySameBlocks 2022-11-01 11:21:18 +01:00
ASTCodegen.cpp LibJS: Perform received abrupt generator completions in the generator 2022-11-26 12:55:59 +01:00
BasicBlock.cpp AK+LibGfx+LibJS: Pass -1 as the file descriptor to anonymous mmap 2022-07-19 12:39:24 +02:00
BasicBlock.h LibJS: Always inline the bytecode instruction iterator's operator++ 2021-10-25 13:37:02 +02:00
CodeGenerationError.h LibJS: Make ASTNode::generate_bytecode() fallible 2022-02-13 14:41:33 +00:00
Executable.cpp LibJS: Add a separate "identifier table" to bytecode executables 2021-10-24 17:18:07 +02:00
Executable.h LibJS/Bytecode: Determine strict mode on an executable basis 2022-07-18 09:00:21 +01:00
Generator.cpp LibJS: Perform received abrupt generator completions in the generator 2022-11-26 12:55:59 +01:00
Generator.h LibJS: Align Instructions as void* and roundup variably sized ones sizes 2022-10-01 00:04:02 +01:00
IdentifierTable.cpp LibJS: Add a separate "identifier table" to bytecode executables 2021-10-24 17:18:07 +02:00
IdentifierTable.h AK+Everywhere: Replace DistinctNumeric bool parameters with named ones 2022-11-11 17:50:53 +03:30
Instruction.cpp LibJS: Move Instruction::length() to the Op.h header 2021-06-09 09:24:32 +02:00
Instruction.h LibJS: Align Instructions as void* and roundup variably sized ones sizes 2022-10-01 00:04:02 +01:00
Interpreter.cpp LibJS/Bytecode: Store unwind contexts inside RegisterWindow 2022-11-26 12:55:59 +01:00
Interpreter.h LibJS/Bytecode: Store unwind contexts inside RegisterWindow 2022-11-26 12:55:59 +01:00
Label.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Op.cpp LibJS+LibWeb: Make Runtime/AbstractOperations.h not include AST.h 2022-11-23 16:05:59 +00:00
Op.h LibJS: Forward a string aproximation of the CallExpression to Call Ops 2022-10-17 01:36:41 +02:00
PassManager.h LibJS: Add a basic pass manager and add some basic passes 2021-06-15 22:06:33 +04:30
Register.h LibJS: Remove Bytecode::Register::global_object() 2022-08-23 13:58:30 +01:00
StringTable.cpp LibJS: Use String and move semantics in Bytecode::StringTable 2021-10-24 17:18:07 +02:00
StringTable.h AK+Everywhere: Replace DistinctNumeric bool parameters with named ones 2022-11-11 17:50:53 +03:30