nitc :: NaiveInterpreter :: new_frame
# Initialize the environment for a call and return a new Frame
# *`node` The AST node
# *`mpropdef` The corresponding mpropdef
# *`args` Arguments of the call
fun new_frame(node: ANode, mpropdef: MPropDef, args: Array[Instance]): FRAME
do
return new InterpreterFrame(node, mpropdef, args)
end
src/interpreter/naive_interpreter.nit:422,2--429,4
# Redef to add the numbering of variables and arguments
redef fun new_frame(node, mpropdef, args)
do
var f = new VmFrame(node, mpropdef, args)
# If this Frame is for a method or an attribute block then number variables into the body of the method
if node isa APropdef then
# Compile the code (number its local variables)
if not node.is_compiled then node.compile(self)
# Create an empty environment
f.variables = new Array[Instance].filled_with(initialization_value, node.environment_size)
end
# Putting self at the beginning of the environment
f.variables[0] = args[0]
return f
end
src/vm/variables_numbering.nit:37,2--54,4