3 #include <unordered_map> 4 #include <forward_list> 32 Obj *holder =
nullptr;
71 set(
static_cast<Obj>(o));
89 return ((reinterpret_cast<intptr_t>(
object)) & 7) == 1;
97 return reinterpret_cast<intptr_t
>(object) >> 3;
111 std::forward_list<Value> globals;
116 std::vector<SymbolTable*> symbols;
132 bool isReturning =
false;
144 Obj *lookupSymbol(
const std::string &name);
149 void setSymbol(
const std::string &name,
Obj *val);
154 void setSymbol(
const std::string &name,
Obj val);
Object * Obj
Object pointer.
void popSymbols()
Pop the top symbol table off the stack.
Value(Value &&o)
Move constructor.
std::unordered_map< std::string, Obj * > SymbolTable
A symbol table stores the address of each allocation.
Object *(* ClosureInvoke)(Closure *,...)
A compiled closure invoke function.
Value()
Default constructor, the value is null.
int getIntValue()
Returns the integer value of this object, if it is a small integer.
bool isInteger()
Returns true if this object is a small integer, false otherwise.
bool forceCompiler
Force the compiler to run.
Value wraps an object pointer.
ClosureInvoke closureTrampolines[]
Array of trampolines, indexed by number or arguments.
Obj * address()
Returns the address of the object.
Value(Value &o)
Copy constructor.
Value(Obj o)
Construct a new value from an object pointer.
~Value()
Destructor, responsible for removing the reference from the GC's view.
void pushSymbols(SymbolTable &s)
Push a new symbol table on top of the stack.
SymbolTable globalSymbols
Global symbols.