Fixed bug when DEBUG is defined. Should this be applied to YaSp?
[scilab.git] / scilab / modules / core / includes / vmkit_core.h
1 #include "MutatorThread.h"
2 #include "vmkit/System.h"
3 #include "vmkit/Locks.h"
4 #include "vmkit/Thread.h"
5 #include "vmkit/VirtualMachine.h"
6
7 namespace VMKitScilab {
8         class ScilabVM;
9
10         class ScilabThread : public vmkit::MutatorThread {
11         private:
12                 int argc, iFileIndex, iLangIndex, ret;
13                 char **argv;
14
15         public:
16                 void setArgs(int argc, char** argv, int iFileIndex, int iLangIndex);
17                 void setret(int ret);
18                 int getargc();
19                 int getiFileIndex();
20                 int getiLangIndex();
21                 char **getargv();
22                 int getret();
23
24                 ScilabThread (ScilabVM* vm);
25                 ScilabVM* vm();
26                 void execute();
27         };
28
29         class ScilabVM : public vmkit::VirtualMachine {
30         private:
31                 int ret;
32
33         public:
34                 vmkit::BumpPtrAllocator Alloc;
35                 vmkit::CompiledFrames **frames;
36
37                 ScilabVM (vmkit::BumpPtrAllocator& Alloc, vmkit::CompiledFrames** frames) : VirtualMachine(Alloc, frames){}
38                 ~ScilabVM(){}
39
40                 virtual void startCollection(){}
41                 virtual void endCollection(){}
42                 virtual void scanWeakReferencesQueue(word_t closure){}
43                 virtual void scanSoftReferencesQueue(word_t closure){}
44                 virtual void scanPhantomReferencesQueue(word_t closure){}
45                 virtual void scanFinalizationQueue(word_t closure){}
46                 virtual void addFinalizationCandidate(gc* obj){}
47                 virtual void finalizeObject(gc* res){}
48                 virtual void traceObject(gc* obj, word_t closure){}
49                 virtual void setType(gc* header, void* type){}
50                 virtual void setType(void* header, void* type){}
51                 virtual void* getType(gc* obj){}
52                 virtual size_t getObjectSize(gc* obj){}
53                 virtual const char* getObjectTypeName(gc* obj){}
54                 virtual bool isCorruptedType(gc* header){}
55                 virtual void printMethod(vmkit::FrameInfo* FI, word_t ip, word_t addr){}
56                 virtual void invokeEnqueueReference(gc* res){}
57                 virtual void clearObjectReferent(gc* ref){}
58                 virtual gc** getObjectReferentPtr(gc* _obj){}
59                 virtual void setObjectReferent(gc* _obj, gc* val){}
60
61                 virtual void runApplication(int argc, char** argv){}
62
63                 virtual void runApplication(int argc, char**  argv, int iFileIndex, int iLangIndex);
64
65                 virtual void nullPointerException(){}
66                 virtual void stackOverflowError(){}
67
68                 static void mainStart(ScilabThread* thread);
69                 int getret();
70                 void setret(int ret);
71         };
72 }