# Glossary

This document contains a list of terms, abbreviations, and acronyms that you may
come across either in this guide or in the HHVM source code. Don't worry if none
of the definitions mean anything to you yet; it may make more sense to revisit
this page as needed once you've read some more of the guide.

## HHVM/Hack/PHP-specific

The terms in this section are specific to HHVM, Hack, or PHP. Concepts that
apply more generally are listed in the [next
section](glossary.md#general).

### APC

The [Alternative PHP Cache](http://php.net/manual/en/intro.apc.php) was
originally added to PHP as a cache for compiled bytecode, to reduce the overhead
of loading a program's source code with every request. It has since been
replaced, but HHVM still supports it as a process-global hash table, used to
share data between active requests and/or cache data to be reused by later
requests.

### BOLT

[BOLT](https://github.com/facebookincubator/BOLT) is a binary optimizer,
developed by Facebook to optimize the performance of large applications.

### FPI/FPI Region

Function parameter info and corresponding regions in the bytecode. Described in
detail in [bytecode.specification](../bytecode.specification).

### HackC

The Hack Compiler, HHVM's new frontend (as of mid-2018). A parser and bytecode
emitter written completely in OCaml.

### HHAS

HipHop assembly: a human-readable and -writable representation of HHBC, HHVM's
bytecode.

### HHBC

HipHop bytecode, HHVM's custom bytecode. Described in
[bytecode.specification](../bytecode.specification).

### HHBBC

HopHop bytecode-to-bytecode compiler. Our static analysis engine that performs a
number of offline optimizations on bytecode.

### HHIR

HipHop intermediate representation, the primary IR in HHVM's JIT. Described in
[ir.specification](../ir.specification).

### HPHPc

[HipHop for PHP](https://en.wikipedia.org/wiki/HipHop_for_PHP), a transpiler
from PHP to C++ and HHVM's predecessor. A large part of HHVM's runtime is
inherited from HPHPc.

### HNI

[HHVM native interface](https://github.com/facebook/hhvm/wiki/Extension-API).
HHVM's mechanism for calling native code from PHP (name inspired by [JNI](https://en.wikipedia.org/wiki/Java_Native_Interface)).

### RDS/Target Cache

The request data segment, defined in
[runtime/base/rds.h](../../runtime/base/rds.h) is a form of [thread-local
storage](https://en.wikipedia.org/wiki/Thread-local_storage), used to hold
information that can vary between PHP requests, like the definitions of classes
and functions. The target cache is a collection of request-local caches used
by the JIT that live in RDS.

### Repo/Repo authoritative

HHVM stores bytecode in a cache we call the [repo](../repo), short for
"repository". Repo authoritative is an execution mode in which HHVM assumes that
no code exists outside of what's already in the currently-loaded repo, allowing
much more aggressive optimizations.

### TC/Translation cache

The block of memory where HHVM stores JIT-compiled code.

### TCA

Translation cache address: a pointer to code or data in the translation cache.

### tc-print

Translation cache printer: a tool for inspecting the code generated by HHVM,
optionally annotated with performance events.

### Tracelet

A region of bytecode used as the basic unit of compilation in some modes of
HHVM's JIT. No larger than a basic block.

### vasm

Virtual assembly, our low-level intermediate representation. Positioned between
HHIR and machine code.

### Xbox

[Cross-box server](../server.xbox_server) (not the video game console). A form
of HHVM-specific IPC.

### XLS

Extended linear scan, the algorithm used by our [register
allocator](../../runtime/vm/jit/vasm-xls.cpp).

## General

If you're new to compilers, performance-sensitive applications, or just curious,
you may want to skim through the following terms:

- [ARM](https://en.wikipedia.org/wiki/ARM_architecture): A family of CPU architectures. In the context of HHVM: [AArch64](https://en.wikipedia.org/wiki/ARM_architecture#AArch64), the 64-bit version of ARM.
- [AST/abstract syntax tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree)
- [Bytecode](https://en.wikipedia.org/wiki/Bytecode)
- [Basic block](https://en.wikipedia.org/wiki/Basic_block)
- **CFG**: [control flow graph](https://en.wikipedia.org/wiki/Control_flow_graph) or [context-free grammar](https://en.wikipedia.org/wiki/Context-free_grammar) (nearly always the former here).
- [Compilation unit/translation unit](https://en.wikipedia.org/wiki/Translation_unit_(programming))
- [COW/copy-on-write](https://en.wikipedia.org/wiki/Copy-on-write)
- [CPU cache](https://en.wikipedia.org/wiki/CPU_cache). Also d-cache, data cache, i-cache, instruction cache.
- [IR/intermediate representation](https://en.wikipedia.org/wiki/Intermediate_representation).
- [FP/frame pointer](https://en.wikipedia.org/wiki/Call_stack#Stack_and_frame_pointers).
- **ICF/identical code folding**: a compiler/linker optimization that detects and de-duplicates identical blocks of code.
- [TLB/iTLB/dTLB](https://en.wikipedia.org/wiki/Translation_lookaside_buffer)
- [Bytecode interpreter](https://en.wikipedia.org/wiki/Interpreter_(computing)#Bytecode_interpreters)
- [JIT/just-in-time compilation](https://en.wikipedia.org/wiki/Just-in-time_compilation)
- **Leaf function**: a function that calls no other functions; a leaf node in the control flow graph.
- [NUMA/non-uniform memory acces](https://en.wikipedia.org/wiki/Non-uniform_memory_access)
- [PGO/profile-guided optimization](https://en.wikipedia.org/wiki/Profile-guided_optimization)
- [RSS/resident set size](https://en.wikipedia.org/wiki/Resident_set_size)
- [SP/stack pointer](https://en.wikipedia.org/wiki/Call_stack#Stack_and_frame_pointers)
- [x86](https://en.wikipedia.org/wiki/X86-64): A family of CPU architectures. In the context of HHVM: [x86-64](https://en.wikipedia.org/wiki/X86-64), the 64-bit version of x64.
