MCPcopy Create free account
hub / github.com/GPPVM-Project/SkyLC / attach_bytecode

Method attach_bytecode

crates/skyl-vm/src/virtual_machine.rs:657–674  ·  view source on GitHub ↗
(&mut self, bytecode: &Bytecode)

Source from the content-addressed store, hash-verified

655 }
656
657 pub fn attach_bytecode(&mut self, bytecode: &Bytecode) {
658 self.bytecode = Some(bytecode.clone());
659 self.attach_main_fn();
660
661 let native_fn_max_id = bytecode
662 .native_functions
663 .iter()
664 .max_by_key(|n| n.1.id)
665 .unwrap()
666 .1
667 .id;
668
669 // TODO: Fix the native functions detection
670 self.native_functions = vec![
671 NativeFunction::new(Self::invalidate_native_call, 0);
672 native_fn_max_id as usize + 1
673 ];
674 }
675
676 pub fn interpret(&mut self) {
677 self.attach_main_fn();

Callers 1

runFunction · 0.80

Calls 2

cloneMethod · 0.80
attach_main_fnMethod · 0.80

Tested by

no test coverage detected