# jerryscript-project/jerryscript architecture

> Architecture diagram of the GitHub repository jerryscript-project/jerryscript, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jerryscript-project/jerryscript
- Repository: https://github.com/jerryscript-project/jerryscript

## Overview

JerryScript is a compact, embeddable JavaScript engine for resource-constrained devices. An embedding application submits JavaScript through the C API; the engine parses and compiles it to bytecode, then executes it in the VM using ECMAScript objects and built-ins. Additional product capabilities include snapshots, modules, and remote debugging. The graph reflects the documented engine workflow and source-index references; several subsystem connections are dashed because their implementation paths were not excerpted.

Main entry points: [`jerry-core/vm/vm.c`](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/vm/vm.c) (Virtual machine), [`jerry-core/parser/js/js-parser-expr.c`](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/parser/js/js-parser-expr.c) (JS parser), [`jerry-core/api/jerryscript.c`](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/api/jerryscript.c) (C API), [`jerry-core/jcontext/jcontext.h`](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/jcontext/jcontext.h) (Engine context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Embedding and APIs"]
  node_api["C API<br/>[jerryscript.c]"]
  node_context["Engine context<br/>[jcontext.h]"]
end

subgraph group_language["Language processing"]
  node_parser["JS parser<br/>[js-parser-expr.c]"]
  node_regexp["RegExp parser<br/>[re-parser.c]"]
  node_literals["Literal storage"]
  node_bytecode["Bytecode<br/>[byte-code.c]"]
end

subgraph group_runtime["Execution runtime"]
  node_vm["Virtual machine<br/>[vm.c]"]
  node_ecma["ECMAScript objects<br/>[ecma-objects.c]"]
  node_builtins["Built-in objects<br/>[ecma-builtins.c]"]
  node_helpers["ECMAScript helpers<br/>[ecma-helpers.c]"]
  node_memory["Memory management<br/>[jmem-heap.c]"]
end

subgraph group_capabilities["Engine capabilities"]
  node_snapshot["Snapshot API<br/>[jerry-snapshot.c]"]
  node_modules["Module API<br/>[jerry-module.c]"]
  node_debugger["Debugger engine<br/>[debugger.c]"]
  node_debugclient["Debugger client<br/>[jerry_client.py]"]
  node_transport["Debugger transport"]
end

node_host(("Embedding application"))

node_host -->|"embeds through"| node_api
node_api -.->|"submits source"| node_parser
node_parser -.->|"compiles to"| node_bytecode
node_bytecode -.->|"executes in"| node_vm
node_vm -->|"uses objects"| node_ecma
node_vm -->|"dispatches built-ins"| node_builtins
node_vm -->|"uses helpers"| node_helpers
node_parser -.->|"stores literals"| node_literals
node_parser -.->|"parses patterns"| node_regexp
node_api -->|"uses context"| node_context
node_context -->|"tracks heap"| node_memory
node_host -->|"precompiles source"| node_snapshot
node_host -.->|"loads modules"| node_modules
node_host -->|"debugs scripts"| node_debugclient
node_debugclient -->|"connects through"| node_transport
node_transport -.->|"carries commands"| node_debugger
node_debugger -->|"inspects execution"| node_vm

click node_api "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/api/jerryscript.c"
click node_context "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/jcontext/jcontext.h"
click node_parser "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/parser/js/js-parser-expr.c"
click node_regexp "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/parser/regexp/re-parser.c"
click node_literals "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/ecma/base/ecma-literal-storage.c"
click node_bytecode "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/parser/js/byte-code.c"
click node_vm "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/vm/vm.c"
click node_ecma "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/ecma/operations/ecma-objects.c"
click node_builtins "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/ecma/builtin-objects/ecma-builtins.c"
click node_helpers "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/ecma/base/ecma-helpers.c"
click node_memory "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/jmem/jmem-heap.c"
click node_snapshot "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/api/jerry-snapshot.c"
click node_modules "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/api/jerry-module.c"
click node_debugger "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/debugger/debugger.c"
click node_debugclient "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-debugger/jerry_client.py"
click node_transport "https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/api/jerry-debugger-transport.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_context toneBlue
class node_parser,node_regexp,node_literals,node_bytecode toneAmber
class node_vm,node_ecma,node_builtins,node_helpers,node_memory toneMint
class node_snapshot,node_modules,node_debugger,node_debugclient,node_transport toneRose
class node_host toneIndigo
```

## Components

### Embedding and APIs

- [C API](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/api/jerryscript.c): `jerry-core/api/jerryscript.c`
- [Engine context](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/jcontext/jcontext.h): `jerry-core/jcontext/jcontext.h`

### Language processing

- [JS parser](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/parser/js/js-parser-expr.c): `jerry-core/parser/js/js-parser-expr.c`
- [RegExp parser](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/parser/regexp/re-parser.c): `jerry-core/parser/regexp/re-parser.c`
- [Literal storage](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/ecma/base/ecma-literal-storage.c): `jerry-core/ecma/base/ecma-literal-storage.c`
- [Bytecode](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/parser/js/byte-code.c): `jerry-core/parser/js/byte-code.c`

### Execution runtime

- [Virtual machine](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/vm/vm.c): `jerry-core/vm/vm.c`
- [ECMAScript objects](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/ecma/operations/ecma-objects.c): `jerry-core/ecma/operations/ecma-objects.c`
- [Built-in objects](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/ecma/builtin-objects/ecma-builtins.c): `jerry-core/ecma/builtin-objects/ecma-builtins.c`
- [ECMAScript helpers](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/ecma/base/ecma-helpers.c): `jerry-core/ecma/base/ecma-helpers.c`
- [Memory management](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/jmem/jmem-heap.c): `jerry-core/jmem/jmem-heap.c`

### Engine capabilities

- [Snapshot API](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/api/jerry-snapshot.c): `jerry-core/api/jerry-snapshot.c`
- [Module API](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/api/jerry-module.c): `jerry-core/api/jerry-module.c`
- [Debugger engine](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/debugger/debugger.c): `jerry-core/debugger/debugger.c`
- [Debugger client](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-debugger/jerry_client.py): `jerry-debugger/jerry_client.py`
- [Debugger transport](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/api/jerry-debugger-transport.c): `jerry-core/api/jerry-debugger-transport.c`

### Other components

- **Embedding application**

## Connections

- Embedding application → C API: embeds through (evidence: `README.md`)
- C API → JS parser: submits source
- JS parser → Bytecode: compiles to
- Bytecode → Virtual machine: executes in
- Virtual machine → ECMAScript objects: uses objects (evidence: `jerry-core/vm/vm.c`)
- Virtual machine → Built-in objects: dispatches built-ins (evidence: `jerry-core/vm/vm.c`)
- Virtual machine → ECMAScript helpers: uses helpers (evidence: `jerry-core/vm/vm.c`)
- JS parser → Literal storage: stores literals
- JS parser → RegExp parser: parses patterns
- C API → Engine context: uses context (evidence: `jerry-core/api/jerryscript.c`)
- Engine context → Memory management: tracks heap (evidence: `jerry-core/jcontext/jcontext.h`)
- Embedding application → Snapshot API: precompiles source (evidence: `README.md`)
- Embedding application → Module API: loads modules
- Embedding application → Debugger client: debugs scripts (evidence: `jerry-debugger/jerry_client.py`)
- Debugger client → Debugger transport: connects through (evidence: `jerry-debugger/jerry_client.py`)
- Debugger transport → Debugger engine: carries commands
- Debugger engine → Virtual machine: inspects execution (evidence: `jerry-core/debugger/debugger.c`)
