Module script::script_runtime
source Β· Expand description
The script runtime contains common traits and structs commonly used by the script thread, the dom, and the worker threads.
Structs§
- A compile-time marker that there are operations that could trigger a JS garbage collection operation within the current stack frame. It is trivially copyable, so it should be passed as a function argument and reused when calling other functions whenever possible. Since it is only meaningful within the current stack frame, it is impossible to move it to a different thread or into a task that will execute asynchronously.
- A version of the
JSContext
that can be used from other threads and is thusSend
andSync
. This should only ever expose operations that are marked as thread-safe by the SpiderMonkey API, ie ones that only atomic fields in JSContext.
Enums§
- Common messages used to control the event loops in both the script and the worker
Constants§
- GC_
CYCL πE_ START - GC_
SLIC πE_ START - THREA
D_ πACTIVE
Statics§
- JOB_
QUEU πE_ TRAPS - JS_
ENGINE π - SECURIT
Y_ πCALLBACKS
Traits§
- A cloneable interface for communicating with an event loop.
- An interface for receiving ScriptMsg values in an event loop. Used for synchronous DOM APIs that need to abstract over multiple kinds of event loops (worker/main thread) with different Receiver interfaces.
Functions§
- consume_
stream π βImplements the steps to compile webassembly response mentioned here https://webassembly.github.io/spec/web-api/#compile-a-potential-webassembly-response - content_
security_ π βpolicy_ allows - debug_
gc_ π βcallback - empty π β
- enqueue_
promise_ π βjob SM callback for promise job resolution. Adds a promise callback to the current globalβs microtask queue. - gc_
slice_ π βcallback - get_
incumbent_ π βglobal - get_
size π β - in_
range π - promise_
rejection_ π βtracker - report_
stream_ π βerror - runtime_
is_ πalive - servo_
build_ π βid - set_
gc_ π βzeal_ options - trace_
rust_ π βroots