mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-24 16:40:21 +00:00
LibWasm: Remove needless and costly copies
Speeds up spidermonkey.wasm instantiation by around 60ms (240ms -> 180ms)
This commit is contained in:
parent
2192c149e2
commit
fc57f5111d
Notes:
github-actions[bot]
2024-07-27 06:20:45 +00:00
Author: https://github.com/dzfrias Commit: https://github.com/LadybirdBrowser/ladybird/commit/fc57f5111df Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/850
1 changed files with 3 additions and 3 deletions
|
@ -1246,7 +1246,7 @@ ParseResult<CodeSection::Func> CodeSection::Func::parse(Stream& stream, size_t s
|
||||||
ScopeLogger<WASM_BINPARSER_DEBUG> logger("Func"sv);
|
ScopeLogger<WASM_BINPARSER_DEBUG> logger("Func"sv);
|
||||||
auto locals = TRY(parse_vector<Locals>(stream));
|
auto locals = TRY(parse_vector<Locals>(stream));
|
||||||
auto body = TRY(Expression::parse(stream, size_hint));
|
auto body = TRY(Expression::parse(stream, size_hint));
|
||||||
return Func { locals, body };
|
return Func { move(locals), move(body) };
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseResult<CodeSection::Code> CodeSection::Code::parse(Stream& stream)
|
ParseResult<CodeSection::Code> CodeSection::Code::parse(Stream& stream)
|
||||||
|
@ -1261,14 +1261,14 @@ ParseResult<CodeSection::Code> CodeSection::Code::parse(Stream& stream)
|
||||||
// `size / 2` instructions, so we pass that as our size hint.
|
// `size / 2` instructions, so we pass that as our size hint.
|
||||||
auto func = TRY(Func::parse(stream, size / 2));
|
auto func = TRY(Func::parse(stream, size / 2));
|
||||||
|
|
||||||
return Code { static_cast<u32>(size), func };
|
return Code { static_cast<u32>(size), move(func) };
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseResult<CodeSection> CodeSection::parse(Stream& stream)
|
ParseResult<CodeSection> CodeSection::parse(Stream& stream)
|
||||||
{
|
{
|
||||||
ScopeLogger<WASM_BINPARSER_DEBUG> logger("CodeSection"sv);
|
ScopeLogger<WASM_BINPARSER_DEBUG> logger("CodeSection"sv);
|
||||||
auto result = TRY(parse_vector<Code>(stream));
|
auto result = TRY(parse_vector<Code>(stream));
|
||||||
return CodeSection { result };
|
return CodeSection { move(result) };
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseResult<DataSection::Data> DataSection::Data::parse(Stream& stream)
|
ParseResult<DataSection::Data> DataSection::Data::parse(Stream& stream)
|
||||||
|
|
Loading…
Reference in a new issue