Commit 31e67c5b authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Implemented Swapstack (untested)

parent e934e453
Pipeline #893 canceled with stages
in 5 minutes and 20 seconds
......@@ -144,6 +144,14 @@ impl MuType {
_ => false
}
}
pub fn is_stackref(&self) -> bool {
match self.v {
MuType_::StackRef => true,
_ => false
}
}
pub fn is_funcref(&self) -> bool {
match self.v {
MuType_::Struct(_) => true,
......
......@@ -295,7 +295,7 @@ fn emit_muir_dot_inner(file: &mut File, f_name: String, f_content: &FunctionCont
vec_utils::as_str(&enable_dest.get_arguments(&ops))
).unwrap();
}
Return(_) | Throw(_) | ThreadExit | TailCall(_) | SwapStackKill {..} => {}
Return(_) | Throw(_) | ThreadExit | TailCall(_) | SwapStackKill { .. } => {}
_ => {
panic!("unexpected terminating instruction: {}", inst);
......
......@@ -234,7 +234,8 @@ impl CompilerPass for GenMovPhi {
}
Instruction_::Watchpoint { .. } => unimplemented!(),
Instruction_::WPBranch { .. } => unimplemented!(),
Instruction_::SwapStackExc { .. } | Instruction_::SwapStackKill { .. } => unimplemented!(),
Instruction_::SwapStackExc { .. } |
Instruction_::SwapStackKill { .. } => unimplemented!(),
Instruction_::ExnInstruction { .. } => unimplemented!(),
_ => {
trace!("no rewrite");
......
......@@ -182,13 +182,8 @@ pub struct NodeKeepaliveClause {
#[derive(Debug)]
pub enum NodeCurrentStackClause {
RetWith {
id: MuID,
rettys: Vec<MuTypeNode>
},
KillOld {
id: MuID,
}
RetWith { id: MuID, rettys: Vec<MuTypeNode> },
KillOld { id: MuID }
}
#[derive(Debug)]
......@@ -198,10 +193,7 @@ pub enum NodeNewStackClause {
tys: Vec<MuTypeNode>,
vars: Vec<MuVarNode>
},
ThrowExc {
id: MuID,
exc: MuVarNode
}
ThrowExc { id: MuID, exc: MuVarNode }
}
#[derive(Debug)]
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment