Closed Bug 1637868 Opened 4 years ago Closed 4 years ago

Baseline and Ion must be independent of Frame::tls

Categories

(Core :: JavaScript: WebAssembly, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Tracking Status
firefox78 --- affected

People

(Reporter: dbezhetskov, Assigned: dbezhetskov)

Details

Attachments

(1 file)

We are moving to the new ABI (https://docs.google.com/document/d/1oi6ROZJuE-hBb21Tgq-XcUegPktecF52gADzBJcYL34) where we don't want to preserve TLS pointer in the Frame.

In this bug, we are going to untie Baseline and Ion from Frame::tls, but we aren't going to touch runtime as FrameIteration or stackMaps tracing now.

For Baseline, we need to introduce a new private stack slot to store WasmTlsReg and reload it when we need it. We need this because Baseline can clobber WasmTlsReg.

For Ion, we are going to make a dependency of tlsParam on the return node to force Ion to restore the initial value of Tls.

Assignee: nobody → dbezhetskov
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: P2 → P3

We are going to get rid of the TLS slot in the Frame because we don't
need it all the time. Now it consumes one stack slot in Frame and forces
the Frame to add one additional padding slot for arm64.

In this patch we are removing dependency from Frame::tls in Baseline.
Note that we need to allocate a stack slot for WasmTlsReg value because
baseline can clobber WasmTlsReg and we should be able to load it when we
need it. For example, when we need access to the Instance*.

The followup patch will do the same for the Ion compiler.

Actually, I want to postpone the Ion bits because now Ion "thinks" that tlsParam is immutable.
We support that invariant at the Codegen level just by reloading WasmTlsReg if it needed, see https://searchfox.org/mozilla-central/source/js/src/jit/CodeGenerator.cpp#8062

With trampolines, we could just eliminate that reloading and preserve LWasmCallBase::isCallPreserved() because trampolines guarantee that WasmTlsReg won't be changed after any call.

I'm going to add this Ion bits right before eliminating Frame::tls.

Keywords: leave-open
Pushed by rmaries@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a9970903e180
Make Baseline free from frame's tls r=wingo,lth

The leave-open keyword is there and there is no activity for 6 months.
:lth, maybe it's time to close this bug?

Flags: needinfo?(lhansen)

Dmitry, are we done here?

Flags: needinfo?(lhansen) → needinfo?(dbezhetskov)

Yes, I think we can close this one.

Flags: needinfo?(dbezhetskov)
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: