mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2025-02-01 01:14:10 +00:00
xujie
81a69cf09f
TSAOT Exception Handler
1. Throw JS exception in tsaot 2. Print bcoffset when occur JS exception issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5AMHL Signed-off-by: xujie <xujie101@huawei.com> Change-Id: I046d76c092a399354ddcdedd859f0c1e622387c2
ARK JS Runtime Module
Introduction
ARK JS Runtime is the runtime used by JavaScript JS
applications on OpenHarmony. It consists of the JS object allocator, garbage collector GC
, a standard library compliant with ECMAScript specifications, ARK bytecode interpreter, inline caches that store hidden classes, and the ARK Foreign Function Interface AFFI
.
For more information, see: ARK Runtime Subsystem.
ARK JS runtime architecture
Directory Structure
/ark/js_runtime
├─ ecmascript # JS object definition
│ ├─ base # Base helper class
│ ├─ builtins # ECMAScript library
│ ├─ class_linker # Bytecode pre-processing module
│ ├─ compiler # JS compiler
│ ├─ containers # Non-ECMAScript container library
│ ├─ cpu_profiler # CPU Performance Analyzer
│ ├─ hprof # Memory analysis utility class
│ ├─ ic # Inline cache module
│ ├─ interpreter # JS interpreter
│ ├─ jobs # Queue of jobs
│ ├─ js_vm # ARK command line tool
│ ├─ mem # Memory management module
│ ├─ napi # External native interface
│ ├─ regexp # Regular expression engine module
│ ├─ snapshot/mem # Snapshot module
│ ├─ tests # Unit test cases
│ ├─ thread # Thread pool
│ ├─ tooling # JS debugger
│ └─ vmstat # Runtime status utility classes
└─ test # Module test cases
Constraints
- Only the bytecode file generated by the ARK JS frontend can be run.
- Only support ES2015 standard and strict mode ("use strict").
- Don't support dynamically create functions via string (e.g., new Function("console.log(1))).
Build
./build.sh --product-name rk3568 --build-target ark_js_host_linux_tools_packages
Available APIs
For details, see NAPI.
Usage Guidelines
For details about how to generate JS bytecodes, see Using the Toolchain.
To run bytecodes:
LD_LIBRARY_PATH=out/rk3568/clang_x64/ark/ark:out/rk3568/clang_x64/ark/ark_js_runtime:out/rk3568/clang_x64/thirdparty/icu:prebuilts/clang/ohos/linux-x86_64/llvm/lib ./out/rk3568/clang_x64/ark/ark_js_runtime/ark_js_vm helloworld.abc
For more information, please see: ARK-Runtime-Usage-Guide.
Repositories Involved
Languages
C++
81.8%
JavaScript
13.1%
TypeScript
3.5%
C
0.9%
Python
0.6%