diff --git a/src/library/lib.rs b/src/library/lib.rs index 996ea94..7156b4d 100644 --- a/src/library/lib.rs +++ b/src/library/lib.rs @@ -271,9 +271,9 @@ impl Lib { } /// Assembles library from the provided instructions by encoding them into bytecode - pub fn assemble(code: &[Isa]) -> Result + pub fn assemble(code: &[Instr], isae: IsaSeg) -> Result where - Isa: InstructionSet, + Instr: Bytecode, { let call_sites = code.iter().filter_map(|instr| instr.call_site()).map(|site| site.lib); let libs_segment = LibSeg::try_from_iter(call_sites)?; @@ -288,13 +288,13 @@ impl Lib { code_segment.adjust_len(pos); let code_segment = SmallBlob::from_collection_unsafe(code_segment.to_vec()); - Ok(Lib { isae: Isa::isa_ids(), libs: libs_segment, code: code_segment, data: data_segment }) + Ok(Lib { isae, libs: libs_segment, code: code_segment, data: data_segment }) } /// Disassembles library into a set of instructions pub fn disassemble(&self) -> Result, CodeEofError> where - Isa: InstructionSet, + Isa: Bytecode, { let mut code = Vec::new(); let mut reader = Cursor::with(&self.code, &self.data, &self.libs);