mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
working happy path
This commit is contained in:
parent
d3ac7d616d
commit
644def72f1
7 changed files with 103 additions and 59 deletions
|
@ -137,6 +137,7 @@ pub trait CallConv<GeneralReg: RegTrait, FloatReg: RegTrait, ASM: Assembler<Gene
|
|||
|
||||
fn setjmp(buf: &mut Vec<'_, u8>, relocs: &mut Vec<'_, Relocation>);
|
||||
fn longjmp(buf: &mut Vec<'_, u8>, relocs: &mut Vec<'_, Relocation>);
|
||||
fn roc_panic(buf: &mut Vec<'_, u8>, relocs: &mut Vec<'_, Relocation>);
|
||||
}
|
||||
|
||||
pub enum CompareOperation {
|
||||
|
@ -913,6 +914,16 @@ impl<
|
|||
out.into_bump_slice()
|
||||
}
|
||||
|
||||
fn build_roc_panic(&mut self) -> &'a [u8] {
|
||||
let mut out = bumpalo::vec![in self.env.arena];
|
||||
|
||||
CC::roc_panic(&mut out, &mut self.relocs);
|
||||
|
||||
dbg!(&self.relocs);
|
||||
|
||||
out.into_bump_slice()
|
||||
}
|
||||
|
||||
fn build_fn_pointer(&mut self, dst: &Symbol, fn_name: String) {
|
||||
let reg = self.storage_manager.claim_general_reg(&mut self.buf, dst);
|
||||
|
||||
|
@ -922,7 +933,11 @@ impl<
|
|||
fn build_data_pointer(&mut self, dst: &Symbol, data_name: String) {
|
||||
let reg = self.storage_manager.claim_general_reg(&mut self.buf, dst);
|
||||
|
||||
ASM::data_pointer(&mut self.buf, &mut self.relocs, data_name, reg)
|
||||
// now, this gives a pointer to the value
|
||||
ASM::data_pointer(&mut self.buf, &mut self.relocs, data_name, reg);
|
||||
|
||||
// dereference
|
||||
ASM::mov_reg64_mem64_offset32(&mut self.buf, reg, reg, 0);
|
||||
}
|
||||
|
||||
fn build_fn_call(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue