feat: SafeRegAlloc IRToX64 integration, wiring, and IRLower routing fixes#130
Merged
Merged
Conversation
…ixes IRToX64.arm: - SafeRegAlloc helpers: safeLoadVal, safeStoreDst, safeLoadArg, safeBeginInstr, safeEndInstr - emitFunctionSafe: stack-canonical prologue/epilogue with param save - emitInstrSafe: 20/35 opcodes (MOV, BINOP, CALL, SYSCALL, LOAD, STORE, control flow) - CALL stack args support (>6 args on Linux, >4 on Windows) - Callee stack param save in safe prologue - _start prologue (capture argc/argv to BSS globals) - R8/R9 push/pop in old-path SYSCALL/CALL NativeBackend.arm: - useSafeRegAlloc flag + setSafeRegAlloc setter - SafeRegAlloc instance creation + wiring in compile() - Error gate: hasError check after elf.build()/pe.build() (prevents binary output on unresolved labels) Main.arm: - --safe-regalloc CLI flag parsing - safeRegAlloc parameter passed through compile() - File.exists == false pattern fixes IRLower.arm: - toLower: __arimo_tolower helper (strlen + mmap + ASCII lowercase loop) - super() routing: resolve parent class name, emit ParentClass__init - system(): __arimo_system helper (fork+execve+waitpid via syscalls) - List.compareTo: inline pointer comparison (0 if same, -1 otherwise) - generateToLower(), generateSystem() helper generators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SafeRegAlloc full integration into the compiler backend
IRToX64.arm (+504 lines)
NativeBackend.arm (+45 lines)
useSafeRegAllocflag +setSafeRegAlloc(enabled)settercompile()hasErrorcheck afterelf.build()/pe.build()(applyFixups)Main.arm (+24 lines)
--safe-regallocCLI flag: activates SafeRegAlloc modecompile()→NativeBackend.setSafeRegAlloc(true)IRLower.arm (+195 lines)
__arimo_tolowerhelper: strlen + mmap + ASCII lowercase loop__arimo_systemhelper: fork+execve+waitpid via syscallsVerification