Class Ruva::VM::Stack::Frame
In: lib/ruva/stack.rb
Parent: Object

A single stack frame

Methods

code   new  

External Aliases

method -> __method
clz -> clazz
  TODO remove this

Attributes

clz  [RW] 
locals  [RW] 
method  [RW] 
pc  [RW] 
stack  [RW] 

Public Class methods

clazz - pool image for this class method_idx - method index in classes’ method array stack - initial stack for first frane locals - initial locals pc - start pc into method code

[Source]

     # File lib/ruva/stack.rb, line 102
102:         def initialize(clz, method_idx, stack = [], locals = [], pc = 0)
103:           @clz = clz
104:           # allow nil class for use in tests
105:           raise NoSuchMethodError, "Method not found" unless method_idx && (@clz == nil || @method = clz.methods[method_idx])
106:           
107:           # TODO native stack size should be configurable...
108:           @stack = Stack.new(@method.max_stack || 10)  # nil if native
109:           
110:           stack.each { |e| @stack.push(e) }
111:           
112:           @locals = locals
113:           @pc = 0          
114:         end

Public Instance methods

[Source]

     # File lib/ruva/stack.rb, line 121
121:         def code
122:           method.code
123:         end

[Validate]