The JIT that runs makepad apps from source: lexer, front end, type checker, lazy borrow checker (Gandalf; `--check-first` opts in), codegen, session and warm/cold caches keyed by compiler stamp, provided crates bound late, startup images, live patching. User-facing name is `makepad run` (binary `makepad`, MAKEPAD_RUN_* env, ~/.makepad-run); libs/relax stays the internal library name. `makepad check` reports rustc-style diagnostics with rustc error codes and checks a whole workspace (`--workspace`). Runs on macOS, Linux, Windows and Android. makepad-remote: one tool schema for apps and the WM (app/1): grabs, captures, traces, frame profiles and tweaks. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
19 lines
563 B
Rust
19 lines
563 B
Rust
// cold has a slot in v0, but no call until v2. Keep the branch dynamic, and call cold through an
|
|
// opaque fn pointer: O1 inlining would otherwise lower it with its caller in v0.
|
|
use std::sync::atomic::{AtomicBool, Ordering};
|
|
|
|
static TAKE_COLD: AtomicBool = AtomicBool::new(false);
|
|
|
|
#[inline(never)]
|
|
fn cold() -> u32 { 40 }
|
|
|
|
#[inline(never)]
|
|
fn a() -> u32 {
|
|
(if TAKE_COLD.load(Ordering::SeqCst) { std::hint::black_box(cold as fn() -> u32)() } else { 0 }) + 1
|
|
}
|
|
|
|
#[test]
|
|
fn run() {
|
|
TAKE_COLD.store(false, Ordering::SeqCst);
|
|
println!("out {}", a());
|
|
}
|