diff -r 12807399b953 -r b3f0aaee735a src/main.cpp --- a/src/main.cpp Sun Aug 05 01:28:12 2012 -0700 +++ b/src/main.cpp Sun Aug 05 01:45:37 2012 -0700 @@ -16,23 +16,12 @@ * JITCraft. If not, see http://www.gnu.org/licenses/. */ #include -#include "Utility.h" -#include "Scanner.h" -#include "Parser.h" -#include "SemanticAnalysis.h" -#include "Zone.h" -#include "BytecodeCompiler.h" -#include "Code.h" -#include "Interpreter.h" -#include "Modules.h" -#include "RootScopes.h" +#include #include "../include/keima.h" -#include "Spaces-inl.h" -#include "Heap-inl.h" -using namespace ke; +using namespace Ke; -class MessageReporter : public Ke::IMessageReporter +class MessageReporter : public IMessageReporter { public: void onOutOfMemory() { @@ -41,7 +30,7 @@ void onUncaughtException(const char *message) { fprintf(stderr, "Uncaught exception: %s\n", message); - Ke::IStackFrameIterator *iter = Ke::Keima::NewStackFrameIterator(); + IStackFrameIterator *iter = Keima::NewStackFrameIterator(); unsigned index = 0; while (!iter->done()) { fprintf(stderr, "[%d] %s (%s line %d)\n", @@ -111,26 +100,28 @@ return 1; } - if (!Ke::Keima::Initialize()) + if (!Keima::Initialize()) return 1; - Ke::Keima::InstallMessageReporter(&s_Reporter); + Keima::InstallMessageReporter(&s_Reporter); { - Ke::HandleScope scope; - Ke::Local module = Ke::Compile(argv[1]); + HandleScope scope; + Local module = Compile(argv[1]); if (!module) return 1; - //Ke::Local native = module->getNative(0); + // Keima::CollectGarbage(); + + //Local native = module->getNative(0); //native->bind(reinterpret_cast(PrintToServer)); //module->setNativeIdentity(reinterpret_cast(5)); int result; - Ke::Local fun = module->getPublic(0); - if (Ke::Keima::Invoke(fun, NULL, 0, true, &result)) + Local fun = module->getPublic(0); + if (Keima::Invoke(fun, NULL, 0, true, &result)) printf("%d\n", result); } - Ke::Keima::Shutdown(); + Keima::Shutdown(); } /* Overload a few things to prevent libstdc++ linking */