Open Bug 1849498 Opened 3 years ago Updated 2 years ago

Stop using InflatedChar16Sequence as parameter or temporary storage in ParserAtom

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

ASSIGNED

People

(Reporter: arai, Assigned: arai)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

InflatedChar16Sequence is constructed with code units pointer and the length, and it stores the information as units pointer and the limit pointer.

https://searchfox.org/mozilla-central/rev/7d98e651953f3135d91e98fa6d33efa131aec7ea/js/src/util/Text.h#206-207

InflatedChar16Sequence(const CharT* units, size_t len)
    : units_(units), limit_(units_ + len) {}

Bug 1849490 is going to add optimized path which uses the length instead of limit pointer,
and storing limit pointer there results in unnecessary turnaround.

Also, sometimes the length is passed along with InflatedChar16Sequence, which is unnecessary.

It's better directly passing the code units pointer and length, for clarity, and simplicity.

Depends on: 1872226
You need to log in before you can comment on or make changes to this bug.