GitLab will continue to be upgraded from 11.4.5-ce.0 on November 25th 2019 at 4.00pm (AEDT) to 5.00pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available.

Commit 920aa273 authored by Stefan Marr's avatar Stefan Marr

Only method needs to handled control flow exceptions [WIP-completed]

Method invocation takes care of restarts and non-local returns, very similar to the Truffle version.
Signed-off-by: 's avatarStefan Marr <>
parent cac30b5e
......@@ -2,6 +2,8 @@ from __future__ import absolute_import
from rpython.rlib import jit
from som.interpreter.control_flow import ReturnException, RestartLoopException
from som.vmobjects.abstract_object import AbstractObject
class Method(AbstractObject):
......@@ -93,8 +95,24 @@ class Method(AbstractObject):
def invoke(self, frame, interpreter):
# Allocate and push a new frame on the interpreter stack
new_frame = interpreter.push_new_frame(self, None)
new_frame = interpreter.new_frame(frame, self, None)
while True:
result = interpreter.interpret(self, new_frame)
frame.pop_old_arguments_and_push_result(self, result)
except ReturnException as e:
if e.has_reached_target(new_frame):
frame.pop_old_arguments_and_push_result(self, e.get_result())
raise e
except RestartLoopException:
def __str__(self):
return "Method(" + self.get_holder().get_name().get_string() + ">>" + str(self.get_signature()) + ")"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment