18 lines
402 B
Go
18 lines
402 B
Go
package vm
|
|
|
|
const FunctionMemorySize = 16
|
|
|
|
type stackFrame struct {
|
|
previousFunctionIndex int64
|
|
previousInstructionIndex int64
|
|
functionMemory *Memory
|
|
}
|
|
|
|
func newStackFrame(state *State) *stackFrame {
|
|
return &stackFrame{
|
|
previousFunctionIndex: state.functionIndex,
|
|
previousInstructionIndex: state.instructionIndex,
|
|
functionMemory: NewMemory(FunctionMemorySize),
|
|
}
|
|
}
|