Commit ac942157 authored by qinsoon's avatar qinsoon

make changes based on formal spec changes

parent 87720ecb
......@@ -72,9 +72,9 @@ pub struct BlockContent {
pub keepalives: Option<Vec<P<SSAVar>>>
}
pub struct TerminationData {
normal_dest: Destination,
exn_dest: Destination
pub struct ResumptionData {
pub normal_dest: Destination,
pub exn_dest: Destination
}
pub enum DestArg {
......@@ -188,7 +188,15 @@ pub enum Terminal {
true_dest: Destination,
false_dest: Destination
},
Watchpoint, // TODO: Watchpoint ((wpid # destination) option) termination_data
Watchpoint{ // Watchpoint NONE ResumptionData
// serves as an unconditional trap. Trap to client, and resume with ResumptionData
// Watchpoint (WPID dest) ResumptionData
// when disabled, jump to dest
// when enabled, trap to client and resume
id: Option<WPID>,
disable_dest: Option<Destination>,
resume: ResumptionData
},
WPBranch{
wp: WPID,
disable_dest: Destination,
......@@ -196,14 +204,13 @@ pub enum Terminal {
},
Call{
data: CallData,
normal_dest: Destination,
exn_dest: Option<Destination>
resume: ResumptionData
},
SwapStack{
stack: P<Value>,
is_exception: bool,
args: Vec<P<Value>>,
normal_dest: Destination,
exn_dest: Destination
resume: ResumptionData
},
Switch{
cond: P<Value>,
......@@ -212,7 +219,7 @@ pub enum Terminal {
},
ExnInstruction{
inner: Expression,
term: TerminationData
resume: ResumptionData
}
}
......
......@@ -111,11 +111,16 @@ mod test_ir {
args: vec![blk_1_v50.clone()],
convention: CallConvention::Mu
},
normal_dest: Destination {
target: "blk_1_cont",
args: vec![DestArg::Normal(blk_1_n_3.clone()), DestArg::Freshbound(0)]
},
exn_dest: None
resume: ResumptionData {
normal_dest: Destination {
target: "blk_1_cont",
args: vec![DestArg::Normal(blk_1_n_3.clone()), DestArg::Freshbound(0)]
},
exn_dest: Destination {
target: "blk_1_cont",
args: vec![DestArg::Normal(blk_1_n_3.clone()), DestArg::Freshbound(0)]
}
}
};
let blk_1_content = BlockContent {
......
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