2021-11-19 20:16:01 -10:00
|
|
|
package vm
|
|
|
|
|
|
|
|
|
|
type Program struct {
|
2021-11-20 18:27:06 -10:00
|
|
|
GlobalMemorySize uint64
|
|
|
|
|
FunctionMemorySize uint64
|
2021-11-20 19:25:16 -10:00
|
|
|
InstructionLimit uint64
|
2021-11-20 18:27:06 -10:00
|
|
|
Functions []*Function
|
2021-11-19 20:16:01 -10:00
|
|
|
}
|
2021-11-22 22:19:38 -08:00
|
|
|
|
|
|
|
|
func (prog *Program) Copy() *Program {
|
|
|
|
|
ret := &Program{
|
|
|
|
|
GlobalMemorySize: prog.GlobalMemorySize,
|
|
|
|
|
FunctionMemorySize: prog.FunctionMemorySize,
|
|
|
|
|
InstructionLimit: prog.InstructionLimit,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, fnc := range prog.Functions {
|
|
|
|
|
ret.Functions = append(ret.Functions, fnc.Copy())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret
|
|
|
|
|
}
|