Closed Bug 1530991 Opened 1 year ago Closed 1 year ago

wasm baseline: fix the "don't create stackmap" criterion in createStackMap()

Categories

(Core :: Javascript: WebAssembly, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: jseward, Assigned: jseward)

References

Details

Attachments

(1 file)

StackMapGenerator::createStackMap() creates stack maps in the wasm baseline
compiler. For release builds, it first performs a check to determine whether
the stackmap would describe only non-ref words, and if so, exits without
creating the map, since the map would be useless.

To make the check cheaper, it is inexact but safe, so it sometimes causes a
map to be created even though it is unnecessary. Specifically, the vector
|extras|, which may contain a description of exit stub register save
locations, is regarded as possibly-contributing-refs if it is merely
non-empty. The actual contents are not checked. This causes creation of
33,688 unnecessary stack maps in the Tanks test case, probably one for each
function.

The fix is simple. Actually check every element of |extras| to see if any are
|true|. This makes the test exact, removes all unnecessary map creation, and
reduces the Tanks compile cost from 2.43 billion instructions to 2.39 billion
instructions. That is, the shortcut was overall a loss anyway, presumably due
to the extra costs incurred by the pointless stackmap creation.

Hah, cool.

Assignee: nobody → jseward
Attachment #9047055 - Flags: review?(lhansen)
Attachment #9047055 - Flags: review?(lhansen) → review+
Blocks: 1517924
Pushed by jseward@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f7dc130bc082
wasm baseline: fix the "don't create stackmap" criterion in createStackMap().  r=lhansen.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.