Lines Matching refs:rt
644 static int interrupt_handler(JSRuntime *rt, void *opaque) in interrupt_handler() argument
667 JSRuntime *rt = JS_GetRuntime(ctx); in js_evalScript() local
668 JSThreadState *ts = JS_GetRuntimeOpaque(rt); in js_evalScript()
715 static void js_std_file_finalizer(JSRuntime *rt, JSValue val) in js_std_file_finalizer() argument
725 js_free_rt(rt, s); in js_std_file_finalizer()
1733 static BOOL is_main_thread(JSRuntime *rt) in is_main_thread() argument
1735 JSThreadState *ts = JS_GetRuntimeOpaque(rt); in is_main_thread()
1752 static void free_rw_handler(JSRuntime *rt, JSOSRWHandler *rh) in free_rw_handler() argument
1757 JS_FreeValueRT(rt, rh->rw_func[i]); in free_rw_handler()
1759 js_free_rt(rt, rh); in free_rw_handler()
1765 JSRuntime *rt = JS_GetRuntime(ctx); in js_os_setReadHandler() local
1766 JSThreadState *ts = JS_GetRuntimeOpaque(rt); in js_os_setReadHandler()
1816 static void free_sh(JSRuntime *rt, JSOSSignalHandler *sh) in free_sh() argument
1819 JS_FreeValueRT(rt, sh->func); in free_sh()
1820 js_free_rt(rt, sh); in free_sh()
1843 JSRuntime *rt = JS_GetRuntime(ctx); in js_os_signal() local
1844 JSThreadState *ts = JS_GetRuntimeOpaque(rt); in js_os_signal()
1850 if (!is_main_thread(rt)) in js_os_signal()
1905 static void unlink_timer(JSRuntime *rt, JSOSTimer *th) in unlink_timer() argument
1913 static void free_timer(JSRuntime *rt, JSOSTimer *th) in free_timer() argument
1915 JS_FreeValueRT(rt, th->func); in free_timer()
1916 js_free_rt(rt, th); in free_timer()
1921 static void js_os_timer_finalizer(JSRuntime *rt, JSValue val) in js_os_timer_finalizer() argument
1927 free_timer(rt, th); in js_os_timer_finalizer()
1931 static void js_os_timer_mark(JSRuntime *rt, JSValueConst val, in js_os_timer_mark() argument
1936 JS_MarkValue(rt, th->func, mark_func); in js_os_timer_mark()
1943 JSRuntime *rt = JS_GetRuntime(ctx); in js_os_setTimeout() local
1944 JSThreadState *ts = JS_GetRuntimeOpaque(rt); in js_os_setTimeout()
2004 JSRuntime *rt = JS_GetRuntime(ctx); in js_os_poll() local
2005 JSThreadState *ts = JS_GetRuntimeOpaque(rt); in js_os_poll()
2028 unlink_timer(rt, th); in js_os_poll()
2030 free_timer(rt, th); in js_os_poll()
2082 static int handle_posted_message(JSRuntime *rt, JSContext *ctx, in handle_posted_message() argument
2147 static int handle_posted_message(JSRuntime *rt, JSContext *ctx, in handle_posted_message() argument
2156 JSRuntime *rt = JS_GetRuntime(ctx); in js_os_poll() local
2157 JSThreadState *ts = JS_GetRuntimeOpaque(rt); in js_os_poll()
2197 unlink_timer(rt, th); in js_os_poll()
2199 free_timer(rt, th); in js_os_poll()
2258 if (handle_posted_message(rt, ctx, port)) in js_os_poll()
3142 static void js_free_port(JSRuntime *rt, JSWorkerMessageHandler *port) in js_free_port() argument
3146 JS_FreeValueRT(rt, port->on_message_func); in js_free_port()
3148 js_free_rt(rt, port); in js_free_port()
3152 static void js_worker_finalizer(JSRuntime *rt, JSValue val) in js_worker_finalizer() argument
3158 js_free_port(rt, worker->msg_handler); in js_worker_finalizer()
3159 js_free_rt(rt, worker); in js_worker_finalizer()
3171 JSRuntime *rt; in worker_func() local
3176 rt = JS_NewRuntime(); in worker_func()
3177 if (rt == NULL) { in worker_func()
3181 js_std_init_handlers(rt); in worker_func()
3184 ts = JS_GetRuntimeOpaque(rt); in worker_func()
3188 ctx = JS_NewContext(rt); in worker_func()
3193 JS_SetCanBlock(rt, TRUE); in worker_func()
3213 js_std_free_handlers(rt); in worker_func()
3214 JS_FreeRuntime(rt); in worker_func()
3253 JSRuntime *rt = JS_GetRuntime(ctx); in js_worker_ctor() local
3264 if (!is_main_thread(rt)) in js_worker_ctor()
3402 JSRuntime *rt = JS_GetRuntime(ctx); in js_worker_set_onmessage() local
3403 JSThreadState *ts = JS_GetRuntimeOpaque(rt); in js_worker_set_onmessage()
3413 js_free_port(rt, port); in js_worker_set_onmessage()
3563 JSRuntime *rt = JS_GetRuntime(ctx); in js_os_init() local
3564 JSThreadState *ts = JS_GetRuntimeOpaque(rt); in js_os_init()
3658 void js_std_init_handlers(JSRuntime *rt) in js_std_init_handlers() argument
3673 JS_SetRuntimeOpaque(rt, ts); in js_std_init_handlers()
3683 JS_SetSharedArrayBufferFunctions(rt, &sf); in js_std_init_handlers()
3688 void js_std_free_handlers(JSRuntime *rt) in js_std_free_handlers() argument
3690 JSThreadState *ts = JS_GetRuntimeOpaque(rt); in js_std_free_handlers()
3695 free_rw_handler(rt, rh); in js_std_free_handlers()
3700 free_sh(rt, sh); in js_std_free_handlers()
3705 unlink_timer(rt, th); in js_std_free_handlers()
3707 free_timer(rt, th); in js_std_free_handlers()
3711 JS_SetRuntimeOpaque(rt, NULL); /* fail safe */ in js_std_free_handlers()