Closed Bug 1641469 Opened 11 months ago Closed 11 months ago

Add Baseline IC stubs at the front, check enteredCounts in WarpOracle


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




Tracking Status
firefox78 --- fixed


(Reporter: jandem, Assigned: jandem)


(Blocks 1 open bug)



(5 files)

A problem with the current Warp design is that we sometimes add a Baseline IC stub and later add a different stub that subsumes it, for example Int32 stub => Double stub or when the global's shape changes. The transpiler can only optimize a single Baseline stub.

A relatively simple way to deal with this is attaching new Baseline stubs at the front of the chain and then in Warp we can check all other stubs have enteredCount == 0 (adding a Baseline stub already resets the enteredCount).

This helps Warp a lot because it will make it possible to use the enteredCount
of old stubs to determine they're no longer being used, for example when an int32
stub gets replaced by a more generic int32-or-double stub.

Performance is unaffected or improves slightly. This also removes a pointer from all
fallback stubs and is easier to implement.

This matters less but is for consistency with Baseline ICs.

Note that Ion ICs don't have a fallback stub like Baseline. Instead, the last
stub's nextCodeRaw_ is a pointer to the fallback code in the IonScript. This gets
initialized when the stub is allocated.

Depends on D77240

Calling this "enteredCount" didn't work: the compiler complains about enteredCount
being defined in multiple base classes for the CacheIR stub classes.

Depends on D77241

Transpile the first IC stub if all other stubs have entered-count 0.
We probably want to tune the heuristics at some point, but for now this is a
significant performance improvement.

Depends on D77242

Pushed by
part 1 - Add Baseline IC stubs at the front of the chain. r=iain
part 2 - Some ICFallbackStub cleanup and dead code removal. r=iain
part 3 - Add Ion IC stubs at the front of the chain too. r=iain
part 4 - Add ICStub::getEnteredCount. r=iain
part 5 - Check entered-counts in WarpOracle. r=iain
Regressions: 1646199
You need to log in before you can comment on or make changes to this bug.