1b1994897Sopenharmony_ci# Glossary
2b1994897Sopenharmony_ci
3b1994897Sopenharmony_ci## Introduction
4b1994897Sopenharmony_ci
5b1994897Sopenharmony_ciDuring the development of Panda Runtime, we faced the fact that terminology related to the
6b1994897Sopenharmony_cidevelopment of compilers and interpreters is confusing in some cases. This document describes what
7b1994897Sopenharmony_cithe terms used mean.
8b1994897Sopenharmony_ci
9b1994897Sopenharmony_ci## Core terminology
10b1994897Sopenharmony_ci
11b1994897Sopenharmony_ci* **AOT** stands for **Ahead-Of-Time**. In compilers, terms "ahead-of-time compilation" and "AOT
12b1994897Sopenharmony_ci  compilation" are used to indicate that the source code or bytecode is compiled before actual
13b1994897Sopenharmony_ci  execution. In case of Panda Runtime, AOT compilation is used to compile Panda Bytecode into
14b1994897Sopenharmony_ci  native machine code to reduce runtime overhead from reading and compiling bytecode.
15b1994897Sopenharmony_ci  See https://en.wikipedia.org/wiki/Ahead-of-time_compilation.
16b1994897Sopenharmony_ci* **Bytecode**. See **Panda Bytecode**.
17b1994897Sopenharmony_ci* **Compiler** is a tool that performs source code or bytecode translation, optimization and
18b1994897Sopenharmony_ci  native code generation.
19b1994897Sopenharmony_ci* **IR** stands for **Intermediate Representation**. IR is an internal compiler data structure
20b1994897Sopenharmony_ci  used to represent input program and usually designed for analysis and optimization.
21b1994897Sopenharmony_ci  See https://en.wikipedia.org/wiki/Intermediate_representation.
22b1994897Sopenharmony_ci* **ISA** stands for **Instruction Set Architecture**. See **Panda Bytecode** and
23b1994897Sopenharmony_ci  https://en.wikipedia.org/wiki/Instruction_set_architecture.
24b1994897Sopenharmony_ci* **JIT** stands for **Just-In-Time**. In compilers, terms "just-in-time compilation" and "JIT
25b1994897Sopenharmony_ci  compilation" are used to indicate that the source code or bytecode is compiled during program
26b1994897Sopenharmony_ci  execution. In case of Panda Runtime, JIT compilation is used to compile Panda Bytecode into
27b1994897Sopenharmony_ci  native machine code to reduce overhead from interpreting bytecode.
28b1994897Sopenharmony_ci  See https://en.wikipedia.org/wiki/Just-in-time_compilation.
29b1994897Sopenharmony_ci* **Panda Assembler** is a tool that translates **Panda Assembly Language**
30b1994897Sopenharmony_ci  to **Panda Binary File**.
31b1994897Sopenharmony_ci* **Panda Assembly Language** is a low-level programming language retaining very strong
32b1994897Sopenharmony_ci  correspondence between the instructions in the language and **Panda Bytecode** instructions.
33b1994897Sopenharmony_ci  See [Assembly Format](assembly_format.md).
34b1994897Sopenharmony_ci* **Panda Binary File** or **Panda File** or **PF** is a binary representation of Panda Bytecode.
35b1994897Sopenharmony_ci  See [File Format](file_format.md).
36b1994897Sopenharmony_ci* **Panda Bytecode** or **PBC** is a portable hardware-independent instruction set designed for
37b1994897Sopenharmony_ci  compactness and efficient execution by Panda Runtime. See https://en.wikipedia.org/wiki/Bytecode.
38b1994897Sopenharmony_ci* **Runtime** is a runtime system, also called runtime environment.
39b1994897Sopenharmony_ci
40b1994897Sopenharmony_ci## Memory management terms
41b1994897Sopenharmony_ci
42b1994897Sopenharmony_ci* **Allocator** is a part of the system that servicing allocation and deallocation requests.
43b1994897Sopenharmony_ci* **Card** is a division of memory with some fixed size. Card size usually smaller than a page.
44b1994897Sopenharmony_ci* **Card table** used for marking cards. In general, it has one bit or byte (a byte used to
45b1994897Sopenharmony_ci  improve performance of GC barrier) for one card.
46b1994897Sopenharmony_ci    It can be used by both generational and concurrent collectors.
47b1994897Sopenharmony_ci    It can be used for tracking references from tenured generation to the young generation and
48b1994897Sopenharmony_ci    for tracking modified references during concurrent phase of GC.
49b1994897Sopenharmony_ci* **Compacting GC** is a GC which compacts live objects to reduce fragmentation.
50b1994897Sopenharmony_ci* **Conservative GC** or non-precise GC works with ambiguous references,
51b1994897Sopenharmony_ci  i.e. it treats anything inside object boundaries like a reference. Opposite term: **Precise GC**.
52b1994897Sopenharmony_ci* **Full GC** is cleaning the entire Heap.
53b1994897Sopenharmony_ci* **Garbage collection** is also known as automatic memory management,
54b1994897Sopenharmony_ci  is the automatic recycling of dynamically allocated memory.
55b1994897Sopenharmony_ci* **Garbage collector** performs garbage collection. Garbage collector recycles memory
56b1994897Sopenharmony_ci  that it can prove will never be used again.
57b1994897Sopenharmony_ci* **GC** stands for Garbage collector or sometimes for Garbage collection.
58b1994897Sopenharmony_ci* **Minor GC** in general it is garbage collection worked over Young generation space
59b1994897Sopenharmony_ci  (it includes survivor Eden and Survivor spaces).
60b1994897Sopenharmony_ci* **Major GC** in general it is garbage collection worked over Tenured/Old generation space.
61b1994897Sopenharmony_ci  Sometimes it is triggered by Minor GC, so it is impossible to separate them(see Full GC).
62b1994897Sopenharmony_ci* **Safepoint** is a range of execution where the state of the executing thread is well described.
63b1994897Sopenharmony_ci    Safepoint is used as a point at which we can safely stop the thread, and at this point, all
64b1994897Sopenharmony_ci    references on the stack are mapped (i.e., it is known when we have an object on the stack or not).
65b1994897Sopenharmony_ci    Mutator is at a known point in its interaction with the heap.
66b1994897Sopenharmony_ci    It means that all objects which are currently in use are known and we know how to get value
67b1994897Sopenharmony_ci    for each of their fields.
68b1994897Sopenharmony_ci* **Precise GC** deals only with exact/sure references, i.e. it knows object layout and can
69b1994897Sopenharmony_ci  extract references to the objects. Opposite term: **Conservative GC**.
70b1994897Sopenharmony_ci* **Semi-space compaction** is a compaction algorithm when memory is split to the two equal spaces
71b1994897Sopenharmony_ci  (one is empty and one used for allocation) and we just copy objects from one space to another
72b1994897Sopenharmony_ci  using bump pointer allocator.
73b1994897Sopenharmony_ci* **STW** stands for **stop the world**, used in context of stop the world pauses forced by GC -
74b1994897Sopenharmony_ci  GC force to stop execution of code (interpreted,AOTed or JITed) to make exclusively some
75b1994897Sopenharmony_ci  operations.
76b1994897Sopenharmony_ci* **TLAB** stands for **Thread Local Allocation Buffer** - buffer used exclusively for allocations
77b1994897Sopenharmony_ci  in the thread (no lock required).
78b1994897Sopenharmony_ci* **white object** is an object non visited by GC(at the end of GC white objects will be reclaimed) 
79b1994897Sopenharmony_ci* **gray object** is reachable/alive object, but still should be scanned by GC (to process all fields with reference type)
80b1994897Sopenharmony_ci* **black object** is reachable/alive object and scanned by GC
81b1994897Sopenharmony_ci* **throughput** is % of time not spent in GC over a long period of time(sometimes `GC throughput` uses as % time spent in GC over a long period of time)
82