mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
LibWasm: Stop using ConstrainedStream
for function parsing
Speeds up spidermonkey.wasm instantiation by around 20ms (260ms -> 240ms)
This commit is contained in:
parent
5cde327d46
commit
2192c149e2
Notes:
github-actions[bot]
2024-07-27 06:20:49 +00:00
Author: https://github.com/dzfrias Commit: https://github.com/LadybirdBrowser/ladybird/commit/2192c149e29 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/850
1 changed files with 1 additions and 3 deletions
|
@ -1257,11 +1257,9 @@ ParseResult<CodeSection::Code> CodeSection::Code::parse(Stream& stream)
|
|||
return with_eof_check(stream, ParseError::InvalidSize);
|
||||
size_t size = size_or_error.release_value();
|
||||
|
||||
auto constrained_stream = ConstrainedStream { MaybeOwned<Stream>(stream), size };
|
||||
|
||||
// Emprically, if there are `size` bytes to be read, then there's around
|
||||
// `size / 2` instructions, so we pass that as our size hint.
|
||||
auto func = TRY(Func::parse(constrained_stream, size / 2));
|
||||
auto func = TRY(Func::parse(stream, size / 2));
|
||||
|
||||
return Code { static_cast<u32>(size), func };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue