2 SuperCollider real time audio synthesis system
3 Copyright (c) 2002 James McCartney. All rights reserved.
4 http://www.audiosynth.com
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 Each virtual machine has a copy of VMGlobals, which contains the state of the virtual machine.
30 #include "SC_AllocPool.h"
34 #define TAILCALLOPTIMIZE 1
36 typedef void (*FifoMsgFunc
)(struct VMGlobals
*, struct FifoMsg
*);
39 FifoMsg() : func(0), dataPtr(0) { dataWord
[0] = dataWord
[1] = 0; }
40 void Perform(struct VMGlobals
* g
);
41 void Free(struct VMGlobals
* g
);
52 class AllocPool
*allocPool
;
53 struct PyrProcess
*process
;
54 class SymbolTable
*symbolTable
;
55 class PyrGC
*gc
; // garbage collector for this process
58 int tailCall
; // next byte code is a tail call.
63 struct PyrThread
*thread
;
64 struct PyrMethod
*method
;
65 struct PyrBlock
*block
;
66 struct PyrFrame
*frame
;
67 struct PyrMethod
*primitiveMethod
;
68 unsigned char *ip
; // current instruction pointer
69 PyrSlot
*sp
; // current stack ptr
71 PyrSlot receiver
; // the receiver
73 int numpop
; // number of args to pop for primitive
76 jmp_buf escapeInterpreter
;
82 inline void FifoMsg::Perform(struct VMGlobals
* g
)
87 inline void FifoMsg::Free(struct VMGlobals
* g
)
89 g
->allocPool
->Free(dataPtr
);
92 extern VMGlobals gVMGlobals
;
93 extern VMGlobals
*gMainVMGlobals
;
94 extern VMGlobals
*gCompilingVMGlobals
;