Class: SyntaxTree::YARV::Nop

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree/yarv/instructions.rb

Overview

### Summary

nop is a no-operation instruction. It is used to pad the instruction sequence so there is a place for other instructions to jump to.

### Usage

~~~ruby raise rescue true ~~~

Instance Method Summary collapse

Instance Method Details

#call(vm) ⇒ Object



2404
2405
# File 'lib/syntax_tree/yarv/instructions.rb', line 2404

def call(vm)
end

#canonicalObject



2400
2401
2402
# File 'lib/syntax_tree/yarv/instructions.rb', line 2400

def canonical
  self
end

#disasm(fmt) ⇒ Object



2380
2381
2382
# File 'lib/syntax_tree/yarv/instructions.rb', line 2380

def disasm(fmt)
  fmt.instruction("nop")
end

#lengthObject



2388
2389
2390
# File 'lib/syntax_tree/yarv/instructions.rb', line 2388

def length
  1
end

#popsObject



2392
2393
2394
# File 'lib/syntax_tree/yarv/instructions.rb', line 2392

def pops
  0
end

#pushesObject



2396
2397
2398
# File 'lib/syntax_tree/yarv/instructions.rb', line 2396

def pushes
  0
end

#to_a(_iseq) ⇒ Object



2384
2385
2386
# File 'lib/syntax_tree/yarv/instructions.rb', line 2384

def to_a(_iseq)
  [:nop]
end