Permalink
Browse files

Put everything in vm/main/ inside the namespace mozart.

  • Loading branch information...
1 parent 33d4ae5 commit d57f71c17d3022b0163fcd7ab6ff8bd75d948ddd @sjrd sjrd committed Mar 16, 2012
Showing with 223 additions and 10 deletions.
  1. +4 −0 vm/main/arrays.hh
  2. +4 −0 vm/main/atom-decl.hh
  3. +4 −0 vm/main/atom.hh
  4. +5 −0 vm/main/atomtable.hh
  5. +4 −0 vm/main/boolean-decl.hh
  6. +4 −0 vm/main/boolean.hh
  7. +4 −0 vm/main/callables-decl.hh
  8. +4 −0 vm/main/callables.hh
  9. +4 −0 vm/main/codearea-decl.hh
  10. +4 −0 vm/main/codearea.hh
  11. +12 −6 vm/main/core-forward-decl.hh
  12. +4 −0 vm/main/corebuiltins.cc
  13. +4 −0 vm/main/corebuiltins.hh
  14. +12 −0 vm/main/coreinterfaces.hh
  15. +4 −0 vm/main/emulate.cc
  16. +4 −0 vm/main/emulate.hh
  17. +4 −0 vm/main/exchelpers-decl.hh
  18. +4 −0 vm/main/exchelpers.hh
  19. +4 −0 vm/main/float-decl.hh
  20. +4 −0 vm/main/float.hh
  21. +4 −0 vm/main/gcollect-decl.hh
  22. +4 −0 vm/main/gcollect.cc
  23. +4 −0 vm/main/gcollect.hh
  24. +4 −0 vm/main/gctypes-decl.hh
  25. +4 −0 vm/main/gctypes.hh
  26. +4 −0 vm/main/memmanager.cc
  27. +4 −0 vm/main/memmanager.hh
  28. +4 −0 vm/main/memmanlist.hh
  29. +4 −0 vm/main/memword.hh
  30. +4 −0 vm/main/opcodes.hh
  31. +4 −0 vm/main/ozlimits.hh
  32. +4 −0 vm/main/records-decl.hh
  33. +4 −0 vm/main/records.hh
  34. +4 −0 vm/main/reference-decl.hh
  35. +4 −0 vm/main/reference.hh
  36. +4 −0 vm/main/runnable-decl.hh
  37. +4 −0 vm/main/runnable.hh
  38. +4 −0 vm/main/smallint-decl.hh
  39. +4 −0 vm/main/smallint.hh
  40. +4 −0 vm/main/storage.hh
  41. +4 −0 vm/main/store-decl.hh
  42. +4 −0 vm/main/store.hh
  43. +4 −0 vm/main/threadpool-decl.hh
  44. +4 −0 vm/main/threadpool.hh
  45. +4 −0 vm/main/type.hh
  46. +4 −0 vm/main/variables-decl.hh
  47. +4 −0 vm/main/variables.hh
  48. +6 −2 vm/main/vm-decl.hh
  49. +8 −2 vm/main/vm.hh
  50. +2 −0 vm/test/floattest.cc
  51. +2 −0 vm/test/smallinttest.cc
View
@@ -28,6 +28,8 @@
#include <cstdlib>
#include <cassert>
+namespace mozart {
+
/**
* A simple wrapper for an array and its size (only in debug mode)
* @param <T> Type of the elements in the array
@@ -89,4 +91,6 @@ public:
}
};
+}
+
#endif // __ARRAYS_H
View
@@ -30,6 +30,8 @@
#include <string>
#include <ostream>
+namespace mozart {
+
class Atom;
#ifndef MOZART_GENERATOR
@@ -71,4 +73,6 @@ private:
#include "Atom-implem-decl-after.hh"
#endif
+}
+
#endif // __ATOM_DECL_H
View
@@ -29,6 +29,8 @@
#include "boolean.hh"
+namespace mozart {
+
#ifndef MOZART_GENERATOR
#include "Atom-implem.hh"
#endif
@@ -63,4 +65,6 @@ void Implementation<Atom>::printReprToStream(Self self, VM vm,
out << "<Atom>";
}
+}
+
#endif // __ATOM_H
View
@@ -27,6 +27,8 @@
#include "core-forward-decl.hh"
+namespace mozart {
+
class Atom;
class AtomTable;
@@ -107,4 +109,7 @@ private:
AtomImpl* root;
size_t _count;
};
+
+}
+
#endif // __ATOMTABLE_H
View
@@ -27,6 +27,8 @@
#include "mozartcore.hh"
+namespace mozart {
+
class Boolean;
typedef enum BOOL_OR_NOT_BOOL {
@@ -68,4 +70,6 @@ private:
#include "Boolean-implem-decl-after.hh"
#endif
+}
+
#endif // __BOOLEAN_DECL_H
View
@@ -27,6 +27,8 @@
#include "boolean-decl.hh"
+namespace mozart {
+
#ifndef MOZART_GENERATOR
#include "Boolean-implem.hh"
#endif
@@ -35,4 +37,6 @@ bool Implementation<Boolean>::build(VM vm, GC gc, Self from) {
return from.get().value();
}
+}
+
#endif // __BOOLEAN_H
@@ -29,6 +29,8 @@
#include "opcodes.hh"
+namespace mozart {
+
//////////////////////
// BuiltinProcedure //
//////////////////////
@@ -168,4 +170,6 @@ private:
#include "Abstraction-implem-decl-after.hh"
#endif
+}
+
#endif // __CALLABLES_DECL_H
View
@@ -32,6 +32,8 @@
#include <iostream>
+namespace mozart {
+
/////////////////////////////
// Inline BuiltinProcedure //
/////////////////////////////
@@ -115,4 +117,6 @@ BuiltinResult Implementation<Abstraction>::getCallInfo(
return BuiltinResult::proceed();
}
+}
+
#endif // __CALLABLES_H
View
@@ -30,6 +30,8 @@
#include <cstring>
+namespace mozart {
+
//////////////
// CodeArea //
//////////////
@@ -85,4 +87,6 @@ private:
#include "CodeArea-implem-decl-after.hh"
#endif
+}
+
#endif // __CODEAREA_DECL_H
View
@@ -27,6 +27,8 @@
#include "codearea-decl.hh"
+namespace mozart {
+
/////////////////////
// Inline CodeArea //
/////////////////////
@@ -67,4 +69,6 @@ Implementation<CodeArea>::getCodeAreaInfo(Self self, VM vm,
return BuiltinResult::proceed();
}
+}
+
#endif // __CODEAREA_H
@@ -34,6 +34,8 @@
#include <cstdlib>
#include <cstdint>
+namespace mozart {
+
typedef intptr_t nativeint;
class Type;
@@ -48,14 +50,18 @@ typedef VirtualMachine* VM;
class GarbageCollector;
typedef GarbageCollector* GC;
-inline
-void* operator new (size_t size, VM vm);
-
-inline
-void* operator new[] (size_t size, VM vm);
-
template <class T>
class Implementation {
};
+}
+
+// new operators must be declared outside of any namespace
+
+inline
+void* operator new (size_t size, mozart::VM vm);
+
+inline
+void* operator new[] (size_t size, mozart::VM vm);
+
#endif // __CORE_FORWARD_DECL_H
View
@@ -30,6 +30,8 @@
#include "emulate.hh"
#include "exchelpers.hh"
+namespace mozart {
+
namespace builtins {
BuiltinResult equals(VM vm, UnstableNode* args[]) {
@@ -147,3 +149,5 @@ void printReprToStream(VM vm, RichNode arg,
}
}
+
+}
View
@@ -27,6 +27,8 @@
#include "mozartcore.hh"
+namespace mozart {
+
namespace builtins {
BuiltinResult equals(VM vm, UnstableNode* args[]);
@@ -52,4 +54,6 @@ void printReprToStream(VM vm, RichNode node,
}
+}
+
#endif // __COREBUILTINS_H
View
@@ -40,6 +40,8 @@
#include <iostream>
+namespace mozart {
+
class DataflowVariable;
template<>
struct Interface<DataflowVariable>: ImplementedBy<Unbound, Variable>, NoAutoWait {
@@ -218,8 +220,12 @@ struct Interface<ArrayInitializer>:
}
};
+} // namespace mozart
+
#ifndef MOZART_GENERATOR
+namespace mozart {
+
#include "DataflowVariable-interf.hh"
#include "Equatable-interf.hh"
#include "BuiltinCallable-interf.hh"
@@ -232,6 +238,8 @@ struct Interface<ArrayInitializer>:
#include "RecordLike-interf.hh"
#include "ArrayInitializer-interf.hh"
+} // namespace mozart
+
#include "variables.hh"
#include "boolean.hh"
#include "smallint.hh"
@@ -243,6 +251,8 @@ struct Interface<ArrayInitializer>:
#include "exchelpers.hh"
+namespace mozart {
+
/////////////
// Inlines //
/////////////
@@ -273,6 +283,8 @@ BuiltinResult Interface<DataflowVariable>::bind(RichNode self, VM vm,
}
}
+} // namespace mozart
+
#endif // MOZART_GENERATOR
#endif // __COREINTERFACES_H
View
@@ -31,6 +31,8 @@
#include "corebuiltins.hh"
#include "variables.hh"
+namespace mozart {
+
const ProgramCounter NullPC = nullptr;
////////////////
@@ -717,4 +719,6 @@ Runnable* Thread::gCollect(GC gc) {
return new (gc->vm) Thread(gc, *this);
}
+}
+
#undef advancePC
View
@@ -37,6 +37,8 @@
#include "runnable.hh"
#include "smallint.hh"
+namespace mozart {
+
/**
* Entry of a thread stack
*/
@@ -189,4 +191,6 @@ private:
VMAllocatedList<StackEntry> stack;
};
+}
+
#endif // __EMULATE_H
@@ -27,10 +27,14 @@
#include "mozartcore.hh"
+namespace mozart {
+
inline
BuiltinResult raiseAtom(VM vm, const char16_t* atom);
inline
BuiltinResult raiseTypeError(VM vm, const char16_t* expected, RichNode actual);
+}
+
#endif // __EXCHELPERS_DECL_H
View
@@ -29,6 +29,8 @@
#include "coreinterfaces.hh"
+namespace mozart {
+
BuiltinResult raiseAtom(VM vm, const char16_t* atom) {
UnstableNode exception;
exception.make<Atom>(vm, atom);
@@ -54,4 +56,6 @@ BuiltinResult raiseTypeError(VM vm, const char16_t* expected, RichNode actual) {
return BuiltinResult::raise(vm, exception);
}
+}
+
#endif // __EXCHELPERS_H
View
@@ -27,6 +27,8 @@
#include "mozartcore.hh"
+namespace mozart {
+
class Float;
#ifndef MOZART_GENERATOR
@@ -106,4 +108,6 @@ private:
#include "Float-implem-decl-after.hh"
#endif
+}
+
#endif // __FLOAT_DECL_H
View
@@ -32,6 +32,8 @@
#include <iostream>
+namespace mozart {
+
//////////////////
// Inline Float //
//////////////////
@@ -165,4 +167,6 @@ BuiltinResult Implementation<Float>::mod(Self self, VM vm,
return raiseTypeError(vm, u"Integer", self);
}
+}
+
#endif // __FLOAT_H
View
@@ -32,6 +32,8 @@
#include "runnable-decl.hh"
+namespace mozart {
+
// Set this to true to print debug info about the GC
#ifdef OZ_DEBUG_GC
const bool OzDebugGC = true;
@@ -89,4 +91,6 @@ private:
MemManagedList<StableNode**> stableRefsToGC;
};
+}
+
#endif // __GCOLLECT_DECL_H
Oops, something went wrong.

0 comments on commit d57f71c

Please sign in to comment.