| 123456789101112131415161718192021222324 |
- // Author: simon
- // Author: ynwdlxm@163.com
- // Date: 2022/11/15 10:57
- // Desc:
- package vm
- import (
- "github/runnignwater/monkey/code"
- "github/runnignwater/monkey/object"
- )
- type Frame struct {
- fn *object.CompileFunction // points to the compiled function
- ip int // the instruction pointer in this frame
- }
- func NewFrame(fn *object.CompileFunction) *Frame {
- return &Frame{fn: fn, ip: -1}
- }
- func (f *Frame) Instructions() code.Instructions {
- return f.fn.Instructions
- }
|