mirror of
https://github.com/servo/servo.git
synced 2025-07-26 08:40:24 +01:00
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> |
||
---|---|---|
.. | ||
codegen | ||
webidls | ||
build.rs | ||
callback.rs | ||
Cargo.toml | ||
constant.rs | ||
constructor.rs | ||
conversions.rs | ||
error.rs | ||
finalize.rs | ||
guard.rs | ||
import.rs | ||
inheritance.rs | ||
interface.rs | ||
interfaces.rs | ||
iterable.rs | ||
lib.rs | ||
like.rs | ||
lock.rs | ||
mem.rs | ||
namespace.rs | ||
num.rs | ||
principals.rs | ||
proxyhandler.rs | ||
realms.rs | ||
record.rs | ||
reflector.rs | ||
root.rs | ||
script_runtime.rs | ||
settings_stack.rs | ||
str.rs | ||
trace.rs | ||
utils.rs | ||
weakref.rs |