LibWeb: Add Wasm Web-API streaming compilation and instantiation

This requires fixing up the "parameter is a promise" handling in
the IDL generator.
This commit is contained in:
Andrew Kaster 2024-10-26 17:34:09 -06:00 committed by Andrew Kaster
commit 36feebb1e7
Notes: github-actions[bot] 2024-11-01 17:43:14 +00:00
7 changed files with 250 additions and 9 deletions

View file

@ -23,9 +23,11 @@ void finalize(JS::Object&);
bool validate(JS::VM&, JS::Handle<WebIDL::BufferSource>& bytes);
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> compile(JS::VM&, JS::Handle<WebIDL::BufferSource>& bytes);
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> compile_streaming(JS::VM&, JS::Handle<WebIDL::Promise> source);
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> instantiate(JS::VM&, JS::Handle<WebIDL::BufferSource>& bytes, Optional<JS::Handle<JS::Object>>& import_object);
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> instantiate(JS::VM&, Module const& module_object, Optional<JS::Handle<JS::Object>>& import_object);
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> instantiate_streaming(JS::VM&, JS::Handle<WebIDL::Promise> source, Optional<JS::Handle<JS::Object>>& import_object);
namespace Detail {
struct CompiledWebAssemblyModule : public RefCounted<CompiledWebAssemblyModule> {