mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibJS/JIT: Compile the DeleteByValue instruction
This commit is contained in:
parent
f5fcd4596c
commit
0776404e03
Notes:
sideshowbarker
2024-07-17 06:54:15 +09:00
Author: https://github.com/jakubberkop
Commit: 0776404e03
Pull-request: https://github.com/SerenityOS/serenity/pull/21680
6 changed files with 33 additions and 10 deletions
|
@ -1108,16 +1108,10 @@ ThrowCompletionOr<void> PutByValueWithThis::execute_impl(Bytecode::Interpreter&
|
|||
|
||||
ThrowCompletionOr<void> DeleteByValue::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
{
|
||||
auto& vm = interpreter.vm();
|
||||
|
||||
// NOTE: Get the property key from the accumulator before side effects have a chance to overwrite it.
|
||||
auto property_key_value = interpreter.accumulator();
|
||||
|
||||
auto base_value = interpreter.reg(m_base);
|
||||
auto property_key = TRY(property_key_value.to_property_key(vm));
|
||||
bool strict = vm.in_strict_mode();
|
||||
auto reference = Reference { base_value, property_key, {}, strict };
|
||||
interpreter.accumulator() = Value(TRY(reference.delete_(vm)));
|
||||
auto property_key_value = interpreter.accumulator();
|
||||
interpreter.accumulator() = TRY(delete_by_value(interpreter, base_value, property_key_value));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue