haXe API Documentation
Back | Index
class neko.vm.Module
Available in neko
A Neko Module represent a execution unit for the Neko Virtual Machine. Each compiled .n bytecode file is a module once loaded by the NekoVM.
var m : ModuleHandle
The abstract handle.
var name(getName,setName) : String
function new(m : ModuleHandle) : Void
function codeSize() : Int
Returns the codeSize of the Module.
function execute() : Dynamic
Execute a module and returns its result (the latest evaluated expression). A module can be executed several times but its globals are only initialized once the first time the Module is loaded.
function exportsTable() : Dynamic
The raw export table.
function getExports() : Hash<Dynamic>
Each Module has an export table which can be useful to transfert values between modules.
function getGlobal(n : Int) : Dynamic
Get a Module global value.
function globalsCount() : Int
Returns the number of globals in this Module global table.
function loader() : Loader
Returns the Loader that this Module was loaded with.s
function setExport(name : String, value : Dynamic) : Void
Set a value in the Module export table.
function setGlobal(n : Int, v : Dynamic) : Void
Set a Module global value.
function toString() : String
static function local() : Module
Returns the local Module, which is the one in which this method is included.
static function read(i : haxe.io.Input, l : Loader) : Module
Reads a module from an Input by using the given Loader. The module is initialized but has not yet been executed.
static function readBytes(b : haxe.io.Bytes, loader : Loader) : Module
Reads a module from Bytes using the given Loader. The module is initialized but has not yet been executed.
static function readPath(name : String, path : Array<String>, loader : Loader) : Module
Reads a module from a name and using the specified seach path and loader. The module is initialized but has not yet been executed.
Back | Index