arkcompiler_runtime_core/static_core
openharmony_ci 5c31329d18
!793 Update test262, ets ignore lists
Merge pull request !793 from kuchkovairina/20231208_kfl
2023-12-12 08:40:07 +00:00
..
assembler add determenistic tests 2023-11-27 11:16:22 +03:00
bytecode_optimizer Merge local ecma scopes for fast interop mode 2023-12-05 15:55:22 +03:00
cmake Rebase to 3e1369808a6750c93617518cf946ee9f7b6f1a8a 2023-10-22 19:07:37 +03:00
compiler !750 [Compiler] Add the instruction LoadUndefined 2023-12-09 19:16:46 +00:00
cross_values Use external_deps to refer to es2panda 2023-10-31 20:32:08 +03:00
disassembler Fix codestyle for various components of static_core 2023-11-14 19:00:41 +03:00
docs Implement simple replacement of new StringBuilder(str).toString() with str 2023-11-20 11:12:44 +03:00
dprof Fix codestyle for various components of static_core 2023-11-14 19:00:41 +03:00
extras Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
gn Use external_deps to refer to es2panda 2023-10-31 20:32:08 +03:00
irtoc Add std.core.String.hashCode intrinsic function 2023-12-08 05:49:31 +00:00
isa Rebase + detach es2panda 2023-10-03 20:44:06 +03:00
ldscripts Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
libpandabase Implement optimisation for task queue. 2023-12-08 10:41:02 +03:00
libpandafile [ETS Runtime] Fixed vtable for case of abstract method with different return type 2023-12-04 11:17:25 +08:00
libziparchive Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
models Add license in arkcompiler 2023-10-06 18:54:08 +03:00
panda Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
pandastdlib Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
patches Switch vixl on ohos third party 2023-11-10 10:20:45 +03:00
platforms Replace TODO, FIXME and TBD with NOTE 2023-11-13 11:08:52 +03:00
plugins !732 Title: Implement support of ArkTS indexable objects. 2023-12-10 04:19:36 +00:00
quickener Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
runtime !691 [ArkTS] Add std.core.String.hashCode intrinsic function 2023-12-09 14:09:21 +00:00
scripts Add libe2p_test_plugin path 2023-12-01 10:01:40 +03:00
static_linker More fixes 2023-10-19 18:25:41 +03:00
templates Implement TaskStatistics, improve callback usage 2023-12-06 18:56:30 +03:00
tests Update test262, ets-cts, etc-func tests ignore lists 2023-12-08 23:16:33 +03:00
tools Remove .gitignore and .gitattributes files 2023-10-23 17:52:59 +03:00
verification [ArkTS] "undefined" ISA int and compiler support 2023-11-17 11:32:09 +03:00
.clang-format Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
.clang-tidy Add license in arkcompiler 2023-10-06 18:54:08 +03:00
.gn Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
ark_config.gni Fix host build 2023-11-24 22:45:35 +03:00
ark_root.gni Rebase to 1da172725b9691982b03cac868c77955e5689d7a 2023-10-21 17:02:57 +03:00
AUTHORS Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
BUILD.gn Merge local ecma scopes for fast interop mode 2023-12-05 15:55:22 +03:00
CMakeLists.txt Fix host build 2023-11-24 22:45:35 +03:00
LICENSE Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
OAT.xml Add arkplatform and static_core 2023-09-29 17:50:24 +03:00
README.md Add arkplatform and static_core 2023-09-29 17:50:24 +03:00

Bootstrapping

Currently an officially supported host OS for development, building and testing is Ubuntu 18.04 and Ubuntu 20.04. The full list of packages required for building and testing the project is specified in scripts/deps-lists files. These packages can be installed either manually or by running a bootstrap script:

$ sudo ./scripts/install-deps-ubuntu

For more bootstrapping options, run:

$ sudo ./scripts/install-deps-ubuntu --help

E.g. for development purposes you should run:

$ sudo ./scripts/install-deps-ubuntu -i=dev

If you want additionally to install python dependencies for running tests add a parameter -i=test:

$ sudo ./scripts/install-deps-ubuntu -i=dev -i=test

It creates a virtual environment .venv-panda in your home directory with all required dependencies. Later, tests python scripts can activate this environment. If you already have run with the parameter -i=test the second time it might be skipped.

Third party

Panda uses third party libraries. To install the libraries and apply patches, run:

$ ./scripts/install-third-party --force-clone

Building

Assuming your system is bootstrapped, please run the following commands in the root of the project:

$ mkdir panda-build
$ cd panda-build
$ cmake /path/to/panda/repository -GNinja
$ ninja

This will build Panda in debug mode with your default C++ compiler. All supported compilers can be found in cmake/toolchain. E.g., to build with Clang 14, pass a path to the corresponding toolchain file during configuration:

$ cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/panda/repository/cmake/toolchain/host_clang_14.cmake /path/to/panda/repository

Explicitly setting build types

Recommended way to build Panda is to set CMAKE_BUILD_TYPE variable explicitly during configurations. Supported values are:

Mode Assertions Optimizations Debug info
Debug Yes None (CMake default) -g (CMake default)
Release No -O3 (CMake default) None (CMake default)
FastVerify Yes -O2 -ggdb3

Notes:

  • Other common modes (RelWithDebInfo, MinSizeRel, DebugDetailed) should work but they are not tested in CI.
  • Unlike RelWithDebInfo, FastVerify preserves assertions (and provides more verbose debug information). Use this build type for running heavy test suites when you want both fast-running code and debuggability.
  • DebugDetailed gives more debug information than Debug, it can be usefull for debugging unit tests for example.

Example:

$ cmake -DCMAKE_BUILD_TYPE=Release ...

Running tests with QEMU for cross-compiled aarch64/arm builds

Recommended QEMU version for running testst is 6.2.0 (but 5.1+ should be ok, too). By default, it is downloaded and installed during environment bootstrap. Any system-installed package is left intact. If recommened QEMU version is not accessible via $PATH it can be specified during configuration time:

# If QEMU is available as /opt/qemu-6.2.0/bin/qemu-aarch64
$ cmake -DQEMU_PREFIX=/opt/qemu-6.2.0 ...

Building with GN

  1. Getting GN binary
$ git clone https://gn.googlesource.com/gn
$ cd gn
$ python build/gen.py
$ ninja -C out
  1. Build panda using gn (ark_asm, ark_disasm, ark_aot, ark_aotdump, c2abc, ark_bin, es2panda, verifier_bin and ark targets are supported)
$ cd /path/to/panda/repository
$ /path/to/gn/repository/out/gn gen out
$ ninja -C out ark

When standard system, use

$ cd /path/to/panda/repository
$ /path/to/gn/repository/out/gn --args=-is_standard_system=true gen out
$ ninja -C out <target name>

Further reading

Testing

For testing, the following umbrella targets that guarantee building prior to running may be used:

  • tests, for running all testing suites.
  • tests_full, for running all testing suites and various code linters.

Clang tools

clang-format and clang-tidy checks are integrated into build system and can be called by target of build system:

$ ninja code-style-check # clang-format
$ ninja clang-tidy-check # clang-tidy

Test coverage

In order to measure bytecode optimizer coverage, configure your build with -DENABLE_BYTECODE_OPTIMIZER_COVERAGE=true. Then run:

$ ninja bytecode_optimizer_coverage

Benchmarking

To build and run benchmarks, please use the umbrella target benchmarks or any of its dependencies. Please see the root CMakeLists.txt for more details.

NB! Make sure that you configure your build with -DCMAKE_BUILD_TYPE=Release, otherwise your run will most likely be dead slow.

Running

Running assembler

Assuming that you are in panda-build directory, please run:

$ ./bin/ark_asm /path/to/panda-assembly.pa /path/to/binary/output.abc

Running interpreter

Assuming that your main function is defined as .function main(...) in the assembly listing, and /path/to/binary/output.abc is the result of the assembler, please run:

$ ./bin/ark /path/to/binary/output.abc _GLOBAL::main