Go to file
wupengyong 52a2b0f777 add runtime stat
Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: Id40e77ef79c6dd1882d0f7c2c68f7c0fba402333
2021-09-16 12:44:01 +08:00
docs fix docs issue 2021-09-14 14:55:27 +08:00
ecmascript add runtime stat 2021-09-16 12:44:01 +08:00
test modify globalrecord test 2021-09-13 19:32:18 +08:00
.gitignore add ark js_runtime 2021-09-05 16:05:06 +08:00
BUILD.gn Sync js_runtime to openharmony 2021-09-08 09:20:53 +08:00
js_runtime_config.gni add ark js_runtime 2021-09-05 16:05:06 +08:00
LICENSE add ark js_runtime 2021-09-05 16:05:06 +08:00
OAT.xml add ark js_runtime 2021-09-05 16:05:06 +08:00
ohos.build Sync js_runtime to openharmony 2021-09-08 09:20:53 +08:00
README_zh.md fix docs issue 2021-09-14 14:55:27 +08:00
README.md fix docs issue 2021-09-14 14:55:27 +08:00
run_test262.sh modify test262 case threshold 2021-09-13 11:08:26 +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 infomation, 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
│   ├─ 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
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 infomation, please see: ARK-Runtime-Usage-Guide.

Repositories Involved

ark_runtime_core

ark_js_runtime

ark_ts2abc