Everything is an object reference or an array of bits. Bits from arrays of bits are read into object references to the bits read. Object references (capabilities) are each composed of a type and a value. For most types, the value is a pointer to a data area. Some types store the value directly in the value field. There are 3 areas of memory that are accessible to the program: STATE, LOCAL, and ARGS. STATE stores persistant state of the object. Values placed in STATE are available to other activations of this object. LOCAL stores temporary variables associated with this activation. Values placed in LOCAL are only available to this activation of this object. No other code can access data in LOCAL. ARGS stores arguments passed to this activation, and values returned from this activation. Values in ARGS are shared with the caller of this activation. The code format is a parse tree with the following nodes: l_xxxx is an l-value. Leaf nodes: SENDS target i j args[1..i] l_results[1..j] Synchronous send. Control is passed to the object referenced by target. args are made available to the receiver as IN[0..i-1]. On return, any return values which were left in the called activation's IN area are placed in l_results Throws NullPointer if target is null. Throws UndefinedPointer if target is undefined. SEND target i args[1..i] Asynchronous send. Similar to SENDS except that the message is delivered at some point in the future. Control continues after this point immediately, and no results are returned. Throws NullPointer if target is null. Throws UndefinedPointer if target is undefined. SENDV target array Asynchronous send with variable number of arguments. Similar to SEND, except arguments are taken from array instead of specified directly. DISPATCH selector Transfer control to the verb that matches the given selector from the verb table. If no verb matches, continue execution with the next node. Throws InsufficientArguments if less than the required number of arguments are available in IN. Throws OutOfMemory if LOCAL storage couldn't be allocated. RETURN if this routine was invoked with a SENDS, transfers control to just after that SENDS. The stack bounds and current object value are restored to their values before the SENDS. If this routine was invoked with a SEND, the stacks are cleared and another SEND is selected for execution. COPY source l_result Places a copy of the source reference in l_result. THIS l_result Places a reference to the currently active object in l_result. COMMENT string Does nothing. THROW exception Initiate exception processing. Stack backtrace information is placed in the exception. Control is transferred to the nearest enclosing CATCH or ALWAYS. RETHROW exception Continue exception processing. The backtrace information in the exception remains unaltered. Control is transferred to the nearest enclosing CATCH or ALWAYS. BREAK n Transfers to just after the n'th enclosing LOOP. CONTINUE n Transfers to the third node of the n'th enclosing LOOP. If the third node of that loop is null, execution continues with the first node. Non-leaf nodes: BLOCK n nodes... Execute the n nodes in sequence. IF test block block If test is true execute the first block, if test is false, execute the second block, otherwise throws NotBoolean. // CONDITIONAL loading LOOP block test block block Executes the first block. If test is true, continues execution with the second block. If test is false, continues execution after the LOOP, otherwise throws NotBoolean. Executes the second block. Executes the third block. Execution continues with the first block. CATCH block l_exception block Execute the first block. If it exits normally, the second block is not executed. If an exception is thrown from the first block's processing, it is placed in l_exception, then the second block is executed. If the second block completes execution without (re)throwing, the exception is considered to be handled. ALWAYS block block Execute the first block. When it exits (for whatever reason), execute the second block. If the second block is entered with an unhandled exception, that exception is implicitly RETHROWn when the second block exits. VERBTABLE i [1..i] VERB name args local Associate the name and the block in the verb table. At least args arguments must be available in the IN area or an InsufficientArguments exception will be thrown. An implicit RETURN is assumed after the end of the block. DECL i [1..i] CLOSURE args local l_result Object file format: Each node consists of a 32 bit integer indicating the node type, an integer indicating the source code origin of the node, an integer for each non-node parameter, followed by any sub-nodes. Parameters can be either 32 bit integers, which are encoded directly in the node, or they can be strings, in which case a string reference is encoded in the node. Names are strings which are expected to have a value associated with them by the loader. If the loader has no knowledge of the given name, it refers to a zero word value, or an undef object value. Things needed: magic number version information options interpretation of code origin word line number character number of start of line character number of start of symbol symbol number name of type package inclusion info data area layout interfaces implemented types inherited from code string table(s?) cryptohash of source code cryptohash of object code (including all components up to this one) compilation date compiler version info source code