fn materialize(&self, label_map: &HashMap<String, Word>) -> MaterializedInstruction {
        match self {
            Instruction::NonBasic(nbi, a) => {
                match a {
                    Value::Static(arg) => {
                        let (opcode, arg1) = nbi.bake(*arg);
                        MaterializedInstruction::Static {
                            instruction: self.clone(),
                            instruction_word: opcode,
                            arg1,
                            arg2: None,
                        }
                    }
                    Value::LabelReference(reference) => {
                        // We now optimistically generate the instruction based on the current
                        // best guess for the label address in the label map.
                        let address = label_map[reference];
                        let arg = InstructionArgument::Literal(address);
                        let (opcode, arg1) = nbi.bake(arg);

                        MaterializedInstruction::Flexible {
                            instruction: self.clone(),
                            instruction_word: opcode,
                            arg1,
                            arg2: None,
                        }
                    }
                }
            }
            Instruction::Basic(bi, a, b) => {
                // Both arguments must be fixed-sized for this to be static.
                match b {
                    Value::Static(arg2) => {
                        let (opcode, arg1, arg2) = bi.bake(*a, *arg2);
                        MaterializedInstruction::Static {
                            instruction: self.clone(),
                            instruction_word: opcode,
                            arg1,
                            arg2,
                        }
                    }
                    Value::LabelReference(reference) => {
                        // We now optimistically generate the instruction based on the current
                        // best guess for the label address in the label map.
                        let address = label_map[reference];
                        let arg2 = InstructionArgument::Literal(address);
                        let (opcode, arg1, arg2) = bi.bake(*a, arg2);

                        MaterializedInstruction::Flexible {
                            instruction: self.clone(),
                            instruction_word: opcode,
                            arg1,
                            arg2,
                        }
                    }
                }
            }
        }
    }
/// Materializes an instruction given the map of jump labels to program addresses.
Materializes an instruction given the map of jump labels to program addresses.
Materializes an instruction given the map of jump labels to program addresses .
fn materialize(&self, label_map: &HashMap<String, Word>) -> MaterializedInstruction {
        match self {
            Instruction::NonBasic(nbi, a) => {
                match a {
                    Value::Static(arg) => {
                        let (opcode, arg1) = nbi.bake(*arg);
                        MaterializedInstruction::Static {
                            instruction: self.clone(),
                            instruction_word: opcode,
                            arg1,
                            arg2: None,
                        }
                    }
                    Value::LabelReference(reference) => {
                        // We now optimistically generate the instruction based on the current
                        // best guess for the label address in the label map.
                        let address = label_map[reference];
                        let arg = InstructionArgument::Literal(address);
                        let (opcode, arg1) = nbi.bake(arg);
                        MaterializedInstruction::Flexible {
                            instruction: self.clone(),
                            instruction_word: opcode,
                            arg1,
                            arg2: None,
                        }
                    }
                }
            }
            Instruction::Basic(bi, a, b) => {
                // Both arguments must be fixed-sized for this to be static.
                match b {
                    Value::Static(arg2) => {
                        let (opcode, arg1, arg2) = bi.bake(*a, *arg2);
                        MaterializedInstruction::Static {
                            instruction: self.clone(),
                            instruction_word: opcode,
                            arg1,
                            arg2,
                        }
                    }
                    Value::LabelReference(reference) => {
                        // We now optimistically generate the instruction based on the current
                        // best guess for the label address in the label map.
                        let address = label_map[reference];
                        let arg2 = InstructionArgument::Literal(address);
                        let (opcode, arg1, arg2) = bi.bake(*a, arg2);
                        MaterializedInstruction::Flexible {
                            instruction: self.clone(),
                            instruction_word: opcode,
                            arg1,
                            arg2,
                        }
                    }
                }
            }
        }
    }
fn materialize ( & self , label_map : & HashMap < String , Word > ) -> MaterializedInstruction { match self { Instruction :: NonBasic ( nbi , a ) => { match a { Value :: Static ( arg ) => { let ( opcode , arg1 ) = nbi . bake ( * arg ) ; MaterializedInstruction :: Static { instruction : self . clone ( ) , instruction_word : opcode , arg1 , arg2 : None , } } Value :: LabelReference ( reference ) => { // We now optimistically generate the instruction based on the current // best guess for the label address in the label map. let address = label_map [ reference ] ; let arg = InstructionArgument :: Literal ( address ) ; let ( opcode , arg1 ) = nbi . bake ( arg ) ; MaterializedInstruction :: Flexible { instruction : self . clone ( ) , instruction_word : opcode , arg1 , arg2 : None , } } } } Instruction :: Basic ( bi , a , b ) => { // Both arguments must be fixed-sized for this to be static. match b { Value :: Static ( arg2 ) => { let ( opcode , arg1 , arg2 ) = bi . bake ( * a , * arg2 ) ; MaterializedInstruction :: Static { instruction : self . clone ( ) , instruction_word : opcode , arg1 , arg2 , } } Value :: LabelReference ( reference ) => { // We now optimistically generate the instruction based on the current // best guess for the label address in the label map. let address = label_map [ reference ] ; let arg2 = InstructionArgument :: Literal ( address ) ; let ( opcode , arg1 , arg2 ) = bi . bake ( * a , arg2 ) ; MaterializedInstruction :: Flexible { instruction : self . clone ( ) , instruction_word : opcode , arg1 , arg2 , } } } } } }
Materializes an instruction given the map of jump labels to program addresses.
Materializes an instruction given the map of jump labels to program addresses .
&self
label_map
&HashMap<String, Word>