MCPcopy Create free account
hub / github.com/diem/move / emit

Method emit

language/move-prover/bytecode/src/function_data_builder.rs:144–159  ·  view source on GitHub ↗

Emits a bytecode.

(&mut self, bc: Bytecode)

Source from the content-addressed store, hash-verified

142
143 /// Emits a bytecode.
144 pub fn emit(&mut self, bc: Bytecode) {
145 use Bytecode::*;
146 let no_fallthrough_jump_removal = self.options.no_fallthrough_jump_removal;
147 // Perform some minimal peephole optimization
148 match (self.data.code.last(), &bc) {
149 // jump L; L: ..
150 (Some(Jump(_, label1)), Label(_, label2))
151 if !no_fallthrough_jump_removal && label1 == label2 =>
152 {
153 *self.data.code.last_mut().unwrap() = bc;
154 }
155 _ => {
156 self.data.code.push(bc);
157 }
158 }
159 }
160
161 /// Emits a sequence of bytecodes.
162 pub fn emit_vec(&mut self, bcs: Vec<Bytecode>) {

Callers 15

processMethod · 0.45
processMethod · 0.45
instrument_bytecodeMethod · 0.45
instrument_bytecodeMethod · 0.45
instrument_callMethod · 0.45
processMethod · 0.45
instrumentMethod · 0.45
processMethod · 0.45
emit_vecMethod · 0.45
emit_withMethod · 0.45
processMethod · 0.45
transform_bytecodeMethod · 0.45

Calls 1

pushMethod · 0.45

Tested by 3

instrument_bytecodeMethod · 0.36
instrument_callMethod · 0.36
processMethod · 0.36