mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
LibWasm: Implement parsing/validation for proposal exception-handling
Actual execution traps for now.
This commit is contained in:
parent
8138c2f48b
commit
d99f663b1a
Notes:
github-actions[bot]
2025-10-14 23:28:59 +00:00
Author: https://github.com/alimpfard
Commit: d99f663b1a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6278
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/gmta
14 changed files with 614 additions and 19 deletions
|
@ -617,6 +617,8 @@ JS::ThrowCompletionOr<Wasm::Value> to_webassembly_value(JS::VM& vm, JS::Value va
|
|||
cache.add_extern_value(extern_addr, value);
|
||||
return Wasm::Value { Wasm::Reference { Wasm::Reference::Extern { extern_addr } } };
|
||||
}
|
||||
case Wasm::ValueType::ExceptionReference:
|
||||
return Wasm::Value(Wasm::ValueType { Wasm::ValueType::Kind::ExceptionReference });
|
||||
case Wasm::ValueType::V128:
|
||||
return vm.throw_completion<JS::TypeError>("Cannot convert a vector value to a javascript value"sv);
|
||||
}
|
||||
|
@ -636,6 +638,8 @@ Wasm::Value default_webassembly_value(JS::VM& vm, Wasm::ValueType type)
|
|||
return Wasm::Value(type);
|
||||
case Wasm::ValueType::ExternReference:
|
||||
return MUST(to_webassembly_value(vm, JS::js_undefined(), type));
|
||||
case Wasm::ValueType::ExceptionReference:
|
||||
return Wasm::Value(type);
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
@ -680,6 +684,7 @@ JS::Value to_js_value(JS::VM& vm, Wasm::Value& wasm_value, Wasm::ValueType type)
|
|||
return value.release_value();
|
||||
}
|
||||
case Wasm::ValueType::V128:
|
||||
case Wasm::ValueType::ExceptionReference:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue