Don't push/assume IonContext when executing JIT code

RESOLVED FIXED in mozilla30

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: luke, Assigned: luke)

Tracking

unspecified
mozilla30
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Assignee

Description

5 years ago
IonContext is used during JIT compilation (much less after the performance work to stop using GetIonContext), but it shouldn't be necessary while running JIT code since we already maintain PerThreadData::ionJSContext when pushing JitActivations.

This patch adds a GetJSContextFromJitCode() that returns TlsPerThreadData.get()->ionJSContext and uses this in the few places that use GetIonContext()->cx when called from JIT code.  The patch also pushes an IonContext in a few places that perform IC compilation.  (Hopefully later we'll be able to remove the remaining IonContext uses from compilation and just use explicit alloc/cx-passing.)
Attachment #8382328 - Flags: review?(jdemooij)
Assignee

Comment 1

5 years ago
While I'm here, I might as well rename ionJSContext to jitJSContext and ionStackLimit to jitStackLimit.
Attachment #8382339 - Flags: review?(jdemooij)
Comment on attachment 8382328 [details] [diff] [review]
rm-ion-context-push

Review of attachment 8382328 [details] [diff] [review]:
-----------------------------------------------------------------

Nice! I think you can also remove FastInvokeGuard::ictx_ (in vm/Interpreter-inl.h) now, r=me with that.
Attachment #8382328 - Flags: review?(jdemooij) → review+
Comment on attachment 8382339 [details] [diff] [review]
rename-ion-to-jit

Review of attachment 8382339 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/vm/Stack.cpp
@@ +1340,5 @@
>  jit::JitActivation::~JitActivation()
>  {
>      if (active_) {
>          cx_->mainThread().ionTop = prevIonTop_;
> +        cx_->mainThread().jitJSContext = prevIonJSContext_;

Nit: we can rename prevIonJSContext_ too.
Attachment #8382339 - Flags: review?(jdemooij) → review+
https://hg.mozilla.org/mozilla-central/rev/2fb5b3b138d7
https://hg.mozilla.org/mozilla-central/rev/1cec924f3734
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.