Make SClass.addInstanceInvokable private and make primitive loading error fatal

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Make systemObject a field of Universe

- to be accessible by the VM at a later point without going through globals

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Completed the type system to include all VM classes

- added the necessary execute methods to ExpressionNode
[TODO-REPORT: the execute methods define which specializations can be done in nodes, I think the return types are used to derive how to compose the evaluation in a way that a specialization can be executed.]

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Complete refactoring of execution strategy to utilize Truffle DSL

This is a major rewrite of the Truffle-based execution system. Instead of relying on a general MessageNode, we need to introduce Unary, Binary, and Ternary nodes to use the Truffle DSL specialization features properly. For variable arguments, we still keep the KeywordMessage nodes around. However, the specific node types are needed to have a specialization down to the argument level of execution methods of a node. For instance, an addition needs to get the receiver and the argument evaluated properly. That's not supported by the DSL otherwise.

The NodeFactory should now be used for all 'higher-level'/'higher-complexity' node creations. (Refactoring needs to be completed still)

#if* and #while* related nodes have be split into classes for each selector.

Primitives are rewritten so that each primitive node class represents one operation (i.e., selector) and implementers all variants for all types.
Not yet clear is whether this is going to work well for primitives. Especially since we still want to enable classes to override primitives in subclasses, and since we need to handle polymorphism in a way that works. Also need to avoid primitives becoming polymorphic sends when it is not necessary!

TODO:
 * Cloning for inlining needs to be implemented
 * Move all 'complex' node creation stuff into NodeFactory
 * Primitives can be further optimized by using primitive types, avoid boxing, using ExactMath, etc.
 * verify polymorphism works properly with new Primitive design

[TODO-REPORT: give an overview of the final node type hierarchy, and the transitions between optimization states]

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Move all logic related to node creation into NodeFactory

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Use a static getter to obtain the Arguments object from a frame

[TODO-REPORT: This is a Truffle idiom]

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Revise Node design and use SimpleLanguage approach to polymorphic inline caches

The node design is now roughly based on the SimpleLanguage approach.
From there, the approach to Send nodes is taken. Send nodes are used for caching and inlining.
However, compared to the previous approach, this means that we have another level of indirection to the primitives.
The last refactoring made primitives direct nodes in the AST. Thus, the node for a specific send operation was a node that could specialize for the primitive operation. Now however, we layer before that the polymorphic inline cache. From a theoretical perspective, this might be cleaner, since the act of sending, and the operation remain decoupled, but it introduces another layer of indication. I think, I would have preferred if the TruffleDSL would support state and we could realize the inline cache as part of the specialization for primitive nodes directly. This would avoid another layer of indirections and make a monomorphic send node just another specialization, similar to the primitive specializations.
Also, I am not sure yet whether the new design allows for proper type specialization because of the way the send nodes work.

The hierarchy of nodes also changed again. Primitive nodes are not monomorphic types of nodes anymore, since this was refactored out to send nodes.
The `cloneForInlining()` is now realized based on a hack of the TruffleDSL to produce a polymorphic `createUninitialized()` function for each node.
This way, I can easily get a copy in an uninitialized state for each node in the AST.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Changed ArgumentEvaluationNode to be able to use execution method specialization for array arguments

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Adapt block evaluation primitive, and make sure only the right primitives get registered for each class

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Change #== primitive to have a case for SAbstractObjects

- also removed specializations for comparing integers with abstract objects (don't think it is too useful)

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Fix #new: primitive on array

It operates on a class instead of on an array, also added a guard to make sure it is the Array class. This might prevent polymorphism :-/ but I think that is screwed up for builtin classes anyway.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Added `isAlwaysToBeInlined()` inspired by SimpleLanguage

This is meant for primitives and perhaps really small methods like accessors.
There are a couple of candidates methods in the boolean classes, Object, Nil, and HashEntry that return literals, self, or fields. These could benefit from this optimization.
And hopefully primitives are then the direct nodes directly behind a Send node to avoid to many indirections.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
[TODO] Comment out code that needs to be removed

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Remove unused files

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Fixed references to old classes

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Change inlining to use an approach similar to the one of SimpleLanguage

- keep copy of uninitialized method AST
- do not use `cloneForInlining()` any longer
- replace `methodCloneForInlining()` with `inline(..)`
- Method defines now the variants for the inlined methods of n-ary messages

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Avoid fully qualified types, if not necessary

Makes the code a little more readable.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Removed extra SymbolTable

- thought I did that already?

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Make arguments of n-ary message nodes concrete

Do not use array of node children, instead make these nodes have explicit child nodes.
This solves an issue with escaping frames, and avoids the additional indirection of the array.

Signed-off-by: Stefan Marr <git@stefan-marr.de>