Go to file
sunzhe23 9c3e2e6aed Optimize some runtime stub for asm interpreter
1 Set FindElementWithCache and Float as no GC runtime
2 Add SavePC for RuntimeCall if needed

issue: #I53PT7

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-20 03:10:30 -07:00
.gitee refactor stl container 2022-04-06 16:05:22 +08:00
docs Documentation Modifications About Compilation 2022-04-18 14:12:24 +08:00
ecmascript Optimize some runtime stub for asm interpreter 2022-04-20 03:10:30 -07:00
test add DoStackOverflowCheck for app crash after reboot many times 2022-04-19 17:44:54 +08:00
.gitignore modify debugger events and api test 2022-01-14 15:24:38 +08:00
BUILD.gn fixed for compiler error in wagner master branch 2022-04-18 17:14:45 +08:00
bundle.json Add stub compile when trigger start build 2022-03-23 12:34:32 +08:00
js_runtime_config.gni Generate asm code for AsmInterCallRuntime 2022-04-17 23:49:48 -07:00
LICENSE add ark js_runtime 2021-09-05 16:05:06 +08:00
OAT.xml Make doc's picture pass through YellowZone CI 2022-03-24 14:38:32 +08:00
README_zh.md Change file folder "platform" to "tastpool" 2022-03-23 15:43:38 +08:00
README.md Fix internal issue list problem 2022-03-14 15:19:45 +08:00

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 Hi3516DV300 --build-target ark_js_runtime

Available APIs

For details, see NAPI.

Usage Guidelines

For details about how to generate JS bytecodes, see Using the Toolchain.

To run bytecodes:

$ cd out/release
$ export LD_LIBRARY_PATH=clang_x64/ark/ark_js_runtime:clang_x64/ark/ark:clang_x64/global/i18n:../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/
$ ./clang_x64/ark/ark_js_runtime/ark_js_vm helloworld.abc

For more information, please see: ARK-Runtime-Usage-Guide.

Repositories Involved

ark_runtime_core

ark_js_runtime

ark_ts2abc