MCPcopy Index your code
hub / github.com/endbasic/endbasic / reg_index

Method reg_index

core/src/vm/context.rs:220–227  ·  view source on GitHub ↗

Computes the absolute index in `regs` for `reg`.

(&self, reg: Register)

Source from the content-addressed store, hash-verified

218impl Context {
219 /// Computes the absolute index in `regs` for `reg`.
220 fn reg_index(&self, reg: Register) -> usize {
221 let (is_global, index) = reg.to_parts();
222 let mut index = usize::from(index);
223 if !is_global {
224 index += self.fp;
225 }
226 index
227 }
228
229 /// Gets the value of register `reg`.
230 ///

Callers 2

get_regMethod · 0.80
set_regMethod · 0.80

Calls 1

to_partsMethod · 0.80

Tested by

no test coverage detected