WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.6% of users enabled 2FA.

Commit a3adc27e authored by Stefan Marr's avatar Stefan Marr
Browse files

Make some key loops unroll-able



From krono/PySOM@9ae38c02b87c20e5e3df865be4d542238d95f335
Signed-off-by: default avatarStefan Marr <git@stefan-marr.de>
parent 8fdd3213
from rpython.rlib import jit
from som.vmobjects.array import Array
# Frame layout:
......@@ -48,18 +49,16 @@ class Frame(Array):
def has_context(self, nilObject):
return self._context != nilObject
@jit.unroll_safe
def _get_context(self, level):
# Get the context frame at the given level
frame = self
# Iterate through the context chain until the given level is reached
while level > 0:
for _ in range(level, 0, -1):
# Get the context of the current frame
frame = frame.get_context()
# Go to the next level
level = level - 1
# Return the found context
return frame
......@@ -157,6 +156,7 @@ class Frame(Array):
# Set the argument with the given index to the given value
context.set_indexable_field(index, value)
@jit.unroll_safe
def copy_arguments_from(self, frame):
# copy arguments from frame:
# - arguments are at the top of the stack of frame.
......
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