libgpac
Documentation of the core library of GPAC
quickjs.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <inttypes.h>
#include <string.h>
#include <assert.h>
#include <sys/time.h>
#include <time.h>
#include <fenv.h>
#include <math.h>
#include "cutils.h"
#include "list.h"
#include "quickjs.h"
#include "libregexp.h"
#include <pthread.h>
#include <stdatomic.h>
#include <errno.h>
#include "quickjs-atom.h"
#include "quickjs-opcode.h"
+ Include dependency graph for quickjs.c:

Data Structures

struct  JSRuntime
 
struct  JSClass
 
struct  JSStackFrame
 
struct  JSGCObjectHeader
 
struct  JSVarRef
 
struct  JSContext
 
union  JSFloat64Union
 
struct  JSAtomStruct
 
struct  JSClosureVar
 
struct  JSVarScope
 
struct  JSVarDef
 
struct  JSFunctionBytecode
 
struct  JSBoundFunction
 
struct  JSForInIterator
 
struct  JSRegExp
 
struct  JSProxyData
 
struct  JSArrayBuffer
 
struct  JSTypedArray
 
struct  JSAsyncFunctionState
 
struct  JSAsyncFunctionData
 
struct  JSBinaryOperatorDefEntry
 
struct  JSBinaryOperatorDef
 
struct  JSOperatorSetData
 
struct  JSReqModuleEntry
 
struct  JSExportEntry
 
struct  JSStarExportEntry
 
struct  JSImportEntry
 
struct  JSModuleDef
 
struct  JSJobEntry
 
struct  JSProperty
 
struct  JSShapeProperty
 
struct  JSShape
 
struct  JSObject
 
struct  JSClassShortDef
 
struct  StringBuffer
 
struct  JSCFunctionDataRecord
 
struct  JSMemoryUsage_helper
 
struct  JSGeneratorData
 
struct  JSAsyncGeneratorRequest
 
struct  JSAsyncGeneratorData
 
struct  BlockEnv
 
struct  JSGlobalVar
 
struct  RelocEntry
 
struct  JumpSlot
 
struct  LabelSlot
 
struct  LineNumberSlot
 
struct  JSFunctionDef
 
struct  JSToken
 
struct  JSParseState
 
struct  JSOpCode
 
struct  JSParsePos
 
struct  ClassFieldsDef
 
struct  JSResolveEntry
 
struct  JSResolveState
 
struct  ExportedNameEntry
 
struct  GetExportNamesState
 
struct  CodeContext
 
struct  StackSizeState
 
struct  JSObjectListEntry
 
struct  JSObjectList
 
struct  BCWriterState
 
struct  BCReaderState
 
struct  ValueSlot
 
struct  array_sort_context
 
struct  JSArrayIteratorData
 
struct  JSRegExpStringIteratorData
 
struct  ValueBuffer
 
struct  JSONStringifyContext
 
struct  JSMapRecord
 
struct  JSMapState
 
struct  JSMapIteratorData
 
struct  JSPromiseData
 
struct  JSPromiseFunctionDataResolved
 
struct  JSPromiseFunctionData
 
struct  JSPromiseReactionData
 
struct  JSAsyncFromSyncIteratorData
 
struct  TA_sort_context
 
struct  JSAtomicsWaiter
 
union  JSVarRef.__unnamed396__
 
struct  JSVarRef.__unnamed396__.__unnamed398__
 
union  JSString.u
 
struct  JSFunctionBytecode.debug
 
union  JSExportEntry.u
 
struct  JSExportEntry.u.local
 
union  JSProperty.u
 
struct  JSProperty.u.getset
 
struct  JSProperty.u.init
 
union  JSObject.__unnamed407__
 
struct  JSObject.__unnamed407__.__unnamed410__
 
union  JSObject.u
 
struct  JSObject.u.func
 
struct  JSObject.u.cfunc
 
struct  JSObject.u.array
 
union  JSObject.u.array.u1
 
union  JSObject.u.array.u
 
union  JSToken.u
 
struct  JSToken.u.str
 
struct  JSToken.u.num
 
struct  JSToken.u.ident
 
struct  JSToken.u.regexp
 
union  ExportedNameEntry.u
 

Macros

#define OPTIMIZE   1
 
#define SHORT_OPCODES   1
 
#define DIRECT_DISPATCH   1
 
#define MALLOC_OVERHEAD   8
 
#define CONFIG_PRINTF_RNDN
 
#define CONFIG_ATOMICS
 
#define DUMP_LEAKS   1
 
#define CONFIG_VERSION   "2020-11-08-rc2"
 
#define JS_TYPED_ARRAY_COUNT   (JS_CLASS_FLOAT64_ARRAY - JS_CLASS_UINT8C_ARRAY + 1)
 
#define typed_array_size_log2(classid)   (typed_array_size_log2[(classid)- JS_CLASS_UINT8C_ARRAY])
 
#define JS_MAX_LOCAL_VARS   65536
 
#define JS_STACK_SIZE_MAX   65534
 
#define JS_STRING_LEN_MAX   ((1 << 30) - 1)
 
#define __exception   __attribute__((warn_unused_result))
 
#define JS_MODE_STRICT   (1 << 0)
 
#define JS_MODE_STRIP   (1 << 1)
 
#define JS_MODE_MATH   (1 << 2)
 
#define JS_INTERRUPT_COUNTER_INIT   10000
 
#define JS_ATOM_HASH_MASK   ((1 << 30) - 1)
 
#define ARG_SCOPE_INDEX   1
 
#define ARG_SCOPE_END   (-2)
 
#define PC2LINE_BASE   (-1)
 
#define PC2LINE_RANGE   5
 
#define PC2LINE_OP_FIRST   1
 
#define PC2LINE_DIFF_PC_MAX   ((255 - PC2LINE_OP_FIRST) / PC2LINE_RANGE)
 
#define JS_PROP_INITIAL_SIZE   2
 
#define JS_PROP_INITIAL_HASH_SIZE   4 /* must be a power of two */
 
#define JS_ARRAY_INITIAL_SIZE   2
 
#define DEF(name, str)   JS_ATOM_ ## name,
 
#define JS_ATOM_LAST_KEYWORD   JS_ATOM_super
 
#define JS_ATOM_LAST_STRICT_KEYWORD   JS_ATOM_yield
 
#define DEF(name, str)   str "\0"
 
#define FMT(f)   OP_FMT_ ## f,
 
#define DEF(id, size, n_pop, n_push, f)
 
#define FMT(f)
 
#define DEF(id, size, n_pop, n_push, f)   OP_ ## id,
 
#define def(id, size, n_pop, n_push, f)
 
#define FMT(f)
 
#define DEF(id, size, n_pop, n_push, f)
 
#define def(id, size, n_pop, n_push, f)   OP_ ## id,
 
#define malloc(s)   malloc_is_forbidden(s)
 
#define free(p)   free_is_forbidden(p)
 
#define realloc(p, s)   realloc_is_forbidden(p,s)
 
#define JS_ATOM_TAG_INT   (1U << 31)
 
#define JS_ATOM_MAX_INT   (JS_ATOM_TAG_INT - 1)
 
#define JS_ATOM_MAX   ((1U << 30) - 1)
 
#define JS_ATOM_COUNT_RESIZE(n)   ((n) * 2)
 
#define ATOM_GET_STR_BUF_SIZE   64
 
#define JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL   (1 << 0)
 
#define JS_BACKTRACE_FLAG_SINGLE_LEVEL   (1 << 1)
 
#define JS_ThrowTypeErrorAtom(ctx, fmt, atom)   __JS_ThrowTypeErrorAtom(ctx, atom, fmt, "")
 
#define JS_ThrowSyntaxErrorAtom(ctx, fmt, atom)   __JS_ThrowSyntaxErrorAtom(ctx, atom, fmt, "")
 
#define DEFINE_GLOBAL_LEX_VAR   (1 << 7)
 
#define DEFINE_GLOBAL_FUNC_VAR   (1 << 6)
 
#define HINT_STRING   0
 
#define HINT_NUMBER   1
 
#define HINT_NONE   2
 
#define HINT_FORCE_ORDINARY   (1 << 4)
 
#define ATOD_INT_ONLY   (1 << 0)
 
#define ATOD_ACCEPT_BIN_OCT   (1 << 2)
 
#define ATOD_ACCEPT_LEGACY_OCTAL   (1 << 4)
 
#define ATOD_ACCEPT_UNDERSCORES   (1 << 5)
 
#define ATOD_ACCEPT_SUFFIX   (1 << 6)
 
#define ATOD_TYPE_MASK   (3 << 7)
 
#define ATOD_TYPE_FLOAT64   (0 << 7)
 
#define ATOD_TYPE_BIG_INT   (1 << 7)
 
#define ATOD_TYPE_BIG_FLOAT   (2 << 7)
 
#define ATOD_TYPE_BIG_DECIMAL   (3 << 7)
 
#define ATOD_MODE_BIGINT   (1 << 9)
 
#define ATOD_ACCEPT_PREFIX_AFTER_SIGN   (1 << 10)
 
#define MAX_SAFE_INTEGER   (((int64_t)1 << 53) - 1)
 
#define JS_DTOA_BUF_SIZE   128
 
#define JS_DTOA_VAR_FORMAT   (0 << 0)
 
#define JS_DTOA_FIXED_FORMAT   (1 << 0)
 
#define JS_DTOA_FRAC_FORMAT   (2 << 0)
 
#define JS_DTOA_FORCE_EXP   (1 << 2)
 
#define GLOBAL_VAR_OFFSET   0x40000000
 
#define ARGUMENT_VAR_OFFSET   0x20000000
 
#define JS_DEFINE_CLASS_HAS_HERITAGE   (1 << 0)
 
#define JS_CALL_FLAG_COPY_ARGV   (1 << 1)
 
#define JS_CALL_FLAG_GENERATOR   (1 << 2)
 
#define FUNC_RET_AWAIT   0
 
#define FUNC_RET_YIELD   1
 
#define FUNC_RET_YIELD_STAR   2
 
#define DEF(id, size, n_pop, n_push, f)   && case_OP_ ## id,
 
#define def(id, size, n_pop, n_push, f)
 
#define SWITCH(pc)   goto *dispatch_table[opcode = *pc++];
 
#define CASE(op)   case_ ## op
 
#define DEFAULT   case_default
 
#define BREAK   SWITCH(pc)
 
#define JS_THROW_VAR_RO   0
 
#define JS_THROW_VAR_REDECL   1
 
#define JS_THROW_VAR_UNINITIALIZED   2
 
#define JS_THROW_ERROR_DELETE_SUPER   3
 
#define JS_THROW_ERROR_ITERATOR_THROW   4
 
#define OP_DEFINE_METHOD_METHOD   0
 
#define OP_DEFINE_METHOD_GETTER   1
 
#define OP_DEFINE_METHOD_SETTER   2
 
#define OP_DEFINE_METHOD_ENUMERABLE   4
 
#define OP_CMP(opcode, binary_op, slow_call)
 
#define GEN_MAGIC_NEXT   0
 
#define GEN_MAGIC_RETURN   1
 
#define GEN_MAGIC_THROW   2
 
#define TOK_FIRST_KEYWORD   TOK_NULL
 
#define TOK_LAST_KEYWORD   TOK_AWAIT
 
#define CP_NBSP   0x00a0
 
#define CP_BOM   0xfeff
 
#define CP_LS   0x2028
 
#define CP_PS   0x2029
 
#define FMT(f)
 
#define DEF(id, size, n_pop, n_push, f)   { size, n_pop, n_push, OP_FMT_ ## f },
 
#define short_opcode_info(op)
 
#define PROP_TYPE_IDENT   0
 
#define PROP_TYPE_VAR   1
 
#define PROP_TYPE_GET   2
 
#define PROP_TYPE_SET   3
 
#define PROP_TYPE_STAR   4
 
#define PROP_TYPE_ASYNC   5
 
#define PROP_TYPE_ASYNC_STAR   6
 
#define PROP_TYPE_PRIVATE   (1 << 4)
 
#define SKIP_HAS_SEMI   (1 << 0)
 
#define SKIP_HAS_ELLIPSIS   (1 << 1)
 
#define SKIP_HAS_ASSIGNMENT   (1 << 2)
 
#define PF_IN_ACCEPTED   (1 << 0)
 
#define PF_POSTFIX_CALL   (1 << 1)
 
#define PF_ARROW_FUNC   (1 << 2)
 
#define PF_POW_ALLOWED   (1 << 3)
 
#define PF_POW_FORBIDDEN   (1 << 4)
 
#define DECL_MASK_FUNC   (1 << 0) /* allow normal function declaration */
 
#define DECL_MASK_FUNC_WITH_LABEL   (1 << 1)
 
#define DECL_MASK_OTHER   (1 << 2) /* all other declarations */
 
#define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
 
#define M2(op1, op2)   ((op1) | (((uint32_t) op2) << 8))
 
#define M3(op1, op2, op3)   ((op1) | (((uint32_t) op2) << 8) | (((uint32_t) op3) << 16))
 
#define M4(op1, op2, op3, op4)   ((op1) | (((uint32_t) op2) << 8) | (((uint32_t) op3) << 16) | (((uint32_t) op4) << 24))
 
#define BC_BASE_VERSION   1
 
#define BC_BE_VERSION   0x40
 
#define BC_VERSION   BC_BASE_VERSION
 
#define bc_read_trace(...)
 
#define special_every   0
 
#define special_some   1
 
#define special_forEach   2
 
#define special_map   3
 
#define special_filter   4
 
#define special_TA   8
 
#define special_reduce   0
 
#define special_reduceRight   1
 
#define MAGIC_SET   (1 << 0)
 
#define MAGIC_WEAK   (1 << 1)
 
#define PROMISE_MAGIC_all   0
 
#define PROMISE_MAGIC_allSettled   1
 
#define PROMISE_MAGIC_any   2
 
#define special_indexOf   0
 
#define special_lastIndexOf   1
 
#define special_includes   -1
 
#define OP(op_name, func_name)
 

Typedefs

typedef enum OPCodeEnum OPCodeEnum
 
typedef JSValue JSAutoInitFunc(JSContext *ctx, JSObject *p, JSAtom atom, void *opaque)
 

Enumerations

enum  {
  JS_CLASS_OBJECT = 1 , JS_CLASS_ARRAY , JS_CLASS_ERROR , JS_CLASS_NUMBER ,
  JS_CLASS_STRING , JS_CLASS_BOOLEAN , JS_CLASS_SYMBOL , JS_CLASS_ARGUMENTS ,
  JS_CLASS_MAPPED_ARGUMENTS , JS_CLASS_DATE , JS_CLASS_MODULE_NS , JS_CLASS_C_FUNCTION ,
  JS_CLASS_BYTECODE_FUNCTION , JS_CLASS_BOUND_FUNCTION , JS_CLASS_C_FUNCTION_DATA , JS_CLASS_GENERATOR_FUNCTION ,
  JS_CLASS_FOR_IN_ITERATOR , JS_CLASS_REGEXP , JS_CLASS_ARRAY_BUFFER , JS_CLASS_SHARED_ARRAY_BUFFER ,
  JS_CLASS_UINT8C_ARRAY , JS_CLASS_INT8_ARRAY , JS_CLASS_UINT8_ARRAY , JS_CLASS_INT16_ARRAY ,
  JS_CLASS_UINT16_ARRAY , JS_CLASS_INT32_ARRAY , JS_CLASS_UINT32_ARRAY , JS_CLASS_FLOAT32_ARRAY ,
  JS_CLASS_FLOAT64_ARRAY , JS_CLASS_DATAVIEW , JS_CLASS_MAP , JS_CLASS_SET ,
  JS_CLASS_WEAKMAP , JS_CLASS_WEAKSET , JS_CLASS_MAP_ITERATOR , JS_CLASS_SET_ITERATOR ,
  JS_CLASS_ARRAY_ITERATOR , JS_CLASS_STRING_ITERATOR , JS_CLASS_REGEXP_STRING_ITERATOR , JS_CLASS_GENERATOR ,
  JS_CLASS_PROXY , JS_CLASS_PROMISE , JS_CLASS_PROMISE_RESOLVE_FUNCTION , JS_CLASS_PROMISE_REJECT_FUNCTION ,
  JS_CLASS_ASYNC_FUNCTION , JS_CLASS_ASYNC_FUNCTION_RESOLVE , JS_CLASS_ASYNC_FUNCTION_REJECT , JS_CLASS_ASYNC_FROM_SYNC_ITERATOR ,
  JS_CLASS_ASYNC_GENERATOR_FUNCTION , JS_CLASS_ASYNC_GENERATOR , JS_CLASS_INIT_COUNT
}
 
enum  JSErrorEnum {
  JS_EVAL_ERROR , JS_RANGE_ERROR , JS_REFERENCE_ERROR , JS_SYNTAX_ERROR ,
  JS_TYPE_ERROR , JS_URI_ERROR , JS_INTERNAL_ERROR , JS_AGGREGATE_ERROR ,
  JS_NATIVE_ERROR_COUNT
}
 
enum  JSGCPhaseEnum { JS_GC_PHASE_NONE , JS_GC_PHASE_DECREF , JS_GC_PHASE_REMOVE_CYCLES }
 
enum  JSGCObjectTypeEnum {
  JS_GC_OBJ_TYPE_JS_OBJECT , JS_GC_OBJ_TYPE_FUNCTION_BYTECODE , JS_GC_OBJ_TYPE_SHAPE , JS_GC_OBJ_TYPE_VAR_REF ,
  JS_GC_OBJ_TYPE_ASYNC_FUNCTION , JS_GC_OBJ_TYPE_JS_CONTEXT
}
 
enum  JSAutoInitIDEnum { JS_AUTOINIT_ID_PROTOTYPE , JS_AUTOINIT_ID_MODULE_NS , JS_AUTOINIT_ID_PROP }
 
enum  { JS_ATOM_TYPE_STRING = 1 , JS_ATOM_TYPE_GLOBAL_SYMBOL , JS_ATOM_TYPE_SYMBOL , JS_ATOM_TYPE_PRIVATE }
 
enum  { JS_ATOM_HASH_SYMBOL , JS_ATOM_HASH_PRIVATE }
 
enum  JSAtomKindEnum { JS_ATOM_KIND_STRING , JS_ATOM_KIND_SYMBOL , JS_ATOM_KIND_PRIVATE }
 
enum  JSVarKindEnum {
  JS_VAR_NORMAL , JS_VAR_FUNCTION_DECL , JS_VAR_NEW_FUNCTION_DECL , JS_VAR_CATCH ,
  JS_VAR_FUNCTION_NAME , JS_VAR_PRIVATE_FIELD , JS_VAR_PRIVATE_METHOD , JS_VAR_PRIVATE_GETTER ,
  JS_VAR_PRIVATE_SETTER , JS_VAR_PRIVATE_GETTER_SETTER
}
 
enum  JSFunctionKindEnum { JS_FUNC_NORMAL = 0 , JS_FUNC_GENERATOR = (1 << 0) , JS_FUNC_ASYNC = (1 << 1) , JS_FUNC_ASYNC_GENERATOR = (JS_FUNC_GENERATOR | JS_FUNC_ASYNC) }
 
enum  JSIteratorKindEnum { JS_ITERATOR_KIND_KEY , JS_ITERATOR_KIND_VALUE , JS_ITERATOR_KIND_KEY_AND_VALUE }
 
enum  JSOverloadableOperatorEnum {
  JS_OVOP_ADD , JS_OVOP_SUB , JS_OVOP_MUL , JS_OVOP_DIV ,
  JS_OVOP_MOD , JS_OVOP_POW , JS_OVOP_OR , JS_OVOP_AND ,
  JS_OVOP_XOR , JS_OVOP_SHL , JS_OVOP_SAR , JS_OVOP_SHR ,
  JS_OVOP_EQ , JS_OVOP_LESS , JS_OVOP_BINARY_COUNT , JS_OVOP_POS = JS_OVOP_BINARY_COUNT ,
  JS_OVOP_NEG , JS_OVOP_INC , JS_OVOP_DEC , JS_OVOP_NOT ,
  JS_OVOP_COUNT
}
 
enum  JSExportTypeEnum { JS_EXPORT_TYPE_LOCAL , JS_EXPORT_TYPE_INDIRECT }
 
enum  { __JS_ATOM_NULL = JS_ATOM_NULL , JS_ATOM_END }
 
enum  OPCodeFormat
 
enum  OPCodeEnum { OP_COUNT , OP_TEMP_START = OP_nop + 1 , OP___dummy = OP_TEMP_START - 1 , OP_TEMP_END }
 
enum  JSFreeModuleEnum { JS_FREE_MODULE_ALL , JS_FREE_MODULE_NOT_RESOLVED , JS_FREE_MODULE_NOT_EVALUATED }
 
enum  JSToNumberHintEnum { TON_FLAG_NUMBER , TON_FLAG_NUMERIC }
 
enum  OPSpecialObjectEnum {
  OP_SPECIAL_OBJECT_ARGUMENTS , OP_SPECIAL_OBJECT_MAPPED_ARGUMENTS , OP_SPECIAL_OBJECT_THIS_FUNC , OP_SPECIAL_OBJECT_NEW_TARGET ,
  OP_SPECIAL_OBJECT_HOME_OBJECT , OP_SPECIAL_OBJECT_VAR_OBJECT , OP_SPECIAL_OBJECT_IMPORT_META
}
 
enum  JSGeneratorStateEnum {
  JS_GENERATOR_STATE_SUSPENDED_START , JS_GENERATOR_STATE_SUSPENDED_YIELD , JS_GENERATOR_STATE_SUSPENDED_YIELD_STAR , JS_GENERATOR_STATE_EXECUTING ,
  JS_GENERATOR_STATE_COMPLETED
}
 
enum  JSAsyncGeneratorStateEnum {
  JS_ASYNC_GENERATOR_STATE_SUSPENDED_START , JS_ASYNC_GENERATOR_STATE_SUSPENDED_YIELD , JS_ASYNC_GENERATOR_STATE_SUSPENDED_YIELD_STAR , JS_ASYNC_GENERATOR_STATE_EXECUTING ,
  JS_ASYNC_GENERATOR_STATE_AWAITING_RETURN , JS_ASYNC_GENERATOR_STATE_COMPLETED
}
 
enum  {
  TOK_NUMBER = -128 , TOK_STRING , TOK_TEMPLATE , TOK_IDENT ,
  TOK_REGEXP , TOK_MUL_ASSIGN , TOK_DIV_ASSIGN , TOK_MOD_ASSIGN ,
  TOK_PLUS_ASSIGN , TOK_MINUS_ASSIGN , TOK_SHL_ASSIGN , TOK_SAR_ASSIGN ,
  TOK_SHR_ASSIGN , TOK_AND_ASSIGN , TOK_XOR_ASSIGN , TOK_OR_ASSIGN ,
  TOK_POW_ASSIGN , TOK_LAND_ASSIGN , TOK_LOR_ASSIGN , TOK_DOUBLE_QUESTION_MARK_ASSIGN ,
  TOK_DEC , TOK_INC , TOK_SHL , TOK_SAR ,
  TOK_SHR , TOK_LT , TOK_LTE , TOK_GT ,
  TOK_GTE , TOK_EQ , TOK_STRICT_EQ , TOK_NEQ ,
  TOK_STRICT_NEQ , TOK_LAND , TOK_LOR , TOK_POW ,
  TOK_ARROW , TOK_ELLIPSIS , TOK_DOUBLE_QUESTION_MARK , TOK_QUESTION_MARK_DOT ,
  TOK_ERROR , TOK_PRIVATE_NAME , TOK_EOF , TOK_NULL ,
  TOK_FALSE , TOK_TRUE , TOK_IF , TOK_ELSE ,
  TOK_RETURN , TOK_VAR , TOK_THIS , TOK_DELETE ,
  TOK_VOID , TOK_TYPEOF , TOK_NEW , TOK_IN ,
  TOK_INSTANCEOF , TOK_DO , TOK_WHILE , TOK_FOR ,
  TOK_BREAK , TOK_CONTINUE , TOK_SWITCH , TOK_CASE ,
  TOK_DEFAULT , TOK_THROW , TOK_TRY , TOK_CATCH ,
  TOK_FINALLY , TOK_FUNCTION , TOK_DEBUGGER , TOK_WITH ,
  TOK_CLASS , TOK_CONST , TOK_ENUM , TOK_EXPORT ,
  TOK_EXTENDS , TOK_IMPORT , TOK_SUPER , TOK_IMPLEMENTS ,
  TOK_INTERFACE , TOK_LET , TOK_PACKAGE , TOK_PRIVATE ,
  TOK_PROTECTED , TOK_PUBLIC , TOK_STATIC , TOK_YIELD ,
  TOK_AWAIT , TOK_OF
}
 
enum  JSParseFunctionEnum {
  JS_PARSE_FUNC_STATEMENT , JS_PARSE_FUNC_VAR , JS_PARSE_FUNC_EXPR , JS_PARSE_FUNC_ARROW ,
  JS_PARSE_FUNC_GETTER , JS_PARSE_FUNC_SETTER , JS_PARSE_FUNC_METHOD , JS_PARSE_FUNC_CLASS_CONSTRUCTOR ,
  JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR
}
 
enum  JSParseExportEnum { JS_PARSE_EXPORT_NONE , JS_PARSE_EXPORT_NAMED , JS_PARSE_EXPORT_DEFAULT }
 
enum  JSVarDefEnum {
  JS_VAR_DEF_WITH , JS_VAR_DEF_LET , JS_VAR_DEF_CONST , JS_VAR_DEF_FUNCTION_DECL ,
  JS_VAR_DEF_NEW_FUNCTION_DECL , JS_VAR_DEF_CATCH , JS_VAR_DEF_VAR
}
 
enum  PutLValueEnum {
  PUT_LVALUE_NOKEEP , PUT_LVALUE_NOKEEP_DEPTH , PUT_LVALUE_KEEP_TOP , PUT_LVALUE_KEEP_SECOND ,
  PUT_LVALUE_NOKEEP_BOTTOM
}
 
enum  FuncCallType { FUNC_CALL_NORMAL , FUNC_CALL_NEW , FUNC_CALL_SUPER_CTOR , FUNC_CALL_TEMPLATE }
 
enum  JSResolveResultEnum {
  JS_RESOLVE_RES_EXCEPTION = -1 , JS_RESOLVE_RES_FOUND = 0 , JS_RESOLVE_RES_NOT_FOUND , JS_RESOLVE_RES_CIRCULAR ,
  JS_RESOLVE_RES_AMBIGUOUS
}
 
enum  ExportedNameEntryEnum { EXPORTED_NAME_AMBIGUOUS , EXPORTED_NAME_NORMAL , EXPORTED_NAME_NS }
 
enum  BCTagEnum {
  BC_TAG_NULL = 1 , BC_TAG_UNDEFINED , BC_TAG_BOOL_FALSE , BC_TAG_BOOL_TRUE ,
  BC_TAG_INT32 , BC_TAG_FLOAT64 , BC_TAG_STRING , BC_TAG_OBJECT ,
  BC_TAG_ARRAY , BC_TAG_BIG_INT , BC_TAG_BIG_FLOAT , BC_TAG_BIG_DECIMAL ,
  BC_TAG_TEMPLATE_OBJECT , BC_TAG_FUNCTION_BYTECODE , BC_TAG_MODULE , BC_TAG_TYPED_ARRAY ,
  BC_TAG_ARRAY_BUFFER , BC_TAG_SHARED_ARRAY_BUFFER , BC_TAG_DATE , BC_TAG_OBJECT_VALUE ,
  BC_TAG_OBJECT_REFERENCE
}
 
enum  {
  magic_string_anchor , magic_string_big , magic_string_blink , magic_string_bold ,
  magic_string_fixed , magic_string_fontcolor , magic_string_fontsize , magic_string_italics ,
  magic_string_link , magic_string_small , magic_string_strike , magic_string_sub ,
  magic_string_sup
}
 
enum  JSPromiseStateEnum { JS_PROMISE_PENDING , JS_PROMISE_FULFILLED , JS_PROMISE_REJECTED }
 
enum  AtomicsOpEnum {
  ATOMICS_OP_ADD , ATOMICS_OP_AND , ATOMICS_OP_OR , ATOMICS_OP_SUB ,
  ATOMICS_OP_XOR , ATOMICS_OP_EXCHANGE , ATOMICS_OP_COMPARE_EXCHANGE , ATOMICS_OP_LOAD
}
 

Functions

static int JS_InitAtoms (JSRuntime *rt)
 
static JSAtom __JS_NewAtomInit (JSRuntime *rt, const char *str, int len, int atom_type)
 
static void JS_FreeAtomStruct (JSRuntime *rt, JSAtomStruct *p)
 
static void free_function_bytecode (JSRuntime *rt, JSFunctionBytecode *b)
 
static JSValue js_call_c_function (JSContext *ctx, JSValueConst func_obj, JSValueConst this_obj, int argc, JSValueConst *argv, int flags)
 
static JSValue js_call_bound_function (JSContext *ctx, JSValueConst func_obj, JSValueConst this_obj, int argc, JSValueConst *argv, int flags)
 
static JSValue JS_CallInternal (JSContext *ctx, JSValueConst func_obj, JSValueConst this_obj, JSValueConst new_target, int argc, JSValue *argv, int flags)
 
static JSValue JS_CallConstructorInternal (JSContext *ctx, JSValueConst func_obj, JSValueConst new_target, int argc, JSValue *argv, int flags)
 
static JSValue JS_CallFree (JSContext *ctx, JSValue func_obj, JSValueConst this_obj, int argc, JSValueConst *argv)
 
static JSValue JS_InvokeFree (JSContext *ctx, JSValue this_val, JSAtom atom, int argc, JSValueConst *argv)
 
static __exception int JS_ToArrayLengthFree (JSContext *ctx, uint32_t *plen, JSValue val, BOOL is_array_ctor)
 
static JSValue JS_EvalObject (JSContext *ctx, JSValueConst this_obj, JSValueConst val, int flags, int scope_idx)
 
JSValue __attribute__ ((format(printf, 2, 3)))
 
static BOOL js_strict_eq2 (JSContext *ctx, JSValue op1, JSValue op2, JSStrictEqModeEnum eq_mode)
 
static BOOL js_strict_eq (JSContext *ctx, JSValue op1, JSValue op2)
 
static BOOL js_same_value (JSContext *ctx, JSValueConst op1, JSValueConst op2)
 
static BOOL js_same_value_zero (JSContext *ctx, JSValueConst op1, JSValueConst op2)
 
static JSValue JS_ToObject (JSContext *ctx, JSValueConst val)
 
static JSValue JS_ToObjectFree (JSContext *ctx, JSValue val)
 
static JSPropertyadd_property (JSContext *ctx, JSObject *p, JSAtom prop, int prop_flags)
 
JSValue JS_ThrowOutOfMemory (JSContext *ctx)
 
static JSValue JS_ThrowTypeErrorRevokedProxy (JSContext *ctx)
 
static JSValue js_proxy_getPrototypeOf (JSContext *ctx, JSValueConst obj)
 
static int js_proxy_setPrototypeOf (JSContext *ctx, JSValueConst obj, JSValueConst proto_val, BOOL throw_flag)
 
static int js_proxy_isExtensible (JSContext *ctx, JSValueConst obj)
 
static int js_proxy_preventExtensions (JSContext *ctx, JSValueConst obj)
 
static int js_proxy_isArray (JSContext *ctx, JSValueConst obj)
 
static int JS_CreateProperty (JSContext *ctx, JSObject *p, JSAtom prop, JSValueConst val, JSValueConst getter, JSValueConst setter, int flags)
 
static int js_string_memcmp (const JSString *p1, const JSString *p2, int len)
 
static void reset_weak_ref (JSRuntime *rt, JSObject *p)
 
static JSValue js_array_buffer_constructor3 (JSContext *ctx, JSValueConst new_target, uint64_t len, JSClassID class_id, uint8_t *buf, JSFreeArrayBufferDataFunc *free_func, void *opaque, BOOL alloc_flag)
 
static JSArrayBufferjs_get_array_buffer (JSContext *ctx, JSValueConst obj)
 
static JSValue js_typed_array_constructor (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int classid)
 
static BOOL typed_array_is_detached (JSContext *ctx, JSObject *p)
 
static uint32_t typed_array_get_length (JSContext *ctx, JSObject *p)
 
static JSValue JS_ThrowTypeErrorDetachedArrayBuffer (JSContext *ctx)
 
static JSVarRefget_var_ref (JSContext *ctx, JSStackFrame *sf, int var_idx, BOOL is_arg)
 
static JSValue js_generator_function_call (JSContext *ctx, JSValueConst func_obj, JSValueConst this_obj, int argc, JSValueConst *argv, int flags)
 
static void js_async_function_resolve_finalizer (JSRuntime *rt, JSValue val)
 
static void js_async_function_resolve_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue JS_EvalInternal (JSContext *ctx, JSValueConst this_obj, const char *input, size_t input_len, const char *filename, int flags, int scope_idx)
 
static void js_free_module_def (JSContext *ctx, JSModuleDef *m)
 
static void js_mark_module_def (JSRuntime *rt, JSModuleDef *m, JS_MarkFunc *mark_func)
 
static JSValue js_import_meta (JSContext *ctx)
 
static JSValue js_dynamic_import (JSContext *ctx, JSValueConst specifier)
 
static void free_var_ref (JSRuntime *rt, JSVarRef *var_ref)
 
static JSValue js_new_promise_capability (JSContext *ctx, JSValue *resolving_funcs, JSValueConst ctor)
 
static __exception int perform_promise_then (JSContext *ctx, JSValueConst promise, JSValueConst *resolve_reject, JSValueConst *cap_resolving_funcs)
 
static JSValue js_promise_resolve (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static int js_string_compare (JSContext *ctx, const JSString *p1, const JSString *p2)
 
static JSValue JS_ToNumber (JSContext *ctx, JSValueConst val)
 
static int JS_SetPropertyValue (JSContext *ctx, JSValueConst this_obj, JSValue prop, JSValue val, int flags)
 
static int JS_NumberIsInteger (JSContext *ctx, JSValueConst val)
 
static BOOL JS_NumberIsNegativeOrMinusZero (JSContext *ctx, JSValueConst val)
 
static JSValue JS_ToNumberFree (JSContext *ctx, JSValue val)
 
static int JS_GetOwnPropertyInternal (JSContext *ctx, JSPropertyDescriptor *desc, JSObject *p, JSAtom prop)
 
static void js_free_desc (JSContext *ctx, JSPropertyDescriptor *desc)
 
static void async_func_mark (JSRuntime *rt, JSAsyncFunctionState *s, JS_MarkFunc *mark_func)
 
static void JS_AddIntrinsicBasicObjects (JSContext *ctx)
 
static void js_free_shape (JSRuntime *rt, JSShape *sh)
 
static void js_free_shape_null (JSRuntime *rt, JSShape *sh)
 
static int js_shape_prepare_update (JSContext *ctx, JSObject *p, JSShapeProperty **pprs)
 
static int init_shape_hash (JSRuntime *rt)
 
static __exception int js_get_length32 (JSContext *ctx, uint32_t *pres, JSValueConst obj)
 
static __exception int js_get_length64 (JSContext *ctx, int64_t *pres, JSValueConst obj)
 
static void free_arg_list (JSContext *ctx, JSValue *tab, uint32_t len)
 
static JSValuebuild_arg_list (JSContext *ctx, uint32_t *plen, JSValueConst array_arg)
 
static BOOL js_get_fast_array (JSContext *ctx, JSValueConst obj, JSValue **arrpp, uint32_t *countp)
 
static JSValue JS_CreateAsyncFromSyncIterator (JSContext *ctx, JSValueConst sync_iter)
 
static void js_c_function_data_finalizer (JSRuntime *rt, JSValue val)
 
static void js_c_function_data_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_c_function_data_call (JSContext *ctx, JSValueConst func_obj, JSValueConst this_val, int argc, JSValueConst *argv, int flags)
 
static JSAtom js_symbol_to_atom (JSContext *ctx, JSValue val)
 
static void add_gc_object (JSRuntime *rt, JSGCObjectHeader *h, JSGCObjectTypeEnum type)
 
static void remove_gc_object (JSGCObjectHeader *h)
 
static void js_async_function_free0 (JSRuntime *rt, JSAsyncFunctionData *s)
 
static JSValue js_instantiate_prototype (JSContext *ctx, JSObject *p, JSAtom atom, void *opaque)
 
static JSValue js_module_ns_autoinit (JSContext *ctx, JSObject *p, JSAtom atom, void *opaque)
 
static JSValue JS_InstantiateFunctionListItem2 (JSContext *ctx, JSObject *p, JSAtom atom, void *opaque)
 
void JS_SetUncatchableError (JSContext *ctx, JSValueConst val, BOOL flag)
 
static void js_trigger_gc (JSRuntime *rt, size_t size)
 
static size_t js_malloc_usable_size_unknown (const void *ptr)
 
void * js_malloc_rt (JSRuntime *rt, size_t size)
 
void js_free_rt (JSRuntime *rt, void *ptr)
 
void * js_realloc_rt (JSRuntime *rt, void *ptr, size_t size)
 
size_t js_malloc_usable_size_rt (JSRuntime *rt, const void *ptr)
 
void * js_mallocz_rt (JSRuntime *rt, size_t size)
 
void * js_malloc (JSContext *ctx, size_t size)
 
void * js_mallocz (JSContext *ctx, size_t size)
 
void js_free (JSContext *ctx, void *ptr)
 
void * js_realloc (JSContext *ctx, void *ptr, size_t size)
 
void * js_realloc2 (JSContext *ctx, void *ptr, size_t size, size_t *pslack)
 
size_t js_malloc_usable_size (JSContext *ctx, const void *ptr)
 
char * js_strndup (JSContext *ctx, const char *s, size_t n)
 
char * js_strdup (JSContext *ctx, const char *str)
 
static no_inline int js_realloc_array (JSContext *ctx, void **parray, int elem_size, int *psize, int req_size)
 
static int js_resize_array (JSContext *ctx, void **parray, int elem_size, int *psize, int req_size)
 
static void js_dbuf_init (JSContext *ctx, DynBuf *s)
 
static int is_digit (int c)
 
static int init_class_range (JSRuntime *rt, JSClassShortDef const *tab, int start, int count)
 
static uintptr_t js_get_stack_pointer (void)
 
static BOOL js_check_stack_overflow (JSRuntime *rt, size_t alloca_size)
 
JSRuntimeJS_NewRuntime2 (const JSMallocFunctions *mf, void *opaque)
 
void * JS_GetRuntimeOpaque (JSRuntime *rt)
 
void JS_SetRuntimeOpaque (JSRuntime *rt, void *opaque)
 
static size_t js_def_malloc_usable_size (void *ptr)
 
static void * js_def_malloc (JSMallocState *s, size_t size)
 
static void js_def_free (JSMallocState *s, void *ptr)
 
static void * js_def_realloc (JSMallocState *s, void *ptr, size_t size)
 
JSRuntimeJS_NewRuntime (void)
 
void JS_SetMemoryLimit (JSRuntime *rt, size_t limit)
 
void JS_SetGCThreshold (JSRuntime *rt, size_t gc_threshold)
 
void JS_SetInterruptHandler (JSRuntime *rt, JSInterruptHandler *cb, void *opaque)
 
void JS_SetCanBlock (JSRuntime *rt, BOOL can_block)
 
void JS_SetSharedArrayBufferFunctions (JSRuntime *rt, const JSSharedArrayBufferFunctions *sf)
 
int JS_EnqueueJob (JSContext *ctx, JSJobFunc *job_func, int argc, JSValueConst *argv)
 
BOOL JS_IsJobPending (JSRuntime *rt)
 
int JS_ExecutePendingJob (JSRuntime *rt, JSContext **pctx)
 
static uint32_t atom_get_free (const JSAtomStruct *p)
 
static BOOL atom_is_free (const JSAtomStruct *p)
 
static JSAtomStruct * atom_set_free (uint32_t v)
 
static JSStringjs_alloc_string_rt (JSRuntime *rt, int max_len, int is_wide_char)
 
static JSStringjs_alloc_string (JSContext *ctx, int max_len, int is_wide_char)
 
static void js_free_string (JSRuntime *rt, JSString *str)
 
void JS_SetRuntimeInfo (JSRuntime *rt, const char *s)
 
void JS_FreeRuntime (JSRuntime *rt)
 
JSContextJS_NewContextRaw (JSRuntime *rt)
 
JSContextJS_NewContext (JSRuntime *rt)
 
void * JS_GetContextOpaque (JSContext *ctx)
 
void JS_SetContextOpaque (JSContext *ctx, void *opaque)
 
static void set_value (JSContext *ctx, JSValue *pval, JSValue new_val)
 
void JS_SetClassProto (JSContext *ctx, JSClassID class_id, JSValue obj)
 
JSValue JS_GetClassProto (JSContext *ctx, JSClassID class_id)
 
static void js_free_modules (JSContext *ctx, JSFreeModuleEnum flag)
 
JSContextJS_DupContext (JSContext *ctx)
 
static void JS_MarkContext (JSRuntime *rt, JSContext *ctx, JS_MarkFunc *mark_func)
 
void JS_FreeContext (JSContext *ctx)
 
JSRuntimeJS_GetRuntime (JSContext *ctx)
 
static void update_stack_limit (JSRuntime *rt)
 
void JS_SetMaxStackSize (JSRuntime *rt, size_t stack_size)
 
void JS_UpdateStackTop (JSRuntime *rt)
 
static BOOL is_strict_mode (JSContext *ctx)
 
static BOOL __JS_AtomIsConst (JSAtom v)
 
static BOOL __JS_AtomIsTaggedInt (JSAtom v)
 
static JSAtom __JS_AtomFromUInt32 (uint32_t v)
 
static uint32_t __JS_AtomToUInt32 (JSAtom atom)
 
static int is_num (int c)
 
static BOOL is_num_string (uint32_t *pval, const JSString *p)
 
static uint32_t hash_string8 (const uint8_t *str, size_t len, uint32_t h)
 
static uint32_t hash_string16 (const uint16_t *str, size_t len, uint32_t h)
 
static uint32_t hash_string (const JSString *str, uint32_t h)
 
static __maybe_unused void JS_DumpString (JSRuntime *rt, const JSString *p)
 
static __maybe_unused void JS_DumpAtoms (JSRuntime *rt)
 
static int JS_ResizeAtomHash (JSRuntime *rt, int new_hash_size)
 
static JSAtom JS_DupAtomRT (JSRuntime *rt, JSAtom v)
 
JSAtom JS_DupAtom (JSContext *ctx, JSAtom v)
 
static JSAtomKindEnum JS_AtomGetKind (JSContext *ctx, JSAtom v)
 
static BOOL JS_AtomIsString (JSContext *ctx, JSAtom v)
 
static JSAtom js_get_atom_index (JSRuntime *rt, JSAtomStruct *p)
 
static JSAtom __JS_NewAtom (JSRuntime *rt, JSString *str, int atom_type)
 
static JSAtom __JS_FindAtom (JSRuntime *rt, const char *str, size_t len, int atom_type)
 
static void __JS_FreeAtom (JSRuntime *rt, uint32_t i)
 
static JSAtom JS_NewAtomStr (JSContext *ctx, JSString *p)
 
JSAtom JS_NewAtomLen (JSContext *ctx, const char *str, size_t len)
 
JSAtom JS_NewAtom (JSContext *ctx, const char *str)
 
JSAtom JS_NewAtomUInt32 (JSContext *ctx, uint32_t n)
 
static JSAtom JS_NewAtomInt64 (JSContext *ctx, int64_t n)
 
static JSValue JS_NewSymbol (JSContext *ctx, JSString *p, int atom_type)
 
static JSValue JS_NewSymbolFromAtom (JSContext *ctx, JSAtom descr, int atom_type)
 
static const char * JS_AtomGetStrRT (JSRuntime *rt, char *buf, int buf_size, JSAtom atom)
 
static const char * JS_AtomGetStr (JSContext *ctx, char *buf, int buf_size, JSAtom atom)
 
static JSValue __JS_AtomToValue (JSContext *ctx, JSAtom atom, BOOL force_string)
 
JSValue JS_AtomToValue (JSContext *ctx, JSAtom atom)
 
JSValue JS_AtomToString (JSContext *ctx, JSAtom atom)
 
BOOL JS_AtomIsArrayIndex (JSContext *ctx, uint32_t *pval, JSAtom atom)
 
static JSValue JS_AtomIsNumericIndex1 (JSContext *ctx, JSAtom atom)
 
static int JS_AtomIsNumericIndex (JSContext *ctx, JSAtom atom)
 
void JS_FreeAtom (JSContext *ctx, JSAtom v)
 
void JS_FreeAtomRT (JSRuntime *rt, JSAtom v)
 
static BOOL JS_AtomSymbolHasDescription (JSContext *ctx, JSAtom v)
 
static __maybe_unused void print_atom (JSContext *ctx, JSAtom atom)
 
const char * JS_AtomToCString (JSContext *ctx, JSAtom atom)
 
static JSAtom js_atom_concat_str (JSContext *ctx, JSAtom name, const char *str1)
 
static JSAtom js_atom_concat_num (JSContext *ctx, JSAtom name, uint32_t n)
 
static BOOL JS_IsEmptyString (JSValueConst v)
 
JSClassID JS_NewClassID (JSClassID *pclass_id)
 
BOOL JS_IsRegisteredClass (JSRuntime *rt, JSClassID class_id)
 
static int JS_NewClass1 (JSRuntime *rt, JSClassID class_id, const JSClassDef *class_def, JSAtom name)
 
int JS_NewClass (JSRuntime *rt, JSClassID class_id, const JSClassDef *class_def)
 
static JSValue js_new_string8 (JSContext *ctx, const uint8_t *buf, int len)
 
static JSValue js_new_string16 (JSContext *ctx, const uint16_t *buf, int len)
 
static JSValue js_new_string_char (JSContext *ctx, uint16_t c)
 
static JSValue js_sub_string (JSContext *ctx, JSString *p, int start, int end)
 
static int string_buffer_init2 (JSContext *ctx, StringBuffer *s, int size, int is_wide)
 
static int string_buffer_init (JSContext *ctx, StringBuffer *s, int size)
 
static void string_buffer_free (StringBuffer *s)
 
static int string_buffer_set_error (StringBuffer *s)
 
static no_inline int string_buffer_widen (StringBuffer *s, int size)
 
static no_inline int string_buffer_realloc (StringBuffer *s, int new_len, int c)
 
static no_inline int string_buffer_putc_slow (StringBuffer *s, uint32_t c)
 
static int string_buffer_putc8 (StringBuffer *s, uint32_t c)
 
static int string_buffer_putc16 (StringBuffer *s, uint32_t c)
 
static int string_buffer_putc (StringBuffer *s, uint32_t c)
 
static int string_get (const JSString *p, int idx)
 
static int string_getc (const JSString *p, int *pidx)
 
static int string_buffer_write8 (StringBuffer *s, const uint8_t *p, int len)
 
static int string_buffer_write16 (StringBuffer *s, const uint16_t *p, int len)
 
static int string_buffer_puts8 (StringBuffer *s, const char *str)
 
static int string_buffer_concat (StringBuffer *s, const JSString *p, uint32_t from, uint32_t to)
 
static int string_buffer_concat_value (StringBuffer *s, JSValueConst v)
 
static int string_buffer_concat_value_free (StringBuffer *s, JSValue v)
 
static int string_buffer_fill (StringBuffer *s, int c, int count)
 
static JSValue string_buffer_end (StringBuffer *s)
 
JSValue JS_NewStringLen (JSContext *ctx, const char *buf, size_t buf_len)
 
static JSValue JS_ConcatString3 (JSContext *ctx, const char *str1, JSValue str2, const char *str3)
 
JSValue JS_NewString (JSContext *ctx, const char *str)
 
JSValue JS_NewAtomString (JSContext *ctx, const char *str)
 
const char * JS_ToCStringLen2 (JSContext *ctx, size_t *plen, JSValueConst val1, BOOL cesu8)
 
void JS_FreeCString (JSContext *ctx, const char *ptr)
 
static int memcmp16_8 (const uint16_t *src1, const uint8_t *src2, int len)
 
static int memcmp16 (const uint16_t *src1, const uint16_t *src2, int len)
 
static void copy_str16 (uint16_t *dst, const JSString *p, int offset, int len)
 
static JSValue JS_ConcatString1 (JSContext *ctx, const JSString *p1, const JSString *p2)
 
static JSValue JS_ConcatString (JSContext *ctx, JSValue op1, JSValue op2)
 
static size_t get_shape_size (size_t hash_size, size_t prop_size)
 
static JSShapeget_shape_from_alloc (void *sh_alloc, size_t hash_size)
 
static uint32_tprop_hash_end (JSShape *sh)
 
static void * get_alloc_from_shape (JSShape *sh)
 
static JSShapePropertyget_shape_prop (JSShape *sh)
 
static uint32_t shape_hash (uint32_t h, uint32_t val)
 
static uint32_t get_shape_hash (uint32_t h, int hash_bits)
 
static uint32_t shape_initial_hash (JSObject *proto)
 
static int resize_shape_hash (JSRuntime *rt, int new_shape_hash_bits)
 
static void js_shape_hash_link (JSRuntime *rt, JSShape *sh)
 
static void js_shape_hash_unlink (JSRuntime *rt, JSShape *sh)
 
static no_inline JSShapejs_new_shape2 (JSContext *ctx, JSObject *proto, int hash_size, int prop_size)
 
static JSShapejs_new_shape (JSContext *ctx, JSObject *proto)
 
static JSShapejs_clone_shape (JSContext *ctx, JSShape *sh1)
 
static JSShapejs_dup_shape (JSShape *sh)
 
static void js_free_shape0 (JSRuntime *rt, JSShape *sh)
 
static no_inline int resize_properties (JSContext *ctx, JSShape **psh, JSObject *p, uint32_t count)
 
static int compact_properties (JSContext *ctx, JSObject *p)
 
static int add_shape_property (JSContext *ctx, JSShape **psh, JSObject *p, JSAtom atom, int prop_flags)
 
static JSShapefind_hashed_shape_proto (JSRuntime *rt, JSObject *proto)
 
static JSShapefind_hashed_shape_prop (JSRuntime *rt, JSShape *sh, JSAtom atom, int prop_flags)
 
static __maybe_unused void JS_DumpShape (JSRuntime *rt, int i, JSShape *sh)
 
static __maybe_unused void JS_DumpShapes (JSRuntime *rt)
 
static JSValue JS_NewObjectFromShape (JSContext *ctx, JSShape *sh, JSClassID class_id)
 
static JSObjectget_proto_obj (JSValueConst proto_val)
 
JSValue JS_NewObjectProtoClass (JSContext *ctx, JSValueConst proto_val, JSClassID class_id)
 
static int JS_SetObjectData (JSContext *ctx, JSValueConst obj, JSValue val)
 
JSValue JS_NewObjectClass (JSContext *ctx, int class_id)
 
JSValue JS_NewObjectProto (JSContext *ctx, JSValueConst proto)
 
JSValue JS_NewArray (JSContext *ctx)
 
JSValue JS_NewObject (JSContext *ctx)
 
static void js_function_set_properties (JSContext *ctx, JSValueConst func_obj, JSAtom name, int len)
 
static BOOL js_class_has_bytecode (JSClassID class_id)
 
static JSFunctionBytecodeJS_GetFunctionBytecode (JSValueConst val)
 
static void js_method_set_home_object (JSContext *ctx, JSValueConst func_obj, JSValueConst home_obj)
 
static JSValue js_get_function_name (JSContext *ctx, JSAtom name)
 
static int js_method_set_properties (JSContext *ctx, JSValueConst func_obj, JSAtom name, int flags, JSValueConst home_obj)
 
static JSValue JS_NewCFunction3 (JSContext *ctx, JSCFunction *func, const char *name, int length, JSCFunctionEnum cproto, int magic, JSValueConst proto_val)
 
JSValue JS_NewCFunction2 (JSContext *ctx, JSCFunction *func, const char *name, int length, JSCFunctionEnum cproto, int magic)
 
JSValue JS_NewCFunctionData (JSContext *ctx, JSCFunctionData *func, int length, int magic, int data_len, JSValueConst *data)
 
static JSContextjs_autoinit_get_realm (JSProperty *pr)
 
static JSAutoInitIDEnum js_autoinit_get_id (JSProperty *pr)
 
static void js_autoinit_free (JSRuntime *rt, JSProperty *pr)
 
static void js_autoinit_mark (JSRuntime *rt, JSProperty *pr, JS_MarkFunc *mark_func)
 
static void free_property (JSRuntime *rt, JSProperty *pr, int prop_flags)
 
static force_inline JSShapePropertyfind_own_property1 (JSObject *p, JSAtom atom)
 
static force_inline JSShapePropertyfind_own_property (JSProperty **ppr, JSObject *p, JSAtom atom)
 
static void set_cycle_flag (JSContext *ctx, JSValueConst obj)
 
static void js_array_finalizer (JSRuntime *rt, JSValue val)
 
static void js_array_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static void js_object_data_finalizer (JSRuntime *rt, JSValue val)
 
static void js_object_data_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static void js_c_function_finalizer (JSRuntime *rt, JSValue val)
 
static void js_c_function_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static void js_bytecode_function_finalizer (JSRuntime *rt, JSValue val)
 
static void js_bytecode_function_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static void js_bound_function_finalizer (JSRuntime *rt, JSValue val)
 
static void js_bound_function_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static void js_for_in_iterator_finalizer (JSRuntime *rt, JSValue val)
 
static void js_for_in_iterator_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static void free_object (JSRuntime *rt, JSObject *p)
 
static void free_gc_object (JSRuntime *rt, JSGCObjectHeader *gp)
 
static void free_zero_refcount (JSRuntime *rt)
 
void __JS_FreeValueRT (JSRuntime *rt, JSValue v)
 
void __JS_FreeValue (JSContext *ctx, JSValue v)
 
void JS_MarkValue (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static void mark_children (JSRuntime *rt, JSGCObjectHeader *gp, JS_MarkFunc *mark_func)
 
static void gc_decref_child (JSRuntime *rt, JSGCObjectHeader *p)
 
static void gc_decref (JSRuntime *rt)
 
static void gc_scan_incref_child (JSRuntime *rt, JSGCObjectHeader *p)
 
static void gc_scan_incref_child2 (JSRuntime *rt, JSGCObjectHeader *p)
 
static void gc_scan (JSRuntime *rt)
 
static void gc_free_cycles (JSRuntime *rt)
 
void JS_RunGC (JSRuntime *rt)
 
BOOL JS_IsLiveObject (JSRuntime *rt, JSValueConst obj)
 
static void compute_value_size (JSValueConst val, JSMemoryUsage_helper *hp)
 
static void compute_jsstring_size (JSString *str, JSMemoryUsage_helper *hp)
 
static void compute_bytecode_size (JSFunctionBytecode *b, JSMemoryUsage_helper *hp)
 
void JS_ComputeMemoryUsage (JSRuntime *rt, JSMemoryUsage *s)
 
void JS_DumpMemoryUsage (FILE *fp, const JSMemoryUsage *s, JSRuntime *rt)
 
JSValue JS_GetGlobalObject (JSContext *ctx)
 
JSValue JS_Throw (JSContext *ctx, JSValue obj)
 
JSValue JS_GetException (JSContext *ctx)
 
static void dbuf_put_leb128 (DynBuf *s, uint32_t v)
 
static void dbuf_put_sleb128 (DynBuf *s, int32_t v1)
 
static int get_leb128 (uint32_t *pval, const uint8_t *buf, const uint8_t *buf_end)
 
static int get_sleb128 (int32_t *pval, const uint8_t *buf, const uint8_t *buf_end)
 
static int find_line_num (JSContext *ctx, JSFunctionBytecode *b, uint32_t pc_value)
 
static const char * get_func_name (JSContext *ctx, JSValueConst func)
 
static void build_backtrace (JSContext *ctx, JSValueConst error_obj, const char *filename, int line_num, int backtrace_flags)
 
static BOOL is_backtrace_needed (JSContext *ctx, JSValueConst obj)
 
JSValue JS_NewError (JSContext *ctx)
 
static JSValue JS_ThrowError2 (JSContext *ctx, JSErrorEnum error_num, const char *fmt, va_list ap, BOOL add_backtrace)
 
static JSValue JS_ThrowError (JSContext *ctx, JSErrorEnum error_num, const char *fmt, va_list ap)
 
static int __attribute__ ((format(printf, 3, 4)))
 
static int JS_ThrowTypeErrorReadOnly (JSContext *ctx, int flags, JSAtom atom)
 
static JSValue JS_ThrowStackOverflow (JSContext *ctx)
 
static JSValue JS_ThrowTypeErrorNotAnObject (JSContext *ctx)
 
static JSValue JS_ThrowTypeErrorNotASymbol (JSContext *ctx)
 
static JSValue JS_ThrowReferenceErrorNotDefined (JSContext *ctx, JSAtom name)
 
static JSValue JS_ThrowReferenceErrorUninitialized (JSContext *ctx, JSAtom name)
 
static JSValue JS_ThrowReferenceErrorUninitialized2 (JSContext *ctx, JSFunctionBytecode *b, int idx, BOOL is_ref)
 
static JSValue JS_ThrowTypeErrorInvalidClass (JSContext *ctx, int class_id)
 
static no_inline __exception int __js_poll_interrupts (JSContext *ctx)
 
static __exception int js_poll_interrupts (JSContext *ctx)
 
static int JS_SetPrototypeInternal (JSContext *ctx, JSValueConst obj, JSValueConst proto_val, BOOL throw_flag)
 
int JS_SetPrototype (JSContext *ctx, JSValueConst obj, JSValueConst proto_val)
 
static JSValueConst JS_GetPrototypePrimitive (JSContext *ctx, JSValueConst val)
 
JSValue JS_GetPrototype (JSContext *ctx, JSValueConst obj)
 
static JSValue JS_GetPrototypeFree (JSContext *ctx, JSValue obj)
 
static int JS_OrdinaryIsInstanceOf (JSContext *ctx, JSValueConst val, JSValueConst obj)
 
int JS_IsInstanceOf (JSContext *ctx, JSValueConst val, JSValueConst obj)
 
static int JS_AutoInitProperty (JSContext *ctx, JSObject *p, JSAtom prop, JSProperty *pr, JSShapeProperty *prs)
 
JSValue JS_GetPropertyInternal (JSContext *ctx, JSValueConst obj, JSAtom prop, JSValueConst this_obj, BOOL throw_ref_error)
 
static JSValue JS_ThrowTypeErrorPrivateNotFound (JSContext *ctx, JSAtom atom)
 
static int JS_DefinePrivateField (JSContext *ctx, JSValueConst obj, JSValueConst name, JSValue val)
 
static JSValue JS_GetPrivateField (JSContext *ctx, JSValueConst obj, JSValueConst name)
 
static int JS_SetPrivateField (JSContext *ctx, JSValueConst obj, JSValueConst name, JSValue val)
 
static int JS_AddBrand (JSContext *ctx, JSValueConst obj, JSValueConst home_obj)
 
static int JS_CheckBrand (JSContext *ctx, JSValueConst obj, JSValueConst func)
 
static uint32_t js_string_obj_get_length (JSContext *ctx, JSValueConst obj)
 
static int num_keys_cmp (const void *p1, const void *p2, void *opaque)
 
static void js_free_prop_enum (JSContext *ctx, JSPropertyEnum *tab, uint32_t len)
 
static int __exception JS_GetOwnPropertyNamesInternal (JSContext *ctx, JSPropertyEnum **ptab, uint32_t *plen, JSObject *p, int flags)
 
int JS_GetOwnPropertyNames (JSContext *ctx, JSPropertyEnum **ptab, uint32_t *plen, JSValueConst obj, int flags)
 
int JS_GetOwnProperty (JSContext *ctx, JSPropertyDescriptor *desc, JSValueConst obj, JSAtom prop)
 
int JS_IsExtensible (JSContext *ctx, JSValueConst obj)
 
int JS_PreventExtensions (JSContext *ctx, JSValueConst obj)
 
int JS_HasProperty (JSContext *ctx, JSValueConst obj, JSAtom prop)
 
JSAtom JS_ValueToAtom (JSContext *ctx, JSValueConst val)
 
static JSValue JS_GetPropertyValue (JSContext *ctx, JSValueConst this_obj, JSValue prop)
 
JSValue JS_GetPropertyUint32 (JSContext *ctx, JSValueConst this_obj, uint32_t idx)
 
static int JS_TryGetPropertyInt64 (JSContext *ctx, JSValueConst obj, int64_t idx, JSValue *pval)
 
static JSValue JS_GetPropertyInt64 (JSContext *ctx, JSValueConst obj, int64_t idx)
 
JSValue JS_GetPropertyStr (JSContext *ctx, JSValueConst this_obj, const char *prop)
 
static no_inline __exception int convert_fast_array_to_array (JSContext *ctx, JSObject *p)
 
static int delete_property (JSContext *ctx, JSObject *p, JSAtom atom)
 
static int call_setter (JSContext *ctx, JSObject *setter, JSValueConst this_obj, JSValue val, int flags)
 
static int set_array_length (JSContext *ctx, JSObject *p, JSValue val, int flags)
 
static int expand_fast_array (JSContext *ctx, JSObject *p, uint32_t new_len)
 
static int add_fast_array_element (JSContext *ctx, JSObject *p, JSValue val, int flags)
 
static int JS_SetPropertyGeneric (JSContext *ctx, JSValueConst obj, JSAtom prop, JSValue val, JSValueConst this_obj, int flags)
 
int JS_SetPropertyInternal (JSContext *ctx, JSValueConst this_obj, JSAtom prop, JSValue val, int flags)
 
int JS_SetPropertyUint32 (JSContext *ctx, JSValueConst this_obj, uint32_t idx, JSValue val)
 
int JS_SetPropertyInt64 (JSContext *ctx, JSValueConst this_obj, int64_t idx, JSValue val)
 
int JS_SetPropertyStr (JSContext *ctx, JSValueConst this_obj, const char *prop, JSValue val)
 
static int get_prop_flags (int flags, int def_flags)
 
static BOOL check_define_prop_flags (int prop_flags, int flags)
 
static int js_update_property_flags (JSContext *ctx, JSObject *p, JSShapeProperty **pprs, int flags)
 
int JS_DefineProperty (JSContext *ctx, JSValueConst this_obj, JSAtom prop, JSValueConst val, JSValueConst getter, JSValueConst setter, int flags)
 
static int JS_DefineAutoInitProperty (JSContext *ctx, JSValueConst this_obj, JSAtom prop, JSAutoInitIDEnum id, void *opaque, int flags)
 
int JS_DefinePropertyValue (JSContext *ctx, JSValueConst this_obj, JSAtom prop, JSValue val, int flags)
 
int JS_DefinePropertyValueValue (JSContext *ctx, JSValueConst this_obj, JSValue prop, JSValue val, int flags)
 
int JS_DefinePropertyValueUint32 (JSContext *ctx, JSValueConst this_obj, uint32_t idx, JSValue val, int flags)
 
int JS_DefinePropertyValueInt64 (JSContext *ctx, JSValueConst this_obj, int64_t idx, JSValue val, int flags)
 
int JS_DefinePropertyValueStr (JSContext *ctx, JSValueConst this_obj, const char *prop, JSValue val, int flags)
 
int JS_DefinePropertyGetSet (JSContext *ctx, JSValueConst this_obj, JSAtom prop, JSValue getter, JSValue setter, int flags)
 
static int JS_CreateDataPropertyUint32 (JSContext *ctx, JSValueConst this_obj, int64_t idx, JSValue val, int flags)
 
static BOOL js_object_has_name (JSContext *ctx, JSValueConst obj)
 
static int JS_DefineObjectName (JSContext *ctx, JSValueConst obj, JSAtom name, int flags)
 
static int JS_DefineObjectNameComputed (JSContext *ctx, JSValueConst obj, JSValueConst str, int flags)
 
static JSValue JS_ThrowSyntaxErrorVarRedeclaration (JSContext *ctx, JSAtom prop)
 
static int JS_CheckDefineGlobalVar (JSContext *ctx, JSAtom prop, int flags)
 
static int JS_DefineGlobalVar (JSContext *ctx, JSAtom prop, int def_flags)
 
static int JS_DefineGlobalFunction (JSContext *ctx, JSAtom prop, JSValueConst func, int def_flags)
 
static JSValue JS_GetGlobalVar (JSContext *ctx, JSAtom prop, BOOL throw_ref_error)
 
static int JS_GetGlobalVarRef (JSContext *ctx, JSAtom prop, JSValue *sp)
 
static int JS_CheckGlobalVar (JSContext *ctx, JSAtom prop)
 
static int JS_SetGlobalVar (JSContext *ctx, JSAtom prop, JSValue val, int flag)
 
int JS_DeleteProperty (JSContext *ctx, JSValueConst obj, JSAtom prop, int flags)
 
int JS_DeletePropertyInt64 (JSContext *ctx, JSValueConst obj, int64_t idx, int flags)
 
BOOL JS_IsFunction (JSContext *ctx, JSValueConst val)
 
BOOL JS_IsCFunction (JSContext *ctx, JSValueConst val, JSCFunction *func, int magic)
 
BOOL JS_IsConstructor (JSContext *ctx, JSValueConst val)
 
BOOL JS_SetConstructorBit (JSContext *ctx, JSValueConst func_obj, BOOL val)
 
BOOL JS_IsError (JSContext *ctx, JSValueConst val)
 
BOOL JS_IsUncatchableError (JSContext *ctx, JSValueConst val)
 
void JS_ResetUncatchableError (JSContext *ctx)
 
void JS_SetOpaque (JSValue obj, void *opaque)
 
void * JS_GetOpaque (JSValueConst obj, JSClassID class_id)
 
void * JS_GetOpaque2 (JSContext *ctx, JSValueConst obj, JSClassID class_id)
 
void * JS_GetOpaque_Nocheck (JSValueConst obj)
 
static JSValue JS_ToPrimitiveFree (JSContext *ctx, JSValue val, int hint)
 
static JSValue JS_ToPrimitive (JSContext *ctx, JSValueConst val, int hint)
 
void JS_SetIsHTMLDDA (JSContext *ctx, JSValueConst obj)
 
static BOOL JS_IsHTMLDDA (JSContext *ctx, JSValueConst obj)
 
static int JS_ToBoolFree (JSContext *ctx, JSValue val)
 
int JS_ToBool (JSContext *ctx, JSValueConst val)
 
static int skip_spaces (const char *pc)
 
static int to_digit (int c)
 
static double js_strtod (const char *p, int radix, BOOL is_float)
 
static JSValue js_atof (JSContext *ctx, const char *str, const char **pp, int radix, int flags)
 
static JSValue JS_ToNumberHintFree (JSContext *ctx, JSValue val, JSToNumberHintEnum flag)
 
static JSValue JS_ToNumericFree (JSContext *ctx, JSValue val)
 
static JSValue JS_ToNumeric (JSContext *ctx, JSValueConst val)
 
static __exception int __JS_ToFloat64Free (JSContext *ctx, double *pres, JSValue val)
 
static int JS_ToFloat64Free (JSContext *ctx, double *pres, JSValue val)
 
int JS_ToFloat64 (JSContext *ctx, double *pres, JSValueConst val)
 
static __maybe_unused JSValue JS_ToIntegerFree (JSContext *ctx, JSValue val)
 
static int JS_ToInt32SatFree (JSContext *ctx, int *pres, JSValue val)
 
int JS_ToInt32Sat (JSContext *ctx, int *pres, JSValueConst val)
 
int JS_ToInt32Clamp (JSContext *ctx, int *pres, JSValueConst val, int min, int max, int min_offset)
 
static int JS_ToInt64SatFree (JSContext *ctx, int64_t *pres, JSValue val)
 
int JS_ToInt64Sat (JSContext *ctx, int64_t *pres, JSValueConst val)
 
int JS_ToInt64Clamp (JSContext *ctx, int64_t *pres, JSValueConst val, int64_t min, int64_t max, int64_t neg_offset)
 
static int JS_ToInt64Free (JSContext *ctx, int64_t *pres, JSValue val)
 
int JS_ToInt64 (JSContext *ctx, int64_t *pres, JSValueConst val)
 
int JS_ToInt64Ext (JSContext *ctx, int64_t *pres, JSValueConst val)
 
static int JS_ToInt32Free (JSContext *ctx, int32_t *pres, JSValue val)
 
int JS_ToInt32 (JSContext *ctx, int32_t *pres, JSValueConst val)
 
static int JS_ToUint32Free (JSContext *ctx, uint32_t *pres, JSValue val)
 
static int JS_ToUint8ClampFree (JSContext *ctx, int32_t *pres, JSValue val)
 
static BOOL is_safe_integer (double d)
 
int JS_ToIndex (JSContext *ctx, uint64_t *plen, JSValueConst val)
 
static __exception int JS_ToLengthFree (JSContext *ctx, int64_t *plen, JSValue val)
 
static char * i64toa (char *buf_end, int64_t n, unsigned int base)
 
static void js_ecvt1 (double d, int n_digits, int *decpt, int *sign, char *buf, int rounding_mode, char *buf1, int buf1_size)
 
static int js_ecvt (double d, int n_digits, int *decpt, int *sign, char *buf, BOOL is_fixed)
 
static int js_fcvt1 (char *buf, int buf_size, double d, int n_digits, int rounding_mode)
 
static void js_fcvt (char *buf, int buf_size, double d, int n_digits)
 
static void js_dtoa1 (char *buf, double d, int radix, int n_digits, int flags)
 
static JSValue js_dtoa (JSContext *ctx, double d, int radix, int n_digits, int flags)
 
JSValue JS_ToStringInternal (JSContext *ctx, JSValueConst val, BOOL is_ToPropertyKey)
 
JSValue JS_ToString (JSContext *ctx, JSValueConst val)
 
static JSValue JS_ToStringFree (JSContext *ctx, JSValue val)
 
static JSValue JS_ToLocaleStringFree (JSContext *ctx, JSValue val)
 
JSValue JS_ToPropertyKey (JSContext *ctx, JSValueConst val)
 
static JSValue JS_ToStringCheckObject (JSContext *ctx, JSValueConst val)
 
static JSValue JS_ToQuotedString (JSContext *ctx, JSValueConst val1)
 
static __maybe_unused void JS_DumpObjectHeader (JSRuntime *rt)
 
static __maybe_unused void JS_DumpObject (JSRuntime *rt, JSObject *p)
 
static __maybe_unused void JS_DumpGCObject (JSRuntime *rt, JSGCObjectHeader *p)
 
static __maybe_unused void JS_DumpValueShort (JSRuntime *rt, JSValueConst val)
 
static __maybe_unused void JS_DumpValue (JSContext *ctx, JSValueConst val)
 
static __maybe_unused void JS_PrintValue (JSContext *ctx, const char *str, JSValueConst val)
 
int JS_IsArray (JSContext *ctx, JSValueConst val)
 
static double js_pow (double a, double b)
 
static JSValue JS_ThrowUnsupportedBigint (JSContext *ctx)
 
JSValue JS_NewBigInt64 (JSContext *ctx, int64_t v)
 
JSValue JS_NewBigUint64 (JSContext *ctx, uint64_t v)
 
int JS_ToBigInt64 (JSContext *ctx, int64_t *pres, JSValueConst val)
 
static no_inline __exception int js_unary_arith_slow (JSContext *ctx, JSValue *sp, OPCodeEnum op)
 
static __exception int js_post_inc_slow (JSContext *ctx, JSValue *sp, OPCodeEnum op)
 
static no_inline __exception int js_binary_arith_slow (JSContext *ctx, JSValue *sp, OPCodeEnum op)
 
static no_inline __exception int js_add_slow (JSContext *ctx, JSValue *sp)
 
static no_inline __exception int js_binary_logic_slow (JSContext *ctx, JSValue *sp, OPCodeEnum op)
 
static no_inline int js_not_slow (JSContext *ctx, JSValue *sp)
 
static no_inline int js_relational_slow (JSContext *ctx, JSValue *sp, OPCodeEnum op)
 
static no_inline __exception int js_eq_slow (JSContext *ctx, JSValue *sp, BOOL is_neq)
 
static no_inline int js_shr_slow (JSContext *ctx, JSValue *sp)
 
static no_inline int js_strict_eq_slow (JSContext *ctx, JSValue *sp, BOOL is_neq)
 
static __exception int js_operator_in (JSContext *ctx, JSValue *sp)
 
static __exception int js_has_unscopable (JSContext *ctx, JSValueConst obj, JSAtom atom)
 
static __exception int js_operator_instanceof (JSContext *ctx, JSValue *sp)
 
static __exception int js_operator_typeof (JSContext *ctx, JSValueConst op1)
 
static __exception int js_operator_delete (JSContext *ctx, JSValue *sp)
 
static JSValue js_throw_type_error (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_function_proto_caller (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_function_proto_fileName (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_function_proto_lineNumber (JSContext *ctx, JSValueConst this_val)
 
static int js_arguments_define_own_property (JSContext *ctx, JSValueConst this_obj, JSAtom prop, JSValueConst val, JSValueConst getter, JSValueConst setter, int flags)
 
static JSValue js_build_arguments (JSContext *ctx, int argc, JSValueConst *argv)
 
static JSValue js_build_mapped_arguments (JSContext *ctx, int argc, JSValueConst *argv, JSStackFrame *sf, int arg_count)
 
static JSValue js_build_rest (JSContext *ctx, int first, int argc, JSValueConst *argv)
 
static JSValue build_for_in_iterator (JSContext *ctx, JSValue obj)
 
static __exception int js_for_in_start (JSContext *ctx, JSValue *sp)
 
static __exception int js_for_in_next (JSContext *ctx, JSValue *sp)
 
static JSValue JS_GetIterator2 (JSContext *ctx, JSValueConst obj, JSValueConst method)
 
static JSValue JS_GetIterator (JSContext *ctx, JSValueConst obj, BOOL is_async)
 
static JSValue JS_IteratorNext2 (JSContext *ctx, JSValueConst enum_obj, JSValueConst method, int argc, JSValueConst *argv, int *pdone)
 
static JSValue JS_IteratorNext (JSContext *ctx, JSValueConst enum_obj, JSValueConst method, int argc, JSValueConst *argv, BOOL *pdone)
 
static int JS_IteratorClose (JSContext *ctx, JSValueConst enum_obj, BOOL is_exception_pending)
 
static __exception int js_for_of_start (JSContext *ctx, JSValue *sp, BOOL is_async)
 
static __exception int js_for_of_next (JSContext *ctx, JSValue *sp, int offset)
 
static JSValue JS_IteratorGetCompleteValue (JSContext *ctx, JSValueConst obj, BOOL *pdone)
 
static __exception int js_iterator_get_value_done (JSContext *ctx, JSValue *sp)
 
static JSValue js_create_iterator_result (JSContext *ctx, JSValue val, BOOL done)
 
static JSValue js_array_iterator_next (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, BOOL *pdone, int magic)
 
static JSValue js_create_array_iterator (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static BOOL js_is_fast_array (JSContext *ctx, JSValueConst obj)
 
static __exception int js_append_enumerate (JSContext *ctx, JSValue *sp)
 
static __exception int JS_CopyDataProperties (JSContext *ctx, JSValueConst target, JSValueConst source, JSValueConst excluded, BOOL setprop)
 
static JSValueConst JS_GetActiveFunction (JSContext *ctx)
 
static JSValue js_closure2 (JSContext *ctx, JSValue func_obj, JSFunctionBytecode *b, JSVarRef **cur_var_refs, JSStackFrame *sf)
 
static JSValue js_closure (JSContext *ctx, JSValue bfunc, JSVarRef **cur_var_refs, JSStackFrame *sf)
 
static int js_op_define_class (JSContext *ctx, JSValue *sp, JSAtom class_name, int class_flags, JSVarRef **cur_var_refs, JSStackFrame *sf, BOOL is_computed_name)
 
static void close_var_refs (JSRuntime *rt, JSStackFrame *sf)
 
static void close_lexical_var (JSContext *ctx, JSStackFrame *sf, int idx, int is_arg)
 
JSValue JS_Call (JSContext *ctx, JSValueConst func_obj, JSValueConst this_obj, int argc, JSValueConst *argv)
 
static JSContextJS_GetFunctionRealm (JSContext *ctx, JSValueConst func_obj)
 
static JSValue js_create_from_ctor (JSContext *ctx, JSValueConst ctor, int class_id)
 
JSValue JS_CallConstructor2 (JSContext *ctx, JSValueConst func_obj, JSValueConst new_target, int argc, JSValueConst *argv)
 
JSValue JS_CallConstructor (JSContext *ctx, JSValueConst func_obj, int argc, JSValueConst *argv)
 
JSValue JS_Invoke (JSContext *ctx, JSValueConst this_val, JSAtom atom, int argc, JSValueConst *argv)
 
static __exception int async_func_init (JSContext *ctx, JSAsyncFunctionState *s, JSValueConst func_obj, JSValueConst this_obj, int argc, JSValueConst *argv)
 
static void async_func_free (JSRuntime *rt, JSAsyncFunctionState *s)
 
static JSValue async_func_resume (JSContext *ctx, JSAsyncFunctionState *s)
 
static void free_generator_stack_rt (JSRuntime *rt, JSGeneratorData *s)
 
static void js_generator_finalizer (JSRuntime *rt, JSValue obj)
 
static void free_generator_stack (JSContext *ctx, JSGeneratorData *s)
 
static void js_generator_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_generator_next (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, BOOL *pdone, int magic)
 
static void js_async_function_terminate (JSRuntime *rt, JSAsyncFunctionData *s)
 
static void js_async_function_free (JSRuntime *rt, JSAsyncFunctionData *s)
 
static int js_async_function_resolve_create (JSContext *ctx, JSAsyncFunctionData *s, JSValue *resolving_funcs)
 
static void js_async_function_resume (JSContext *ctx, JSAsyncFunctionData *s)
 
static JSValue js_async_function_resolve_call (JSContext *ctx, JSValueConst func_obj, JSValueConst this_obj, int argc, JSValueConst *argv, int flags)
 
static JSValue js_async_function_call (JSContext *ctx, JSValueConst func_obj, JSValueConst this_obj, int argc, JSValueConst *argv, int flags)
 
static void js_async_generator_free (JSRuntime *rt, JSAsyncGeneratorData *s)
 
static void js_async_generator_finalizer (JSRuntime *rt, JSValue obj)
 
static void js_async_generator_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_async_generator_resolve_function (JSContext *ctx, JSValueConst this_obj, int argc, JSValueConst *argv, int magic, JSValue *func_data)
 
static int js_async_generator_resolve_function_create (JSContext *ctx, JSValueConst generator, JSValue *resolving_funcs, BOOL is_resume_next)
 
static int js_async_generator_await (JSContext *ctx, JSAsyncGeneratorData *s, JSValueConst value)
 
static void js_async_generator_resolve_or_reject (JSContext *ctx, JSAsyncGeneratorData *s, JSValueConst result, int is_reject)
 
static void js_async_generator_resolve (JSContext *ctx, JSAsyncGeneratorData *s, JSValueConst value, BOOL done)
 
static void js_async_generator_reject (JSContext *ctx, JSAsyncGeneratorData *s, JSValueConst exception)
 
static void js_async_generator_complete (JSContext *ctx, JSAsyncGeneratorData *s)
 
static int js_async_generator_completed_return (JSContext *ctx, JSAsyncGeneratorData *s, JSValueConst value)
 
static void js_async_generator_resume_next (JSContext *ctx, JSAsyncGeneratorData *s)
 
static JSValue js_async_generator_next (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_async_generator_function_call (JSContext *ctx, JSValueConst func_obj, JSValueConst this_obj, int argc, JSValueConst *argv, int flags)
 
static __exception int next_token (JSParseState *s)
 
static void free_token (JSParseState *s, JSToken *token)
 
static void __maybe_unused dump_token (JSParseState *s, const JSToken *token)
 
static int js_parse_expect (JSParseState *s, int tok)
 
static int js_parse_expect_semi (JSParseState *s)
 
static int js_parse_error_reserved_identifier (JSParseState *s)
 
static __exception int js_parse_template_part (JSParseState *s, const uint8_t *p)
 
static __exception int js_parse_string (JSParseState *s, int sep, BOOL do_throw, const uint8_t *p, JSToken *token, const uint8_t **pp)
 
static BOOL token_is_pseudo_keyword (JSParseState *s, JSAtom atom)
 
static __exception int js_parse_regexp (JSParseState *s)
 
static __exception int ident_realloc (JSContext *ctx, char **pbuf, size_t *psize, char *static_buf)
 
static JSAtom parse_ident (JSParseState *s, const uint8_t **pp, BOOL *pident_has_escape, int c, BOOL is_private)
 
static JSAtom json_parse_ident (JSParseState *s, const uint8_t **pp, int c)
 
static __exception int json_next_token (JSParseState *s)
 
static int simple_next_token (const uint8_t **pp, BOOL no_line_terminator)
 
static int peek_token (JSParseState *s, BOOL no_line_terminator)
 
BOOL JS_DetectModule (const char *input, size_t input_len)
 
static int get_prev_opcode (JSFunctionDef *fd)
 
static BOOL js_is_live_code (JSParseState *s)
 
static void emit_u8 (JSParseState *s, uint8_t val)
 
static void emit_u16 (JSParseState *s, uint16_t val)
 
static void emit_u32 (JSParseState *s, uint32_t val)
 
static void emit_op (JSParseState *s, uint8_t val)
 
static void emit_atom (JSParseState *s, JSAtom name)
 
static int update_label (JSFunctionDef *s, int label, int delta)
 
static int new_label_fd (JSFunctionDef *fd, int label)
 
static int new_label (JSParseState *s)
 
static int emit_label (JSParseState *s, int label)
 
static int emit_goto (JSParseState *s, int opcode, int label)
 
static int cpool_add (JSParseState *s, JSValue val)
 
static __exception int emit_push_const (JSParseState *s, JSValueConst val, BOOL as_atom)
 
static int find_arg (JSContext *ctx, JSFunctionDef *fd, JSAtom name)
 
static int find_var (JSContext *ctx, JSFunctionDef *fd, JSAtom name)
 
static int find_var_in_scope (JSContext *ctx, JSFunctionDef *fd, JSAtom name, int scope_level)
 
static BOOL is_child_scope (JSContext *ctx, JSFunctionDef *fd, int scope, int parent_scope)
 
static int find_var_in_child_scope (JSContext *ctx, JSFunctionDef *fd, JSAtom name, int scope_level)
 
static JSGlobalVarfind_global_var (JSFunctionDef *fd, JSAtom name)
 
static JSGlobalVarfind_lexical_global_var (JSFunctionDef *fd, JSAtom name)
 
static int find_lexical_decl (JSContext *ctx, JSFunctionDef *fd, JSAtom name, int scope_idx, BOOL check_catch_var)
 
static int push_scope (JSParseState *s)
 
static int get_first_lexical_var (JSFunctionDef *fd, int scope)
 
static void pop_scope (JSParseState *s)
 
static void close_scopes (JSParseState *s, int scope, int scope_stop)
 
static int add_var (JSContext *ctx, JSFunctionDef *fd, JSAtom name)
 
static int add_scope_var (JSContext *ctx, JSFunctionDef *fd, JSAtom name, JSVarKindEnum var_kind)
 
static int add_func_var (JSContext *ctx, JSFunctionDef *fd, JSAtom name)
 
static int add_arguments_var (JSContext *ctx, JSFunctionDef *fd)
 
static int add_arguments_arg (JSContext *ctx, JSFunctionDef *fd)
 
static int add_arg (JSContext *ctx, JSFunctionDef *fd, JSAtom name)
 
static JSGlobalVaradd_global_var (JSContext *ctx, JSFunctionDef *s, JSAtom name)
 
static int define_var (JSParseState *s, JSFunctionDef *fd, JSAtom name, JSVarDefEnum var_def_type)
 
static int add_private_class_field (JSParseState *s, JSFunctionDef *fd, JSAtom name, JSVarKindEnum var_kind)
 
static __exception int js_parse_expr (JSParseState *s)
 
static __exception int js_parse_function_decl (JSParseState *s, JSParseFunctionEnum func_type, JSFunctionKindEnum func_kind, JSAtom func_name, const uint8_t *ptr, int start_line)
 
static JSFunctionDefjs_parse_function_class_fields_init (JSParseState *s)
 
static __exception int js_parse_function_decl2 (JSParseState *s, JSParseFunctionEnum func_type, JSFunctionKindEnum func_kind, JSAtom func_name, const uint8_t *ptr, int function_line_num, JSParseExportEnum export_flag, JSFunctionDef **pfd)
 
static __exception int js_parse_assign_expr2 (JSParseState *s, int parse_flags)
 
static __exception int js_parse_assign_expr (JSParseState *s)
 
static __exception int js_parse_unary (JSParseState *s, int parse_flags)
 
static void push_break_entry (JSFunctionDef *fd, BlockEnv *be, JSAtom label_name, int label_break, int label_cont, int drop_count)
 
static void pop_break_entry (JSFunctionDef *fd)
 
static JSExportEntryadd_export_entry (JSParseState *s, JSModuleDef *m, JSAtom local_name, JSAtom export_name, JSExportTypeEnum export_type)
 
static int seal_template_obj (JSContext *ctx, JSValueConst obj)
 
static __exception int js_parse_template (JSParseState *s, int call, int *argc)
 
static BOOL token_is_ident (int tok)
 
static int __exception js_parse_property_name (JSParseState *s, JSAtom *pname, BOOL allow_method, BOOL allow_var, BOOL allow_private)
 
static int js_parse_get_pos (JSParseState *s, JSParsePos *sp)
 
static __exception int js_parse_seek_token (JSParseState *s, const JSParsePos *sp)
 
static BOOL is_regexp_allowed (int tok)
 
static int js_parse_skip_parens_token (JSParseState *s, int *pbits, BOOL no_line_terminator)
 
static void set_object_name (JSParseState *s, JSAtom name)
 
static void set_object_name_computed (JSParseState *s)
 
static __exception int js_parse_object_literal (JSParseState *s)
 
static __exception int js_parse_postfix_expr (JSParseState *s, int parse_flags)
 
static __exception int js_parse_left_hand_side_expr (JSParseState *s)
 
static __exception int js_parse_class_default_ctor (JSParseState *s, BOOL has_super, JSFunctionDef **pfd)
 
static int find_private_class_field (JSContext *ctx, JSFunctionDef *fd, JSAtom name, int scope_level)
 
static void emit_class_field_init (JSParseState *s)
 
static JSAtom get_private_setter_name (JSContext *ctx, JSAtom name)
 
static __exception int emit_class_init_start (JSParseState *s, ClassFieldsDef *cf)
 
static __exception int add_brand (JSParseState *s, ClassFieldsDef *cf)
 
static void emit_class_init_end (JSParseState *s, ClassFieldsDef *cf)
 
static __exception int js_parse_class (JSParseState *s, BOOL is_class_expr, JSParseExportEnum export_flag)
 
static __exception int js_parse_array_literal (JSParseState *s)
 
static BOOL has_with_scope (JSFunctionDef *s, int scope_level)
 
static __exception int get_lvalue (JSParseState *s, int *popcode, int *pscope, JSAtom *pname, int *plabel, int *pdepth, BOOL keep, int tok)
 
static void put_lvalue (JSParseState *s, int opcode, int scope, JSAtom name, int label, PutLValueEnum special, BOOL is_let)
 
static __exception int js_parse_expr_paren (JSParseState *s)
 
static int js_unsupported_keyword (JSParseState *s, JSAtom atom)
 
static __exception int js_define_var (JSParseState *s, JSAtom name, int tok)
 
static void js_emit_spread_code (JSParseState *s, int depth)
 
static int js_parse_check_duplicate_parameter (JSParseState *s, JSAtom name)
 
static JSAtom js_parse_destructuring_var (JSParseState *s, int tok, int is_arg)
 
static int js_parse_destructuring_element (JSParseState *s, int tok, int is_arg, int hasval, int has_ellipsis, BOOL allow_initializer)
 
static void optional_chain_test (JSParseState *s, int *poptional_chaining_label, int drop_count)
 
static __exception int js_parse_delete (JSParseState *s)
 
static __exception int js_parse_expr_binary (JSParseState *s, int level, int parse_flags)
 
static __exception int js_parse_logical_and_or (JSParseState *s, int op, int parse_flags)
 
static __exception int js_parse_coalesce_expr (JSParseState *s, int parse_flags)
 
static __exception int js_parse_cond_expr (JSParseState *s, int parse_flags)
 
static void emit_return (JSParseState *s, BOOL hasval)
 
static __exception int js_parse_expr2 (JSParseState *s, int parse_flags)
 
static __exception int emit_break (JSParseState *s, JSAtom name, int is_cont)
 
static __exception int js_parse_statement_or_decl (JSParseState *s, int decl_mask)
 
static __exception int js_parse_statement (JSParseState *s)
 
static __exception int js_parse_block (JSParseState *s)
 
static __exception int js_parse_var (JSParseState *s, int parse_flags, int tok, BOOL export_flag)
 
static BOOL is_label (JSParseState *s)
 
static int is_let (JSParseState *s, int decl_mask)
 
static __exception int js_parse_for_in_of (JSParseState *s, int label_name, BOOL is_async)
 
static void set_eval_ret_undefined (JSParseState *s)
 
static JSModuleDefjs_new_module_def (JSContext *ctx, JSAtom name)
 
static int add_req_module_entry (JSContext *ctx, JSModuleDef *m, JSAtom module_name)
 
static JSExportEntryfind_export_entry (JSContext *ctx, JSModuleDef *m, JSAtom export_name)
 
static JSExportEntryadd_export_entry2 (JSContext *ctx, JSParseState *s, JSModuleDef *m, JSAtom local_name, JSAtom export_name, JSExportTypeEnum export_type)
 
static int add_star_export_entry (JSContext *ctx, JSModuleDef *m, int req_module_idx)
 
JSModuleDefJS_NewCModule (JSContext *ctx, const char *name_str, JSModuleInitFunc *func)
 
int JS_AddModuleExport (JSContext *ctx, JSModuleDef *m, const char *export_name)
 
int JS_SetModuleExport (JSContext *ctx, JSModuleDef *m, const char *export_name, JSValue val)
 
void JS_SetModuleLoaderFunc (JSRuntime *rt, JSModuleNormalizeFunc *module_normalize, JSModuleLoaderFunc *module_loader, void *opaque)
 
static char * js_default_module_normalize_name (JSContext *ctx, const char *base_name, const char *name)
 
static JSModuleDefjs_find_loaded_module (JSContext *ctx, JSAtom name)
 
static JSModuleDefjs_host_resolve_imported_module (JSContext *ctx, const char *base_cname, const char *cname1)
 
static JSModuleDefjs_host_resolve_imported_module_atom (JSContext *ctx, JSAtom base_module_name, JSAtom module_name1)
 
static int find_resolve_entry (JSResolveState *s, JSModuleDef *m, JSAtom name)
 
static int add_resolve_entry (JSContext *ctx, JSResolveState *s, JSModuleDef *m, JSAtom name)
 
static JSResolveResultEnum js_resolve_export1 (JSContext *ctx, JSModuleDef **pmodule, JSExportEntry **pme, JSModuleDef *m, JSAtom export_name, JSResolveState *s)
 
static JSResolveResultEnum js_resolve_export (JSContext *ctx, JSModuleDef **pmodule, JSExportEntry **pme, JSModuleDef *m, JSAtom export_name)
 
static void js_resolve_export_throw_error (JSContext *ctx, JSResolveResultEnum res, JSModuleDef *m, JSAtom export_name)
 
static int find_exported_name (GetExportNamesState *s, JSAtom name)
 
static __exception int get_exported_names (JSContext *ctx, GetExportNamesState *s, JSModuleDef *m, BOOL from_star)
 
static int js_module_ns_has (JSContext *ctx, JSValueConst obj, JSAtom atom)
 
static int exported_names_cmp (const void *p1, const void *p2, void *opaque)
 
static JSValue js_get_module_ns (JSContext *ctx, JSModuleDef *m)
 
static JSValue js_build_module_ns (JSContext *ctx, JSModuleDef *m)
 
static int js_resolve_module (JSContext *ctx, JSModuleDef *m)
 
static JSVarRefjs_create_module_var (JSContext *ctx, BOOL is_lexical)
 
static int js_create_module_bytecode_function (JSContext *ctx, JSModuleDef *m)
 
static int js_create_module_function (JSContext *ctx, JSModuleDef *m)
 
static int js_link_module (JSContext *ctx, JSModuleDef *m)
 
JSAtom JS_GetScriptOrModuleName (JSContext *ctx, int n_stack_levels)
 
JSAtom JS_GetModuleName (JSContext *ctx, JSModuleDef *m)
 
JSValue JS_GetImportMeta (JSContext *ctx, JSModuleDef *m)
 
JSModuleDefJS_RunModule (JSContext *ctx, const char *basename, const char *filename)
 
static JSValue js_dynamic_import_job (JSContext *ctx, int argc, JSValueConst *argv)
 
static JSValue js_evaluate_module (JSContext *ctx, JSModuleDef *m)
 
static __exception JSAtom js_parse_from_clause (JSParseState *s)
 
static __exception int js_parse_export (JSParseState *s)
 
static int add_closure_var (JSContext *ctx, JSFunctionDef *s, BOOL is_local, BOOL is_arg, int var_idx, JSAtom var_name, BOOL is_const, BOOL is_lexical, JSVarKindEnum var_kind)
 
static int add_import (JSParseState *s, JSModuleDef *m, JSAtom local_name, JSAtom import_name)
 
static __exception int js_parse_import (JSParseState *s)
 
static __exception int js_parse_source_element (JSParseState *s)
 
static JSFunctionDefjs_new_function_def (JSContext *ctx, JSFunctionDef *parent, BOOL is_eval, BOOL is_func_expr, const char *filename, int line_num)
 
static void free_bytecode_atoms (JSRuntime *rt, const uint8_t *bc_buf, int bc_len, BOOL use_short_opcodes)
 
static void js_free_function_def (JSContext *ctx, JSFunctionDef *fd)
 
static int find_closure_var (JSContext *ctx, JSFunctionDef *s, JSAtom var_name)
 
static int get_closure_var2 (JSContext *ctx, JSFunctionDef *s, JSFunctionDef *fd, BOOL is_local, BOOL is_arg, int var_idx, JSAtom var_name, BOOL is_const, BOOL is_lexical, JSVarKindEnum var_kind)
 
static int get_closure_var (JSContext *ctx, JSFunctionDef *s, JSFunctionDef *fd, BOOL is_arg, int var_idx, JSAtom var_name, BOOL is_const, BOOL is_lexical, JSVarKindEnum var_kind)
 
static int get_with_scope_opcode (int op)
 
static BOOL can_opt_put_ref_value (const uint8_t *bc_buf, int pos)
 
static BOOL can_opt_put_global_ref_value (const uint8_t *bc_buf, int pos)
 
static int optimize_scope_make_ref (JSContext *ctx, JSFunctionDef *s, DynBuf *bc, uint8_t *bc_buf, LabelSlot *ls, int pos_next, int get_op, int var_idx)
 
static int optimize_scope_make_global_ref (JSContext *ctx, JSFunctionDef *s, DynBuf *bc, uint8_t *bc_buf, LabelSlot *ls, int pos_next, JSAtom var_name)
 
static int add_var_this (JSContext *ctx, JSFunctionDef *fd)
 
static int resolve_pseudo_var (JSContext *ctx, JSFunctionDef *s, JSAtom var_name)
 
static void var_object_test (JSContext *ctx, JSFunctionDef *s, JSAtom var_name, int op, DynBuf *bc, int *plabel_done, BOOL is_with)
 
static int resolve_scope_var (JSContext *ctx, JSFunctionDef *s, JSAtom var_name, int scope_level, int op, DynBuf *bc, uint8_t *bc_buf, LabelSlot *ls, int pos_next)
 
static int find_private_class_field_all (JSContext *ctx, JSFunctionDef *fd, JSAtom name, int scope_level)
 
static void get_loc_or_ref (DynBuf *bc, BOOL is_ref, int idx)
 
static int resolve_scope_private_field1 (JSContext *ctx, BOOL *pis_ref, int *pvar_kind, JSFunctionDef *s, JSAtom var_name, int scope_level)
 
static int resolve_scope_private_field (JSContext *ctx, JSFunctionDef *s, JSAtom var_name, int scope_level, int op, DynBuf *bc)
 
static void mark_eval_captured_variables (JSContext *ctx, JSFunctionDef *s, int scope_level)
 
static BOOL is_var_in_arg_scope (const JSVarDef *vd)
 
static void add_eval_variables (JSContext *ctx, JSFunctionDef *s)
 
static void set_closure_from_var (JSContext *ctx, JSClosureVar *cv, JSVarDef *vd, int var_idx)
 
static __exception int add_closure_variables (JSContext *ctx, JSFunctionDef *s, JSFunctionBytecode *b, int scope_idx)
 
static BOOL code_match (CodeContext *s, int pos,...)
 
static void instantiate_hoisted_definitions (JSContext *ctx, JSFunctionDef *s, DynBuf *bc)
 
static int skip_dead_code (JSFunctionDef *s, const uint8_t *bc_buf, int bc_len, int pos, int *linep)
 
static int get_label_pos (JSFunctionDef *s, int label)
 
static __exception int resolve_variables (JSContext *ctx, JSFunctionDef *s)
 
static void add_pc2line_info (JSFunctionDef *s, uint32_t pc, int line_num)
 
static void compute_pc2line_info (JSFunctionDef *s)
 
static RelocEntryadd_reloc (JSContext *ctx, LabelSlot *ls, uint32_t addr, int size)
 
static BOOL code_has_label (CodeContext *s, int pos, int label)
 
static int find_jump_target (JSFunctionDef *s, int label, int *pop, int *pline)
 
static void push_short_int (DynBuf *bc_out, int val)
 
static void put_short_code (DynBuf *bc_out, int op, int idx)
 
static __exception int resolve_labels (JSContext *ctx, JSFunctionDef *s)
 
static __exception int ss_check (JSContext *ctx, StackSizeState *s, int pos, int op, int stack_len)
 
static __exception int compute_stack_size (JSContext *ctx, JSFunctionDef *fd, int *pstack_size)
 
static int add_module_variables (JSContext *ctx, JSFunctionDef *fd)
 
static JSValue js_create_function (JSContext *ctx, JSFunctionDef *fd)
 
static __exception int js_parse_directives (JSParseState *s)
 
static int js_parse_function_check_names (JSParseState *s, JSFunctionDef *fd, JSAtom func_name)
 
static __exception int js_parse_program (JSParseState *s)
 
static void js_parse_init (JSContext *ctx, JSParseState *s, const char *input, size_t input_len, const char *filename)
 
static JSValue JS_EvalFunctionInternal (JSContext *ctx, JSValue fun_obj, JSValueConst this_obj, JSVarRef **var_refs, JSStackFrame *sf)
 
JSValue JS_EvalFunction (JSContext *ctx, JSValue fun_obj)
 
static void skip_shebang (JSParseState *s)
 
static JSValue __JS_EvalInternal (JSContext *ctx, JSValueConst this_obj, const char *input, size_t input_len, const char *filename, int flags, int scope_idx)
 
JSValue JS_EvalThis (JSContext *ctx, JSValueConst this_obj, const char *input, size_t input_len, const char *filename, int eval_flags)
 
JSValue JS_Eval (JSContext *ctx, const char *input, size_t input_len, const char *filename, int eval_flags)
 
int JS_ResolveModule (JSContext *ctx, JSValueConst obj)
 
static void js_object_list_init (JSObjectList *s)
 
static uint32_t js_object_list_get_hash (JSObject *p, uint32_t hash_size)
 
static int js_object_list_resize_hash (JSContext *ctx, JSObjectList *s, uint32_t new_hash_size)
 
static int js_object_list_add (JSContext *ctx, JSObjectList *s, JSObject *obj)
 
static int js_object_list_find (JSContext *ctx, JSObjectList *s, JSObject *obj)
 
static void js_object_list_end (JSContext *ctx, JSObjectList *s)
 
static void bc_put_u8 (BCWriterState *s, uint8_t v)
 
static void bc_put_u16 (BCWriterState *s, uint16_t v)
 
static __maybe_unused void bc_put_u32 (BCWriterState *s, uint32_t v)
 
static void bc_put_u64 (BCWriterState *s, uint64_t v)
 
static void bc_put_leb128 (BCWriterState *s, uint32_t v)
 
static void bc_put_sleb128 (BCWriterState *s, int32_t v)
 
static void bc_set_flags (uint32_t *pflags, int *pidx, uint32_t val, int n)
 
static int bc_atom_to_idx (BCWriterState *s, uint32_t *pres, JSAtom atom)
 
static int bc_put_atom (BCWriterState *s, JSAtom atom)
 
static void bc_byte_swap (uint8_t *bc_buf, int bc_len)
 
static int JS_WriteFunctionBytecode (BCWriterState *s, const uint8_t *bc_buf1, int bc_len)
 
static void JS_WriteString (BCWriterState *s, JSString *p)
 
static int JS_WriteObjectRec (BCWriterState *s, JSValueConst obj)
 
static int JS_WriteFunctionTag (BCWriterState *s, JSValueConst obj)
 
static int JS_WriteModule (BCWriterState *s, JSValueConst obj)
 
static int JS_WriteArray (BCWriterState *s, JSValueConst obj)
 
static int JS_WriteObjectTag (BCWriterState *s, JSValueConst obj)
 
static int JS_WriteTypedArray (BCWriterState *s, JSValueConst obj)
 
static int JS_WriteArrayBuffer (BCWriterState *s, JSValueConst obj)
 
static int JS_WriteSharedArrayBuffer (BCWriterState *s, JSValueConst obj)
 
static int JS_WriteObjectAtoms (BCWriterState *s)
 
uint8_tJS_WriteObject2 (JSContext *ctx, size_t *psize, JSValueConst obj, int flags, uint8_t ***psab_tab, size_t *psab_tab_len)
 
uint8_tJS_WriteObject (JSContext *ctx, size_t *psize, JSValueConst obj, int flags)
 
static int bc_read_error_end (BCReaderState *s)
 
static int bc_get_u8 (BCReaderState *s, uint8_t *pval)
 
static int bc_get_u16 (BCReaderState *s, uint16_t *pval)
 
static __maybe_unused int bc_get_u32 (BCReaderState *s, uint32_t *pval)
 
static int bc_get_u64 (BCReaderState *s, uint64_t *pval)
 
static int bc_get_leb128 (BCReaderState *s, uint32_t *pval)
 
static int bc_get_sleb128 (BCReaderState *s, int32_t *pval)
 
static int bc_get_leb128_int (BCReaderState *s, int *pval)
 
static int bc_get_leb128_u16 (BCReaderState *s, uint16_t *pval)
 
static int bc_get_buf (BCReaderState *s, uint8_t *buf, uint32_t buf_len)
 
static int bc_idx_to_atom (BCReaderState *s, JSAtom *patom, uint32_t idx)
 
static int bc_get_atom (BCReaderState *s, JSAtom *patom)
 
static JSStringJS_ReadString (BCReaderState *s)
 
static uint32_t bc_get_flags (uint32_t flags, int *pidx, int n)
 
static int JS_ReadFunctionBytecode (BCReaderState *s, JSFunctionBytecode *b, int byte_code_offset, uint32_t bc_len)
 
static JSValue JS_ReadObjectRec (BCReaderState *s)
 
static int BC_add_object_ref1 (BCReaderState *s, JSObject *p)
 
static int BC_add_object_ref (BCReaderState *s, JSValueConst obj)
 
static JSValue JS_ReadFunctionTag (BCReaderState *s)
 
static JSValue JS_ReadModule (BCReaderState *s)
 
static JSValue JS_ReadObjectTag (BCReaderState *s)
 
static JSValue JS_ReadArray (BCReaderState *s, int tag)
 
static JSValue JS_ReadTypedArray (BCReaderState *s)
 
static JSValue JS_ReadArrayBuffer (BCReaderState *s)
 
static JSValue JS_ReadSharedArrayBuffer (BCReaderState *s)
 
static JSValue JS_ReadDate (BCReaderState *s)
 
static JSValue JS_ReadObjectValue (BCReaderState *s)
 
static int JS_ReadObjectAtoms (BCReaderState *s)
 
static void bc_reader_free (BCReaderState *s)
 
JSValue JS_ReadObject (JSContext *ctx, const uint8_t *buf, size_t buf_len, int flags)
 
static JSValue js_string_constructor (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_boolean_constructor (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_number_constructor (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int check_function (JSContext *ctx, JSValueConst obj)
 
static int check_exception_free (JSContext *ctx, JSValue obj)
 
static JSAtom find_atom (JSContext *ctx, const char *name)
 
static int JS_InstantiateFunctionListItem (JSContext *ctx, JSValueConst obj, JSAtom atom, const JSCFunctionListEntry *e)
 
void JS_SetPropertyFunctionList (JSContext *ctx, JSValueConst obj, const JSCFunctionListEntry *tab, int len)
 
int JS_AddModuleExportList (JSContext *ctx, JSModuleDef *m, const JSCFunctionListEntry *tab, int len)
 
int JS_SetModuleExportList (JSContext *ctx, JSModuleDef *m, const JSCFunctionListEntry *tab, int len)
 
static void JS_SetConstructor2 (JSContext *ctx, JSValueConst func_obj, JSValueConst proto, int proto_flags, int ctor_flags)
 
void JS_SetConstructor (JSContext *ctx, JSValueConst func_obj, JSValueConst proto)
 
static void JS_NewGlobalCConstructor2 (JSContext *ctx, JSValue func_obj, const char *name, JSValueConst proto)
 
static JSValueConst JS_NewGlobalCConstructor (JSContext *ctx, const char *name, JSCFunction *func, int length, JSValueConst proto)
 
static JSValueConst JS_NewGlobalCConstructorOnly (JSContext *ctx, const char *name, JSCFunction *func, int length, JSValueConst proto)
 
static JSValue js_global_eval (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_global_isNaN (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_global_isFinite (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int js_obj_to_desc (JSContext *ctx, JSPropertyDescriptor *d, JSValueConst desc)
 
static __exception int JS_DefinePropertyDesc (JSContext *ctx, JSValueConst obj, JSAtom prop, JSValueConst desc, int flags)
 
static __exception int JS_ObjectDefineProperties (JSContext *ctx, JSValueConst obj, JSValueConst properties)
 
static JSValue js_object_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv)
 
static JSValue js_object_create (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_getPrototypeOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_object_setPrototypeOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_defineProperty (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_object_defineProperties (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object___defineGetter__ (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_object_getOwnPropertyDescriptor (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_object_getOwnPropertyDescriptors (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue JS_GetOwnPropertyNames2 (JSContext *ctx, JSValueConst obj1, int flags, int kind)
 
static JSValue js_object_getOwnPropertyNames (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_getOwnPropertySymbols (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_keys (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int kind)
 
static JSValue js_object_isExtensible (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int reflect)
 
static JSValue js_object_preventExtensions (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int reflect)
 
static JSValue js_object_hasOwnProperty (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_valueOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_toLocaleString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_assign (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_seal (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int freeze_flag)
 
static JSValue js_object_isSealed (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int is_frozen)
 
static JSValue js_object_fromEntries (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object___getClass (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_is (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue JS_SpeciesConstructor (JSContext *ctx, JSValueConst obj, JSValueConst defaultConstructor)
 
static JSValue js_object_get___proto__ (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_object_set___proto__ (JSContext *ctx, JSValueConst this_val, JSValueConst proto)
 
static JSValue js_object_isPrototypeOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object_propertyIsEnumerable (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_object___lookupGetter__ (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int setter)
 
static JSValue js_function_proto (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_function_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv, int magic)
 
static JSValue js_function_apply (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_function_call (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_function_bind (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_function_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_function_hasInstance (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue iterator_to_array (JSContext *ctx, JSValueConst items)
 
static JSValue js_error_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv, int magic)
 
static JSValue js_error_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_aggregate_error_constructor (JSContext *ctx, JSValueConst errors)
 
static int JS_CopySubArray (JSContext *ctx, JSValueConst obj, int64_t to_pos, int64_t from_pos, int64_t count, int dir)
 
static JSValue js_array_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv)
 
static JSValue js_array_from (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_array_of (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_array_isArray (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_get_this (JSContext *ctx, JSValueConst this_val)
 
static JSValue JS_ArraySpeciesCreate (JSContext *ctx, JSValueConst obj, JSValueConst len_val)
 
static int JS_isConcatSpreadable (JSContext *ctx, JSValueConst obj)
 
static JSValue js_array_concat (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int js_typed_array_get_length_internal (JSContext *ctx, JSValueConst obj)
 
static JSValue js_typed_array___speciesCreate (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_array_every (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int special)
 
static JSValue js_array_reduce (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int special)
 
static JSValue js_array_fill (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_array_includes (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_array_indexOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_array_lastIndexOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_array_find (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int findIndex)
 
static JSValue js_array_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_array_join (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int toLocaleString)
 
static JSValue js_array_pop (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int shift)
 
static JSValue js_array_push (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int unshift)
 
static JSValue js_array_reverse (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_array_slice (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int splice)
 
static JSValue js_array_copyWithin (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int64_t JS_FlattenIntoArray (JSContext *ctx, JSValueConst target, JSValueConst source, int64_t sourceLen, int64_t targetIndex, int depth, JSValueConst mapperFunction, JSValueConst thisArg)
 
static JSValue js_array_flatten (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int map)
 
static int js_array_cmp_generic (const void *a, const void *b, void *opaque)
 
static JSValue js_array_sort (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static void js_array_iterator_finalizer (JSRuntime *rt, JSValue val)
 
static void js_array_iterator_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_create_array (JSContext *ctx, int len, JSValueConst *tab)
 
static JSValue js_iterator_proto_iterator (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_number_isNaN (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_number_isFinite (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_number_isInteger (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_number_isSafeInteger (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_thisNumberValue (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_number_valueOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int js_get_radix (JSContext *ctx, JSValueConst val)
 
static JSValue js_number_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_number_toFixed (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_number_toExponential (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_number_toPrecision (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_parseInt (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_parseFloat (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_thisBooleanValue (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_boolean_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_boolean_valueOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int js_string_get_own_property (JSContext *ctx, JSPropertyDescriptor *desc, JSValueConst obj, JSAtom prop)
 
static int js_string_define_own_property (JSContext *ctx, JSValueConst this_obj, JSAtom prop, JSValueConst val, JSValueConst getter, JSValueConst setter, int flags)
 
static int js_string_delete_property (JSContext *ctx, JSValueConst obj, JSAtom prop)
 
static JSValue js_thisStringValue (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_string_fromCharCode (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_fromCodePoint (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_raw (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
JSValue js_string_codePointRange (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_charCodeAt (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_charAt (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_codePointAt (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_concat (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int string_cmp (JSString *p1, JSString *p2, int x1, int x2, int len)
 
static int string_indexof_char (JSString *p, int c, int from)
 
static int string_indexof (JSString *p1, JSString *p2, int from)
 
static int64_t string_advance_index (JSString *p, int64_t index, BOOL unicode)
 
static JSValue js_string_indexOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int lastIndexOf)
 
static int js_is_regexp (JSContext *ctx, JSValueConst obj)
 
static JSValue js_string_includes (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static int check_regexp_g_flag (JSContext *ctx, JSValueConst regexp)
 
static JSValue js_string_match (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int atom)
 
static JSValue js_string___GetSubstitution (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_replace (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int is_replaceAll)
 
static JSValue js_string_split (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_substring (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_substr (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_slice (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_pad (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int padEnd)
 
static JSValue js_string_repeat (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_trim (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_string___quote (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int string_prevc (JSString *p, int *pidx)
 
static BOOL test_final_sigma (JSString *p, int sigma_pos)
 
static JSValue js_string_localeCompare (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_toLowerCase (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int to_lower)
 
static int JS_ToUTF32String (JSContext *ctx, uint32_t **pbuf, JSValueConst val1)
 
static JSValue JS_NewUTF32String (JSContext *ctx, const uint32_t *buf, int len)
 
static JSValue js_string_normalize (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_string_iterator_next (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, BOOL *pdone, int magic)
 
static JSValue js_string_CreateHTML (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
void JS_AddIntrinsicStringNormalize (JSContext *ctx)
 
static double js_fmin (double a, double b)
 
static double js_fmax (double a, double b)
 
static JSValue js_math_min_max (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static double js_math_sign (double a)
 
static double js_math_round (double a)
 
static JSValue js_math_hypot (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static double js_math_fround (double a)
 
static JSValue js_math_imul (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_math_clz32 (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static uint64_t xorshift64star (uint64_t *pstate)
 
static void js_random_init (JSContext *ctx)
 
static JSValue js_math_random (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js___date_clock (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int getTimezoneOffset (int64_t time)
 
static void js_regexp_finalizer (JSRuntime *rt, JSValue val)
 
static JSValue js_compile_regexp (JSContext *ctx, JSValueConst pattern, JSValueConst flags)
 
static JSValue js_regexp_constructor_internal (JSContext *ctx, JSValueConst ctor, JSValue pattern, JSValue bc)
 
static JSRegExpjs_get_regexp (JSContext *ctx, JSValueConst obj, BOOL throw_error)
 
static JSValue js_regexp_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv)
 
static JSValue js_regexp_compile (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_regexp_get_source (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_regexp_get_flag (JSContext *ctx, JSValueConst this_val, int mask)
 
static JSValue js_regexp_get_flags (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_regexp_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
BOOL lre_check_stack_overflow (void *opaque, size_t alloca_size)
 
void * lre_realloc (void *opaque, void *ptr, size_t size)
 
static JSValue js_regexp_exec (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue JS_RegExpDelete (JSContext *ctx, JSValueConst this_val, JSValueConst arg)
 
static JSValue JS_RegExpExec (JSContext *ctx, JSValueConst r, JSValueConst s)
 
static JSValue js_regexp_test (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_regexp_Symbol_match (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static void js_regexp_string_iterator_finalizer (JSRuntime *rt, JSValue val)
 
static void js_regexp_string_iterator_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_regexp_string_iterator_next (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, BOOL *pdone, int magic)
 
static JSValue js_regexp_Symbol_matchAll (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int value_buffer_init (JSContext *ctx, ValueBuffer *b)
 
static void value_buffer_free (ValueBuffer *b)
 
static int value_buffer_append (ValueBuffer *b, JSValue val)
 
static int js_is_standard_regexp (JSContext *ctx, JSValueConst rx)
 
static JSValue js_regexp_Symbol_replace (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_regexp_Symbol_search (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_regexp_Symbol_split (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
void JS_AddIntrinsicRegExpCompiler (JSContext *ctx)
 
void JS_AddIntrinsicRegExp (JSContext *ctx)
 
static int json_parse_expect (JSParseState *s, int tok)
 
static JSValue json_parse_value (JSParseState *s)
 
JSValue JS_ParseJSON2 (JSContext *ctx, const char *buf, size_t buf_len, const char *filename, int flags)
 
JSValue JS_ParseJSON (JSContext *ctx, const char *buf, size_t buf_len, const char *filename)
 
static JSValue internalize_json_property (JSContext *ctx, JSValueConst holder, JSAtom name, JSValueConst reviver)
 
static JSValue js_json_parse (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue JS_ToQuotedStringFree (JSContext *ctx, JSValue val)
 
static JSValue js_json_check (JSContext *ctx, JSONStringifyContext *jsc, JSValueConst holder, JSValue val, JSValueConst key)
 
static int js_json_to_str (JSContext *ctx, JSONStringifyContext *jsc, JSValueConst holder, JSValue val, JSValueConst indent)
 
JSValue JS_JSONStringify (JSContext *ctx, JSValueConst obj, JSValueConst replacer, JSValueConst space0)
 
static JSValue js_json_stringify (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
void JS_AddIntrinsicJSON (JSContext *ctx)
 
static JSValue js_reflect_apply (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_reflect_construct (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_reflect_deleteProperty (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_reflect_get (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_reflect_has (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_reflect_set (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_reflect_setPrototypeOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_reflect_ownKeys (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static void js_proxy_finalizer (JSRuntime *rt, JSValue val)
 
static void js_proxy_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSProxyDataget_proxy_method (JSContext *ctx, JSValue *pmethod, JSValueConst obj, JSAtom name)
 
static int js_proxy_has (JSContext *ctx, JSValueConst obj, JSAtom atom)
 
static JSValue js_proxy_get (JSContext *ctx, JSValueConst obj, JSAtom atom, JSValueConst receiver)
 
static int js_proxy_set (JSContext *ctx, JSValueConst obj, JSAtom atom, JSValueConst value, JSValueConst receiver, int flags)
 
static JSValue js_create_desc (JSContext *ctx, JSValueConst val, JSValueConst getter, JSValueConst setter, int flags)
 
static int js_proxy_get_own_property (JSContext *ctx, JSPropertyDescriptor *pdesc, JSValueConst obj, JSAtom prop)
 
static int js_proxy_define_own_property (JSContext *ctx, JSValueConst obj, JSAtom prop, JSValueConst val, JSValueConst getter, JSValueConst setter, int flags)
 
static int js_proxy_delete_property (JSContext *ctx, JSValueConst obj, JSAtom atom)
 
static int find_prop_key (const JSPropertyEnum *tab, int n, JSAtom atom)
 
static int js_proxy_get_own_property_names (JSContext *ctx, JSPropertyEnum **ptab, uint32_t *plen, JSValueConst obj)
 
static JSValue js_proxy_call_constructor (JSContext *ctx, JSValueConst func_obj, JSValueConst new_target, int argc, JSValueConst *argv)
 
static JSValue js_proxy_call (JSContext *ctx, JSValueConst func_obj, JSValueConst this_obj, int argc, JSValueConst *argv, int flags)
 
static JSValue js_proxy_constructor (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_proxy_revoke (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic, JSValue *func_data)
 
static JSValue js_proxy_revoke_constructor (JSContext *ctx, JSValueConst proxy_obj)
 
static JSValue js_proxy_revocable (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
void JS_AddIntrinsicProxy (JSContext *ctx)
 
static JSValue js_symbol_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv)
 
static JSValue js_thisSymbolValue (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_symbol_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_symbol_valueOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_symbol_get_description (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_symbol_for (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_symbol_keyFor (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_map_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv, int magic)
 
static JSValueConst map_normalize_key (JSContext *ctx, JSValueConst key)
 
static uint32_t map_hash_key (JSContext *ctx, JSValueConst key)
 
static JSMapRecordmap_find_record (JSContext *ctx, JSMapState *s, JSValueConst key)
 
static void map_hash_resize (JSContext *ctx, JSMapState *s)
 
static JSMapRecordmap_add_record (JSContext *ctx, JSMapState *s, JSValueConst key)
 
static void delete_weak_ref (JSRuntime *rt, JSMapRecord *mr)
 
static void map_delete_record (JSRuntime *rt, JSMapState *s, JSMapRecord *mr)
 
static void map_decref_record (JSRuntime *rt, JSMapRecord *mr)
 
static JSValue js_map_set (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_map_get (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_map_has (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_map_delete (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_map_clear (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_map_get_size (JSContext *ctx, JSValueConst this_val, int magic)
 
static JSValue js_map_forEach (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static void js_map_finalizer (JSRuntime *rt, JSValue val)
 
static void js_map_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static void js_map_iterator_finalizer (JSRuntime *rt, JSValue val)
 
static void js_map_iterator_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_create_map_iterator (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_map_iterator_next (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, BOOL *pdone, int magic)
 
void JS_AddIntrinsicMapSet (JSContext *ctx)
 
static int js_create_resolving_functions (JSContext *ctx, JSValue *args, JSValueConst promise)
 
static void promise_reaction_data_free (JSRuntime *rt, JSPromiseReactionData *rd)
 
static JSValue promise_reaction_job (JSContext *ctx, int argc, JSValueConst *argv)
 
void JS_SetHostPromiseRejectionTracker (JSRuntime *rt, JSHostPromiseRejectionTracker *cb, void *opaque)
 
static void fulfill_or_reject_promise (JSContext *ctx, JSValueConst promise, JSValueConst value, BOOL is_reject)
 
static void reject_promise (JSContext *ctx, JSValueConst promise, JSValueConst value)
 
static JSValue js_promise_resolve_thenable_job (JSContext *ctx, int argc, JSValueConst *argv)
 
static void js_promise_resolve_function_free_resolved (JSRuntime *rt, JSPromiseFunctionDataResolved *sr)
 
static void js_promise_resolve_function_finalizer (JSRuntime *rt, JSValue val)
 
static void js_promise_resolve_function_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_promise_resolve_function_call (JSContext *ctx, JSValueConst func_obj, JSValueConst this_val, int argc, JSValueConst *argv, int flags)
 
static void js_promise_finalizer (JSRuntime *rt, JSValue val)
 
static void js_promise_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_promise_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv)
 
static JSValue js_promise_executor (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic, JSValue *func_data)
 
static JSValue js_promise_executor_new (JSContext *ctx)
 
JSValue JS_NewPromiseCapability (JSContext *ctx, JSValue *resolving_funcs)
 
static __exception int remainingElementsCount_add (JSContext *ctx, JSValueConst resolve_element_env, int addend)
 
static JSValue js_promise_all_resolve_element (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic, JSValue *func_data)
 
static JSValue js_promise_all (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_promise_race (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_promise_then (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_promise_catch (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_promise_finally_value_thunk (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic, JSValue *func_data)
 
static JSValue js_promise_finally_thrower (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic, JSValue *func_data)
 
static JSValue js_promise_then_finally_func (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic, JSValue *func_data)
 
static JSValue js_promise_finally (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_async_from_sync_iterator_unwrap (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic, JSValue *func_data)
 
static JSValue js_async_from_sync_iterator_unwrap_func_create (JSContext *ctx, BOOL done)
 
static void js_async_from_sync_iterator_finalizer (JSRuntime *rt, JSValue val)
 
static void js_async_from_sync_iterator_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_async_from_sync_iterator_next (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
void JS_AddIntrinsicPromise (JSContext *ctx)
 
static int string_get_hex (JSString *p, int k, int n)
 
static int isURIReserved (int c)
 
static int hex_decode (JSContext *ctx, JSString *p, int k)
 
static JSValue js_global_decodeURI (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int isComponent)
 
static int isUnescaped (int c)
 
static int isURIUnescaped (int c, int isComponent)
 
static int encodeURI_hex (StringBuffer *b, int c)
 
static JSValue js_global_encodeURI (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int isComponent)
 
static JSValue js_global_escape (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_global_unescape (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int64_t math_mod (int64_t a, int64_t b)
 
static int64_t floor_div (int64_t a, int64_t b)
 
static JSValue js_Date_parse (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static __exception int JS_ThisTimeValue (JSContext *ctx, double *valp, JSValueConst this_val)
 
static JSValue JS_SetThisTimeValue (JSContext *ctx, JSValueConst this_val, double v)
 
static int64_t days_from_year (int64_t y)
 
static int64_t days_in_year (int64_t y)
 
static int64_t year_from_days (int64_t *days)
 
static __exception int get_date_fields (JSContext *ctx, JSValueConst obj, double fields[9], int is_local, int force)
 
static double time_clip (double t)
 
static double set_date_fields (double fields[], int is_local)
 
static JSValue get_date_field (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue set_date_field (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue get_date_string (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static int64_t date_now (void)
 
static JSValue js_date_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv)
 
static JSValue js_Date_UTC (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static void string_skip_spaces (JSString *sp, int *pp)
 
static void string_skip_non_spaces (JSString *sp, int *pp)
 
static int string_get_digits (JSString *sp, int *pp, int64_t *pval)
 
static int string_get_signed_digits (JSString *sp, int *pp, int64_t *pval)
 
static int string_get_fixed_width_digits (JSString *sp, int *pp, int n, int64_t *pval)
 
static int string_get_milliseconds (JSString *sp, int *pp, int64_t *pval)
 
static int find_abbrev (JSString *sp, int p, const char *list, int count)
 
static int string_get_month (JSString *sp, int *pp, int64_t *pval)
 
static JSValue js_Date_now (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_date_Symbol_toPrimitive (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_date_getTimezoneOffset (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_date_getTime (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_date_setTime (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_date_setYear (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_date_toJSON (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
void JS_AddIntrinsicDate (JSContext *ctx)
 
void JS_AddIntrinsicEval (JSContext *ctx)
 
void JS_AddIntrinsicBaseObjects (JSContext *ctx)
 
static void js_array_buffer_free (JSRuntime *rt, void *opaque, void *ptr)
 
static JSValue js_array_buffer_constructor2 (JSContext *ctx, JSValueConst new_target, uint64_t len, JSClassID class_id)
 
static JSValue js_array_buffer_constructor1 (JSContext *ctx, JSValueConst new_target, uint64_t len)
 
JSValue JS_NewArrayBuffer (JSContext *ctx, uint8_t *buf, size_t len, JSFreeArrayBufferDataFunc *free_func, void *opaque, BOOL is_shared)
 
JSValue JS_NewArrayBufferCopy (JSContext *ctx, const uint8_t *buf, size_t len)
 
static JSValue js_array_buffer_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv)
 
static JSValue js_shared_array_buffer_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv)
 
static void js_array_buffer_finalizer (JSRuntime *rt, JSValue val)
 
static JSValue js_array_buffer_isView (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_array_buffer_get_byteLength (JSContext *ctx, JSValueConst this_val, int class_id)
 
void JS_DetachArrayBuffer (JSContext *ctx, JSValueConst obj)
 
uint8_tJS_GetArrayBuffer (JSContext *ctx, size_t *psize, JSValueConst obj)
 
static JSValue js_array_buffer_slice (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int class_id)
 
static JSObjectget_typed_array (JSContext *ctx, JSValueConst this_val, int is_dataview)
 
static int validate_typed_array (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_typed_array_get_length (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_typed_array_get_buffer (JSContext *ctx, JSValueConst this_val, int is_dataview)
 
static JSValue js_typed_array_get_byteLength (JSContext *ctx, JSValueConst this_val, int is_dataview)
 
static JSValue js_typed_array_get_byteOffset (JSContext *ctx, JSValueConst this_val, int is_dataview)
 
JSValue JS_GetTypedArrayBuffer (JSContext *ctx, JSValueConst obj, size_t *pbyte_offset, size_t *pbyte_length, size_t *pbytes_per_element)
 
static JSValue js_typed_array_get_toStringTag (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_typed_array_set_internal (JSContext *ctx, JSValueConst dst, JSValueConst src, JSValueConst off)
 
static JSValue js_typed_array_set (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_create_typed_array_iterator (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_typed_array_create (JSContext *ctx, JSValueConst ctor, int argc, JSValueConst *argv)
 
static JSValue js_typed_array_from (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_typed_array_of (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_typed_array_copyWithin (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_typed_array_fill (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_typed_array_find (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int findIndex)
 
static JSValue js_typed_array_indexOf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int special)
 
static JSValue js_typed_array_join (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int toLocaleString)
 
static JSValue js_typed_array_reverse (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_typed_array_slice (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_typed_array_subarray (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int js_cmp_doubles (double x, double y)
 
static int js_TA_cmp_int8 (const void *a, const void *b, void *opaque)
 
static int js_TA_cmp_uint8 (const void *a, const void *b, void *opaque)
 
static int js_TA_cmp_int16 (const void *a, const void *b, void *opaque)
 
static int js_TA_cmp_uint16 (const void *a, const void *b, void *opaque)
 
static int js_TA_cmp_int32 (const void *a, const void *b, void *opaque)
 
static int js_TA_cmp_uint32 (const void *a, const void *b, void *opaque)
 
static int js_TA_cmp_float32 (const void *a, const void *b, void *opaque)
 
static int js_TA_cmp_float64 (const void *a, const void *b, void *opaque)
 
static JSValue js_TA_get_int8 (JSContext *ctx, const void *a)
 
static JSValue js_TA_get_uint8 (JSContext *ctx, const void *a)
 
static JSValue js_TA_get_int16 (JSContext *ctx, const void *a)
 
static JSValue js_TA_get_uint16 (JSContext *ctx, const void *a)
 
static JSValue js_TA_get_int32 (JSContext *ctx, const void *a)
 
static JSValue js_TA_get_uint32 (JSContext *ctx, const void *a)
 
static JSValue js_TA_get_float32 (JSContext *ctx, const void *a)
 
static JSValue js_TA_get_float64 (JSContext *ctx, const void *a)
 
static int js_TA_cmp_generic (const void *a, const void *b, void *opaque)
 
static JSValue js_typed_array_sort (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_typed_array_base_constructor (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int typed_array_init (JSContext *ctx, JSValueConst obj, JSValue buffer, uint64_t offset, uint64_t len)
 
static JSValue js_array_from_iterator (JSContext *ctx, uint32_t *plen, JSValueConst obj, JSValueConst method)
 
static JSValue js_typed_array_constructor_obj (JSContext *ctx, JSValueConst new_target, JSValueConst obj, int classid)
 
static JSValue js_typed_array_constructor_ta (JSContext *ctx, JSValueConst new_target, JSValueConst src_obj, int classid)
 
static void js_typed_array_finalizer (JSRuntime *rt, JSValue val)
 
static void js_typed_array_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_dataview_constructor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv)
 
static JSValue js_dataview_getValue (JSContext *ctx, JSValueConst this_obj, int argc, JSValueConst *argv, int class_id)
 
static JSValue js_dataview_setValue (JSContext *ctx, JSValueConst this_obj, int argc, JSValueConst *argv, int class_id)
 
static void * js_atomics_get_ptr (JSContext *ctx, JSArrayBuffer **pabuf, int *psize_log2, JSClassID *pclass_id, JSValueConst obj, JSValueConst idx_val, int is_waitable)
 
static JSValue js_atomics_op (JSContext *ctx, JSValueConst this_obj, int argc, JSValueConst *argv, int op)
 
static JSValue js_atomics_store (JSContext *ctx, JSValueConst this_obj, int argc, JSValueConst *argv)
 
static JSValue js_atomics_isLockFree (JSContext *ctx, JSValueConst this_obj, int argc, JSValueConst *argv)
 
static JSValue js_atomics_wait (JSContext *ctx, JSValueConst this_obj, int argc, JSValueConst *argv)
 
static JSValue js_atomics_notify (JSContext *ctx, JSValueConst this_obj, int argc, JSValueConst *argv)
 
void JS_AddIntrinsicAtomics (JSContext *ctx)
 
void JS_AddIntrinsicTypedArrays (JSContext *ctx)
 
int JS_IsArrayBuffer (JSContext *ctx, JSValueConst val)
 
int JS_SwitchClassID (JSValue obj, JSClassID class_id)
 

Variables

static uint8_t const typed_array_size_log2 [JS_TYPED_ARRAY_COUNT]
 
static const char js_atom_init []
 
 JSStrictEqModeEnum
 
static const JSClassExoticMethods js_arguments_exotic_methods
 
static const JSClassExoticMethods js_string_exotic_methods
 
static const JSClassExoticMethods js_proxy_exotic_methods
 
static const JSClassExoticMethods js_module_ns_exotic_methods
 
static JSClassID js_class_id_alloc = JS_CLASS_INIT_COUNT
 
static JSClassShortDef const js_std_class_def []
 
static const JSMallocFunctions def_malloc_funcs
 
static JSAutoInitFuncjs_autoinit_func_table []
 
static const uint16_t func_kind_to_class_id []
 
static const JSOpCode opcode_info [OP_COUNT+(OP_TEMP_END - OP_TEMP_START)]
 
static const JSCFunctionListEntry js_object_funcs []
 
static const JSCFunctionListEntry js_object_proto_funcs []
 
static const JSCFunctionListEntry js_function_proto_funcs []
 
static const JSCFunctionListEntry js_error_proto_funcs []
 
static const JSCFunctionListEntry js_array_funcs []
 
static const JSCFunctionListEntry js_iterator_proto_funcs []
 
static const JSCFunctionListEntry js_array_proto_funcs []
 
static const JSCFunctionListEntry js_array_iterator_proto_funcs []
 
static const JSCFunctionListEntry js_number_funcs []
 
static const JSCFunctionListEntry js_number_proto_funcs []
 
static const JSCFunctionListEntry js_boolean_proto_funcs []
 
static const JSCFunctionListEntry js_string_funcs []
 
static const JSCFunctionListEntry js_string_proto_funcs []
 
static const JSCFunctionListEntry js_string_iterator_proto_funcs []
 
static const JSCFunctionListEntry js_string_proto_normalize []
 
static const JSCFunctionListEntry js_math_funcs []
 
static const JSCFunctionListEntry js_math_obj []
 
static const JSCFunctionListEntry js_regexp_funcs []
 
static const JSCFunctionListEntry js_regexp_proto_funcs []
 
static const JSCFunctionListEntry js_regexp_string_iterator_proto_funcs []
 
static const JSCFunctionListEntry js_json_funcs []
 
static const JSCFunctionListEntry js_json_obj []
 
static const JSCFunctionListEntry js_reflect_funcs []
 
static const JSCFunctionListEntry js_reflect_obj []
 
static const JSCFunctionListEntry js_proxy_funcs []
 
static const JSClassShortDef js_proxy_class_def []
 
static const JSCFunctionListEntry js_symbol_proto_funcs []
 
static const JSCFunctionListEntry js_symbol_funcs []
 
static const JSCFunctionListEntry js_map_funcs []
 
static const JSCFunctionListEntry js_map_proto_funcs []
 
static const JSCFunctionListEntry js_map_iterator_proto_funcs []
 
static const JSCFunctionListEntry js_set_proto_funcs []
 
static const JSCFunctionListEntry js_set_iterator_proto_funcs []
 
static const JSCFunctionListEntry js_weak_map_proto_funcs []
 
static const JSCFunctionListEntry js_weak_set_proto_funcs []
 
static const JSCFunctionListEntry *const js_map_proto_funcs_ptr [6]
 
static const uint8_t js_map_proto_funcs_count [6]
 
static const JSCFunctionListEntry js_generator_function_proto_funcs []
 
static const JSCFunctionListEntry js_generator_proto_funcs []
 
static const JSCFunctionListEntry js_promise_funcs []
 
static const JSCFunctionListEntry js_promise_proto_funcs []
 
static const JSCFunctionListEntry js_async_function_proto_funcs []
 
static const JSCFunctionListEntry js_async_iterator_proto_funcs []
 
static const JSCFunctionListEntry js_async_from_sync_iterator_proto_funcs []
 
static const JSCFunctionListEntry js_async_generator_function_proto_funcs []
 
static const JSCFunctionListEntry js_async_generator_proto_funcs []
 
static JSClassShortDef const js_async_class_def []
 
static const JSCFunctionListEntry js_global_funcs []
 
static int const month_days [] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
 
static char const month_names [] = "JanFebMarAprMayJunJulAugSepOctNovDec"
 
static char const day_names [] = "SunMonTueWedThuFriSat"
 
static const JSCFunctionListEntry js_date_funcs []
 
static const JSCFunctionListEntry js_date_proto_funcs []
 
static const char *const native_error_name [JS_NATIVE_ERROR_COUNT]
 
static const JSCFunctionListEntry js_array_buffer_funcs []
 
static const JSCFunctionListEntry js_array_buffer_proto_funcs []
 
static const JSCFunctionListEntry js_shared_array_buffer_funcs []
 
static const JSCFunctionListEntry js_shared_array_buffer_proto_funcs []
 
static const JSCFunctionListEntry js_typed_array_base_funcs []
 
static const JSCFunctionListEntry js_typed_array_base_proto_funcs []
 
static const JSCFunctionListEntry js_dataview_proto_funcs []
 
static pthread_mutex_t js_atomics_mutex = PTHREAD_MUTEX_INITIALIZER
 
static struct list_head js_atomics_waiter_list
 
static const JSCFunctionListEntry js_atomics_funcs []
 
static const JSCFunctionListEntry js_atomics_obj []
 

Data Structure Documentation

◆ JSRuntime

struct JSRuntime
+ Collaboration diagram for JSRuntime:
Data Fields
JSMallocFunctions mf
JSMallocState malloc_state
const char * rt_info
int atom_hash_size
int atom_count
int atom_size
int atom_count_resize
uint32_t * atom_hash
JSAtomStruct ** atom_array
int atom_free_index
int class_count
JSClass * class_array
struct list_head context_list
struct list_head gc_obj_list
struct list_head gc_zero_ref_count_list
struct list_head tmp_obj_list
JSGCPhaseEnum gc_phase: 8
size_t malloc_gc_threshold
struct list_head string_list
uintptr_t stack_size
uintptr_t stack_top
uintptr_t stack_limit
JSValue current_exception
BOOL in_out_of_memory: 8
struct JSStackFrame * current_stack_frame
JSInterruptHandler * interrupt_handler
void * interrupt_opaque
JSHostPromiseRejectionTracker * host_promise_rejection_tracker
void * host_promise_rejection_tracker_opaque
struct list_head job_list
JSModuleNormalizeFunc * module_normalize_func
JSModuleLoaderFunc * module_loader_func
void * module_loader_opaque
BOOL can_block: 8
JSSharedArrayBufferFunctions sab_funcs
int shape_hash_bits
int shape_hash_size
int shape_hash_count
JSShape ** shape_hash
void * user_opaque

◆ JSClass

struct JSClass
+ Collaboration diagram for JSClass:
Data Fields
uint32_t class_id
JSAtom class_name
JSClassFinalizer * finalizer
JSClassGCMark * gc_mark
JSClassCall * call
const JSClassExoticMethods * exotic

◆ JSStackFrame

struct JSStackFrame
+ Collaboration diagram for JSStackFrame:
Data Fields
struct JSStackFrame * prev_frame
JSValue cur_func
JSValue * arg_buf
JSValue * var_buf
struct list_head var_ref_list
const uint8_t * cur_pc
int arg_count
int js_mode
JSValue * cur_sp

◆ JSGCObjectHeader

struct JSGCObjectHeader
+ Collaboration diagram for JSGCObjectHeader:
Data Fields
int ref_count
JSGCObjectTypeEnum gc_obj_type: 4
uint8_t mark: 4
uint8_t dummy1
uint16_t dummy2
struct list_head link

◆ JSVarRef

struct JSVarRef
+ Collaboration diagram for JSVarRef:
Data Fields
union JSVarRef __unnamed__
JSValue * pvalue
JSValue value

◆ JSFloat64Union

union JSFloat64Union
Data Fields
double d
uint64_t u64
uint32_t u32[2]

◆ JSString

struct JSString
+ Collaboration diagram for JSAtomStruct:
Data Fields
JSRefCountHeader header
uint32_t len: 31
uint8_t is_wide_char: 1
uint32_t hash: 30
uint8_t atom_type: 2
uint32_t hash_next
struct list_head link
union JSString u

◆ JSClosureVar

struct JSClosureVar
Data Fields
uint8_t is_local: 1
uint8_t is_arg: 1
uint8_t is_const: 1
uint8_t is_lexical: 1
uint8_t var_kind: 4
uint16_t var_idx
JSAtom var_name

◆ JSVarScope

struct JSVarScope
Data Fields
int parent
int first

◆ JSVarDef

struct JSVarDef
Data Fields
JSAtom var_name
int scope_level
int scope_next
uint8_t is_const: 1
uint8_t is_lexical: 1
uint8_t is_captured: 1
uint8_t var_kind: 4
int func_pool_idx: 24

◆ JSFunctionBytecode

struct JSFunctionBytecode
+ Collaboration diagram for JSFunctionBytecode:
Data Fields
JSGCObjectHeader header
uint8_t js_mode
uint8_t has_prototype: 1
uint8_t has_simple_parameter_list: 1
uint8_t is_derived_class_constructor: 1
uint8_t need_home_object: 1
uint8_t func_kind: 2
uint8_t new_target_allowed: 1
uint8_t super_call_allowed: 1
uint8_t super_allowed: 1
uint8_t arguments_allowed: 1
uint8_t has_debug: 1
uint8_t backtrace_barrier: 1
uint8_t read_only_bytecode: 1
uint8_t * byte_code_buf
int byte_code_len
JSAtom func_name
JSVarDef * vardefs
JSClosureVar * closure_var
uint16_t arg_count
uint16_t var_count
uint16_t defined_arg_count
uint16_t stack_size
JSContext * realm
JSValue * cpool
int cpool_count
int closure_var_count
struct JSFunctionBytecode debug

◆ JSBoundFunction

struct JSBoundFunction
+ Collaboration diagram for JSBoundFunction:
Data Fields
JSValue func_obj
JSValue this_val
int argc
JSValue argv[0]

◆ JSForInIterator

struct JSForInIterator
+ Collaboration diagram for JSForInIterator:
Data Fields
JSValue obj
BOOL is_array
uint32_t array_length
uint32_t idx

◆ JSRegExp

struct JSRegExp
+ Collaboration diagram for JSRegExp:
Data Fields
JSString * pattern
JSString * bytecode

◆ JSProxyData

struct JSProxyData
+ Collaboration diagram for JSProxyData:
Data Fields
JSValue target
JSValue handler
uint8_t is_func
uint8_t is_revoked

◆ JSArrayBuffer

struct JSArrayBuffer
+ Collaboration diagram for JSArrayBuffer:
Data Fields
int byte_length
uint8_t detached
uint8_t shared
uint8_t * data
struct list_head array_list
void * opaque
JSFreeArrayBufferDataFunc * free_func

◆ JSTypedArray

struct JSTypedArray
+ Collaboration diagram for JSTypedArray:
Data Fields
struct list_head link
JSObject * obj
JSObject * buffer
uint32_t offset
uint32_t length

◆ JSAsyncFunctionState

struct JSAsyncFunctionState
+ Collaboration diagram for JSAsyncFunctionState:
Data Fields
JSValue this_val
int argc
BOOL throw_flag