fix using old mach
This commit is contained in:
@@ -438,6 +438,7 @@ function resolve_mod_fn(path, pkg) {
|
||||
var compiled = null
|
||||
var mach_path = null
|
||||
var mach_blob = null
|
||||
var mcode_path = null
|
||||
var ir = null
|
||||
var optimized = null
|
||||
|
||||
@@ -446,7 +447,7 @@ function resolve_mod_fn(path, pkg) {
|
||||
return cached
|
||||
}
|
||||
|
||||
// Check for pre-compiled .mach file alongside .cm source
|
||||
// Check for pre-compiled .mach or .mcode file alongside .cm source
|
||||
if (ends_with(path, '.cm')) {
|
||||
mach_path = text(path, 0, length(path) - 3) + '.mach'
|
||||
if (fd.is_file(mach_path)) {
|
||||
@@ -454,6 +455,12 @@ function resolve_mod_fn(path, pkg) {
|
||||
put_into_cache(stone(blob(content)), mach_blob)
|
||||
return mach_blob
|
||||
}
|
||||
mcode_path = path + '.mcode'
|
||||
if (fd.is_file(mcode_path)) {
|
||||
compiled = mach_compile_mcode_bin(path, text(fd.slurp(mcode_path)))
|
||||
put_into_cache(stone(blob(content)), compiled)
|
||||
return compiled
|
||||
}
|
||||
}
|
||||
|
||||
// Compile via full pipeline: analyze → mcode → streamline → serialize
|
||||
|
||||
Reference in New Issue
Block a user