Merge pull request #3185 from mthom/install_verify_attr_opt

Optimize `verify_attr` by removing the need to scan instructions
This commit is contained in:
Mark Thom
2025-12-03 19:10:46 -07:00
committed by GitHub
12 changed files with 2272 additions and 1947 deletions

View File

@@ -143,9 +143,8 @@ mod libraries {
}
pub static BREAK_FROM_DISPATCH_LOOP_LOC: usize = 0;
pub static INSTALL_VERIFY_ATTR_INTERRUPT: usize = 1;
pub static VERIFY_ATTR_INTERRUPT_LOC: usize = 2;
pub static LIB_QUERY_SUCCESS: usize = 3;
pub static VERIFY_ATTR_INTERRUPT_LOC: usize = 1;
pub static LIB_QUERY_SUCCESS: usize = 2;
pub struct MachinePreludeView<'a> {
pub indices: &'a mut IndexStore,
@@ -418,12 +417,11 @@ impl Machine {
}
pub(crate) fn add_impls_to_indices(&mut self) {
let impls_offset = self.code.len() + 4;
let impls_offset = self.code.len() + 3;
self.code.extend(vec![
Instruction::BreakFromDispatchLoop,
Instruction::InstallVerifyAttr,
Instruction::VerifyAttrInterrupt(0),
Instruction::RunVerifyAttr,
Instruction::BreakFromDispatchLoop, // the location of LIB_QUERY_SUCCESS
Instruction::ExecuteTermGreaterThan,
Instruction::ExecuteTermLessThan,