3 # Describes the environment a block was created in. BlockEnvironment is used
4 # to create a BlockContext.
7 ivar_as_index :__ivars__ => 0, :home => 1, :initial_ip => 2, :last_ip => 3,
8 :post_send => 4, :home_block => 5, :local_count => 6, :metadata_container => 7, :method => 8
9 def __ivars__ ; @__ivars__ ; end
10 def home ; @home ; end
11 def initial_ip ; @initial_ip ; end
12 def last_ip ; @last_ip ; end
13 def post_send ; @post_send ; end
14 def home_block ; @home_block ; end
15 def local_count ; @local_count ; end
16 def method ; @method ; end
18 attr_accessor :proc_environment
23 def home_block=(block)
35 def metadata_container
39 def under_context(context, cmethod)
40 if context.__kind_of__ BlockContext
49 @local_count = cmethod.local_count
52 @last_ip = 0x10000000 # 2**28
58 # Holds a Tuple of additional metadata.
59 # First field of the tuple holds a boolean indicating if the context is from
61 def metadata_container=(tup)
62 @metadata_container = tup
66 @metadata_container and @metadata_container[0]
70 @metadata_container = Tuple.new(1) unless @metadata_container
71 @metadata_container[0] = true
75 # The CompiledMethod object that we were called from
91 @home_block = @home_block.dup
98 env.home.receiver = obj
102 def call_on_instance(obj, *args)
103 obj = redirect_to(obj)
107 def disable_long_return!
115 # Static scope for constant lookup
116 def constant_scope=(scope)
117 @constant_scope = scope
121 @constant_scope ||= @method.staticscope