Commit graph

2 commits

Author SHA1 Message Date
shuppy
52f53f61e1
script: Add support for creating globals in isolated compartments (#38236)
to use the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), we need to
call it from an internal debugger script that we will supply. this
script must run in the same runtime as the debuggee(s), but in a
separate
[compartment](https://udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Compartments)
([more
details](https://hacks.mozilla.org/2020/03/future-proofing-firefoxs-javascript-debugger-implementation/)).

when creating two globals in the same runtime, Servo will generally try
to reuse an existing compartment for the second global, and there are
other places in script where we rely on this reuse. but for the debugger
script, we can’t do this.

this patch adds a `use_system_compartment` flag to global object
descriptors, which isolates the global in its own compartment in both
possible directions:
- it forces the global to create a new compartment, preventing the reuse
of any debuggee’s compartment
- it fails the check in select_compartment(), preventing future
debuggees from reusing the global’s compartment

Testing: manually tested working in devtools debugger patch (#37667),
where it will undergo automated tests

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-07-23 11:34:37 +00:00
Ashwin Naren
ac2cfdb801
script: Use Pythonic file names for code generation and use functools.cache (#38047)
Renames the files to pythonic file names. Also replaces the bespoke
caching function with the functools caching function which is
functionally equivalent.

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-14 19:38:55 +00:00
Renamed from components/script_bindings/codegen/Configuration.py (Browse further)