simplify and optimize attributed variables (#1590, #1634, #1730)

This commit is contained in:
Mark Thom
2023-02-10 00:09:22 -07:00
parent 9454d670c7
commit 359619e035
6 changed files with 289 additions and 243 deletions

View File

@@ -3570,22 +3570,6 @@ impl Machine {
self.file_time();
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallDeleteAttribute(_) => {
self.delete_attribute();
self.machine_st.p += 1;
}
&Instruction::ExecuteDeleteAttribute(_) => {
self.delete_attribute();
self.machine_st.p = self.machine_st.cp;
}
&Instruction::CallDeleteHeadAttribute(_) => {
self.delete_head_attribute();
self.machine_st.p += 1;
}
&Instruction::ExecuteDeleteHeadAttribute(_) => {
self.delete_head_attribute();
self.machine_st.p = self.machine_st.cp;
}
&Instruction::CallDynamicModuleResolution(arity, _) => {
let (module_name, key) = try_or_throw!(
self.machine_st,
@@ -3616,14 +3600,6 @@ impl Machine {
self.machine_st.backtrack();
}
}
&Instruction::CallEnqueueAttributedVar(_) => {
self.enqueue_attributed_var();
self.machine_st.p += 1;
}
&Instruction::ExecuteEnqueueAttributedVar(_) => {
self.enqueue_attributed_var();
self.machine_st.p = self.machine_st.cp;
}
&Instruction::CallFetchGlobalVar(_) => {
self.fetch_global_var();
step_or_fail!(self, self.machine_st.p += 1);
@@ -5215,6 +5191,22 @@ impl Machine {
self.get_from_attributed_variable_list();
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallPutToAttributedVarList(_) => {
self.put_to_attributed_variable_list();
step_or_fail!(self, self.machine_st.p += 1);
}
&Instruction::ExecutePutToAttributedVarList(_) => {
self.put_to_attributed_variable_list();
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallDeleteFromAttributedVarList(_) => {
self.delete_from_attributed_variable_list();
step_or_fail!(self, self.machine_st.p += 1);
}
&Instruction::ExecuteDeleteFromAttributedVarList(_) => {
self.delete_from_attributed_variable_list();
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
}
}