Class: SyntaxTree::YARV::PutNil
Overview
### Summary
‘putnil` pushes a global nil object onto the stack.
### Usage
~~~ruby nil ~~~
Instance Method Summary
collapse
Methods inherited from Instruction
#branch_targets, #falls_through?, #leaves?, #length, #pops
Instance Method Details
#==(other) ⇒ Object
4544
4545
4546
|
# File 'lib/syntax_tree/yarv/instructions.rb', line 4544
def ==(other)
other.is_a?(PutNil)
end
|
#call(vm) ⇒ Object
4556
4557
4558
|
# File 'lib/syntax_tree/yarv/instructions.rb', line 4556
def call(vm)
canonical.call(vm)
end
|
#canonical ⇒ Object
4552
4553
4554
|
# File 'lib/syntax_tree/yarv/instructions.rb', line 4552
def canonical
PutObject.new(nil)
end
|
#deconstruct_keys(_keys) ⇒ Object
4540
4541
4542
|
# File 'lib/syntax_tree/yarv/instructions.rb', line 4540
def deconstruct_keys(_keys)
{}
end
|
#disasm(fmt) ⇒ Object
4532
4533
4534
|
# File 'lib/syntax_tree/yarv/instructions.rb', line 4532
def disasm(fmt)
fmt.instruction("putnil")
end
|
#pushes ⇒ Object
4548
4549
4550
|
# File 'lib/syntax_tree/yarv/instructions.rb', line 4548
def pushes
1
end
|
#side_effects? ⇒ Boolean
4560
4561
4562
|
# File 'lib/syntax_tree/yarv/instructions.rb', line 4560
def side_effects?
false
end
|
#to_a(_iseq) ⇒ Object
4536
4537
4538
|
# File 'lib/syntax_tree/yarv/instructions.rb', line 4536
def to_a(_iseq)
[:putnil]
end
|