Class: SyntaxTree::YARV::PutSelf
- Inherits:
-
Object
- Object
- SyntaxTree::YARV::PutSelf
- Defined in:
- lib/syntax_tree/yarv/instructions.rb
Overview
### Summary
putself pushes the current value of self onto the stack.
### Usage
~~~ruby puts “Hello, world!” ~~~
Instance Method Summary collapse
- #call(vm) ⇒ Object
- #canonical ⇒ Object
- #disasm(fmt) ⇒ Object
- #length ⇒ Object
- #pops ⇒ Object
- #pushes ⇒ Object
- #to_a(_iseq) ⇒ Object
Instance Method Details
#call(vm) ⇒ Object
4363 4364 4365 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4363 def call(vm) vm.push(vm.frame._self) end |
#canonical ⇒ Object
4359 4360 4361 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4359 def canonical self end |
#disasm(fmt) ⇒ Object
4339 4340 4341 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4339 def disasm(fmt) fmt.instruction("putself") end |
#length ⇒ Object
4347 4348 4349 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4347 def length 1 end |
#pops ⇒ Object
4351 4352 4353 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4351 def pops 0 end |
#pushes ⇒ Object
4355 4356 4357 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4355 def pushes 1 end |
#to_a(_iseq) ⇒ Object
4343 4344 4345 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4343 def to_a(_iseq) [:putself] end |