MysoreScript
Classes | Namespaces | Enumerations | Functions | Variables
runtime.cc File Reference
#include "runtime.hh"
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <iostream>
#include <unordered_map>
#include <vector>
#include <gc.h>
Include dependency graph for runtime.cc:

Go to the source code of this file.

Classes

struct  anonymous_namespace{runtime.cc}::File
 The structure representing MysoreScript File objects. More...
 

Namespaces

 anonymous_namespace{runtime.cc}
 
 MysoreScript
 

Enumerations

enum  anonymous_namespace{runtime.cc}::StaticSelectors {
  anonymous_namespace{runtime.cc}::length = 1, anonymous_namespace{runtime.cc}::charAt, anonymous_namespace{runtime.cc}::dump, anonymous_namespace{runtime.cc}::print,
  anonymous_namespace{runtime.cc}::invoke, anonymous_namespace{runtime.cc}::atPut, anonymous_namespace{runtime.cc}::at, anonymous_namespace{runtime.cc}::add,
  anonymous_namespace{runtime.cc}::sub, anonymous_namespace{runtime.cc}::mul, anonymous_namespace{runtime.cc}::div, anonymous_namespace{runtime.cc}::compare,
  anonymous_namespace{runtime.cc}::open, anonymous_namespace{runtime.cc}::close, anonymous_namespace{runtime.cc}::readline, anonymous_namespace{runtime.cc}::write,
  anonymous_namespace{runtime.cc}::LAST_STATIC_SELECTOR
}
 Selectors for methods that are defined as part of the runtime. More...
 

Functions

Obj anonymous_namespace{runtime.cc}::invalidMethod (Obj obj, Selector sel)
 Invalid method function. More...
 
File * anonymous_namespace{runtime.cc}::FileOpen (File *f, Selector sel, String *file)
 The open method on File objects. More...
 
Obj anonymous_namespace{runtime.cc}::FileClose (File *f, Selector sel)
 The close method on File objects. More...
 
Stringanonymous_namespace{runtime.cc}::FileReadLine (File *f, Selector sel)
 The readline method on File objects. More...
 
Obj anonymous_namespace{runtime.cc}::FileWrite (File *f, Selector sel, String *data)
 The write method on File objects. More...
 
Obj anonymous_namespace{runtime.cc}::StringLength (String *str, Selector sel)
 The .length() method for String objects. More...
 
Obj anonymous_namespace{runtime.cc}::StringCharAt (String *str, Selector sel, Obj idx)
 The .charAt(idx) method for String objects. More...
 
Obj anonymous_namespace{runtime.cc}::ArrayLength (Array *arr, Selector sel)
 The .length() method for Array objects. More...
 
Obj anonymous_namespace{runtime.cc}::ArrayAt (Array *arr, Selector sel, Obj idx)
 The .at(idx) method for Array objects. More...
 
Obj anonymous_namespace{runtime.cc}::ArrayAtPut (Array *arr, Selector sel, Obj idx, Obj obj)
 The .atPut(idx, obj) method for Array objects. More...
 
Obj anonymous_namespace{runtime.cc}::NumberDump (Obj str, Selector sel)
 The .dump() method for Number objects. More...
 
Obj anonymous_namespace{runtime.cc}::NumberPrint (Obj str, Selector sel)
 The .print() method for Number objects. More...
 
Obj anonymous_namespace{runtime.cc}::StringDump (String *str, Selector sel)
 The .dump() method for String objects. More...
 
Obj anonymous_namespace{runtime.cc}::StringPrint (String *str, Selector sel)
 The .dump() method for String objects. More...
 
Obj anonymous_namespace{runtime.cc}::StringAdd (String *str, Selector sel, String *other)
 The + method on a string, allocates a new string with the specified length. More...
 
Obj anonymous_namespace{runtime.cc}::StringCmp (String *str, Selector sel, String *other)
 Compare two strings, returning an integer representing the ordering. More...
 
Selector MysoreScript::lookupSelector (const std::string &)
 Looks up the selector for a specified string value, registering a new value if this is the first time the mapping has been needed. More...
 
void MysoreScript::registerClass (const std::string &name, struct Class *cls)
 Register a newly constructed class. More...
 
struct ClassMysoreScript::lookupClass (const std::string &name)
 Look up an existing class. More...
 
Obj MysoreScript::newObject (struct Class *cls)
 Instantiate an object. More...
 
MethodMysoreScript::methodForSelector (Class *, Selector)
 Looks up the Method that should be invoked for the specified selector on this class. More...
 
Obj MysoreScript::callCompiledMethod (CompiledMethod m, Obj receiver, Selector sel, Obj *args, int argCount)
 Calls a compiled method, constructing the correct argument frame based on the arguments. More...
 
Obj MysoreScript::callCompiledClosure (ClosureInvoke m, Closure *receiver, Obj *args, int argCount)
 Calls a compiled closure from the specified argument list. More...
 
Obj MysoreScript::mysoreScriptAdd (Obj lhs, Obj rhs)
 Helper function called by compiled code for the + operator on objects that are not small (embedded in a pointer) integers. More...
 
Obj MysoreScript::mysoreScriptSub (Obj lhs, Obj rhs)
 Helper function called by compiled code for the - operator on objects that are not small (embedded in a pointer) integers. More...
 
Obj MysoreScript::mysoreScriptMul (Obj lhs, Obj rhs)
 Helper function called by compiled code for the * operator on objects that are not small (embedded in a pointer) integers. More...
 
Obj MysoreScript::mysoreScriptDiv (Obj lhs, Obj rhs)
 Helper function called by compiled code for the / operator on objects that are not small (embedded in a pointer) integers. More...
 
CompiledMethod MysoreScript::compiledMethodForSelector (Obj obj, Selector sel)
 Look up the compiled method to call for a specific selector. More...
 

Variables

std::vector< std::string > anonymous_namespace{runtime.cc}::selNames
 Global vector of selector names. More...
 
const char * anonymous_namespace{runtime.cc}::StaticSelectorNames []
 The names of the selectors in the StaticSelectors enumeration. More...
 
struct Method anonymous_namespace{runtime.cc}::FileMethods []
 Methods for the file class. More...
 
struct Method anonymous_namespace{runtime.cc}::StringMethods []
 Method table for the String class. More...
 
struct Method anonymous_namespace{runtime.cc}::NumberMethods []
 Method table for the Number class. More...
 
struct Method anonymous_namespace{runtime.cc}::ArrayMethods []
 Method table for the Array class. More...
 
const char * anonymous_namespace{runtime.cc}::StringIvars [] = { "length" }
 The names of the instance variables in the String class. More...
 
const char * anonymous_namespace{runtime.cc}::ArrayIvars [] = { "length", "bufferSize", "buffer" }
 The names of the instance variables in the Array class. More...
 
const char * anonymous_namespace{runtime.cc}::FileIvars [] = { "fd" }
 The names of the instance variables in the File class. More...
 
struct Class MysoreScript::StringClass
 The String class structure. More...
 
struct Class MysoreScript::FileClass
 The File class structure. More...
 
struct Class MysoreScript::ArrayClass
 The Array class structure. More...
 
struct Class MysoreScript::SmallIntClass
 The SmallInt (Number) class structure. More...
 
struct Class MysoreScript::ClosureClass
 The Closure class structure. More...