[2016][rust][23.1] No inlining for profiling?

profile
Alpha Chen 8 years ago
parent 3ff87286de
commit d60889b13c

@ -10,10 +10,12 @@ pub struct Assembunny {
} }
impl Assembunny { impl Assembunny {
#[inline(never)]
fn instruction(&self, i: usize) -> Option<Instruction> { fn instruction(&self, i: usize) -> Option<Instruction> {
self.instructions.get(i).cloned() self.instructions.get(i).cloned()
} }
#[inline(never)]
fn value<V: Into<Variable>>(&self, v: V) -> isize { fn value<V: Into<Variable>>(&self, v: V) -> isize {
let v: Variable = v.into(); let v: Variable = v.into();
match v { match v {
@ -22,6 +24,7 @@ impl Assembunny {
} }
} }
#[inline(never)]
fn toggle(&mut self, i: usize) { fn toggle(&mut self, i: usize) {
let instruction = match self.instruction(i) { let instruction = match self.instruction(i) {
Some(x) => x, Some(x) => x,
@ -42,6 +45,7 @@ impl Assembunny {
impl Iterator for Assembunny { impl Iterator for Assembunny {
type Item = Registers; type Item = Registers;
#[inline(never)]
fn next(&mut self) -> Option<Registers> { fn next(&mut self) -> Option<Registers> {
let pc = self.value(Register::PC) as usize; let pc = self.value(Register::PC) as usize;
let instruction = match self.instruction(pc) { let instruction = match self.instruction(pc) {

Loading…
Cancel
Save