P5.5: migrate the 35 BuildOptions accessors off #compiler to VM-native abi(.compiler)
`BuildOptions :: struct #compiler { ...35 methods... }` becomes
`BuildOptions :: struct { }` (an opaque null-sentinel handle) plus 35 free
`ufcs (self: BuildOptions, …) abi(.compiler)` decls in build.sx, each serviced
by a new `comptime_vm.callBuildOptionFn` arm (off `callCompilerFn`). No legacy
`compiler_lib` handler: the names are registered in `bound_fns` with a single
bailing stub only so `weldedCompilerFn` accepts them.
- String lifetime: setters dupe the arg into the persistent `Vm.gpa` (the
Compilation allocator, threaded into both `tryEval` and `runBuildCallback` —
not the per-eval VM arena) and write/append to the threaded `BuildConfig`.
Getters read the field/slice or compute the target predicate from the triple.
- Dispatch routing (Option B): a `#run`/const-init entry that directly calls a
compiler-domain/welded fn (`emit_llvm.entryNeedsVm`) runs on the VM with no
legacy fallback regardless of the `-Dcomptime-flat` gate, so gate-OFF stays
green without a legacy BuildOptions handler (P5.7 retires the legacy interp).
- Mark the 5 `platform/bundle.sx` getter-calling helpers `abi(.compiler)` (they
are comptime-only bundler code; otherwise their now-welded getter calls trip
the runtime-call gate).
- 37 `.ir` snapshots regenerated (std transitively imports build.sx → string-
pool/type-table indices shift); verified `.ir`-only, zero behavior-stream diffs.
BuildOptions `compiler_call` strict bails gone (1609/1614/1615 strict-clean);
1616 now bails on a separate, pre-existing unported bitwise/shift VM gap (`shr`),
to port first in P5.6. 703/0 both gates.
Also sweep the outdated "flat memory" terminology to "comptime/byte-addressable"
across comptime_vm + the plan/checkpoint/CLAUDE docs: the comptime VM is
arena-backed, byte-addressable memory where `Addr` is a real host pointer, not a
flat contiguous address space (flag names `-Dcomptime-flat`/`SX_COMPTIME_FLAT` kept).
This commit is contained in:
@@ -223,7 +223,7 @@ IOS_MIN_OS : string : "14.0";
|
||||
// carry the keys the iOS launcher needs (UIDeviceFamily,
|
||||
// LSRequiresIPhoneOS, UIApplicationSceneManifest, DTPlatformName,
|
||||
// MinimumOSVersion); macOS doesn't need any of those.
|
||||
build_info_plist :: (opts: BuildOptions, exe_name: string, bundle_id: string) -> string {
|
||||
build_info_plist :: (opts: BuildOptions, exe_name: string, bundle_id: string) -> string abi(.compiler) {
|
||||
if opts.is_ios() {
|
||||
platform_key := if opts.is_ios_simulator() then "iPhoneSimulator" else "iPhoneOS";
|
||||
return format(#string PLIST
|
||||
@@ -371,7 +371,7 @@ copy_asset_dir :: (src: string, dest: string, bundle: string) -> bool {
|
||||
// paths into `<dest_dir>`. Walks the framework paths in order; first
|
||||
// hit wins. Falls back to a `cp -R` subprocess because fs.sx Phase 1A
|
||||
// doesn't expose `list_dir` / `walk` yet.
|
||||
embed_framework :: (opts: BuildOptions, name: string, dest_dir: string) -> bool {
|
||||
embed_framework :: (opts: BuildOptions, name: string, dest_dir: string) -> bool abi(.compiler) {
|
||||
subdir := concat(name, ".framework");
|
||||
path_count := opts.framework_path_count();
|
||||
i : i64 = 0;
|
||||
@@ -580,7 +580,7 @@ absolutify :: (path: string) -> string {
|
||||
path
|
||||
}
|
||||
|
||||
android_bundle_main :: (opts: BuildOptions, binary: string, apk_path: string, bundle_id: string) -> bool {
|
||||
android_bundle_main :: (opts: BuildOptions, binary: string, apk_path: string, bundle_id: string) -> bool abi(.compiler) {
|
||||
// The bundler `cd`s into the stage dir for `zip` steps, so any
|
||||
// relative path the caller gave us would resolve against the wrong
|
||||
// cwd. Pin everything to absolute paths up front.
|
||||
@@ -872,7 +872,7 @@ lib_name_from_so_basename :: (basename: string) -> string {
|
||||
// `android:hasCode="true"` so Android loads the bundled classes.dex.
|
||||
// Otherwise it falls back to the legacy NativeActivity shape with an
|
||||
// `android.app.lib_name` meta-data entry pointing at the .so.
|
||||
build_android_manifest :: (opts: BuildOptions, package: string, lib_name: string) -> string {
|
||||
build_android_manifest :: (opts: BuildOptions, package: string, lib_name: string) -> string abi(.compiler) {
|
||||
pkg_esc := xml.escape(package);
|
||||
lib_esc := xml.escape(lib_name);
|
||||
if opts.jni_main_count() > 0 {
|
||||
@@ -969,7 +969,7 @@ dir_part :: (path: string) -> string {
|
||||
// the resulting class files via `d8 --release --lib <android.jar>
|
||||
// --output <stage>` so `<stage>/classes.dex` lands where the
|
||||
// orchestrator can zip it into the APK.
|
||||
compile_jni_main_sources :: (opts: BuildOptions, stage: string, android_jar: string, d8_path: string) -> bool {
|
||||
compile_jni_main_sources :: (opts: BuildOptions, stage: string, android_jar: string, d8_path: string) -> bool abi(.compiler) {
|
||||
java_root := path_join(stage, "java");
|
||||
classes_root := path_join(stage, "classes");
|
||||
if !create_dir_all(str_to_cstr(java_root)) {
|
||||
|
||||
Reference in New Issue
Block a user