Closed Bug 1466133 Opened 6 years ago Closed 6 years ago

Enter callee's realm when making scripted/native calls

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 obsolete file)

Things we need to do here:

* Update cx->realm_ before and after scripted/native calls (including getters/setters). The hardest part here is doing that in JIT code for calls where we don't know the target's realm statically.

* Ion should not inline cross-realm scripted/native functions.

* The exception handlers will have to restore cx->realm_.

* In debug builds we could assert cx->realm_ == script->realm_ in script prologues.

We should soon have a testing mechanism for this in the shell so then we can write tests for things we fix.
Depends on: 1470250
Note to self: also need to fix Wasm indirect/import calls.
(In reply to Jan de Mooij [:jandem] from comment #3)
> Note to self: also need to fix Wasm indirect/import calls.

Also optimized DOM calls in Ion and call/construct class hook calls.
Depends on: 1470904
Depends on: 1471169
Depends on: 1471844
Depends on: 1471924
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: