harmony 鸿蒙jsvm_types.h
jsvm_types.h
Overview
JSVM-API type definitions.
Through the APIs, independent, standard, and complete JavaScript engine capabilities are provided, including managing the engine lifecycle, compiling and running JS code, implementing JS/C++ cross-language invoking, and taking snapshots.
Library: libjsvm.so
System capability: SystemCapability.ArkCompiler.JSVM
Since: 11
Related module: JSVM
Summary
Structs
Name | Description |
---|---|
struct JSVM_CallbackStruct | Pointer to and data of the native callbacks provided by the user. These functions are exposed to JavaScript via JSVM-API. |
struct JSVM_HeapStatistics | Heap statistics struct, which is used to store statistics about JavaScript heap memory usage. |
struct JSVM_InitOptions | Options for initializing a JavaScript VM. |
struct JSVM_CreateVMOptions | Options for creating a JavaScript VM. |
struct JSVM_VMInfo | JavaScript VM information. |
struct JSVM_PropertyDescriptor | Property descriptor. |
struct JSVM_ExtendedErrorInfo | Extended error information. |
struct JSVM_TypeTag | Type tag, stored as a 128-bit value of two unsigned 64-bit integers. This tag can be used as a UUID, so that JavaScript objects can be tagged, to ensure that their types remain unchanged. |
struct JSVM_PropertyHandlerConfigurationStruct | Struct for triggering the corresponding function callback in the struct when the getter, setter, deleter, or enumerator of an object is executed. |
struct JSVM_ScriptOrigin | Source code information. |
Types
Name | Description |
---|---|
typedef uint16_t char16_t | |
typedef struct JSVM_VM__ * JSVM_VM | JavaScript VM instance. |
typedef struct JSVM_VMScope__ * JSVM_VMScope | JavaScript VM scope. |
typedef struct JSVM_EnvScope__ * JSVM_EnvScope | Environment scope of the current VM instance. The environment is available to the VM instance of the thread only after the thread enters JSVM_EnvScope of the environment through OH_JSVM_OpenEnvScope. |
typedef struct JSVM_Script__ * JSVM_Script | JavaScript code. |
typedef struct JSVM_Env__ * JSVM_Env | Context of a specific VM state. It needs to be passed as a parameter when the native function is called and passed to any subsequent JSVM-API nested invoking. |
typedef struct JSVM_CpuProfiler__ * JSVM_CpuProfiler | JavaScript CPU profiler. |
typedef struct JSVM_Value__ * JSVM_Value | JavaScript value. |
typedef struct JSVM_Ref__ * JSVM_Ref | Reference to the JavaScript value. |
typedef struct JSVM_HandleScope__ * JSVM_HandleScope | Scope of the JavaScript value. It is used to control and modify the lifecycle of an object created in a specific scope. Typically, the JSVM-API value is created in the context of JSVM_HandleScope. When the native method is called from JavaScript, the default JSVM_HandleScope exists. If the user does not explicitly create a new JSVM_HandleScope, the JSVM-API value is created in the default JSVM_HandleScope. For any code call other than native method execution (for example, libuv callback), the module needs to create a scope before calling any function that may cause JavaScript value creation. JSVM_HandleScope is created using OH_JSVM_OpenHandleScope and destroyed using OH_JSVM_CloseHandleScope. Closing the scope represents indicating to the GC that all JSVM_Values created during the lifecycle of JSVM_HandleScope will no longer be referenced from the stack frame of the current heap. |
typedef struct JSVM_EscapableHandleScope__ * JSVM_EscapableHandleScope | A special type of handle scope, which is used to return the value created in a specific handle scope to the parent scope. |
typedef struct JSVM_CallbackInfo__ * JSVM_CallbackInfo | An opaque data type passed to the callback. It can be used to obtain additional information about the context in which the function is called. |
typedef struct JSVM_Deferred__ * JSVM_Deferred | Promise deferred object. |
typedef JSVM_CallbackStruct * JSVM_Callback | Pointer types of the native functions provided by user. These functions are exposed to JavaScript via JSVM-API. |
typedef void(JSVM_CDECL * JSVM_Finalize) (JSVM_Env env, void *finalizeData, void *finalizeHint) | Function pointer type. It is passed in when a native object or data is associated with a JavaScript object. This function is called when the associated JavaScript object is reclaimed by the GC to execute the native cleanup action. |
typedef bool(JSVM_CDECL * JSVM_OutputStream) (const char *data, int size, void *streamData) | Pointer to the callback of the ASCII output stream. data indicates the pointer to the output data. size indicates the size of the output data. void points to the end of the stream. streamData indicates the pointer passed to the API function together with the callback. The API function generates data to the output stream. If true is returned, the stream can continue to receive data. Otherwise, it aborts the stream. |
typedef JSVM_PropertyHandlerConfigurationStruct * JSVM_PropertyHandlerCfg | Pointer type of the struct that contains the property listening callback. |
Enums
你可能感兴趣的鸿蒙文章
harmony 鸿蒙JSVM_CreateVMOptions
harmony 鸿蒙JSVM_ExtendedErrorInfo
harmony 鸿蒙JSVM_PropertyDescriptor
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦