Skip to content

Optimize lexically bound dispatches in interpreter #208

Open
@smarr

Description

@smarr

Currently, lexically bound dispatch is handled uniformly with other dispatches via a LexicallyBoundDispatchNode.

However, I noticed during debugging a stack overflow problem that it could potentially be replaced by a new subclass for AbstractMessageSendNode.
The idea would be to transition the GenericMessageSendNode subtree into a LexicallyBoundSendNode, which doesn't require a separate LexicallyBoundDispatchNode anymore.

This could give a bit of a speedup in the interpreter, and might reduce stack pressure a little.
However, this is likely going to interfere with instrumentation and other things.

This could be a good getting started issue.
It would give you some familiarity with the idea of self-optimizing AST interpreters, the relevant node rewriting, SOMns' basic structure, and interpreter optimizations.

Stack trace of the bit that might benefit from optimization:

at som.interpreter.nodes.dispatch.LexicallyBoundDispatchNode.executeDispatch(LexicallyBoundDispatchNode.java:34)
at som.interpreter.nodes.MessageSendNode$GenericMessageSendNode.doPreEvaluated(MessageSendNode.java:313)
at som.interpreter.nodes.MessageSendNode$AbstractMessageSendNode.executeGeneric(MessageSendNode.java:128)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImproves the implementation with something noteworthygood first issueAre you trying to have a good at SOMns? Start here!help wantedWould be great if you could help out here.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions