Closed Bug 1537908 Opened 5 years ago Closed 5 years ago

Store numICEntries in SharedScriptData

Categories

(Core :: JavaScript Engine: JIT, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

This will let us remove the Vector in ICScript::Create. We can allocate the ICScript upfront and write to that directly.

We should probably move the JOF_TYPESET uint16_t from JSScript to SharedScriptData at the same time.

Priority: -- → P2

This makes the naming more consistent. Also, instead of checking against
JSScript::MaxBytecodeTypeSets at every JOF_TYPESET op, we can move this
condition to SharedScriptData creation if we use uint32_t instead of uint16_t.
This is more efficient and also nicer because MaxBytecodeTypeSets seems to be
more of a JSScript implementation detail the bytecode emitter doessn't need to
worry about.

This also tidies up overflow checks to ensure numICEntries never overflows
UINT32_MAX in the emitter.

ICScript currently stores numICEntries as uint32_t, but it's not an
issue due to BaselineMaxScriptLength.

Depends on D28449

Because SharedScriptData now contains numICEntries, we can allocate the ICScript
up front and fill it in directly. Advantages are: no Vector malloc/free overhead,
no ICEntry copying, no more LifoAlloc::steal, better cache locality, fewer moving
parts. This will also make it easier to merge ICScript and TypeScript in the future.

Depends on D28450

Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Depends on: 1543211
Attachment #9060019 - Attachment description: Bug 1537908 part 3 - Get rid of ICEntry Vector and temporary ICStubSpace when creating ICScript. r?tcampbell! → Bug 1537908 part 3 - Use SharedScriptData::numICEntries to allocate and initialize ICScript directly. r?tcampbell!

leave-open because after this lands I want to post a part 4 to replace the exception in part 2 with a static_assert.

Keywords: leave-open
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f35cf62b01a1
part 1 - Clean up BytecodeEmitter's TypeSet count a bit. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/39133aa95fce
part 2 - Store numICEntries in SharedScriptData. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/50967daabdf4
part 3 - Use SharedScriptData::numICEntries to allocate and initialize ICScript directly. r=tcampbell
Keywords: leave-open
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3ce407a09308
part 4 - Replace overflow check with a static_assert. r=tcampbell
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: