Class: Rubinius::ToolSet.current::TS::Compiler::EvalLocalReference

Inherits:
Object
  • Object
show all
Defined in:
lib/rubinius/compiler/locals.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ EvalLocalReference

Returns a new instance of EvalLocalReference.



127
128
129
130
# File 'lib/rubinius/compiler/locals.rb', line 127

def initialize(name)
  @name = name
  @depth = 0
end

Instance Attribute Details

#depthObject

Ignored, but simplifies duck-typing references



125
126
127
# File 'lib/rubinius/compiler/locals.rb', line 125

def depth
  @depth
end

Instance Method Details

#get_bytecode(g) ⇒ Object



132
133
134
135
136
# File 'lib/rubinius/compiler/locals.rb', line 132

def get_bytecode(g)
  g.push_variables
  g.push_literal @name
  g.send :get_eval_local, 1, false
end

#set_bytecode(g) ⇒ Object



138
139
140
141
142
143
144
# File 'lib/rubinius/compiler/locals.rb', line 138

def set_bytecode(g)
  g.push_variables
  g.swap
  g.push_literal @name
  g.swap
  g.send :set_eval_local, 2, false
end