[vmkit-commits] [vmkit] r121261 - /vmkit/branches/multi-vm/tools/toy-vm/Main.cpp
Gael Thomas
gael.thomas at lip6.fr
Wed Dec 8 07:11:59 PST 2010
Author: gthomas
Date: Wed Dec 8 09:11:59 2010
New Revision: 121261
URL: http://llvm.org/viewvc/llvm-project?rev=121261&view=rev
Log:
create the class toy vm
Modified:
vmkit/branches/multi-vm/tools/toy-vm/Main.cpp
Modified: vmkit/branches/multi-vm/tools/toy-vm/Main.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/tools/toy-vm/Main.cpp?rev=121261&r1=121260&r2=121261&view=diff
==============================================================================
--- vmkit/branches/multi-vm/tools/toy-vm/Main.cpp (original)
+++ vmkit/branches/multi-vm/tools/toy-vm/Main.cpp Wed Dec 8 09:11:59 2010
@@ -1,5 +1,36 @@
+#include "mvm/VMKit.h"
+#include "mvm/VirtualMachine.h"
+#include "mvm/Threads/Thread.h"
+#define NI() fprintf(stderr, "Not implemented\n"); abort()
+
+namespace toyvm {
+
+ class ToyVM : public mvm::VirtualMachine {
+ public:
+ ToyVM(mvm::BumpPtrAllocator &alloc, mvm::VMKit* vmkit) : mvm::VirtualMachine(alloc, vmkit) {}
+
+ virtual mvm::gc** getReferent(mvm::gc*) { NI(); }
+ virtual void setReferent(mvm::gc*, mvm::gc*) { NI(); }
+ virtual bool enqueueReference(mvm::gc*) { NI(); }
+ virtual size_t getObjectSize(mvm::gc*) { NI(); }
+ virtual void runApplication(int, char**) { NI(); }
+ virtual void waitForExit() { NI(); }
+ };
+
+ class ToyVMThread : public mvm::VMThreadData {
+ };
+
+}
+
+using namespace toyvm;
int main(int argc, char **argv) {
+ // Initialize base components.
+ mvm::BumpPtrAllocator Allocator;
+ mvm::VMKit* vmkit = new(Allocator, "VMKit") mvm::VMKit(Allocator);
+
+ new(Allocator, "toy vm") ToyVM(Allocator, vmkit);
+
return 0;
}
More information about the vmkit-commits
mailing list