Bug 260913
Summary: | WasmSectionParser should use tryReserveInitialCapacity instead of tryReserveCapacity. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Mark Lam <mark.lam> |
Component: | JavaScriptCore | Assignee: | Mark Lam <mark.lam> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Mark Lam
We already enforced ordered section parsing, which also enforces that a section type can only be parsed once (with CustomSection being the only exception). For each of these sections, there are many cases where capacity for their vector stores can be allocated with Vector::tryReserveInitialCapacity instead of Vector::tryReserveCapacity. Vector::tryReserveInitialCapacity will be more efficient.
Added some RELEASE_ASSERTs to enforce the invariant that these section types are only parsed once.
Added Vector::growCapacityBy and Vector::tryGrowCapacityBy to more concisely express the idea that we're growing the capacity by some increment.
rdar://114175821
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mark Lam
Pull request: https://github.com/WebKit/WebKit/pull/17237
EWS
Committed 267469@main (78ca85d1db78): <https://commits.webkit.org/267469@main>
Reviewed commits have been landed. Closing PR #17237 and removing active labels.