1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! # Ristretto JIT
//!
//! [](https://codecov.io/gh/theseus-rs/ristretto)
//! [](https://bencher.dev/perf/theseus-rs-ristretto)
//! [](https://github.com/theseus-rs/ristretto#license)
//! [](https://semver.org/spec/v2.0.0.html)
//!
//! ## Overview
//!
//! Ristretto JIT provides a Just-In-Time compiler for the Ristretto VM. The JIT compiler generates
//! native code from Ristretto VM bytecode, allowing for high-performance execution directly on the
//! host machine.
//!
//! ## Architecture
//!
//! The JIT compiler follows a multi-stage compilation pipeline:
//!
//! 1. **Bytecode Analysis** - Analyzes Java bytecode for control flow patterns
//! 2. **Control Flow Graph Construction** - Builds a block based control flow graph
//! 3. **SSA Transformation** - Converts stack-based operations to Static Single Assignment form
//! 4. **Native Code Generation** - Generates optimized machine code
//! 5. **Function Binding** - Creates callable native functions
//!
//! ## Features
//!
//! - **Fast execution** through native code generation
//! - **Automatic optimization** of bytecode patterns
//! - **Control flow graph analysis** for complex branching logic
//! - **Platform-specific compilation** for x86-64, aarch64 (ARM64), s390x (IBM Z) and riscv64
//! - **Comprehensive error handling** with detailed error messages
//!
//! ## Platform Support
//!
//! The JIT compiler automatically adapts to the target platform:
//!
//! - **Native platforms**:
//! - x86-64 (Intel/AMD 64-bit)
//! - aarch64 (ARM 64-bit)
//! - s390x (IBM Z Architecture)
//! - riscv64 (RISC-V 64-bit)
//!
//! ## Limitations
//!
//! Current limitations include:
//!
//! - Only static methods and constructors (`<init>`) are supported
//! - Limited object-oriented features (no instance method compilation yet)
//! - No garbage collection integration
//! - Exception handling is not fully implemented
pub use Compiler;
pub use ;
pub use Function;
pub use JitValue;
pub use Value;
pub use Compiler;