Bug 1802568 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

While looking at something else, I spotted a surprising [pair of lines](https://searchfox.org/mozilla-central/rev/513d9c0f27c0c3fdc9ed6c5fb222a3f90ae69d70/js/src/frontend/ParserAtom.h#860,878) with zero hits in code-coverage. 

I haven't quite gotten to the bottom of this, but it appears that for some reason `SpecificParserAtomLookup::equalsEntry ` is only ever called with something that has a matching hash. 

I have found _only two_ test cases that fail if you replace these `equalsEntry` functions: 

* [`wasm/name.js`](https://searchfox.org/mozilla-central/source/js/src/jit-test/tests/wasm/name.js) fails if the well-known info overload is replaced with `return true` -- though, this is _only true for non-debug builds_. 
* [`for-of/strings.js`](https://searchfox.org/mozilla-central/source/js/src/jit-test/tests/for-of/strings.js) fails if `ParserAtom::equalsSeq`, which powers the `ParserAtom` overload, is replaced with `return true`. 

If the hashes aren't being used, it means that every time we call these functions we're using a string-walk: It would potentially be worth figuring out if there's a pre-computable property here that could be used to avoid having to walk the strings each time.
While looking at something else, I spotted a surprising [pair of lines](https://searchfox.org/mozilla-central/rev/513d9c0f27c0c3fdc9ed6c5fb222a3f90ae69d70/js/src/frontend/ParserAtom.h#860,878) with zero hits in code-coverage. 

I haven't quite gotten to the bottom of this, but it appears that for some reason `SpecificParserAtomLookup::equalsEntry ` is only ever called with something that has a matching hash. 

I have found _only two_ test cases that fail if you replace these `equalsEntry` functions with stubs that just `return true`: 

* [`wasm/name.js`](https://searchfox.org/mozilla-central/source/js/src/jit-test/tests/wasm/name.js) fails if the well-known info overload is replaced with `return true` -- though, this is _only true for non-debug builds_. 
* [`for-of/strings.js`](https://searchfox.org/mozilla-central/source/js/src/jit-test/tests/for-of/strings.js) fails if `ParserAtom::equalsSeq`, which powers the `ParserAtom` overload, is replaced with `return true`. 

If the hashes aren't being used, it means that every time we call these functions we're using a string-walk: It would potentially be worth figuring out if there's a pre-computable property here that could be used to avoid having to walk the strings each time.

Back to Bug 1802568 Comment 0