Class: Rubinius::ToolSets.current::ToolSet::Compiler::NestedLocalReference
- Inherits:
-
Object
- Object
- Rubinius::ToolSets.current::ToolSet::Compiler::NestedLocalReference
- Defined in:
- lib/rubinius/compiler/locals.rb
Instance Attribute Summary collapse
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#slot ⇒ Object
readonly
Returns the value of attribute slot.
Instance Method Summary collapse
- #get_bytecode(g) ⇒ Object
-
#initialize(slot, depth = 0) ⇒ NestedLocalReference
constructor
A new instance of NestedLocalReference.
- #set_bytecode(g) ⇒ Object
Constructor Details
#initialize(slot, depth = 0) ⇒ NestedLocalReference
Returns a new instance of NestedLocalReference.
100 101 102 103 |
# File 'lib/rubinius/compiler/locals.rb', line 100 def initialize(slot, depth=0) @slot = slot @depth = depth end |
Instance Attribute Details
#depth ⇒ Object
Returns the value of attribute depth.
97 98 99 |
# File 'lib/rubinius/compiler/locals.rb', line 97 def depth @depth end |
#slot ⇒ Object (readonly)
Returns the value of attribute slot.
98 99 100 |
# File 'lib/rubinius/compiler/locals.rb', line 98 def slot @slot end |
Instance Method Details
#get_bytecode(g) ⇒ Object
105 106 107 108 109 110 111 |
# File 'lib/rubinius/compiler/locals.rb', line 105 def get_bytecode(g) if @depth == 0 g.push_local @slot else g.push_local_depth @depth, @slot end end |
#set_bytecode(g) ⇒ Object
113 114 115 116 117 118 119 |
# File 'lib/rubinius/compiler/locals.rb', line 113 def set_bytecode(g) if @depth == 0 g.set_local @slot else g.set_local_depth @depth, @slot end end |