MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / patch_jump

Method patch_jump

aiscript-vm/src/compiler/codegen.rs:1604–1610  ·  view source on GitHub ↗
(&mut self, offset: usize)

Source from the content-addressed store, hash-verified

1602 }
1603
1604 fn patch_jump(&mut self, offset: usize) {
1605 let jump = self.function.code_size() - offset;
1606 if jump > u16::MAX as usize {
1607 self.error("Too much code to jump over.");
1608 }
1609 self.function[offset - 1].putch_jump(jump as u16);
1610 }
1611
1612 fn emit_loop(&mut self, loop_start: usize) {
1613 let offset = self.function.code_size() - loop_start + 1;

Callers 4

generate_stmtMethod · 0.80
generate_exprMethod · 0.80
generate_matchMethod · 0.80

Calls 3

code_sizeMethod · 0.80
putch_jumpMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected