jseption 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -6
- package/dist/atoms.d.ts +1 -0
- package/dist/atoms.js +2 -1
- package/dist/atoms.js.map +1 -1
- package/dist/builtins/base64.d.ts +14 -0
- package/dist/builtins/base64.js +219 -0
- package/dist/builtins/base64.js.map +1 -0
- package/dist/builtins/bigint.js +3 -3
- package/dist/builtins/bigint.js.map +1 -1
- package/dist/builtins/date.d.ts +1 -0
- package/dist/builtins/date.js +26 -12
- package/dist/builtins/date.js.map +1 -1
- package/dist/builtins/error.js +9 -0
- package/dist/builtins/error.js.map +1 -1
- package/dist/builtins/float16.d.ts +3 -0
- package/dist/builtins/float16.js +69 -0
- package/dist/builtins/float16.js.map +1 -0
- package/dist/builtins/function.js +2 -2
- package/dist/builtins/index.js +9 -6
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/iterator.d.ts +2 -0
- package/dist/builtins/iterator.js +624 -0
- package/dist/builtins/iterator.js.map +1 -0
- package/dist/builtins/json.d.ts +13 -1
- package/dist/builtins/json.js +283 -211
- package/dist/builtins/json.js.map +1 -1
- package/dist/builtins/mapset.js +365 -6
- package/dist/builtins/mapset.js.map +1 -1
- package/dist/builtins/math.js +203 -3
- package/dist/builtins/math.js.map +1 -1
- package/dist/builtins/native.js +6 -6
- package/dist/builtins/object.js +9 -2
- package/dist/builtins/object.js.map +1 -1
- package/dist/builtins/promise.js +31 -11
- package/dist/builtins/promise.js.map +1 -1
- package/dist/builtins/proxy.js +2 -2
- package/dist/builtins/reflect.js +6 -2
- package/dist/builtins/reflect.js.map +1 -1
- package/dist/builtins/regexp.js +74 -3
- package/dist/builtins/regexp.js.map +1 -1
- package/dist/builtins/string.js +1 -1
- package/dist/builtins/symbol.js +1 -1
- package/dist/builtins/symbol.js.map +1 -1
- package/dist/builtins/typedarray.d.ts +4 -1
- package/dist/builtins/typedarray.js +325 -37
- package/dist/builtins/typedarray.js.map +1 -1
- package/dist/builtins/weakref.js +7 -7
- package/dist/embed.d.ts +5 -0
- package/dist/embed.js +36 -11
- package/dist/embed.js.map +1 -1
- package/dist/interpreter.js +15 -14
- package/dist/interpreter.js.map +1 -1
- package/dist/jit.d.ts +1 -0
- package/dist/jit.js +51 -13
- package/dist/jit.js.map +1 -1
- package/dist/jit_hook.d.ts +1 -0
- package/dist/jit_hook.js.map +1 -1
- package/dist/jit_runtime.d.ts +1 -1
- package/dist/jit_runtime.js +6 -6
- package/dist/jit_runtime.js.map +1 -1
- package/dist/jit_stack.d.ts +1 -0
- package/dist/jit_stack.js +2 -1
- package/dist/jit_stack.js.map +1 -1
- package/dist/jseption.d.ts +2 -0
- package/dist/jseption.js +1 -0
- package/dist/jseption.js.map +1 -1
- package/dist/membrane.d.ts +6 -0
- package/dist/membrane.js +7 -3
- package/dist/membrane.js.map +1 -1
- package/dist/module.js +5 -3
- package/dist/module.js.map +1 -1
- package/dist/parser.js +26 -9
- package/dist/parser.js.map +1 -1
- package/dist/print.d.ts +12 -0
- package/dist/print.js +494 -0
- package/dist/print.js.map +1 -0
- package/dist/qjs.js +13 -10
- package/dist/qjs.js.map +1 -1
- package/dist/quickjs.d.ts +8 -0
- package/dist/quickjs.js +132 -53
- package/dist/quickjs.js.map +1 -1
- package/dist/std.d.ts +4 -2
- package/dist/std.js +42 -8
- package/dist/std.js.map +1 -1
- package/dist/values.d.ts +31 -27
- package/dist/values.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
package/dist/jit_hook.d.ts
CHANGED
package/dist/jit_hook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jit_hook.js","sourceRoot":"","sources":["../src/jit_hook.ts"],"names":[],"mappings":"AASA,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAkB,MAAM,CAAC,kBAAkB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"jit_hook.js","sourceRoot":"","sources":["../src/jit_hook.ts"],"names":[],"mappings":"AASA,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAkB,MAAM,CAAC,kBAAkB,CAAC,CAAC;AA4C1E,MAAM,CAAC,MAAM,SAAS,GAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC","sourcesContent":["/*\n * Hook between the interpreter and the compiled tier (src/jit.ts).\n *\n * This module has no imports so that the interpreter can depend on it\n * without creating an import cycle. jit.ts installs `try_call` when it is\n * loaded; when it is not loaded the interpreter runs everything.\n */\nimport type { JSFunctionBytecode, JSValue } from './values.ts';\n\n/* returned by try_call when the function is not (yet) compiled */\nexport const JIT_NOT_COMPILED: unique symbol = Symbol('JIT_NOT_COMPILED');\n\n/* a guest-relevant frame of the host stack (see src/jit_stack.ts):\n compiled: a compiled guest function, with its guest position when known;\n interp: the host frame running an interpreter frame (`js_interpret`);\n cfunc: the host frame running a C function frame (`js_call_c_function`);\n native: a host builtin called by guest code (`[].map`) */\nexport interface HostFrame {\n kind: 'compiled' | 'interp' | 'cfunc' | 'native';\n name: string;\n file: string;\n line: number;\n col: number;\n /* compiled frame at a native `new`: the callee's variable or property name */\n ctor?: string;\n}\n\nexport interface JitStackHooks {\n /* the current host stack, captured with a frame limit high enough for guest backtraces */\n capture(): string;\n /* the guest-relevant frames of a host stack, innermost first */\n frames(host_stack: string): HostFrame[];\n /* true when the innermost guest frame of the host stack is compiled code (its position is\n only available now, from the host stack), false when it is an interpreter frame */\n compiled_on_top(host_stack: string): boolean;\n}\n\nexport interface JitHooks {\n /* Called at the entry of JS_CallInternal for bytecode functions.\n `func_data` is the closure data of the function object (bytecode + var refs). */\n try_call: ((ctx: any, func_obj: JSValue, func_data: any, b: JSFunctionBytecode, this_obj: JSValue,\n new_target: JSValue, argv: JSValue[], flags: number) => JSValue | typeof JIT_NOT_COMPILED) | null;\n /* backtrace support for compiled frames; null while the compiled tier is off */\n stack: JitStackHooks | null;\n /* Creates the function object of an interpreted closure of a normal function as a\n retargetable wrapper (it calls the compiled body once one exists), or returns null for the\n generic interpreter wrapper. */\n make_wrapper: ((ctx: any, b: JSFunctionBytecode, var_refs: any[], proto: JSValue | null, is_ctor: boolean) => JSValue | null) | null;\n /* On-stack replacement: called by the interpreter when a backward jump to `pc` is taken in a\n frame of `func_obj`; returns the frame's result (JS_EXCEPTION with the exception pending)\n when the rest of the frame ran in compiled code, else JIT_NOT_COMPILED. */\n osr: ((ctx: any, func_obj: JSValue, b: JSFunctionBytecode, sf: any, pc: number, sp: number) => JSValue | typeof JIT_NOT_COMPILED) | null;\n}\n\nexport const jit_hooks: JitHooks = { try_call: null, stack: null, make_wrapper: null, osr: null };\n"]}
|
package/dist/jit_runtime.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare class JitRuntime {
|
|
|
26
26
|
throw_type_error(msg: string): never;
|
|
27
27
|
throw_reference_error(msg: string): never;
|
|
28
28
|
throw_internal_error(msg: string): never;
|
|
29
|
-
throw_not_a_constructor(
|
|
29
|
+
throw_not_a_constructor(f: JSValue): never;
|
|
30
30
|
throw_uninitialized(b: JSFunctionBytecode, idx: number, is_ref: boolean): never;
|
|
31
31
|
throw_error(atom: JSAtom, type: number): never;
|
|
32
32
|
new_cell(v: JSValue): JSVarRef;
|
package/dist/jit_runtime.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* it when it has an explicit `this` or new.target, and calls guest
|
|
18
18
|
* functions natively otherwise.
|
|
19
19
|
*/
|
|
20
|
-
import { JS_EXCEPTION, JS_UNINITIALIZED, JS_IsException, JS_IsObject, JS_GetException, js_take_exception, js_host_exception_to_guest, JS_ThrowTypeError, JS_ThrowReferenceError, JS_ThrowInternalError, JS_ThrowStackOverflow, JS_ThrowTypeErrorReadOnly, JS_ThrowSyntaxErrorAtom, JS_ThrowReferenceErrorUninitialized, JS_ThrowReferenceErrorNotDefined, JS_ThrowReferenceErrorUninitialized2, JS_ThrowTypeErrorNotAnObject, JS_GetProperty, JS_GetPropertyInternal, JS_GetPropertyValue, JS_SetPropertyInternal, JS_SetPropertyValue, JS_DefinePropertyValue, JS_DefinePropertyValueValue, JS_DefinePropertyValueUint32, JS_DefineProperty, JS_DeleteProperty, JS_HasProperty, JS_GetPrototype, JS_SetPrototypeInternal, JS_NewObject, JS_NewObjectProto, JS_NewObjectProtoClass, JS_NewArrayFrom, JS_ValueToAtom, JS_AtomToValue, JS_AtomToKey, JS_NewSymbolFromAtom, JS_ToObject, JS_ToPropertyKey, JS_ToNumericFree, JS_IsInstanceOf, js_operator_in, js_unary_arith_slow, JS_GetIterator, JS_IteratorClose, build_for_in_iterator, js_for_in_next, JS_CopyDataProperties, JS_Call, JS_CallConstructorInternal, JS_CallConstructor2, js_create_from_ctor, JS_CheckGlobalVar, JS_GetGlobalVar, JS_SetGlobalVar, JS_CheckDefineGlobalVar, JS_DefineGlobalVar, JS_DefineGlobalFunction, JS_GetGlobalVarRef, hooks, js_meta, js_direct, JS_GetFunctionData, js_new_host_function, js_init_host_function, JS_ATOM_NULL, JS_ATOM_return, JS_ATOM_throw, JS_ATOM_length, JS_ATOM_prototype, JS_ATOM_callee, JS_ATOM_Symbol_iterator, JS_ATOM_empty_string, JS_ATOM_TYPE_PRIVATE, JS_ATOM_constructor, JS_IsUncatchableError, JS_SetUncatchableError, } from "./quickjs.js";
|
|
20
|
+
import { JS_EXCEPTION, JS_UNINITIALIZED, JS_IsException, JS_IsObject, JS_GetException, js_take_exception, js_host_exception_to_guest, JS_ThrowTypeError, JS_ThrowReferenceError, JS_ThrowInternalError, JS_ThrowStackOverflow, JS_ThrowTypeErrorReadOnly, JS_ThrowSyntaxErrorAtom, JS_ThrowReferenceErrorUninitialized, JS_ThrowReferenceErrorNotDefined, JS_ThrowReferenceErrorUninitialized2, JS_ThrowTypeErrorNotAnObject, JS_GetProperty, JS_GetPropertyInternal, JS_GetPropertyValue, JS_SetPropertyInternal, JS_SetPropertyValue, JS_DefinePropertyValue, JS_DefinePropertyValueValue, JS_DefinePropertyValueUint32, JS_DefineProperty, JS_DeleteProperty, JS_HasProperty, JS_GetPrototype, JS_SetPrototypeInternal, JS_NewObject, JS_NewObjectProto, JS_NewObjectProtoClass, JS_NewArrayFrom, JS_ValueToAtom, JS_AtomToValue, JS_AtomToKey, JS_NewSymbolFromAtom, JS_ToObject, JS_ToPropertyKey, JS_ToNumericFree, JS_IsInstanceOf, js_operator_in, js_unary_arith_slow, JS_GetIterator, JS_IteratorClose, build_for_in_iterator, js_for_in_next, JS_CopyDataProperties, JS_Call, JS_CallConstructorInternal, JS_CallConstructor2, js_create_from_ctor, JS_CheckGlobalVar, JS_GetGlobalVar, JS_SetGlobalVar, JS_CheckDefineGlobalVar, JS_DefineGlobalVar, JS_DefineGlobalFunction, JS_GetGlobalVarRef, hooks, js_meta, js_direct, JS_GetFunctionData, js_new_host_function, js_init_host_function, JS_ATOM_NULL, JS_ATOM_return, JS_ATOM_throw, JS_ATOM_length, JS_ATOM_prototype, JS_ATOM_callee, JS_ATOM_Symbol_iterator, JS_ATOM_empty_string, JS_ATOM_TYPE_PRIVATE, JS_ATOM_constructor, JS_IsUncatchableError, JS_SetUncatchableError, JS_ThrowTypeErrorNotAConstructor, } from "./quickjs.js";
|
|
21
21
|
import { JSFunctionData, JSObjectMeta, new_var_ref_cell, JS_PROP_C_W_E, JS_PROP_THROW, JS_PROP_CONFIGURABLE, JS_PROP_WRITABLE, JS_PROP_ENUMERABLE, JS_PROP_HAS_CONFIGURABLE, JS_PROP_HAS_ENUMERABLE, JS_PROP_HAS_VALUE, JS_PROP_HAS_WRITABLE, JS_PROP_HAS_GET, JS_PROP_HAS_SET, JS_CALL_FLAG_CONSTRUCTOR, } from "./values.js";
|
|
22
22
|
import { JS_CallInternal, js_closure_from_refs, js_function_set_properties, js_define_class, js_build_arguments_value, js_build_rest, JS_DefinePrivateField, JS_GetPrivateField, JS_SetPrivateField, JS_AddBrand, JS_CheckBrand, js_operator_private_in, js_method_set_home_object, js_method_set_properties, JS_DefineObjectName, JS_DefineObjectNameComputed, js_function_apply, js_for_of_start_value, js_for_of_next_value, js_append_enumerate_value, } from "./interpreter.js";
|
|
23
23
|
import { short_opcode_info } from "./opcodes.js";
|
|
@@ -208,8 +208,8 @@ export function jit_runtime_call_compiled(ctx, direct, this_obj, new_target, arg
|
|
|
208
208
|
function func_kind_to_class_id(kind) {
|
|
209
209
|
switch (kind) {
|
|
210
210
|
case 1 /* JSFunctionKind.GENERATOR */: return 16 /* JSClassID.GENERATOR_FUNCTION */;
|
|
211
|
-
case 2 /* JSFunctionKind.ASYNC */: return
|
|
212
|
-
case 3 /* JSFunctionKind.ASYNC_GENERATOR */: return
|
|
211
|
+
case 2 /* JSFunctionKind.ASYNC */: return 49 /* JSClassID.ASYNC_FUNCTION */;
|
|
212
|
+
case 3 /* JSFunctionKind.ASYNC_GENERATOR */: return 53 /* JSClassID.ASYNC_GENERATOR_FUNCTION */;
|
|
213
213
|
default: return 13 /* JSClassID.BYTECODE_FUNCTION */;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -281,7 +281,7 @@ export class JitRuntime {
|
|
|
281
281
|
throw_type_error(msg) { JS_ThrowTypeError(this.ctx, msg); this.throw_pending(); }
|
|
282
282
|
throw_reference_error(msg) { JS_ThrowReferenceError(this.ctx, msg); this.throw_pending(); }
|
|
283
283
|
throw_internal_error(msg) { JS_ThrowInternalError(this.ctx, msg); this.throw_pending(); }
|
|
284
|
-
throw_not_a_constructor(
|
|
284
|
+
throw_not_a_constructor(f) { JS_ThrowTypeErrorNotAConstructor(this.ctx, f); this.throw_pending(); }
|
|
285
285
|
throw_uninitialized(b, idx, is_ref) {
|
|
286
286
|
JS_ThrowReferenceErrorUninitialized2(this.ctx, b, idx, is_ref);
|
|
287
287
|
this.throw_pending();
|
|
@@ -363,7 +363,7 @@ export class JitRuntime {
|
|
|
363
363
|
create_this(new_target) {
|
|
364
364
|
/* fast path: an ordinary guest function with an object `prototype` (the property read is
|
|
365
365
|
native, as the host does for `new`) */
|
|
366
|
-
if (typeof new_target === 'function' && js_meta.get(new_target)?.class_id !==
|
|
366
|
+
if (typeof new_target === 'function' && js_meta.get(new_target)?.class_id !== 45 /* JSClassID.PROXY */) {
|
|
367
367
|
const p = new_target.prototype;
|
|
368
368
|
if (typeof p === 'object' && p !== null)
|
|
369
369
|
return Object.create(p);
|
|
@@ -454,7 +454,7 @@ export class JitRuntime {
|
|
|
454
454
|
name_atom = JS_ATOM_empty_string;
|
|
455
455
|
js_function_set_properties(ctx, fo, name_atom, b.defined_arg_count);
|
|
456
456
|
if (b.func_kind & 1 /* JSFunctionKind.GENERATOR */) {
|
|
457
|
-
const proto_class_id = (b.func_kind === 3 /* JSFunctionKind.ASYNC_GENERATOR */) ?
|
|
457
|
+
const proto_class_id = (b.func_kind === 3 /* JSFunctionKind.ASYNC_GENERATOR */) ? 54 /* JSClassID.ASYNC_GENERATOR */ : 44 /* JSClassID.GENERATOR */;
|
|
458
458
|
const gproto = this.check(JS_NewObjectProto(ctx, ctx.class_proto[proto_class_id]));
|
|
459
459
|
JS_DefinePropertyValue(ctx, fo, JS_ATOM_prototype, gproto, JS_PROP_WRITABLE);
|
|
460
460
|
}
|
package/dist/jit_runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jit_runtime.js","sourceRoot":"","sources":["../src/jit_runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAC2C,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAC3G,eAAe,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,sBAAsB,EACzG,qBAAqB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,uBAAuB,EAChG,mCAAmC,EAAE,gCAAgC,EAAE,oCAAoC,EAC3G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,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF","sourcesContent":["/*\n * Runtime adapter for the compiled tier (src/jit.ts).\n *\n * This is the ONLY module that generated code talks to, and the only\n * place where the compiled tier touches engine internals. Generated code\n * receives one `JitRuntime` instance per context as `$RT`, plus a few\n * host intrinsics and engine tables as factory parameters (see\n * JIT_FACTORY_PARAMS).\n *\n * Conventions:\n * - every helper either returns a guest value or `throw`s a guest value\n * (the engine's JS_EXCEPTION/current_exception convention is converted\n * here by `check()`/`throw_pending()`);\n * - `DONE` is a sentinel returned by the iteration helpers;\n * - the direct entry of a guest function (js_direct) uses the explicit\n * convention `direct($this, $new_target, ...args)`; compiled code calls\n * it when it has an explicit `this` or new.target, and calls guest\n * functions natively otherwise.\n */\nimport {\n JSContext, JSValue, JSFunctionBytecode, JSAtom, JS_EXCEPTION, JS_UNINITIALIZED, JS_IsException, JS_IsObject,\n JS_GetException, js_take_exception, js_host_exception_to_guest, JS_ThrowTypeError, JS_ThrowReferenceError,\n JS_ThrowInternalError, JS_ThrowStackOverflow, JS_ThrowTypeErrorReadOnly, JS_ThrowSyntaxErrorAtom,\n JS_ThrowReferenceErrorUninitialized, JS_ThrowReferenceErrorNotDefined, JS_ThrowReferenceErrorUninitialized2,\n JS_ThrowTypeErrorNotAnObject, JS_GetProperty, JS_GetPropertyInternal, JS_GetPropertyValue, JS_SetPropertyInternal,\n JS_SetPropertyValue, JS_DefinePropertyValue, JS_DefinePropertyValueValue, JS_DefinePropertyValueUint32, JS_DefineProperty,\n JS_DeleteProperty, JS_HasProperty, JS_GetPrototype, JS_SetPrototypeInternal, JS_NewObject, JS_NewObjectProto,\n JS_NewObjectProtoClass, JS_NewArrayFrom, JS_ValueToAtom, JS_AtomToValue, JS_AtomToKey, JS_NewSymbolFromAtom, JS_ToObject,\n JS_ToPropertyKey, JS_ToNumericFree, JS_IsInstanceOf, js_operator_in, js_unary_arith_slow, JSUnaryOp, JS_GetIterator,\n JS_IteratorNext, JS_IteratorClose, build_for_in_iterator, js_for_in_next, JS_CopyDataProperties, JS_Call,\n JS_CallConstructorInternal, JS_CallConstructor2, js_create_from_ctor, JS_CheckGlobalVar, JS_GetGlobalVar, JS_SetGlobalVar,\n JS_CheckDefineGlobalVar, JS_DefineGlobalVar, JS_DefineGlobalFunction, JS_GetGlobalVarRef, hooks, js_meta, js_direct,\n JS_GetFunctionData, js_new_host_function, js_init_host_function, JS_ATOM_NULL, JS_ATOM_next, JS_ATOM_return, JS_ATOM_throw, JS_ATOM_length,\n JS_ATOM_prototype, JS_ATOM_callee, JS_ATOM_Symbol_iterator, JS_ATOM_empty_string, JS_ATOM_TYPE_PRIVATE, JS_ATOM_constructor,\n JS_IsUncatchableError, JS_SetUncatchableError,\n} from './quickjs.ts';\nimport {\n JSClassID, JSFunctionKind, JSVarRef, JSFunctionData, JSObjectMeta, new_var_ref_cell, JS_PROP_C_W_E, JS_PROP_THROW,\n JS_PROP_CONFIGURABLE, JS_PROP_WRITABLE, JS_PROP_ENUMERABLE, JS_PROP_HAS_CONFIGURABLE, JS_PROP_HAS_ENUMERABLE,\n JS_PROP_HAS_VALUE, JS_PROP_HAS_WRITABLE, JS_PROP_HAS_GET, JS_PROP_HAS_SET, JS_CALL_FLAG_CONSTRUCTOR,\n} from './values.ts';\nimport {\n JS_CallInternal, js_closure_from_refs, js_function_set_properties, js_define_class, js_build_arguments_value, js_build_rest,\n JS_DefinePrivateField, JS_GetPrivateField, JS_SetPrivateField, JS_AddBrand, JS_CheckBrand, js_operator_private_in,\n js_method_set_home_object, js_method_set_properties, JS_DefineObjectName, JS_DefineObjectNameComputed, js_function_apply,\n js_for_of_start_value, js_for_of_next_value, js_append_enumerate_value,\n} from './interpreter.ts';\nimport { OP, short_opcode_info, OPSpecialObject } from './opcodes.ts';\nimport { OP_DEFINE_METHOD_ENUMERABLE, OP_DEFINE_METHOD_METHOD, OP_DEFINE_METHOD_GETTER, JS_THROW_VAR_RO, JS_THROW_VAR_REDECL,\n JS_THROW_VAR_UNINITIALIZED, JS_THROW_ERROR_DELETE_SUPER, JS_THROW_ERROR_ITERATOR_THROW } from './opcodes.ts';\n\n/* what jit.ts produces for a bytecode function (see JitCompiled in jit.ts) */\nexport interface JitCompiledLike {\n /* returns [function object, direct entry, private copy factory]; `func_obj` overrides the\n function object (used when an existing interpreter wrapper is tiered up) */\n make: (var_refs: JSVarRef[], func_obj?: JSValue) => [Function, Function, (() => Function) | null];\n}\n\n/* parameters of the generated factory function, in order */\nexport const JIT_FACTORY_PARAMS = ['$RT', '$cpool', '$b', '$U', '$D', '$Obj', '$set', '$del', '$getproto', '$DIRECT', '$P', '$G', '$GV',\n '$CALL', '$CONSTRUCT', '$C'];\n\nexport function jit_runtime_factory_args(RT: JitRuntime, b: JSFunctionBytecode): any[] {\n return [RT, b.cpool, b, JS_UNINITIALIZED, RT.DONE, RT.Obj, Reflect.set, Reflect.deleteProperty, Object.getPrototypeOf,\n js_direct, RT.ctx.plain_object_proto, RT.ctx.global_obj, RT.ctx.global_var_obj, Function.prototype.call, Reflect.construct,\n RT.ctx];\n}\n\nconst runtimes = new WeakMap<JSContext, JitRuntime>();\n\n/* `compile(b)` returns the compiled form of `b` if it is (or should now be) compiled, else null */\nexport function make_jit_runtime(ctx: JSContext, compile: (b: JSFunctionBytecode) => JitCompiledLike | null): JitRuntime {\n let rt = runtimes.get(ctx);\n if (!rt) { rt = new JitRuntime(ctx, compile); runtimes.set(ctx, rt); }\n return rt;\n}\n\n/* Call a compiled body through its private host-convention copy (`fd.priv`): the engine's\n ordinary (non-construct) calls of compiled functions. */\nexport function jit_runtime_call_priv(ctx: JSContext, priv: Function, this_obj: JSValue, argv: JSValue[]): JSValue {\n const rt = ctx.rt;\n if (rt.stack_depth >= rt.max_stack_depth) return JS_ThrowStackOverflow(ctx);\n rt.stack_depth++;\n const sf = rt.current_stack_frame;\n try {\n return priv.apply(this_obj, argv);\n } catch (e) {\n return js_host_exception_to_guest(ctx, e);\n } finally {\n rt.current_stack_frame = sf;\n rt.stack_depth--;\n }\n}\n\n/* ---------------------------------------------------------------------\n Retargetable wrappers\n\n The function object of a closure created by the interpreter (or by compiled code before the\n function's bytecode is compiled) is a wrapper that calls the compiled body as soon as one\n exists for the closure (JSFunctionData.priv for calls, .ctor for construct calls) and the\n engine otherwise, so its identity survives tier-up. The wrappers are generated once per\n (kind, arity) without rest parameters: a call is `fd.priv.call(this, a0, a1)`, which the host\n inlines (measured: the same cost as calling the compiled function directly, also for `new`).\n --------------------------------------------------------------------- */\n\n/* the body reads `arguments` (or a rest parameter, or init_ctor's arguments): its wrapper must\n forward the exact argument list. Cached on the bytecode. */\nexport function jit_bytecode_uses_args(b: JSFunctionBytecode): boolean {\n if (b.uses_args >= 0) return b.uses_args === 1;\n const buf = b.byte_code_buf, len = b.byte_code_len;\n let r = 0;\n for (let pos = 0; pos < len;) {\n const op = buf[pos];\n if (op === OP.rest || op === OP.init_ctor) { r = 1; break; }\n if (op === OP.special_object) {\n const k = buf[pos + 1];\n if (k === OPSpecialObject.ARGUMENTS || k === OPSpecialObject.MAPPED_ARGUMENTS) { r = 1; break; }\n }\n const oi = short_opcode_info(op);\n if (!oi || oi.size <= 0) { r = 1; break; }\n pos += oi.size;\n }\n b.uses_args = r;\n return r === 1;\n}\n\ntype SlowCall = (w: Function, t: JSValue, nt: JSValue, args: ArrayLike<JSValue>) => JSValue;\ntype WrapperFactory = (fd: JSFunctionData, slow: SlowCall) => Function;\nconst MAX_WRAPPER_ARITY = 12;\n\n/* The wrapper code is generated once per function (bytecode), not once per arity: the call\n `p.call(this, a0)` inside a wrapper shared by many functions sees many targets and the host\n stops inlining it (measured in Bun: 1.75x the cost of a direct call, against 1x for a\n per-function wrapper). Closures of the same function share their wrapper's code. */\nfunction wrapper_factory(b: JSFunctionBytecode, is_ctor: boolean): WrapperFactory | null {\n /* cached per kind (constructible or not): a function is normally wrapped as one kind only */\n const slot = is_ctor ? 'f' : 'm';\n if (b.wrapper_factory === null) b.wrapper_factory = { f: undefined, m: undefined };\n const cached = b.wrapper_factory[slot];\n if (cached !== undefined) return cached;\n const arity = b.arg_count;\n let use_args = jit_bytecode_uses_args(b);\n if (arity > MAX_WRAPPER_ARITY) use_args = true;\n let f: WrapperFactory | null;\n const params = use_args ? '' : Array.from({ length: arity }, (_, i) => `a${i}`).join(', ');\n const call_p = use_args ? 'p.apply(this, arguments)' : `p.call(this${params ? ', ' + params : ''})`;\n const call_c = use_args ? 'c(t, new.target, ...arguments)' : `c(t, new.target${params ? ', ' + params : ''})`;\n const src = is_ctor\n ? `\"use strict\"; return function (fd, slow) { return function $w(${params}) {\n if (new.target === undefined) { const p = fd.priv; if (p !== null) return ${call_p}; }\n else { const c = fd.ctor; if (c !== null) { const xp = new.target.prototype; const t = (typeof xp === 'object' ? xp !== null : typeof xp === 'function') ? this : undefined; return ${call_c}; } }\n return slow($w, this, new.target, arguments);\n}; };`\n : `\"use strict\"; return function (fd, slow) { let w; const o = { $w(${params}) {\n const p = fd.priv; if (p !== null) return ${call_p};\n return slow(w, this, undefined, arguments);\n} }; w = o.$w; return w; };`;\n try { f = (new Function(src) as () => WrapperFactory)(); } catch { f = null; /* code generation unavailable */ }\n b.wrapper_factory[slot] = f;\n return f;\n}\n\nconst slow_calls = new WeakMap<JSContext, SlowCall>();\nfunction slow_call(ctx: JSContext): SlowCall {\n let s = slow_calls.get(ctx);\n if (s === undefined) {\n s = (w, t, nt, args) => {\n const argv: JSValue[] = new Array(args.length);\n for (let i = 0; i < args.length; i++) argv[i] = args[i];\n const ret = nt !== undefined ? JS_CallInternal(ctx, w, nt, nt, argv, JS_CALL_FLAG_CONSTRUCTOR)\n : JS_CallInternal(ctx, w, t, undefined, argv, 0);\n if (ret === JS_EXCEPTION) throw js_take_exception(ctx);\n return ret;\n };\n slow_calls.set(ctx, s);\n }\n return s;\n}\n\n/* the function object of a closure of a normal function: a retargetable wrapper, or null when\n wrappers cannot be generated (the engine then uses its generic wrapper) */\nexport function jit_runtime_make_wrapper(ctx: JSContext, b: JSFunctionBytecode, var_refs: JSVarRef[],\n proto: JSValue | null, is_ctor: boolean): JSValue | null {\n const fac = wrapper_factory(b, is_ctor);\n if (fac === null) return null;\n const fd = new JSFunctionData(b, var_refs);\n const slow = slow_call(ctx);\n const w = fac(fd, slow);\n /* a host `function` has an own `prototype` object with a host prototype chain */\n if (is_ctor) (w as any).prototype = undefined;\n const m = js_init_host_function(ctx, w, is_ctor, '', b.defined_arg_count, proto, func_kind_to_class_id(b.func_kind));\n m.func = fd;\n m.realm = b.realm ?? ctx;\n js_direct.set(w, (t: JSValue, nt: JSValue, ...args: JSValue[]) => {\n if (nt === undefined) { const p = fd.priv; if (p !== null) return p.apply(t, args); }\n return slow(w, t, nt, args);\n });\n return w;\n}\n\n/* Call the direct entry of a compiled function from the engine (JS_CallInternal). */\nexport function jit_runtime_call_compiled(ctx: JSContext, direct: Function, this_obj: JSValue, new_target: JSValue,\n argv: JSValue[], flags: number): JSValue {\n const rt = ctx.rt;\n if (rt.stack_depth >= rt.max_stack_depth) return JS_ThrowStackOverflow(ctx);\n rt.stack_depth++;\n const sf = rt.current_stack_frame;\n try {\n /* construct call (JS_CallConstructorInternal passes new_target as this_obj, like C): the\n callee creates `this`. The interpreter's legacy constructor path calls back with the flag\n cleared, new_target set and `this` already created: the compiled prologue keeps it. */\n if (flags & JS_CALL_FLAG_CONSTRUCTOR) return (direct as any)(undefined, new_target, ...argv);\n return (direct as any)(this_obj, new_target, ...argv);\n } catch (e) {\n return js_host_exception_to_guest(ctx, e);\n } finally {\n rt.current_stack_frame = sf;\n rt.stack_depth--;\n }\n}\n\nfunction func_kind_to_class_id(kind: JSFunctionKind): JSClassID {\n switch (kind) {\n case JSFunctionKind.GENERATOR: return JSClassID.GENERATOR_FUNCTION;\n case JSFunctionKind.ASYNC: return JSClassID.ASYNC_FUNCTION;\n case JSFunctionKind.ASYNC_GENERATOR: return JSClassID.ASYNC_GENERATOR_FUNCTION;\n default: return JSClassID.BYTECODE_FUNCTION;\n }\n}\n\nexport class JitRuntime {\n ctx: JSContext;\n compile: (b: JSFunctionBytecode) => JitCompiledLike | null;\n /* sentinel returned by iteration helpers */\n DONE: any = Symbol('jit.done');\n /* host constructor whose .prototype is the guest Object.prototype: `new $Obj()` creates an\n object literal (measured ~0.7 ns vs ~27 ns for `{__proto__: proto}`) */\n Obj: Function;\n\n constructor(ctx: JSContext, compile: (b: JSFunctionBytecode) => JitCompiledLike | null) {\n this.ctx = ctx;\n this.compile = compile;\n const Obj = function () {};\n Obj.prototype = ctx.class_proto[JSClassID.OBJECT] as any;\n this.Obj = Obj;\n }\n\n /* --- exception plumbing --- */\n throw_pending(): never {\n throw js_take_exception(this.ctx);\n }\n check<T>(v: T): T {\n if (v === (JS_EXCEPTION as unknown)) this.throw_pending();\n return v;\n }\n checkn(r: number): void {\n if (r < 0) this.throw_pending();\n }\n /* host exception -> guest exception value (guest values pass through) */\n to_guest_exception(e: unknown): JSValue {\n if (!(e instanceof Error) && e !== (JS_EXCEPTION as unknown)) return e as JSValue;\n js_host_exception_to_guest(this.ctx, e);\n return js_take_exception(this.ctx);\n }\n /* a guest `catch` (or the handler that runs `finally`, or closes an iterator) takes the\n exception, unless it is uncatchable (an interrupt): that one goes on unwinding, without\n running handlers, as in the interpreter */\n catchable(e: unknown): JSValue {\n const v = this.to_guest_exception(e);\n if (JS_IsUncatchableError(this.ctx, v)) throw v;\n return v;\n }\n\n /* --- interrupts --- */\n /* compiled code polls at every function entry and loop head, as the interpreter polls at\n its jumps. Generated code decrements `ctx.interrupt_counter` inline and calls\n poll_handler() when it runs out; poll() is the same check as a call. Every 10000 polls\n the runtime's interrupt handler is asked, and a request to stop throws an uncatchable\n InternalError */\n poll(): void {\n if (--this.ctx.interrupt_counter > 0) return;\n this.poll_handler();\n }\n poll_handler(): void {\n const ctx = this.ctx;\n ctx.interrupt_counter = 10000;\n const rt = ctx.rt;\n if (rt.interrupt_handler === null || !rt.interrupt_handler(rt, rt.interrupt_opaque)) return;\n JS_ThrowInternalError(ctx, 'interrupted');\n JS_SetUncatchableError(ctx, rt.current_exception, true);\n this.throw_pending();\n }\n throw_type_error(msg: string): never { JS_ThrowTypeError(this.ctx, msg); this.throw_pending(); }\n throw_reference_error(msg: string): never { JS_ThrowReferenceError(this.ctx, msg); this.throw_pending(); }\n throw_internal_error(msg: string): never { JS_ThrowInternalError(this.ctx, msg); this.throw_pending(); }\n throw_not_a_constructor(_f: JSValue): never { this.throw_type_error('not a constructor'); }\n throw_uninitialized(b: JSFunctionBytecode, idx: number, is_ref: boolean): never {\n JS_ThrowReferenceErrorUninitialized2(this.ctx, b, idx, is_ref);\n this.throw_pending();\n }\n throw_error(atom: JSAtom, type: number): never {\n const ctx = this.ctx;\n if (type === JS_THROW_VAR_RO) JS_ThrowTypeErrorReadOnly(ctx, JS_PROP_THROW, atom);\n else if (type === JS_THROW_VAR_REDECL) JS_ThrowSyntaxErrorAtom(ctx, \"redeclaration of '%s'\", atom);\n else if (type === JS_THROW_VAR_UNINITIALIZED) JS_ThrowReferenceErrorUninitialized(ctx, atom);\n else if (type === JS_THROW_ERROR_DELETE_SUPER) JS_ThrowReferenceError(ctx, \"unsupported reference to 'super'\");\n else if (type === JS_THROW_ERROR_ITERATOR_THROW) JS_ThrowTypeError(ctx, 'iterator does not have a throw method');\n else JS_ThrowInternalError(ctx, 'invalid throw var type ' + type);\n this.throw_pending();\n }\n\n /* --- values --- */\n new_cell(v: JSValue): JSVarRef { return new_var_ref_cell(v); }\n new_object(): JSValue { return this.check(JS_NewObject(this.ctx)); }\n new_object_null(): JSValue { return this.check(JS_NewObjectProto(this.ctx, null)); }\n /* array literal: takes ownership of the host array and re-prototypes it */\n array(elems: JSValue[]): JSValue { return JS_NewArrayFrom(this.ctx, elems); }\n atom_value(atom: JSAtom): JSValue { return JS_AtomToValue(this.ctx, atom); }\n private_symbol(atom: JSAtom): JSValue { return JS_NewSymbolFromAtom(this.ctx, atom, JS_ATOM_TYPE_PRIVATE); }\n sloppy_this(t: JSValue): JSValue {\n if (JS_IsObject(t)) return t;\n if (t === undefined || t === null) return this.ctx.global_obj;\n return this.check(JS_ToObject(this.ctx, t));\n }\n regexp(pattern: JSValue, flags: JSValue): JSValue {\n if (!hooks.js_regexp_constructor_internal) this.throw_internal_error('RegExp is not available');\n return this.check(hooks.js_regexp_constructor_internal(this.ctx, undefined, pattern as string, flags as string));\n }\n to_object(v: JSValue): JSValue { return this.check(JS_ToObject(this.ctx, v)); }\n to_propkey(v: JSValue): JSValue { return this.check(JS_ToPropertyKey(this.ctx, v)); }\n to_numeric(v: JSValue): JSValue { return this.check(JS_ToNumericFree(this.ctx, v)); }\n inc(v: JSValue): JSValue { return this.check(js_unary_arith_slow(this.ctx, JSUnaryOp.INC, v)); }\n dec(v: JSValue): JSValue { return this.check(js_unary_arith_slow(this.ctx, JSUnaryOp.DEC, v)); }\n in(k: JSValue, o: JSValue): boolean {\n const r = js_operator_in(this.ctx, k, o);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n instanceof(v: JSValue, c: JSValue): boolean {\n const r = JS_IsInstanceOf(this.ctx, v, c);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n get_prototype(o: JSValue): JSValue { return this.check(JS_GetPrototype(this.ctx, o)); }\n\n /* --- calls --- */\n /* call with an explicit this when the callee has no direct entry (not a guest function) */\n call_slow(f: JSValue, thisv: JSValue, args: JSValue[]): JSValue {\n return this.check(JS_CallInternal(this.ctx, f, thisv, undefined, args, 0));\n }\n construct_slow(f: JSValue, new_target: JSValue, args: JSValue[]): JSValue {\n return this.check(JS_CallConstructorInternal(this.ctx, f, new_target, args, 0));\n }\n /* method call on a primitive receiver (looked up on the guest prototype of its type) */\n call_method_prim(o: JSValue, atom: JSAtom, args: JSValue[]): JSValue {\n const f = this.check(JS_GetProperty(this.ctx, o, atom));\n return this.check(JS_CallInternal(this.ctx, f, o, undefined, args, 0));\n }\n call_method_prim_key(o: JSValue, key: JSValue, args: JSValue[]): JSValue {\n const f = this.check(JS_GetPropertyValue(this.ctx, o, key));\n return this.check(JS_CallInternal(this.ctx, f, o, undefined, args, 0));\n }\n apply(f: JSValue, thisv: JSValue, arr: JSValue, magic: number): JSValue {\n return this.check(js_function_apply(this.ctx, f, [thisv, arr], magic));\n }\n create_this(new_target: JSValue): JSValue {\n /* fast path: an ordinary guest function with an object `prototype` (the property read is\n native, as the host does for `new`) */\n if (typeof new_target === 'function' && js_meta.get(new_target)?.class_id !== JSClassID.PROXY) {\n const p = (new_target as any).prototype;\n if (typeof p === 'object' && p !== null) return Object.create(p);\n }\n return this.check(js_create_from_ctor(this.ctx, new_target, JSClassID.OBJECT));\n }\n /* `off` is the index of the first guest argument in the host `arguments` object (2 for the\n direct convention, 0 for the natural one) */\n init_ctor(self: JSValue, new_target: JSValue, args: IArguments, off: number): JSValue {\n if (new_target === undefined) this.throw_type_error(\"class constructors must be invoked with 'new'\");\n const sup = this.check(JS_GetPrototype(this.ctx, self));\n return this.check(JS_CallConstructor2(this.ctx, sup, new_target, Array.prototype.slice.call(args, off)));\n }\n arguments(args: IArguments, off: number): JSValue {\n return this.check(js_build_arguments_value(this.ctx, Array.prototype.slice.call(args, off)));\n }\n /* legacy arguments object aliasing the argument cells through accessor properties */\n mapped_arguments(args: IArguments, off: number, cells: JSVarRef[], self: JSValue): JSValue {\n const ctx = this.ctx;\n const argv: JSValue[] = Array.prototype.slice.call(args, off);\n const argc = argv.length;\n const val = this.check(JS_NewObjectProtoClass(ctx, ctx.class_proto[JSClassID.OBJECT], JSClassID.MAPPED_ARGUMENTS));\n JS_DefinePropertyValue(ctx, val, JS_ATOM_length, argc, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);\n const n = Math.min(argc, cells.length);\n for (let i = 0; i < n; i++) {\n const cell = cells[i];\n const getter = js_new_host_function(ctx, () => cell.get(), false, '', 0, ctx.function_proto, JSClassID.C_FUNCTION);\n const setter = js_new_host_function(ctx, (_t, _nt, a) => { cell.set(a[0]); return undefined; }, false, '', 1,\n ctx.function_proto, JSClassID.C_FUNCTION);\n Reflect.defineProperty(val as object, i, { get: getter as any, set: setter as any, enumerable: true, configurable: true });\n }\n for (let i = n; i < argc; i++) this.checkn(JS_DefinePropertyValueUint32(ctx, val, i, argv[i], JS_PROP_C_W_E));\n JS_DefinePropertyValue(ctx, val, JS_ATOM_Symbol_iterator, ctx.array_proto_values, JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE);\n JS_DefinePropertyValue(ctx, val, JS_ATOM_callee, self, JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE);\n return val;\n }\n rest(args: IArguments, off: number, first: number): JSValue {\n const argv: JSValue[] = Array.prototype.slice.call(args, off);\n return this.check(js_build_rest(this.ctx, first, argv.length, argv));\n }\n /* --- modules --- */\n dynamic_import(b: JSFunctionBytecode, specifier: JSValue, options: JSValue): JSValue {\n if (hooks.js_dynamic_import === null) this.throw_type_error('dynamic import is not supported');\n return this.check(hooks.js_dynamic_import!(this.ctx, b, specifier, options));\n }\n import_meta(b: JSFunctionBytecode): JSValue {\n if (hooks.js_import_meta === null) this.throw_type_error('import.meta is not supported');\n return this.check(hooks.js_import_meta!(this.ctx, b));\n }\n home_object(self: JSValue): JSValue {\n return JS_GetFunctionData(self)?.home_object ?? undefined;\n }\n\n /* --- closures and classes --- */\n /* guest function object for bytecode `b` with the given variable references (fclosure).\n When `b` is compiled the object is the generated forwarder, else an interpreter wrapper\n that the call hook tiers up later. */\n closure(b: JSFunctionBytecode, var_refs: JSVarRef[], _parent: JSValue): JSValue {\n const ctx = this.ctx;\n const class_id = func_kind_to_class_id(b.func_kind);\n const proto = ctx.class_proto[class_id] ?? ctx.function_proto;\n let fo: JSValue | null = null;\n if (b.func_kind === JSFunctionKind.NORMAL && !b.no_jit) {\n const c = this.compile(b);\n if (c) {\n const [f, direct, mkpriv] = c.make(var_refs);\n const m = new JSObjectMeta(JSClassID.BYTECODE_FUNCTION);\n m.func = new JSFunctionData(b, var_refs);\n m.func.compiled = direct;\n m.func.mkpriv = mkpriv;\n m.is_constructor = b.has_prototype;\n m.realm = b.realm ?? ctx;\n js_meta.set(f, m);\n js_direct.set(f, direct);\n Object.setPrototypeOf(f, proto);\n /* a host `function` has an own `prototype` object with a host prototype chain */\n if (Object.prototype.hasOwnProperty.call(f, 'prototype')) (f as any).prototype = undefined;\n fo = f;\n }\n }\n if (fo === null) fo = this.check(js_closure_from_refs(ctx, b, var_refs, proto, b.has_prototype));\n let name_atom = b.func_name;\n if (name_atom === JS_ATOM_NULL) name_atom = JS_ATOM_empty_string;\n js_function_set_properties(ctx, fo, name_atom, b.defined_arg_count);\n if (b.func_kind & JSFunctionKind.GENERATOR) {\n const proto_class_id = (b.func_kind === JSFunctionKind.ASYNC_GENERATOR) ? JSClassID.ASYNC_GENERATOR : JSClassID.GENERATOR;\n const gproto = this.check(JS_NewObjectProto(ctx, ctx.class_proto[proto_class_id]));\n JS_DefinePropertyValue(ctx, fo, JS_ATOM_prototype, gproto, JS_PROP_WRITABLE);\n } else if (b.has_prototype) {\n const pobj = this.check(JS_NewObject(ctx));\n this.checkn(JS_DefinePropertyValue(ctx, pobj, JS_ATOM_constructor, fo, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE));\n this.checkn(JS_DefinePropertyValue(ctx, fo, JS_ATOM_prototype, pobj, JS_PROP_WRITABLE));\n }\n return fo;\n }\n define_class(name: JSAtom | JSValue, parent_class: JSValue, b: JSFunctionBytecode, class_flags: number,\n var_refs: JSVarRef[], is_computed_name: boolean): [JSValue, JSValue] {\n const r = js_define_class(this.ctx, is_computed_name ? JS_ATOM_NULL : (name as JSAtom), class_flags, parent_class, b, var_refs,\n is_computed_name, is_computed_name ? (name as JSValue) : undefined);\n if (r === null) this.throw_pending();\n return r;\n }\n set_home_object(f: JSValue, home: JSValue): void { js_method_set_home_object(this.ctx, f, home); }\n set_name(f: JSValue, atom: JSAtom): void { this.checkn(JS_DefineObjectName(this.ctx, f, atom, JS_PROP_CONFIGURABLE)); }\n set_name_computed(f: JSValue, name: JSValue): void { this.checkn(JS_DefineObjectNameComputed(this.ctx, f, name, JS_PROP_CONFIGURABLE)); }\n define_method(obj: JSValue, key: JSAtom | JSValue, fn: JSValue, op_flags: number, computed: boolean): void {\n const ctx = this.ctx;\n let atom: JSAtom;\n if (computed) {\n atom = JS_ValueToAtom(ctx, key as JSValue);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n } else {\n atom = key as JSAtom;\n }\n let fl = JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE | JS_PROP_THROW;\n if (op_flags & OP_DEFINE_METHOD_ENUMERABLE) fl |= JS_PROP_ENUMERABLE;\n op_flags &= 3;\n let value: JSValue = undefined, getter: JSValue = undefined, setter: JSValue = undefined;\n if (op_flags === OP_DEFINE_METHOD_METHOD) { value = fn; fl |= JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE; }\n else if (op_flags === OP_DEFINE_METHOD_GETTER) { getter = fn; fl |= JS_PROP_HAS_GET; }\n else { setter = fn; fl |= JS_PROP_HAS_SET; }\n this.checkn(js_method_set_properties(ctx, fn, atom, fl, obj));\n this.checkn(JS_DefineProperty(ctx, obj, atom, value, getter, setter, fl));\n }\n set_proto(o: JSValue, proto: JSValue): void {\n if (JS_IsObject(proto) || proto === null) this.checkn(JS_SetPrototypeInternal(this.ctx, o, proto, true));\n }\n check_brand(o: JSValue, f: JSValue): void {\n const r = JS_CheckBrand(this.ctx, o, f);\n if (r < 0) this.throw_pending();\n if (!r) this.throw_type_error('invalid brand on object');\n }\n add_brand(o: JSValue, f: JSValue): void { this.checkn(JS_AddBrand(this.ctx, o, f)); }\n get_private_field(o: JSValue, name: JSValue): JSValue { return this.check(JS_GetPrivateField(this.ctx, o, name)); }\n put_private_field(o: JSValue, name: JSValue, v: JSValue): void { this.checkn(JS_SetPrivateField(this.ctx, o, name, v)); }\n define_private_field(o: JSValue, name: JSValue, v: JSValue): void { this.checkn(JS_DefinePrivateField(this.ctx, o, name, v)); }\n private_in(o: JSValue, name: JSValue): boolean {\n const r = js_operator_private_in(this.ctx, o, name);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n\n /* --- globals --- */\n check_var(atom: JSAtom): boolean {\n const r = JS_CheckGlobalVar(this.ctx, atom);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n get_global(atom: JSAtom, throw_ref_error: boolean): JSValue {\n return this.check(JS_GetGlobalVar(this.ctx, atom, throw_ref_error ? 1 : 0));\n }\n /* JS_SetGlobalVar with an explicit strict flag (the engine's version reads the strictness\n from the current interpreter frame, which does not exist for compiled code) */\n put_global(atom: JSAtom, v: JSValue, flag: number, strict: boolean): void {\n const ctx = this.ctx;\n if (flag === 1 || !strict || (JS_AtomToKey(ctx, atom) in ctx.global_var_obj)) {\n this.checkn(JS_SetGlobalVar(ctx, atom, v, flag));\n return;\n }\n const ret = JS_HasProperty(ctx, ctx.global_obj, atom);\n if (ret < 0) this.throw_pending();\n if (!ret) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n this.checkn(JS_SetPropertyInternal(ctx, ctx.global_obj, atom, v, ctx.global_obj, JS_PROP_THROW));\n }\n put_global_strict(atom: JSAtom, defined: JSValue, v: JSValue): void {\n const ctx = this.ctx;\n if (!defined) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n if (JS_AtomToKey(ctx, atom) in ctx.global_var_obj) { this.checkn(JS_SetGlobalVar(ctx, atom, v, 2)); return; }\n this.checkn(JS_SetPropertyInternal(ctx, ctx.global_obj, atom, v, ctx.global_obj, JS_PROP_THROW));\n }\n check_define_var(atom: JSAtom, flags: number): void { if (JS_CheckDefineGlobalVar(this.ctx, atom, flags)) this.throw_pending(); }\n define_var(atom: JSAtom, flags: number): void { this.checkn(JS_DefineGlobalVar(this.ctx, atom, flags)); }\n define_func(atom: JSAtom, v: JSValue, flags: number): void { this.checkn(JS_DefineGlobalFunction(this.ctx, atom, v, flags)); }\n get_global_ref(atom: JSAtom): [JSValue, JSValue] {\n const r = JS_GetGlobalVarRef(this.ctx, atom);\n if (!r) this.throw_pending();\n return r as [JSValue, JSValue];\n }\n delete_global(atom: JSAtom): boolean {\n const r = JS_DeleteProperty(this.ctx, this.ctx.global_obj, atom, 0);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n\n /* --- properties (slow paths: primitive bases and runtime-dependent semantics) --- */\n get_field(o: JSValue, atom: JSAtom): JSValue { return this.check(JS_GetProperty(this.ctx, o, atom)); }\n get_field_str(o: JSValue, name: string): JSValue {\n return this.check(JS_GetProperty(this.ctx, o, this.ctx.rt.atoms.newAtomStr(name)));\n }\n get_length(o: JSValue): JSValue { return this.check(JS_GetProperty(this.ctx, o, JS_ATOM_length)); }\n get_el(o: JSValue, k: JSValue): JSValue { return this.check(JS_GetPropertyValue(this.ctx, o, k)); }\n put_field(o: JSValue, atom: JSAtom, v: JSValue, strict: boolean): void {\n this.checkn(JS_SetPropertyInternal(this.ctx, o, atom, v, o, strict ? JS_PROP_THROW : 0));\n }\n put_el(o: JSValue, k: JSValue, v: JSValue, strict: boolean): void {\n this.checkn(JS_SetPropertyValue(this.ctx, o, k, v, strict ? JS_PROP_THROW : 0));\n }\n delete(o: JSValue, k: JSValue, strict: boolean): boolean {\n const atom = JS_ValueToAtom(this.ctx, k);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n const r = JS_DeleteProperty(this.ctx, o, atom, strict ? JS_PROP_THROW : 0);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n define_field(o: JSValue, atom: JSAtom, v: JSValue): void {\n this.checkn(JS_DefinePropertyValue(this.ctx, o, atom, v, JS_PROP_C_W_E | JS_PROP_THROW));\n }\n define_array_el(arr: JSValue, pos: JSValue, v: JSValue): void {\n this.checkn(JS_DefinePropertyValueValue(this.ctx, arr, pos, v, JS_PROP_C_W_E | JS_PROP_THROW));\n }\n append(arr: JSValue, pos: JSValue, src: JSValue): number {\n if (typeof pos !== 'number') this.throw_internal_error('invalid index for append');\n const r = js_append_enumerate_value(this.ctx, arr, pos as number, src);\n if (r < 0) this.throw_pending();\n return r;\n }\n copy_data_properties(target: JSValue, source: JSValue, excluded: JSValue): void {\n if (JS_CopyDataProperties(this.ctx, target, source, excluded, false)) this.throw_pending();\n }\n get_ref_value(o: JSValue, k: JSValue, strict: boolean): JSValue {\n const ctx = this.ctx;\n const atom = JS_ValueToAtom(ctx, k);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n if (o === undefined) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n const r = JS_HasProperty(ctx, o, atom);\n if (r < 0) this.throw_pending();\n if (!r) {\n if (strict) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n return undefined;\n }\n return this.check(JS_GetProperty(ctx, o, atom));\n }\n put_ref_value(o: JSValue, k: JSValue, v: JSValue, strict: boolean): void {\n const ctx = this.ctx;\n const atom = JS_ValueToAtom(ctx, k);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n if (o === undefined) {\n if (strict) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n o = ctx.global_obj;\n }\n const r = JS_HasProperty(ctx, o, atom);\n if (r < 0) this.throw_pending();\n if (!r && strict) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n this.checkn(JS_SetPropertyInternal(ctx, o, atom, v, o, strict ? JS_PROP_THROW : 0));\n }\n get_super_value(thisv: JSValue, o: JSValue, k: JSValue): JSValue {\n const atom = JS_ValueToAtom(this.ctx, k);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n return this.check(JS_GetPropertyInternal(this.ctx, o, atom, thisv, false));\n }\n put_super_value(thisv: JSValue, o: JSValue, k: JSValue, v: JSValue): void {\n if (!JS_IsObject(o)) { JS_ThrowTypeErrorNotAnObject(this.ctx); this.throw_pending(); }\n const atom = JS_ValueToAtom(this.ctx, k);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n this.checkn(JS_SetPropertyInternal(this.ctx, o, atom, v, thisv, JS_PROP_THROW));\n }\n\n /* --- iteration --- */\n for_in_start(o: JSValue): JSValue { return this.check(build_for_in_iterator(this.ctx, o)); }\n for_in_next(it: JSValue): JSValue {\n const pdone = { done: 0 };\n const v = this.check(js_for_in_next(this.ctx, it, pdone));\n return pdone.done ? this.DONE : v;\n }\n get_iterator(o: JSValue): JSValue { return this.check(JS_GetIterator(this.ctx, o, false)); }\n for_of_start(o: JSValue): [JSValue, JSValue] {\n const r = js_for_of_start_value(this.ctx, o, false);\n if (r === null) this.throw_pending();\n return r;\n }\n for_of_next(iter: JSValue, next: JSValue): JSValue {\n if (iter === undefined) return this.DONE;\n const r = js_for_of_next_value(this.ctx, iter, next);\n if (r === null) this.throw_pending();\n return r.done ? this.DONE : r.value;\n }\n iterator_close(iter: JSValue): void {\n if (JS_IteratorClose(this.ctx, iter, false) < 0) this.throw_pending();\n }\n /* close an iterator while an exception is propagating: errors from return() are ignored */\n iterator_close_exc(iter: JSValue): void {\n if (iter === undefined) return;\n const ctx = this.ctx;\n const method = JS_GetProperty(ctx, iter, JS_ATOM_return);\n if (JS_IsException(method)) { JS_GetException(ctx); return; }\n if (method === undefined || method === null) return;\n const r = JS_Call(ctx, method, iter, []);\n if (JS_IsException(r)) JS_GetException(ctx);\n }\n iterator_call(iter: JSValue, val: JSValue, flags: number): JSValue {\n const ctx = this.ctx;\n const method = this.check(JS_GetProperty(ctx, iter, (flags & 1) ? JS_ATOM_throw : JS_ATOM_return));\n if (method === undefined || method === null) return this.DONE;\n return this.check(JS_Call(ctx, method, iter, (flags & 2) ? [] : [val]));\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"jit_runtime.js","sourceRoot":"","sources":["../src/jit_runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAC2C,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAC3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C,cAAc,CAAC,CAAC,CAAC;QACnG,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC,IAAI,CAAC;QAC9D,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF","sourcesContent":["/*\n * Runtime adapter for the compiled tier (src/jit.ts).\n *\n * This is the ONLY module that generated code talks to, and the only\n * place where the compiled tier touches engine internals. Generated code\n * receives one `JitRuntime` instance per context as `$RT`, plus a few\n * host intrinsics and engine tables as factory parameters (see\n * JIT_FACTORY_PARAMS).\n *\n * Conventions:\n * - every helper either returns a guest value or `throw`s a guest value\n * (the engine's JS_EXCEPTION/current_exception convention is converted\n * here by `check()`/`throw_pending()`);\n * - `DONE` is a sentinel returned by the iteration helpers;\n * - the direct entry of a guest function (js_direct) uses the explicit\n * convention `direct($this, $new_target, ...args)`; compiled code calls\n * it when it has an explicit `this` or new.target, and calls guest\n * functions natively otherwise.\n */\nimport {\n JSContext, JSValue, JSFunctionBytecode, JSAtom, JS_EXCEPTION, JS_UNINITIALIZED, JS_IsException, JS_IsObject,\n JS_GetException, js_take_exception, js_host_exception_to_guest, JS_ThrowTypeError, JS_ThrowReferenceError,\n JS_ThrowInternalError, JS_ThrowStackOverflow, JS_ThrowTypeErrorReadOnly, JS_ThrowSyntaxErrorAtom,\n JS_ThrowReferenceErrorUninitialized, JS_ThrowReferenceErrorNotDefined, JS_ThrowReferenceErrorUninitialized2,\n JS_ThrowTypeErrorNotAnObject, JS_GetProperty, JS_GetPropertyInternal, JS_GetPropertyValue, JS_SetPropertyInternal,\n JS_SetPropertyValue, JS_DefinePropertyValue, JS_DefinePropertyValueValue, JS_DefinePropertyValueUint32, JS_DefineProperty,\n JS_DeleteProperty, JS_HasProperty, JS_GetPrototype, JS_SetPrototypeInternal, JS_NewObject, JS_NewObjectProto,\n JS_NewObjectProtoClass, JS_NewArrayFrom, JS_ValueToAtom, JS_AtomToValue, JS_AtomToKey, JS_NewSymbolFromAtom, JS_ToObject,\n JS_ToPropertyKey, JS_ToNumericFree, JS_IsInstanceOf, js_operator_in, js_unary_arith_slow, JSUnaryOp, JS_GetIterator,\n JS_IteratorNext, JS_IteratorClose, build_for_in_iterator, js_for_in_next, JS_CopyDataProperties, JS_Call,\n JS_CallConstructorInternal, JS_CallConstructor2, js_create_from_ctor, JS_CheckGlobalVar, JS_GetGlobalVar, JS_SetGlobalVar,\n JS_CheckDefineGlobalVar, JS_DefineGlobalVar, JS_DefineGlobalFunction, JS_GetGlobalVarRef, hooks, js_meta, js_direct,\n JS_GetFunctionData, js_new_host_function, js_init_host_function, JS_ATOM_NULL, JS_ATOM_next, JS_ATOM_return, JS_ATOM_throw, JS_ATOM_length,\n JS_ATOM_prototype, JS_ATOM_callee, JS_ATOM_Symbol_iterator, JS_ATOM_empty_string, JS_ATOM_TYPE_PRIVATE, JS_ATOM_constructor,\n JS_IsUncatchableError, JS_SetUncatchableError, JS_ThrowTypeErrorNotAConstructor,\n} from './quickjs.ts';\nimport {\n JSClassID, JSFunctionKind, JSVarRef, JSFunctionData, JSObjectMeta, new_var_ref_cell, JS_PROP_C_W_E, JS_PROP_THROW,\n JS_PROP_CONFIGURABLE, JS_PROP_WRITABLE, JS_PROP_ENUMERABLE, JS_PROP_HAS_CONFIGURABLE, JS_PROP_HAS_ENUMERABLE,\n JS_PROP_HAS_VALUE, JS_PROP_HAS_WRITABLE, JS_PROP_HAS_GET, JS_PROP_HAS_SET, JS_CALL_FLAG_CONSTRUCTOR,\n} from './values.ts';\nimport {\n JS_CallInternal, js_closure_from_refs, js_function_set_properties, js_define_class, js_build_arguments_value, js_build_rest,\n JS_DefinePrivateField, JS_GetPrivateField, JS_SetPrivateField, JS_AddBrand, JS_CheckBrand, js_operator_private_in,\n js_method_set_home_object, js_method_set_properties, JS_DefineObjectName, JS_DefineObjectNameComputed, js_function_apply,\n js_for_of_start_value, js_for_of_next_value, js_append_enumerate_value,\n} from './interpreter.ts';\nimport { OP, short_opcode_info, OPSpecialObject } from './opcodes.ts';\nimport { OP_DEFINE_METHOD_ENUMERABLE, OP_DEFINE_METHOD_METHOD, OP_DEFINE_METHOD_GETTER, JS_THROW_VAR_RO, JS_THROW_VAR_REDECL,\n JS_THROW_VAR_UNINITIALIZED, JS_THROW_ERROR_DELETE_SUPER, JS_THROW_ERROR_ITERATOR_THROW } from './opcodes.ts';\n\n/* what jit.ts produces for a bytecode function (see JitCompiled in jit.ts) */\nexport interface JitCompiledLike {\n /* returns [function object, direct entry, private copy factory]; `func_obj` overrides the\n function object (used when an existing interpreter wrapper is tiered up) */\n make: (var_refs: JSVarRef[], func_obj?: JSValue) => [Function, Function, (() => Function) | null];\n}\n\n/* parameters of the generated factory function, in order */\nexport const JIT_FACTORY_PARAMS = ['$RT', '$cpool', '$b', '$U', '$D', '$Obj', '$set', '$del', '$getproto', '$DIRECT', '$P', '$G', '$GV',\n '$CALL', '$CONSTRUCT', '$C'];\n\nexport function jit_runtime_factory_args(RT: JitRuntime, b: JSFunctionBytecode): any[] {\n return [RT, b.cpool, b, JS_UNINITIALIZED, RT.DONE, RT.Obj, Reflect.set, Reflect.deleteProperty, Object.getPrototypeOf,\n js_direct, RT.ctx.plain_object_proto, RT.ctx.global_obj, RT.ctx.global_var_obj, Function.prototype.call, Reflect.construct,\n RT.ctx];\n}\n\nconst runtimes = new WeakMap<JSContext, JitRuntime>();\n\n/* `compile(b)` returns the compiled form of `b` if it is (or should now be) compiled, else null */\nexport function make_jit_runtime(ctx: JSContext, compile: (b: JSFunctionBytecode) => JitCompiledLike | null): JitRuntime {\n let rt = runtimes.get(ctx);\n if (!rt) { rt = new JitRuntime(ctx, compile); runtimes.set(ctx, rt); }\n return rt;\n}\n\n/* Call a compiled body through its private host-convention copy (`fd.priv`): the engine's\n ordinary (non-construct) calls of compiled functions. */\nexport function jit_runtime_call_priv(ctx: JSContext, priv: Function, this_obj: JSValue, argv: JSValue[]): JSValue {\n const rt = ctx.rt;\n if (rt.stack_depth >= rt.max_stack_depth) return JS_ThrowStackOverflow(ctx);\n rt.stack_depth++;\n const sf = rt.current_stack_frame;\n try {\n return priv.apply(this_obj, argv);\n } catch (e) {\n return js_host_exception_to_guest(ctx, e);\n } finally {\n rt.current_stack_frame = sf;\n rt.stack_depth--;\n }\n}\n\n/* ---------------------------------------------------------------------\n Retargetable wrappers\n\n The function object of a closure created by the interpreter (or by compiled code before the\n function's bytecode is compiled) is a wrapper that calls the compiled body as soon as one\n exists for the closure (JSFunctionData.priv for calls, .ctor for construct calls) and the\n engine otherwise, so its identity survives tier-up. The wrappers are generated once per\n (kind, arity) without rest parameters: a call is `fd.priv.call(this, a0, a1)`, which the host\n inlines (measured: the same cost as calling the compiled function directly, also for `new`).\n --------------------------------------------------------------------- */\n\n/* the body reads `arguments` (or a rest parameter, or init_ctor's arguments): its wrapper must\n forward the exact argument list. Cached on the bytecode. */\nexport function jit_bytecode_uses_args(b: JSFunctionBytecode): boolean {\n if (b.uses_args >= 0) return b.uses_args === 1;\n const buf = b.byte_code_buf, len = b.byte_code_len;\n let r = 0;\n for (let pos = 0; pos < len;) {\n const op = buf[pos];\n if (op === OP.rest || op === OP.init_ctor) { r = 1; break; }\n if (op === OP.special_object) {\n const k = buf[pos + 1];\n if (k === OPSpecialObject.ARGUMENTS || k === OPSpecialObject.MAPPED_ARGUMENTS) { r = 1; break; }\n }\n const oi = short_opcode_info(op);\n if (!oi || oi.size <= 0) { r = 1; break; }\n pos += oi.size;\n }\n b.uses_args = r;\n return r === 1;\n}\n\ntype SlowCall = (w: Function, t: JSValue, nt: JSValue, args: ArrayLike<JSValue>) => JSValue;\ntype WrapperFactory = (fd: JSFunctionData, slow: SlowCall) => Function;\nconst MAX_WRAPPER_ARITY = 12;\n\n/* The wrapper code is generated once per function (bytecode), not once per arity: the call\n `p.call(this, a0)` inside a wrapper shared by many functions sees many targets and the host\n stops inlining it (measured in Bun: 1.75x the cost of a direct call, against 1x for a\n per-function wrapper). Closures of the same function share their wrapper's code. */\nfunction wrapper_factory(b: JSFunctionBytecode, is_ctor: boolean): WrapperFactory | null {\n /* cached per kind (constructible or not): a function is normally wrapped as one kind only */\n const slot = is_ctor ? 'f' : 'm';\n if (b.wrapper_factory === null) b.wrapper_factory = { f: undefined, m: undefined };\n const cached = b.wrapper_factory[slot];\n if (cached !== undefined) return cached;\n const arity = b.arg_count;\n let use_args = jit_bytecode_uses_args(b);\n if (arity > MAX_WRAPPER_ARITY) use_args = true;\n let f: WrapperFactory | null;\n const params = use_args ? '' : Array.from({ length: arity }, (_, i) => `a${i}`).join(', ');\n const call_p = use_args ? 'p.apply(this, arguments)' : `p.call(this${params ? ', ' + params : ''})`;\n const call_c = use_args ? 'c(t, new.target, ...arguments)' : `c(t, new.target${params ? ', ' + params : ''})`;\n const src = is_ctor\n ? `\"use strict\"; return function (fd, slow) { return function $w(${params}) {\n if (new.target === undefined) { const p = fd.priv; if (p !== null) return ${call_p}; }\n else { const c = fd.ctor; if (c !== null) { const xp = new.target.prototype; const t = (typeof xp === 'object' ? xp !== null : typeof xp === 'function') ? this : undefined; return ${call_c}; } }\n return slow($w, this, new.target, arguments);\n}; };`\n : `\"use strict\"; return function (fd, slow) { let w; const o = { $w(${params}) {\n const p = fd.priv; if (p !== null) return ${call_p};\n return slow(w, this, undefined, arguments);\n} }; w = o.$w; return w; };`;\n try { f = (new Function(src) as () => WrapperFactory)(); } catch { f = null; /* code generation unavailable */ }\n b.wrapper_factory[slot] = f;\n return f;\n}\n\nconst slow_calls = new WeakMap<JSContext, SlowCall>();\nfunction slow_call(ctx: JSContext): SlowCall {\n let s = slow_calls.get(ctx);\n if (s === undefined) {\n s = (w, t, nt, args) => {\n const argv: JSValue[] = new Array(args.length);\n for (let i = 0; i < args.length; i++) argv[i] = args[i];\n const ret = nt !== undefined ? JS_CallInternal(ctx, w, nt, nt, argv, JS_CALL_FLAG_CONSTRUCTOR)\n : JS_CallInternal(ctx, w, t, undefined, argv, 0);\n if (ret === JS_EXCEPTION) throw js_take_exception(ctx);\n return ret;\n };\n slow_calls.set(ctx, s);\n }\n return s;\n}\n\n/* the function object of a closure of a normal function: a retargetable wrapper, or null when\n wrappers cannot be generated (the engine then uses its generic wrapper) */\nexport function jit_runtime_make_wrapper(ctx: JSContext, b: JSFunctionBytecode, var_refs: JSVarRef[],\n proto: JSValue | null, is_ctor: boolean): JSValue | null {\n const fac = wrapper_factory(b, is_ctor);\n if (fac === null) return null;\n const fd = new JSFunctionData(b, var_refs);\n const slow = slow_call(ctx);\n const w = fac(fd, slow);\n /* a host `function` has an own `prototype` object with a host prototype chain */\n if (is_ctor) (w as any).prototype = undefined;\n const m = js_init_host_function(ctx, w, is_ctor, '', b.defined_arg_count, proto, func_kind_to_class_id(b.func_kind));\n m.func = fd;\n m.realm = b.realm ?? ctx;\n js_direct.set(w, (t: JSValue, nt: JSValue, ...args: JSValue[]) => {\n if (nt === undefined) { const p = fd.priv; if (p !== null) return p.apply(t, args); }\n return slow(w, t, nt, args);\n });\n return w;\n}\n\n/* Call the direct entry of a compiled function from the engine (JS_CallInternal). */\nexport function jit_runtime_call_compiled(ctx: JSContext, direct: Function, this_obj: JSValue, new_target: JSValue,\n argv: JSValue[], flags: number): JSValue {\n const rt = ctx.rt;\n if (rt.stack_depth >= rt.max_stack_depth) return JS_ThrowStackOverflow(ctx);\n rt.stack_depth++;\n const sf = rt.current_stack_frame;\n try {\n /* construct call (JS_CallConstructorInternal passes new_target as this_obj, like C): the\n callee creates `this`. The interpreter's legacy constructor path calls back with the flag\n cleared, new_target set and `this` already created: the compiled prologue keeps it. */\n if (flags & JS_CALL_FLAG_CONSTRUCTOR) return (direct as any)(undefined, new_target, ...argv);\n return (direct as any)(this_obj, new_target, ...argv);\n } catch (e) {\n return js_host_exception_to_guest(ctx, e);\n } finally {\n rt.current_stack_frame = sf;\n rt.stack_depth--;\n }\n}\n\nfunction func_kind_to_class_id(kind: JSFunctionKind): JSClassID {\n switch (kind) {\n case JSFunctionKind.GENERATOR: return JSClassID.GENERATOR_FUNCTION;\n case JSFunctionKind.ASYNC: return JSClassID.ASYNC_FUNCTION;\n case JSFunctionKind.ASYNC_GENERATOR: return JSClassID.ASYNC_GENERATOR_FUNCTION;\n default: return JSClassID.BYTECODE_FUNCTION;\n }\n}\n\nexport class JitRuntime {\n ctx: JSContext;\n compile: (b: JSFunctionBytecode) => JitCompiledLike | null;\n /* sentinel returned by iteration helpers */\n DONE: any = Symbol('jit.done');\n /* host constructor whose .prototype is the guest Object.prototype: `new $Obj()` creates an\n object literal (measured ~0.7 ns vs ~27 ns for `{__proto__: proto}`) */\n Obj: Function;\n\n constructor(ctx: JSContext, compile: (b: JSFunctionBytecode) => JitCompiledLike | null) {\n this.ctx = ctx;\n this.compile = compile;\n const Obj = function () {};\n Obj.prototype = ctx.class_proto[JSClassID.OBJECT] as any;\n this.Obj = Obj;\n }\n\n /* --- exception plumbing --- */\n throw_pending(): never {\n throw js_take_exception(this.ctx);\n }\n check<T>(v: T): T {\n if (v === (JS_EXCEPTION as unknown)) this.throw_pending();\n return v;\n }\n checkn(r: number): void {\n if (r < 0) this.throw_pending();\n }\n /* host exception -> guest exception value (guest values pass through) */\n to_guest_exception(e: unknown): JSValue {\n if (!(e instanceof Error) && e !== (JS_EXCEPTION as unknown)) return e as JSValue;\n js_host_exception_to_guest(this.ctx, e);\n return js_take_exception(this.ctx);\n }\n /* a guest `catch` (or the handler that runs `finally`, or closes an iterator) takes the\n exception, unless it is uncatchable (an interrupt): that one goes on unwinding, without\n running handlers, as in the interpreter */\n catchable(e: unknown): JSValue {\n const v = this.to_guest_exception(e);\n if (JS_IsUncatchableError(this.ctx, v)) throw v;\n return v;\n }\n\n /* --- interrupts --- */\n /* compiled code polls at every function entry and loop head, as the interpreter polls at\n its jumps. Generated code decrements `ctx.interrupt_counter` inline and calls\n poll_handler() when it runs out; poll() is the same check as a call. Every 10000 polls\n the runtime's interrupt handler is asked, and a request to stop throws an uncatchable\n InternalError */\n poll(): void {\n if (--this.ctx.interrupt_counter > 0) return;\n this.poll_handler();\n }\n poll_handler(): void {\n const ctx = this.ctx;\n ctx.interrupt_counter = 10000;\n const rt = ctx.rt;\n if (rt.interrupt_handler === null || !rt.interrupt_handler(rt, rt.interrupt_opaque)) return;\n JS_ThrowInternalError(ctx, 'interrupted');\n JS_SetUncatchableError(ctx, rt.current_exception, true);\n this.throw_pending();\n }\n throw_type_error(msg: string): never { JS_ThrowTypeError(this.ctx, msg); this.throw_pending(); }\n throw_reference_error(msg: string): never { JS_ThrowReferenceError(this.ctx, msg); this.throw_pending(); }\n throw_internal_error(msg: string): never { JS_ThrowInternalError(this.ctx, msg); this.throw_pending(); }\n throw_not_a_constructor(f: JSValue): never { JS_ThrowTypeErrorNotAConstructor(this.ctx, f); this.throw_pending(); }\n throw_uninitialized(b: JSFunctionBytecode, idx: number, is_ref: boolean): never {\n JS_ThrowReferenceErrorUninitialized2(this.ctx, b, idx, is_ref);\n this.throw_pending();\n }\n throw_error(atom: JSAtom, type: number): never {\n const ctx = this.ctx;\n if (type === JS_THROW_VAR_RO) JS_ThrowTypeErrorReadOnly(ctx, JS_PROP_THROW, atom);\n else if (type === JS_THROW_VAR_REDECL) JS_ThrowSyntaxErrorAtom(ctx, \"redeclaration of '%s'\", atom);\n else if (type === JS_THROW_VAR_UNINITIALIZED) JS_ThrowReferenceErrorUninitialized(ctx, atom);\n else if (type === JS_THROW_ERROR_DELETE_SUPER) JS_ThrowReferenceError(ctx, \"unsupported reference to 'super'\");\n else if (type === JS_THROW_ERROR_ITERATOR_THROW) JS_ThrowTypeError(ctx, 'iterator does not have a throw method');\n else JS_ThrowInternalError(ctx, 'invalid throw var type ' + type);\n this.throw_pending();\n }\n\n /* --- values --- */\n new_cell(v: JSValue): JSVarRef { return new_var_ref_cell(v); }\n new_object(): JSValue { return this.check(JS_NewObject(this.ctx)); }\n new_object_null(): JSValue { return this.check(JS_NewObjectProto(this.ctx, null)); }\n /* array literal: takes ownership of the host array and re-prototypes it */\n array(elems: JSValue[]): JSValue { return JS_NewArrayFrom(this.ctx, elems); }\n atom_value(atom: JSAtom): JSValue { return JS_AtomToValue(this.ctx, atom); }\n private_symbol(atom: JSAtom): JSValue { return JS_NewSymbolFromAtom(this.ctx, atom, JS_ATOM_TYPE_PRIVATE); }\n sloppy_this(t: JSValue): JSValue {\n if (JS_IsObject(t)) return t;\n if (t === undefined || t === null) return this.ctx.global_obj;\n return this.check(JS_ToObject(this.ctx, t));\n }\n regexp(pattern: JSValue, flags: JSValue): JSValue {\n if (!hooks.js_regexp_constructor_internal) this.throw_internal_error('RegExp is not available');\n return this.check(hooks.js_regexp_constructor_internal(this.ctx, undefined, pattern as string, flags as string));\n }\n to_object(v: JSValue): JSValue { return this.check(JS_ToObject(this.ctx, v)); }\n to_propkey(v: JSValue): JSValue { return this.check(JS_ToPropertyKey(this.ctx, v)); }\n to_numeric(v: JSValue): JSValue { return this.check(JS_ToNumericFree(this.ctx, v)); }\n inc(v: JSValue): JSValue { return this.check(js_unary_arith_slow(this.ctx, JSUnaryOp.INC, v)); }\n dec(v: JSValue): JSValue { return this.check(js_unary_arith_slow(this.ctx, JSUnaryOp.DEC, v)); }\n in(k: JSValue, o: JSValue): boolean {\n const r = js_operator_in(this.ctx, k, o);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n instanceof(v: JSValue, c: JSValue): boolean {\n const r = JS_IsInstanceOf(this.ctx, v, c);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n get_prototype(o: JSValue): JSValue { return this.check(JS_GetPrototype(this.ctx, o)); }\n\n /* --- calls --- */\n /* call with an explicit this when the callee has no direct entry (not a guest function) */\n call_slow(f: JSValue, thisv: JSValue, args: JSValue[]): JSValue {\n return this.check(JS_CallInternal(this.ctx, f, thisv, undefined, args, 0));\n }\n construct_slow(f: JSValue, new_target: JSValue, args: JSValue[]): JSValue {\n return this.check(JS_CallConstructorInternal(this.ctx, f, new_target, args, 0));\n }\n /* method call on a primitive receiver (looked up on the guest prototype of its type) */\n call_method_prim(o: JSValue, atom: JSAtom, args: JSValue[]): JSValue {\n const f = this.check(JS_GetProperty(this.ctx, o, atom));\n return this.check(JS_CallInternal(this.ctx, f, o, undefined, args, 0));\n }\n call_method_prim_key(o: JSValue, key: JSValue, args: JSValue[]): JSValue {\n const f = this.check(JS_GetPropertyValue(this.ctx, o, key));\n return this.check(JS_CallInternal(this.ctx, f, o, undefined, args, 0));\n }\n apply(f: JSValue, thisv: JSValue, arr: JSValue, magic: number): JSValue {\n return this.check(js_function_apply(this.ctx, f, [thisv, arr], magic));\n }\n create_this(new_target: JSValue): JSValue {\n /* fast path: an ordinary guest function with an object `prototype` (the property read is\n native, as the host does for `new`) */\n if (typeof new_target === 'function' && js_meta.get(new_target)?.class_id !== JSClassID.PROXY) {\n const p = (new_target as any).prototype;\n if (typeof p === 'object' && p !== null) return Object.create(p);\n }\n return this.check(js_create_from_ctor(this.ctx, new_target, JSClassID.OBJECT));\n }\n /* `off` is the index of the first guest argument in the host `arguments` object (2 for the\n direct convention, 0 for the natural one) */\n init_ctor(self: JSValue, new_target: JSValue, args: IArguments, off: number): JSValue {\n if (new_target === undefined) this.throw_type_error(\"class constructors must be invoked with 'new'\");\n const sup = this.check(JS_GetPrototype(this.ctx, self));\n return this.check(JS_CallConstructor2(this.ctx, sup, new_target, Array.prototype.slice.call(args, off)));\n }\n arguments(args: IArguments, off: number): JSValue {\n return this.check(js_build_arguments_value(this.ctx, Array.prototype.slice.call(args, off)));\n }\n /* legacy arguments object aliasing the argument cells through accessor properties */\n mapped_arguments(args: IArguments, off: number, cells: JSVarRef[], self: JSValue): JSValue {\n const ctx = this.ctx;\n const argv: JSValue[] = Array.prototype.slice.call(args, off);\n const argc = argv.length;\n const val = this.check(JS_NewObjectProtoClass(ctx, ctx.class_proto[JSClassID.OBJECT], JSClassID.MAPPED_ARGUMENTS));\n JS_DefinePropertyValue(ctx, val, JS_ATOM_length, argc, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);\n const n = Math.min(argc, cells.length);\n for (let i = 0; i < n; i++) {\n const cell = cells[i];\n const getter = js_new_host_function(ctx, () => cell.get(), false, '', 0, ctx.function_proto, JSClassID.C_FUNCTION);\n const setter = js_new_host_function(ctx, (_t, _nt, a) => { cell.set(a[0]); return undefined; }, false, '', 1,\n ctx.function_proto, JSClassID.C_FUNCTION);\n Reflect.defineProperty(val as object, i, { get: getter as any, set: setter as any, enumerable: true, configurable: true });\n }\n for (let i = n; i < argc; i++) this.checkn(JS_DefinePropertyValueUint32(ctx, val, i, argv[i], JS_PROP_C_W_E));\n JS_DefinePropertyValue(ctx, val, JS_ATOM_Symbol_iterator, ctx.array_proto_values, JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE);\n JS_DefinePropertyValue(ctx, val, JS_ATOM_callee, self, JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE);\n return val;\n }\n rest(args: IArguments, off: number, first: number): JSValue {\n const argv: JSValue[] = Array.prototype.slice.call(args, off);\n return this.check(js_build_rest(this.ctx, first, argv.length, argv));\n }\n /* --- modules --- */\n dynamic_import(b: JSFunctionBytecode, specifier: JSValue, options: JSValue): JSValue {\n if (hooks.js_dynamic_import === null) this.throw_type_error('dynamic import is not supported');\n return this.check(hooks.js_dynamic_import!(this.ctx, b, specifier, options));\n }\n import_meta(b: JSFunctionBytecode): JSValue {\n if (hooks.js_import_meta === null) this.throw_type_error('import.meta is not supported');\n return this.check(hooks.js_import_meta!(this.ctx, b));\n }\n home_object(self: JSValue): JSValue {\n return JS_GetFunctionData(self)?.home_object ?? undefined;\n }\n\n /* --- closures and classes --- */\n /* guest function object for bytecode `b` with the given variable references (fclosure).\n When `b` is compiled the object is the generated forwarder, else an interpreter wrapper\n that the call hook tiers up later. */\n closure(b: JSFunctionBytecode, var_refs: JSVarRef[], _parent: JSValue): JSValue {\n const ctx = this.ctx;\n const class_id = func_kind_to_class_id(b.func_kind);\n const proto = ctx.class_proto[class_id] ?? ctx.function_proto;\n let fo: JSValue | null = null;\n if (b.func_kind === JSFunctionKind.NORMAL && !b.no_jit) {\n const c = this.compile(b);\n if (c) {\n const [f, direct, mkpriv] = c.make(var_refs);\n const m = new JSObjectMeta(JSClassID.BYTECODE_FUNCTION);\n m.func = new JSFunctionData(b, var_refs);\n m.func.compiled = direct;\n m.func.mkpriv = mkpriv;\n m.is_constructor = b.has_prototype;\n m.realm = b.realm ?? ctx;\n js_meta.set(f, m);\n js_direct.set(f, direct);\n Object.setPrototypeOf(f, proto);\n /* a host `function` has an own `prototype` object with a host prototype chain */\n if (Object.prototype.hasOwnProperty.call(f, 'prototype')) (f as any).prototype = undefined;\n fo = f;\n }\n }\n if (fo === null) fo = this.check(js_closure_from_refs(ctx, b, var_refs, proto, b.has_prototype));\n let name_atom = b.func_name;\n if (name_atom === JS_ATOM_NULL) name_atom = JS_ATOM_empty_string;\n js_function_set_properties(ctx, fo, name_atom, b.defined_arg_count);\n if (b.func_kind & JSFunctionKind.GENERATOR) {\n const proto_class_id = (b.func_kind === JSFunctionKind.ASYNC_GENERATOR) ? JSClassID.ASYNC_GENERATOR : JSClassID.GENERATOR;\n const gproto = this.check(JS_NewObjectProto(ctx, ctx.class_proto[proto_class_id]));\n JS_DefinePropertyValue(ctx, fo, JS_ATOM_prototype, gproto, JS_PROP_WRITABLE);\n } else if (b.has_prototype) {\n const pobj = this.check(JS_NewObject(ctx));\n this.checkn(JS_DefinePropertyValue(ctx, pobj, JS_ATOM_constructor, fo, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE));\n this.checkn(JS_DefinePropertyValue(ctx, fo, JS_ATOM_prototype, pobj, JS_PROP_WRITABLE));\n }\n return fo;\n }\n define_class(name: JSAtom | JSValue, parent_class: JSValue, b: JSFunctionBytecode, class_flags: number,\n var_refs: JSVarRef[], is_computed_name: boolean): [JSValue, JSValue] {\n const r = js_define_class(this.ctx, is_computed_name ? JS_ATOM_NULL : (name as JSAtom), class_flags, parent_class, b, var_refs,\n is_computed_name, is_computed_name ? (name as JSValue) : undefined);\n if (r === null) this.throw_pending();\n return r;\n }\n set_home_object(f: JSValue, home: JSValue): void { js_method_set_home_object(this.ctx, f, home); }\n set_name(f: JSValue, atom: JSAtom): void { this.checkn(JS_DefineObjectName(this.ctx, f, atom, JS_PROP_CONFIGURABLE)); }\n set_name_computed(f: JSValue, name: JSValue): void { this.checkn(JS_DefineObjectNameComputed(this.ctx, f, name, JS_PROP_CONFIGURABLE)); }\n define_method(obj: JSValue, key: JSAtom | JSValue, fn: JSValue, op_flags: number, computed: boolean): void {\n const ctx = this.ctx;\n let atom: JSAtom;\n if (computed) {\n atom = JS_ValueToAtom(ctx, key as JSValue);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n } else {\n atom = key as JSAtom;\n }\n let fl = JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE | JS_PROP_THROW;\n if (op_flags & OP_DEFINE_METHOD_ENUMERABLE) fl |= JS_PROP_ENUMERABLE;\n op_flags &= 3;\n let value: JSValue = undefined, getter: JSValue = undefined, setter: JSValue = undefined;\n if (op_flags === OP_DEFINE_METHOD_METHOD) { value = fn; fl |= JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE; }\n else if (op_flags === OP_DEFINE_METHOD_GETTER) { getter = fn; fl |= JS_PROP_HAS_GET; }\n else { setter = fn; fl |= JS_PROP_HAS_SET; }\n this.checkn(js_method_set_properties(ctx, fn, atom, fl, obj));\n this.checkn(JS_DefineProperty(ctx, obj, atom, value, getter, setter, fl));\n }\n set_proto(o: JSValue, proto: JSValue): void {\n if (JS_IsObject(proto) || proto === null) this.checkn(JS_SetPrototypeInternal(this.ctx, o, proto, true));\n }\n check_brand(o: JSValue, f: JSValue): void {\n const r = JS_CheckBrand(this.ctx, o, f);\n if (r < 0) this.throw_pending();\n if (!r) this.throw_type_error('invalid brand on object');\n }\n add_brand(o: JSValue, f: JSValue): void { this.checkn(JS_AddBrand(this.ctx, o, f)); }\n get_private_field(o: JSValue, name: JSValue): JSValue { return this.check(JS_GetPrivateField(this.ctx, o, name)); }\n put_private_field(o: JSValue, name: JSValue, v: JSValue): void { this.checkn(JS_SetPrivateField(this.ctx, o, name, v)); }\n define_private_field(o: JSValue, name: JSValue, v: JSValue): void { this.checkn(JS_DefinePrivateField(this.ctx, o, name, v)); }\n private_in(o: JSValue, name: JSValue): boolean {\n const r = js_operator_private_in(this.ctx, o, name);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n\n /* --- globals --- */\n check_var(atom: JSAtom): boolean {\n const r = JS_CheckGlobalVar(this.ctx, atom);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n get_global(atom: JSAtom, throw_ref_error: boolean): JSValue {\n return this.check(JS_GetGlobalVar(this.ctx, atom, throw_ref_error ? 1 : 0));\n }\n /* JS_SetGlobalVar with an explicit strict flag (the engine's version reads the strictness\n from the current interpreter frame, which does not exist for compiled code) */\n put_global(atom: JSAtom, v: JSValue, flag: number, strict: boolean): void {\n const ctx = this.ctx;\n if (flag === 1 || !strict || (JS_AtomToKey(ctx, atom) in ctx.global_var_obj)) {\n this.checkn(JS_SetGlobalVar(ctx, atom, v, flag));\n return;\n }\n const ret = JS_HasProperty(ctx, ctx.global_obj, atom);\n if (ret < 0) this.throw_pending();\n if (!ret) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n this.checkn(JS_SetPropertyInternal(ctx, ctx.global_obj, atom, v, ctx.global_obj, JS_PROP_THROW));\n }\n put_global_strict(atom: JSAtom, defined: JSValue, v: JSValue): void {\n const ctx = this.ctx;\n if (!defined) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n if (JS_AtomToKey(ctx, atom) in ctx.global_var_obj) { this.checkn(JS_SetGlobalVar(ctx, atom, v, 2)); return; }\n this.checkn(JS_SetPropertyInternal(ctx, ctx.global_obj, atom, v, ctx.global_obj, JS_PROP_THROW));\n }\n check_define_var(atom: JSAtom, flags: number): void { if (JS_CheckDefineGlobalVar(this.ctx, atom, flags)) this.throw_pending(); }\n define_var(atom: JSAtom, flags: number): void { this.checkn(JS_DefineGlobalVar(this.ctx, atom, flags)); }\n define_func(atom: JSAtom, v: JSValue, flags: number): void { this.checkn(JS_DefineGlobalFunction(this.ctx, atom, v, flags)); }\n get_global_ref(atom: JSAtom): [JSValue, JSValue] {\n const r = JS_GetGlobalVarRef(this.ctx, atom);\n if (!r) this.throw_pending();\n return r as [JSValue, JSValue];\n }\n delete_global(atom: JSAtom): boolean {\n const r = JS_DeleteProperty(this.ctx, this.ctx.global_obj, atom, 0);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n\n /* --- properties (slow paths: primitive bases and runtime-dependent semantics) --- */\n get_field(o: JSValue, atom: JSAtom): JSValue { return this.check(JS_GetProperty(this.ctx, o, atom)); }\n get_field_str(o: JSValue, name: string): JSValue {\n return this.check(JS_GetProperty(this.ctx, o, this.ctx.rt.atoms.newAtomStr(name)));\n }\n get_length(o: JSValue): JSValue { return this.check(JS_GetProperty(this.ctx, o, JS_ATOM_length)); }\n get_el(o: JSValue, k: JSValue): JSValue { return this.check(JS_GetPropertyValue(this.ctx, o, k)); }\n put_field(o: JSValue, atom: JSAtom, v: JSValue, strict: boolean): void {\n this.checkn(JS_SetPropertyInternal(this.ctx, o, atom, v, o, strict ? JS_PROP_THROW : 0));\n }\n put_el(o: JSValue, k: JSValue, v: JSValue, strict: boolean): void {\n this.checkn(JS_SetPropertyValue(this.ctx, o, k, v, strict ? JS_PROP_THROW : 0));\n }\n delete(o: JSValue, k: JSValue, strict: boolean): boolean {\n const atom = JS_ValueToAtom(this.ctx, k);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n const r = JS_DeleteProperty(this.ctx, o, atom, strict ? JS_PROP_THROW : 0);\n if (r < 0) this.throw_pending();\n return r !== 0;\n }\n define_field(o: JSValue, atom: JSAtom, v: JSValue): void {\n this.checkn(JS_DefinePropertyValue(this.ctx, o, atom, v, JS_PROP_C_W_E | JS_PROP_THROW));\n }\n define_array_el(arr: JSValue, pos: JSValue, v: JSValue): void {\n this.checkn(JS_DefinePropertyValueValue(this.ctx, arr, pos, v, JS_PROP_C_W_E | JS_PROP_THROW));\n }\n append(arr: JSValue, pos: JSValue, src: JSValue): number {\n if (typeof pos !== 'number') this.throw_internal_error('invalid index for append');\n const r = js_append_enumerate_value(this.ctx, arr, pos as number, src);\n if (r < 0) this.throw_pending();\n return r;\n }\n copy_data_properties(target: JSValue, source: JSValue, excluded: JSValue): void {\n if (JS_CopyDataProperties(this.ctx, target, source, excluded, false)) this.throw_pending();\n }\n get_ref_value(o: JSValue, k: JSValue, strict: boolean): JSValue {\n const ctx = this.ctx;\n const atom = JS_ValueToAtom(ctx, k);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n if (o === undefined) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n const r = JS_HasProperty(ctx, o, atom);\n if (r < 0) this.throw_pending();\n if (!r) {\n if (strict) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n return undefined;\n }\n return this.check(JS_GetProperty(ctx, o, atom));\n }\n put_ref_value(o: JSValue, k: JSValue, v: JSValue, strict: boolean): void {\n const ctx = this.ctx;\n const atom = JS_ValueToAtom(ctx, k);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n if (o === undefined) {\n if (strict) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n o = ctx.global_obj;\n }\n const r = JS_HasProperty(ctx, o, atom);\n if (r < 0) this.throw_pending();\n if (!r && strict) { JS_ThrowReferenceErrorNotDefined(ctx, atom); this.throw_pending(); }\n this.checkn(JS_SetPropertyInternal(ctx, o, atom, v, o, strict ? JS_PROP_THROW : 0));\n }\n get_super_value(thisv: JSValue, o: JSValue, k: JSValue): JSValue {\n const atom = JS_ValueToAtom(this.ctx, k);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n return this.check(JS_GetPropertyInternal(this.ctx, o, atom, thisv, false));\n }\n put_super_value(thisv: JSValue, o: JSValue, k: JSValue, v: JSValue): void {\n if (!JS_IsObject(o)) { JS_ThrowTypeErrorNotAnObject(this.ctx); this.throw_pending(); }\n const atom = JS_ValueToAtom(this.ctx, k);\n if (atom === JS_ATOM_NULL) this.throw_pending();\n this.checkn(JS_SetPropertyInternal(this.ctx, o, atom, v, thisv, JS_PROP_THROW));\n }\n\n /* --- iteration --- */\n for_in_start(o: JSValue): JSValue { return this.check(build_for_in_iterator(this.ctx, o)); }\n for_in_next(it: JSValue): JSValue {\n const pdone = { done: 0 };\n const v = this.check(js_for_in_next(this.ctx, it, pdone));\n return pdone.done ? this.DONE : v;\n }\n get_iterator(o: JSValue): JSValue { return this.check(JS_GetIterator(this.ctx, o, false)); }\n for_of_start(o: JSValue): [JSValue, JSValue] {\n const r = js_for_of_start_value(this.ctx, o, false);\n if (r === null) this.throw_pending();\n return r;\n }\n for_of_next(iter: JSValue, next: JSValue): JSValue {\n if (iter === undefined) return this.DONE;\n const r = js_for_of_next_value(this.ctx, iter, next);\n if (r === null) this.throw_pending();\n return r.done ? this.DONE : r.value;\n }\n iterator_close(iter: JSValue): void {\n if (JS_IteratorClose(this.ctx, iter, false) < 0) this.throw_pending();\n }\n /* close an iterator while an exception is propagating: errors from return() are ignored */\n iterator_close_exc(iter: JSValue): void {\n if (iter === undefined) return;\n const ctx = this.ctx;\n const method = JS_GetProperty(ctx, iter, JS_ATOM_return);\n if (JS_IsException(method)) { JS_GetException(ctx); return; }\n if (method === undefined || method === null) return;\n const r = JS_Call(ctx, method, iter, []);\n if (JS_IsException(r)) JS_GetException(ctx);\n }\n iterator_call(iter: JSValue, val: JSValue, flags: number): JSValue {\n const ctx = this.ctx;\n const method = this.check(JS_GetProperty(ctx, iter, (flags & 1) ? JS_ATOM_throw : JS_ATOM_return));\n if (method === undefined || method === null) return this.DONE;\n return this.check(JS_Call(ctx, method, iter, (flags & 2) ? [] : [val]));\n }\n}\n\n"]}
|
package/dist/jit_stack.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface CompiledEntry {
|
|
|
6
6
|
file: string;
|
|
7
7
|
source: string;
|
|
8
8
|
lines: Map<number, number[]> | null;
|
|
9
|
+
ctor_names?: Map<number, string> | null;
|
|
9
10
|
}
|
|
10
11
|
export declare function jit_stack_alloc_id(): number;
|
|
11
12
|
export declare function jit_stack_register(id: number, entry: CompiledEntry): void;
|
package/dist/jit_stack.js
CHANGED
|
@@ -154,7 +154,8 @@ function compiled_frame(f) {
|
|
|
154
154
|
and the host's placeholders fall back to the bytecode's name. */
|
|
155
155
|
const n = f.name;
|
|
156
156
|
const name = n !== '' && !n.startsWith('$f') && n !== 'anonymous' && n !== '<anonymous>' ? n : e.name;
|
|
157
|
-
|
|
157
|
+
const ctor = pc >= 0 ? e.ctor_names?.get(pc) : undefined;
|
|
158
|
+
return ctor === undefined ? { kind: 'compiled', name, file: e.file, line, col } : { kind: 'compiled', name, file: e.file, line, col, ctor };
|
|
158
159
|
}
|
|
159
160
|
/* lines of a host stack that can be guest-relevant frames (the engine's own frames are the
|
|
160
161
|
majority: they are skipped without parsing) */
|
package/dist/jit_stack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jit_stack.js","sourceRoot":"","sources":["../src/jit_stack.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAsC,MAAM,eAAe,CAAC;AAa9E,8FAA8F;AAC9F,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkD,CAAC;AAC3E,MAAM,WAAW,GAAG,OAAO,OAAO,KAAK,UAAU,CAAC;AAClD,IAAI,OAAO,GAAG,CAAC,CAAC;AAEhB,MAAM,UAAU,kBAAkB,KAAa,OAAO,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ClC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AACpD,CAAC;AAED;4CAC4C;AAC5C,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,UAAU,iBAAiB;IAC/B,MAAM,CAAC,GAAG,KAAY,CAAC;IACvB,MAAM,KAAK,GAAG,CAAC,CAAC,eAAe,CAAC;IAChC,CAAC,CAAC,eAAe,GAAG,WAAW,CAAC;IAChC,IAAI,CAAC;QACH,OAAO,IAAI,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC;IACjC,CAAC;YAAS,CAAC;QACT,CAAC,CAAC,eAAe,GAAG,KAAK,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAkB;IAC5C,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,gBAAgB;IACxB,eAAe,EAAE,yBAAyB;CAC3C,CAAC;AAEF;;wFAEwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,EAAW;IAC3C,IAAI,EAAE,EAAE,CAAC;QACP,MAAM,CAAC,GAAG,KAAY,CAAC;QACvB,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,eAAe,KAAK,QAAQ,IAAI,CAAC,CAAC,eAAe,IAAI,EAAE,CAAC;YAAE,CAAC,CAAC,eAAe,GAAG,EAAE,CAAC;QAChG,SAAS,CAAC,KAAK,GAAG,eAAe,CAAC;IACpC,CAAC;SAAM,CAAC;QACN,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;IACzB,CAAC;AACH,CAAC","sourcesContent":["/*\n * Guest backtraces for compiled code (src/jit.ts).\n *\n * Compiled functions have no interpreter frame. Their positions come from the\n * HOST stack instead: the compiler marks every operation in the generated\n * source with its guest pc (a comment \"/*@<pc>*\\/\", parsed by the host as whitespace), which\n * gives a side table (generated line, column) -> pc per compiled function, and\n * `b.debug.pc2line` maps the pc to the guest (line, column) exactly as for\n * interpreted code. The generated source ends with\n * `//# sourceURL=jseption:<id>:<file>:<name>`, so the host names the compiled\n * function's frames with an url that leads to its table.\n *\n * Host stack formats handled (lines and columns are 1-based in both):\n * V8 / Bun: \" at name (url:line:col)\" | \" at url:line:col\" | \" at name (native)\"\n * JSC/Safari: \"name@url:line:col\" | \"@url:line:col\" | \"name@[native code]\"\n * Bun's JavaScriptCore prints the V8 layout but places the columns as JSC\n * does: a call at its `(`, a property access at its `.` or `[`, a binary\n * expression at the start of its (parenthesized) operand chain, a unary\n * operator at the operator. The compiler marks every expression at its start\n * and at those points, so a frame maps to the operation whose last marker is\n * at or before the reported column.\n *\n * The body of a `new Function` starts on a later line of the host's\n * synthesized function text; the offset is calibrated with a probe.\n */\nimport type { JSFunctionBytecode } from './values.ts';\nimport { find_line_num } from './quickjs.ts';\nimport { jit_hooks, type HostFrame, type JitStackHooks } from './jit_hook.ts';\n\nexport interface CompiledEntry {\n b: JSFunctionBytecode;\n name: string; /* guest function name */\n file: string; /* guest file name */\n /* the evaluated factory source (with marker comments) */\n source: string;\n /* generated line (1-based, in the factory source) -> [col0, pc0, col1, pc1, ...]; columns are\n 0-based and increasing. Built lazily from `source` (jit_stack_marker_table). */\n lines: Map<number, number[]> | null;\n}\n\n/* compiled function id -> entry; a WeakRef keeps the registry from retaining dead bytecode */\nconst registry = new Map<number, CompiledEntry | WeakRef<CompiledEntry>>();\nconst HAS_WEAKREF = typeof WeakRef === 'function';\nlet next_id = 1;\n\nexport function jit_stack_alloc_id(): number { return next_id++; }\n\n/* the caller keeps the entry alive as long as the bytecode (`JitCompiled.stack`) */\nexport function jit_stack_register(id: number, entry: CompiledEntry): void {\n registry.set(id, HAS_WEAKREF ? new WeakRef(entry) : entry);\n}\n\nfunction lookup(id: number): CompiledEntry | undefined {\n const e = registry.get(id);\n if (e === undefined) return undefined;\n if (e instanceof WeakRef) {\n const t = e.deref();\n if (t === undefined) registry.delete(id);\n return t;\n }\n return e;\n}\n\n/* Position markers. The compiler emits a comment \"/*@<pc>*\\/\" at the start of every operation\n (src/jit.ts); the host parses it as whitespace, so the evaluated source is the generated source\n and nothing is stripped at compile time. The (line, column) -> pc table of a function is built\n from its source on the first backtrace that needs it. */\n\n/* generated line (1-based) -> [col0, pc0, col1, pc1, ...]: the column (0-based) of each marker\n comment on that line, increasing */\nexport function jit_stack_marker_table(source: string): Map<number, number[]> {\n const lines = new Map<number, number[]>();\n let m = source.indexOf('/*@');\n let line = 1, line_start = 0, next_nl = source.indexOf('\\n');\n if (next_nl < 0) next_nl = source.length;\n let table: number[] | null = null, table_line = 0;\n while (m >= 0) {\n while (next_nl < m) {\n line++;\n line_start = next_nl + 1;\n next_nl = source.indexOf('\\n', line_start);\n if (next_nl < 0) next_nl = source.length;\n }\n let i = m + 3, pc = 0, c = source.charCodeAt(i);\n while (c >= 48 && c <= 57) { pc = pc * 10 + (c - 48); c = source.charCodeAt(++i); }\n if (table === null || table_line !== line) { table = []; table_line = line; lines.set(line, table); }\n table.push(m - line_start, pc);\n m = source.indexOf('/*@', i);\n }\n return lines;\n}\n\nfunction entry_lines(e: CompiledEntry): Map<number, number[]> {\n if (e.lines === null) e.lines = jit_stack_marker_table(e.source);\n return e.lines;\n}\n\n/* --- host stack parsing --- */\n\nexport interface RawFrame { name: string; url: string; line: number; col: number }\n\nconst V8_RE = /^\\s*at (?:(.*?) \\()?(.*?)(?::(\\d+):(\\d+))?\\)?$/;\nconst JSC_RE = /^(.*?)@(.*?)(?::(\\d+):(\\d+))?$/;\n\n/* \"new Foo\", \"async f\", V8's \"Type.method [as alias]\" -> the function's own name */\nfunction clean_name(name: string): string {\n if (name.startsWith('new ')) name = name.slice(4);\n else if (name.startsWith('async ')) name = name.slice(6);\n const as = name.indexOf(' [as ');\n if (as >= 0) name = name.slice(0, as);\n const dot = name.lastIndexOf('.');\n return dot >= 0 ? name.slice(dot + 1) : name;\n}\n\nexport function jit_stack_parse(stack: string): RawFrame[] {\n const frames: RawFrame[] = [];\n for (const raw of stack.split('\\n')) {\n const line = raw.trimEnd();\n if (line === '') continue;\n let m: RegExpExecArray | null;\n if (/^\\s*at /.test(line)) {\n m = V8_RE.exec(line);\n if (m) {\n frames.push({ name: clean_name(m[1] ?? ''), url: m[2], line: m[3] ? Number(m[3]) : -1, col: m[4] ? Number(m[4]) : -1 });\n continue;\n }\n }\n if (line.indexOf('@') >= 0 && !/^\\s*[A-Za-z]*Error\\b/.test(line) && (m = JSC_RE.exec(line)) !== null) {\n frames.push({ name: clean_name(m[1]), url: m[2], line: m[3] ? Number(m[3]) : -1, col: m[4] ? Number(m[4]) : -1 });\n continue;\n }\n /* the message line(s) of the error: skipped */\n }\n return frames;\n}\n\n/* line offset of the body of a `new Function` in the host's synthesized source text */\nlet line_offset = -1;\nfunction calibrate(): void {\n if (line_offset >= 0) return;\n line_offset = 2; /* \"function anonymous(\\n) {\\n\" on V8 and JSC */\n try {\n const probe = new Function('return new Error(\"probe\").stack;') as () => string;\n const frames = jit_stack_parse(probe());\n if (frames.length && frames[0].line > 0) line_offset = frames[0].line - 1;\n } catch { /* code generation unavailable: keep the default */ }\n}\n\n/* the engine's own modules: their frames are invisible to the guest except the two that run\n guest frames */\nconst ENGINE_URL_RE = /(?:^|[\\\\/])(?:quickjs|interpreter|jit|jit_runtime|jit_stack|jit_hook|jseption|std|qjs|parser|atoms|values|opcodes|[a-z_]+)\\.ts(?:$|[?:])/;\nconst INTERP_FRAME = 'js_interpret';\nconst CFUNC_FRAMES = new Set(['js_call_c_function', 'js_c_function_data_call']);\n\nfunction engine_frame_kind(f: RawFrame): HostFrame['kind'] | null {\n if (f.name === INTERP_FRAME) return 'interp';\n if (CFUNC_FRAMES.has(f.name)) return 'cfunc';\n return null;\n}\n\n/* guest frame of a compiled function from a host frame with a `jseption:` url */\nfunction compiled_frame(f: RawFrame): HostFrame | null {\n const id = parseInt(f.url.slice(9), 10);\n const e = lookup(id);\n if (e === undefined) return null;\n /* a line without markers runs no guest operation (the direct entry adapter, the forwarder):\n such a frame is not a guest frame */\n const table = entry_lines(e).get(f.line - line_offset);\n if (table === undefined || table.length === 0) return null;\n let pc = -1;\n const hcol = f.col - 1; /* 0-based */\n for (let i = 0; i < table.length; i += 2) {\n if (table[i] <= hcol) pc = table[i + 1]; else break;\n }\n if (pc < 0) pc = table[1]; /* before the first marker: the first operation of the line */\n let line = -1, col = -1;\n if (pc >= 0 && e.b.has_debug) [line, col] = find_line_num(null as any, e.b, pc);\n /* V8 and JavaScriptCore name a frame after the function's `name` property: with the natural\n convention that is the guest function object's name as the engine set it (a method's key,\n an inferred name), which is what the interpreter reports too. The generated names (`$f...`)\n and the host's placeholders fall back to the bytecode's name. */\n const n = f.name;\n const name = n !== '' && !n.startsWith('$f') && n !== 'anonymous' && n !== '<anonymous>' ? n : e.name;\n return { kind: 'compiled', name, file: e.file, line, col };\n}\n\n/* lines of a host stack that can be guest-relevant frames (the engine's own frames are the\n majority: they are skipped without parsing) */\nconst RELEVANT_RE = /jseption:|native|js_interpret|js_call_c_function|js_c_function_data_call/;\n\n/* the guest-relevant frames of a host stack, innermost first */\nexport function jit_stack_frames(host_stack: string): HostFrame[] {\n calibrate();\n const out: HostFrame[] = [];\n const relevant: string[] = [];\n for (const line of host_stack.split('\\n')) if (RELEVANT_RE.test(line)) relevant.push(line);\n for (const f of jit_stack_parse(relevant.join('\\n'))) {\n if (f.url.startsWith('jseption:')) {\n const hf = compiled_frame(f);\n if (hf !== null) out.push(hf);\n } else if (f.url === 'native' || f.url === '[native code]') {\n out.push({ kind: 'native', name: f.name, file: '', line: -1, col: -1 });\n } else {\n const k = engine_frame_kind(f);\n if (k !== null) out.push({ kind: k, name: '', file: '', line: -1, col: -1 });\n /* other frames (the engine, the embedder) are invisible to the guest */\n }\n }\n return out;\n}\n\n/* is the innermost guest frame compiled code? (cheap: no full parse) */\nconst TOP_RE = /jseption:\\d+:|\\bjs_interpret\\b|\\bjs_call_c_function\\b|\\bjs_c_function_data_call\\b/;\nexport function jit_stack_compiled_on_top(host_stack: string): boolean {\n const m = TOP_RE.exec(host_stack);\n return m !== null && m[0].startsWith('jseption:');\n}\n\n/* the number of frames the host records: engine frames sit between guest frames, and a\n guest backtrace needs the guest frames */\nconst STACK_LIMIT = 64;\n\nexport function jit_stack_capture(): string {\n const E = Error as any;\n const saved = E.stackTraceLimit;\n E.stackTraceLimit = STACK_LIMIT;\n try {\n return new Error().stack ?? '';\n } finally {\n E.stackTraceLimit = saved;\n }\n}\n\nexport const jit_stack_hooks: JitStackHooks = {\n capture: jit_stack_capture,\n frames: jit_stack_frames,\n compiled_on_top: jit_stack_compiled_on_top,\n};\n\n/* install (mode on) or remove (mode off) the backtrace support. Host errors raised inside\n compiled code (`null.x`) carry the host's own capture of the stack, so the host's limit is\n raised to a value that keeps a few guest frames (the default is 10 on V8 and Bun). */\nexport function jit_stack_install(on: boolean): void {\n if (on) {\n const E = Error as any;\n if (!(typeof E.stackTraceLimit === 'number' && E.stackTraceLimit >= 32)) E.stackTraceLimit = 32;\n jit_hooks.stack = jit_stack_hooks;\n } else {\n jit_hooks.stack = null;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"jit_stack.js","sourceRoot":"","sources":["../src/jit_stack.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAsC,MAAM,eAAe,CAAC;AAe9E,8FAA8F;AAC9F,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkD,CAAC;AAC3E,MAAM,WAAW,GAAG,OAAO,OAAO,KAAK,UAAU,CAAC;AAClD,IAAI,OAAO,GAAG,CAAC,CAAC;AAEhB,MAAM,UAAU,kBAAkB,KAAa,OAAO,OAAO,EAAE,CAAC,CAAC,CAAC;AAElE,oFAAoF;AACpF,MAAM,UAAU,kBAAkB,CAAC,EAAU,EAAE,KAAoB;IACjE,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC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AAC;AACnG,MAAM,UAAU,yBAAyB,CAAC,UAAkB;IAC1D,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAClC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AACpD,CAAC;AAED;4CAC4C;AAC5C,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,UAAU,iBAAiB;IAC/B,MAAM,CAAC,GAAG,KAAY,CAAC;IACvB,MAAM,KAAK,GAAG,CAAC,CAAC,eAAe,CAAC;IAChC,CAAC,CAAC,eAAe,GAAG,WAAW,CAAC;IAChC,IAAI,CAAC;QACH,OAAO,IAAI,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC;IACjC,CAAC;YAAS,CAAC;QACT,CAAC,CAAC,eAAe,GAAG,KAAK,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAkB;IAC5C,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,gBAAgB;IACxB,eAAe,EAAE,yBAAyB;CAC3C,CAAC;AAEF;;wFAEwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,EAAW;IAC3C,IAAI,EAAE,EAAE,CAAC;QACP,MAAM,CAAC,GAAG,KAAY,CAAC;QACvB,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,eAAe,KAAK,QAAQ,IAAI,CAAC,CAAC,eAAe,IAAI,EAAE,CAAC;YAAE,CAAC,CAAC,eAAe,GAAG,EAAE,CAAC;QAChG,SAAS,CAAC,KAAK,GAAG,eAAe,CAAC;IACpC,CAAC;SAAM,CAAC;QACN,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;IACzB,CAAC;AACH,CAAC","sourcesContent":["/*\n * Guest backtraces for compiled code (src/jit.ts).\n *\n * Compiled functions have no interpreter frame. Their positions come from the\n * HOST stack instead: the compiler marks every operation in the generated\n * source with its guest pc (a comment \"/*@<pc>*\\/\", parsed by the host as whitespace), which\n * gives a side table (generated line, column) -> pc per compiled function, and\n * `b.debug.pc2line` maps the pc to the guest (line, column) exactly as for\n * interpreted code. The generated source ends with\n * `//# sourceURL=jseption:<id>:<file>:<name>`, so the host names the compiled\n * function's frames with an url that leads to its table.\n *\n * Host stack formats handled (lines and columns are 1-based in both):\n * V8 / Bun: \" at name (url:line:col)\" | \" at url:line:col\" | \" at name (native)\"\n * JSC/Safari: \"name@url:line:col\" | \"@url:line:col\" | \"name@[native code]\"\n * Bun's JavaScriptCore prints the V8 layout but places the columns as JSC\n * does: a call at its `(`, a property access at its `.` or `[`, a binary\n * expression at the start of its (parenthesized) operand chain, a unary\n * operator at the operator. The compiler marks every expression at its start\n * and at those points, so a frame maps to the operation whose last marker is\n * at or before the reported column.\n *\n * The body of a `new Function` starts on a later line of the host's\n * synthesized function text; the offset is calibrated with a probe.\n */\nimport type { JSFunctionBytecode } from './values.ts';\nimport { find_line_num } from './quickjs.ts';\nimport { jit_hooks, type HostFrame, type JitStackHooks } from './jit_hook.ts';\n\nexport interface CompiledEntry {\n b: JSFunctionBytecode;\n name: string; /* guest function name */\n file: string; /* guest file name */\n /* the evaluated factory source (with marker comments) */\n source: string;\n /* generated line (1-based, in the factory source) -> [col0, pc0, col1, pc1, ...]; columns are\n 0-based and increasing. Built lazily from `source` (jit_stack_marker_table). */\n lines: Map<number, number[]> | null;\n /* pc of a native `new` -> the callee's variable or property name */\n ctor_names?: Map<number, string> | null;\n}\n\n/* compiled function id -> entry; a WeakRef keeps the registry from retaining dead bytecode */\nconst registry = new Map<number, CompiledEntry | WeakRef<CompiledEntry>>();\nconst HAS_WEAKREF = typeof WeakRef === 'function';\nlet next_id = 1;\n\nexport function jit_stack_alloc_id(): number { return next_id++; }\n\n/* the caller keeps the entry alive as long as the bytecode (`JitCompiled.stack`) */\nexport function jit_stack_register(id: number, entry: CompiledEntry): void {\n registry.set(id, HAS_WEAKREF ? new WeakRef(entry) : entry);\n}\n\nfunction lookup(id: number): CompiledEntry | undefined {\n const e = registry.get(id);\n if (e === undefined) return undefined;\n if (e instanceof WeakRef) {\n const t = e.deref();\n if (t === undefined) registry.delete(id);\n return t;\n }\n return e;\n}\n\n/* Position markers. The compiler emits a comment \"/*@<pc>*\\/\" at the start of every operation\n (src/jit.ts); the host parses it as whitespace, so the evaluated source is the generated source\n and nothing is stripped at compile time. The (line, column) -> pc table of a function is built\n from its source on the first backtrace that needs it. */\n\n/* generated line (1-based) -> [col0, pc0, col1, pc1, ...]: the column (0-based) of each marker\n comment on that line, increasing */\nexport function jit_stack_marker_table(source: string): Map<number, number[]> {\n const lines = new Map<number, number[]>();\n let m = source.indexOf('/*@');\n let line = 1, line_start = 0, next_nl = source.indexOf('\\n');\n if (next_nl < 0) next_nl = source.length;\n let table: number[] | null = null, table_line = 0;\n while (m >= 0) {\n while (next_nl < m) {\n line++;\n line_start = next_nl + 1;\n next_nl = source.indexOf('\\n', line_start);\n if (next_nl < 0) next_nl = source.length;\n }\n let i = m + 3, pc = 0, c = source.charCodeAt(i);\n while (c >= 48 && c <= 57) { pc = pc * 10 + (c - 48); c = source.charCodeAt(++i); }\n if (table === null || table_line !== line) { table = []; table_line = line; lines.set(line, table); }\n table.push(m - line_start, pc);\n m = source.indexOf('/*@', i);\n }\n return lines;\n}\n\nfunction entry_lines(e: CompiledEntry): Map<number, number[]> {\n if (e.lines === null) e.lines = jit_stack_marker_table(e.source);\n return e.lines;\n}\n\n/* --- host stack parsing --- */\n\nexport interface RawFrame { name: string; url: string; line: number; col: number }\n\nconst V8_RE = /^\\s*at (?:(.*?) \\()?(.*?)(?::(\\d+):(\\d+))?\\)?$/;\nconst JSC_RE = /^(.*?)@(.*?)(?::(\\d+):(\\d+))?$/;\n\n/* \"new Foo\", \"async f\", V8's \"Type.method [as alias]\" -> the function's own name */\nfunction clean_name(name: string): string {\n if (name.startsWith('new ')) name = name.slice(4);\n else if (name.startsWith('async ')) name = name.slice(6);\n const as = name.indexOf(' [as ');\n if (as >= 0) name = name.slice(0, as);\n const dot = name.lastIndexOf('.');\n return dot >= 0 ? name.slice(dot + 1) : name;\n}\n\nexport function jit_stack_parse(stack: string): RawFrame[] {\n const frames: RawFrame[] = [];\n for (const raw of stack.split('\\n')) {\n const line = raw.trimEnd();\n if (line === '') continue;\n let m: RegExpExecArray | null;\n if (/^\\s*at /.test(line)) {\n m = V8_RE.exec(line);\n if (m) {\n frames.push({ name: clean_name(m[1] ?? ''), url: m[2], line: m[3] ? Number(m[3]) : -1, col: m[4] ? Number(m[4]) : -1 });\n continue;\n }\n }\n if (line.indexOf('@') >= 0 && !/^\\s*[A-Za-z]*Error\\b/.test(line) && (m = JSC_RE.exec(line)) !== null) {\n frames.push({ name: clean_name(m[1]), url: m[2], line: m[3] ? Number(m[3]) : -1, col: m[4] ? Number(m[4]) : -1 });\n continue;\n }\n /* the message line(s) of the error: skipped */\n }\n return frames;\n}\n\n/* line offset of the body of a `new Function` in the host's synthesized source text */\nlet line_offset = -1;\nfunction calibrate(): void {\n if (line_offset >= 0) return;\n line_offset = 2; /* \"function anonymous(\\n) {\\n\" on V8 and JSC */\n try {\n const probe = new Function('return new Error(\"probe\").stack;') as () => string;\n const frames = jit_stack_parse(probe());\n if (frames.length && frames[0].line > 0) line_offset = frames[0].line - 1;\n } catch { /* code generation unavailable: keep the default */ }\n}\n\n/* the engine's own modules: their frames are invisible to the guest except the two that run\n guest frames */\nconst ENGINE_URL_RE = /(?:^|[\\\\/])(?:quickjs|interpreter|jit|jit_runtime|jit_stack|jit_hook|jseption|std|qjs|parser|atoms|values|opcodes|[a-z_]+)\\.ts(?:$|[?:])/;\nconst INTERP_FRAME = 'js_interpret';\nconst CFUNC_FRAMES = new Set(['js_call_c_function', 'js_c_function_data_call']);\n\nfunction engine_frame_kind(f: RawFrame): HostFrame['kind'] | null {\n if (f.name === INTERP_FRAME) return 'interp';\n if (CFUNC_FRAMES.has(f.name)) return 'cfunc';\n return null;\n}\n\n/* guest frame of a compiled function from a host frame with a `jseption:` url */\nfunction compiled_frame(f: RawFrame): HostFrame | null {\n const id = parseInt(f.url.slice(9), 10);\n const e = lookup(id);\n if (e === undefined) return null;\n /* a line without markers runs no guest operation (the direct entry adapter, the forwarder):\n such a frame is not a guest frame */\n const table = entry_lines(e).get(f.line - line_offset);\n if (table === undefined || table.length === 0) return null;\n let pc = -1;\n const hcol = f.col - 1; /* 0-based */\n for (let i = 0; i < table.length; i += 2) {\n if (table[i] <= hcol) pc = table[i + 1]; else break;\n }\n if (pc < 0) pc = table[1]; /* before the first marker: the first operation of the line */\n let line = -1, col = -1;\n if (pc >= 0 && e.b.has_debug) [line, col] = find_line_num(null as any, e.b, pc);\n /* V8 and JavaScriptCore name a frame after the function's `name` property: with the natural\n convention that is the guest function object's name as the engine set it (a method's key,\n an inferred name), which is what the interpreter reports too. The generated names (`$f...`)\n and the host's placeholders fall back to the bytecode's name. */\n const n = f.name;\n const name = n !== '' && !n.startsWith('$f') && n !== 'anonymous' && n !== '<anonymous>' ? n : e.name;\n const ctor = pc >= 0 ? e.ctor_names?.get(pc) : undefined;\n return ctor === undefined ? { kind: 'compiled', name, file: e.file, line, col } : { kind: 'compiled', name, file: e.file, line, col, ctor };\n}\n\n/* lines of a host stack that can be guest-relevant frames (the engine's own frames are the\n majority: they are skipped without parsing) */\nconst RELEVANT_RE = /jseption:|native|js_interpret|js_call_c_function|js_c_function_data_call/;\n\n/* the guest-relevant frames of a host stack, innermost first */\nexport function jit_stack_frames(host_stack: string): HostFrame[] {\n calibrate();\n const out: HostFrame[] = [];\n const relevant: string[] = [];\n for (const line of host_stack.split('\\n')) if (RELEVANT_RE.test(line)) relevant.push(line);\n for (const f of jit_stack_parse(relevant.join('\\n'))) {\n if (f.url.startsWith('jseption:')) {\n const hf = compiled_frame(f);\n if (hf !== null) out.push(hf);\n } else if (f.url === 'native' || f.url === '[native code]') {\n out.push({ kind: 'native', name: f.name, file: '', line: -1, col: -1 });\n } else {\n const k = engine_frame_kind(f);\n if (k !== null) out.push({ kind: k, name: '', file: '', line: -1, col: -1 });\n /* other frames (the engine, the embedder) are invisible to the guest */\n }\n }\n return out;\n}\n\n/* is the innermost guest frame compiled code? (cheap: no full parse) */\nconst TOP_RE = /jseption:\\d+:|\\bjs_interpret\\b|\\bjs_call_c_function\\b|\\bjs_c_function_data_call\\b/;\nexport function jit_stack_compiled_on_top(host_stack: string): boolean {\n const m = TOP_RE.exec(host_stack);\n return m !== null && m[0].startsWith('jseption:');\n}\n\n/* the number of frames the host records: engine frames sit between guest frames, and a\n guest backtrace needs the guest frames */\nconst STACK_LIMIT = 64;\n\nexport function jit_stack_capture(): string {\n const E = Error as any;\n const saved = E.stackTraceLimit;\n E.stackTraceLimit = STACK_LIMIT;\n try {\n return new Error().stack ?? '';\n } finally {\n E.stackTraceLimit = saved;\n }\n}\n\nexport const jit_stack_hooks: JitStackHooks = {\n capture: jit_stack_capture,\n frames: jit_stack_frames,\n compiled_on_top: jit_stack_compiled_on_top,\n};\n\n/* install (mode on) or remove (mode off) the backtrace support. Host errors raised inside\n compiled code (`null.x`) carry the host's own capture of the stack, so the host's limit is\n raised to a value that keeps a few guest frames (the default is 10 on V8 and Bun). */\nexport function jit_stack_install(on: boolean): void {\n if (on) {\n const E = Error as any;\n if (!(typeof E.stackTraceLimit === 'number' && E.stackTraceLimit >= 32)) E.stackTraceLimit = 32;\n jit_hooks.stack = jit_stack_hooks;\n } else {\n jit_hooks.stack = null;\n }\n}\n"]}
|
package/dist/jseption.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export * from './quickjs.ts';
|
|
|
7
7
|
export { OP, opcode_info } from './opcodes.ts';
|
|
8
8
|
export { JS_WriteObject, JS_ReadObject, JS_WRITE_OBJ_SOURCE } from './bytecode.ts';
|
|
9
9
|
export { JSEPTION_VERSION } from './version.ts';
|
|
10
|
+
export { JS_PrintValue, JS_PrintValueSetDefaultOptions, JS_PrintValueToString } from './print.ts';
|
|
11
|
+
export type { JSPrintValueOptions, JSPrintValueWrite } from './print.ts';
|
|
10
12
|
export { JS_SetModuleLoader, JS_EvalModule, JS_ImportModule, JS_GetModuleNamespace, JS_DetectModule, js_default_module_resolve } from './module.ts';
|
|
11
13
|
export type { JSModuleLoader, JSModuleSource, JSModuleLoadResult, JSModuleSourceType } from './module.ts';
|
|
12
14
|
export { JS_PromiseState, JS_PromiseResult, JS_NewPromiseCapability } from './builtins/promise.ts';
|
package/dist/jseption.js
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./quickjs.js";
|
|
|
13
13
|
export { opcode_info } from "./opcodes.js";
|
|
14
14
|
export { JS_WriteObject, JS_ReadObject, JS_WRITE_OBJ_SOURCE } from "./bytecode.js";
|
|
15
15
|
export { JSEPTION_VERSION } from "./version.js";
|
|
16
|
+
export { JS_PrintValue, JS_PrintValueSetDefaultOptions, JS_PrintValueToString } from "./print.js";
|
|
16
17
|
export { JS_SetModuleLoader, JS_EvalModule, JS_ImportModule, JS_GetModuleNamespace, JS_DetectModule, js_default_module_resolve } from "./module.js";
|
|
17
18
|
export { JS_PromiseState, JS_PromiseResult, JS_NewPromiseCapability } from "./builtins/promise.js";
|
|
18
19
|
export { JS_CallInternal, js_closure } from "./interpreter.js";
|
package/dist/jseption.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jseption.js","sourceRoot":"","sources":["../src/jseption.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,aAAa,CAAC;AACrB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,UAAU,CAAC;AAClB,OAAO,aAAa,CAAC;AAErB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAM,WAAW,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAk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C;IACD,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["/*\n * jseption: TypeScript port of QuickJS - public entry point\n *\n * Importing this module loads the interpreter, the compiler and the\n * builtin objects and re-exports the core API.\n */\nimport './interpreter.ts';\nimport './parser.ts';\nimport './builtins/index.ts';\nimport './jit.ts';\nimport './module.ts';\n\nexport * from './quickjs.ts';\nexport { OP, opcode_info } from './opcodes.ts';\nexport { JS_WriteObject, JS_ReadObject, JS_WRITE_OBJ_SOURCE } from './bytecode.ts';\nexport { JSEPTION_VERSION } from './version.ts';\nexport { JS_SetModuleLoader, JS_EvalModule, JS_ImportModule, JS_GetModuleNamespace, JS_DetectModule,\n js_default_module_resolve } from './module.ts';\nexport type { JSModuleLoader, JSModuleSource, JSModuleLoadResult, JSModuleSourceType } from './module.ts';\nexport { JS_PromiseState, JS_PromiseResult, JS_NewPromiseCapability } from './builtins/promise.ts';\nexport { JS_CallInternal, js_closure } from './interpreter.ts';\nexport { jit_config, jit_configure, jit_compile, jit_generate_source, jit_stats, jit_probe, jit_is_wrapper, jit_default_mode } from './jit.ts';\nexport { JS_EvalInternal, next_token, JSParseState, TOK } from './parser.ts';\nexport { toGuest, fromGuest, expose, hostFunction, hostPromise, guestPromiseToHost, guestErrorToHost, isGuestValue, drainJobs } from './embed.ts';\nexport type { ToGuestOptions } from './embed.ts';\nexport { exposeLive, toGuestLive, isLiveProxy } from './membrane.ts';\nexport type { MembranePolicy } from './membrane.ts';\n\nimport { JSContext, JSValue, JS_Eval, JS_IsException, JS_GetException, JS_ToString, JS_GetPropertyStr, JS_IsError,\n JS_EVAL_TYPE_GLOBAL, JSRuntime, JS_ExecutePendingJob, JS_IsJobPending } from './quickjs.ts';\n\n/* convenience helpers for tests and the CLI */\n\n/* evaluate 'src' and return the result or throw a host Error describing the JS exception */\nexport function evalOrThrow(ctx: JSContext, src: string, filename = '<eval>', flags: number = JS_EVAL_TYPE_GLOBAL): JSValue {\n const r = JS_Eval(ctx, src, filename, flags);\n if (JS_IsException(r)) {\n const exc = JS_GetException(ctx);\n throw new Error(formatException(ctx, exc));\n }\n return r;\n}\n\nexport function formatException(ctx: JSContext, exc: JSValue): string {\n let msg: string;\n const s = JS_ToString(ctx, exc);\n if (JS_IsException(s)) { JS_GetException(ctx); msg = '[exception]'; }\n else msg = s as string;\n if (JS_IsError(ctx, exc)) {\n const stack = JS_GetPropertyStr(ctx, exc, 'stack');\n if (typeof stack === 'string' && stack.length > 0) msg += '\\n' + stack;\n }\n return msg;\n}\n\n/* run all pending promise jobs; returns the number of jobs executed */\nexport function runPendingJobs(rt: JSRuntime): number {\n let n = 0;\n const pctx = { ctx: null as JSContext | null };\n while (JS_IsJobPending(rt)) {\n const r = JS_ExecutePendingJob(rt, pctx);\n if (r < 0) {\n /* the exception is left in the context */\n if (pctx.ctx) {\n const exc = JS_GetException(pctx.ctx);\n throw new Error('uncaught exception in job: ' + formatException(pctx.ctx, exc));\n }\n }\n n++;\n }\n return n;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"jseption.js","sourceRoot":"","sources":["../src/jseption.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,aAAa,CAAC;AACrB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,UAAU,CAAC;AAClB,OAAO,aAAa,CAAC;AAErB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAM,WAAW,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAElG,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,eAAe,EACjG,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,eA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C;IAChB,MAAM,CAAC,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAChC,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;QAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAAC,GAAG,GAAG,aAAa,CAAC;IAAC,CAAC;;QAChE,GAAG,GAAG,CAAW,CAAC;IACvB,IAAI,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,GAAG,IAAI,IAAI,GAAG,KAAK,CAAC;IACzE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,cAAc,CAAC,EAAa;IAC1C,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,IAAwB,EAAE,CAAC;IAC/C,OAAO,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAG,oBAAoB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACV,0CAA0C;YAC1C,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;gBACb,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACtC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YAClF,CAAC;QACH,CAAC;QACD,CAAC,EAAE,CAAC;IACN,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["/*\n * jseption: TypeScript port of QuickJS - public entry point\n *\n * Importing this module loads the interpreter, the compiler and the\n * builtin objects and re-exports the core API.\n */\nimport './interpreter.ts';\nimport './parser.ts';\nimport './builtins/index.ts';\nimport './jit.ts';\nimport './module.ts';\n\nexport * from './quickjs.ts';\nexport { OP, opcode_info } from './opcodes.ts';\nexport { JS_WriteObject, JS_ReadObject, JS_WRITE_OBJ_SOURCE } from './bytecode.ts';\nexport { JSEPTION_VERSION } from './version.ts';\nexport { JS_PrintValue, JS_PrintValueSetDefaultOptions, JS_PrintValueToString } from './print.ts';\nexport type { JSPrintValueOptions, JSPrintValueWrite } from './print.ts';\nexport { JS_SetModuleLoader, JS_EvalModule, JS_ImportModule, JS_GetModuleNamespace, JS_DetectModule,\n js_default_module_resolve } from './module.ts';\nexport type { JSModuleLoader, JSModuleSource, JSModuleLoadResult, JSModuleSourceType } from './module.ts';\nexport { JS_PromiseState, JS_PromiseResult, JS_NewPromiseCapability } from './builtins/promise.ts';\nexport { JS_CallInternal, js_closure } from './interpreter.ts';\nexport { jit_config, jit_configure, jit_compile, jit_generate_source, jit_stats, jit_probe, jit_is_wrapper, jit_default_mode } from './jit.ts';\nexport { JS_EvalInternal, next_token, JSParseState, TOK } from './parser.ts';\nexport { toGuest, fromGuest, expose, hostFunction, hostPromise, guestPromiseToHost, guestErrorToHost, isGuestValue, drainJobs } from './embed.ts';\nexport type { ToGuestOptions } from './embed.ts';\nexport { exposeLive, toGuestLive, isLiveProxy } from './membrane.ts';\nexport type { MembranePolicy } from './membrane.ts';\n\nimport { JSContext, JSValue, JS_Eval, JS_IsException, JS_GetException, JS_ToString, JS_GetPropertyStr, JS_IsError,\n JS_EVAL_TYPE_GLOBAL, JSRuntime, JS_ExecutePendingJob, JS_IsJobPending } from './quickjs.ts';\n\n/* convenience helpers for tests and the CLI */\n\n/* evaluate 'src' and return the result or throw a host Error describing the JS exception */\nexport function evalOrThrow(ctx: JSContext, src: string, filename = '<eval>', flags: number = JS_EVAL_TYPE_GLOBAL): JSValue {\n const r = JS_Eval(ctx, src, filename, flags);\n if (JS_IsException(r)) {\n const exc = JS_GetException(ctx);\n throw new Error(formatException(ctx, exc));\n }\n return r;\n}\n\nexport function formatException(ctx: JSContext, exc: JSValue): string {\n let msg: string;\n const s = JS_ToString(ctx, exc);\n if (JS_IsException(s)) { JS_GetException(ctx); msg = '[exception]'; }\n else msg = s as string;\n if (JS_IsError(ctx, exc)) {\n const stack = JS_GetPropertyStr(ctx, exc, 'stack');\n if (typeof stack === 'string' && stack.length > 0) msg += '\\n' + stack;\n }\n return msg;\n}\n\n/* run all pending promise jobs; returns the number of jobs executed */\nexport function runPendingJobs(rt: JSRuntime): number {\n let n = 0;\n const pctx = { ctx: null as JSContext | null };\n while (JS_IsJobPending(rt)) {\n const r = JS_ExecutePendingJob(rt, pctx);\n if (r < 0) {\n /* the exception is left in the context */\n if (pctx.ctx) {\n const exc = JS_GetException(pctx.ctx);\n throw new Error('uncaught exception in job: ' + formatException(pctx.ctx, exc));\n }\n }\n n++;\n }\n return n;\n}\n"]}
|