GitLab will be upgraded to the 12.10.14-ce.0 on 28 Sept 2020 at 2.00pm (AEDT) to 2.30pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

Commit 512c442b authored by Stefan Marr's avatar Stefan Marr

Made InterpreterHalt a top-level class otherwise RPython complains about it not being constant

Signed-off-by: default avatarStefan Marr <git@stefan-marr.de>
parent 8f9f8e44
from som.interpreter.bytecodes import bytecode_length
class InterpreterHalt(Exception):
"""This exception is used to exit from the interpreter loop using the
HALT bytecode."""
pass
class Interpreter(object):
def __init__(self, universe):
......@@ -22,11 +27,8 @@ class Interpreter(object):
self._do_return_local,
self._do_return_non_local]
class InterpreterHalt(Exception):
pass
def _do_halt(self, bytecode_index):
raise self.InterpreterHalt()
raise InterpreterHalt()
def _do_dup(self, bytecode_index):
# Handle the dup bytecode
......@@ -195,7 +197,7 @@ class Interpreter(object):
# Handle the current bytecode
self._dispatch_table[bytecode](bytecode_index)
except self.InterpreterHalt:
except InterpreterHalt:
return self.get_frame().get_stack_element(0)
def push_new_frame(self, method):
......
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