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.7% of users enabled 2FA.

Commit 279f216d authored by Stefan Marr's avatar Stefan Marr
Browse files

Only expose signature and holder to SOM language level



The other elements such as number of locals, maximum number of stack elements, and number of method fields are not available on all SOM VMs.

These information should be made available by a VM-specific mirror object.
Signed-off-by: default avatarStefan Marr <git@stefan-marr.de>
parent b2d20680
...@@ -7,11 +7,9 @@ from som.interpreter.bytecodes import bytecode_length ...@@ -7,11 +7,9 @@ from som.interpreter.bytecodes import bytecode_length
class Method(Array): class Method(Array):
# Static field indices and number of method fields # Static field indices and number of method fields
NUMBER_OF_LOCALS_INDEX = 1 + Array.CLASS_INDEX SIGNATURE_INDEX = 1 + Array.CLASS_INDEX
MAXIMUM_NUMBER_OF_STACK_ELEMENTS_INDEX = 1 + NUMBER_OF_LOCALS_INDEX HOLDER_INDEX = 1 + SIGNATURE_INDEX
SIGNATURE_INDEX = 1 + MAXIMUM_NUMBER_OF_STACK_ELEMENTS_INDEX NUMBER_OF_METHOD_FIELDS = 1 + HOLDER_INDEX
HOLDER_INDEX = 1 + SIGNATURE_INDEX
NUMBER_OF_METHOD_FIELDS = 1 + HOLDER_INDEX
def __init__(self, nilObject): def __init__(self, nilObject):
...@@ -26,6 +24,9 @@ class Method(Array): ...@@ -26,6 +24,9 @@ class Method(Array):
self._bytecodes = None self._bytecodes = None
self._inline_cache_class = None self._inline_cache_class = None
self._inline_cache_invokable = None self._inline_cache_invokable = None
self._number_of_locals = -1
self._maximum_number_of_stack_elements = -1
def is_primitive(self): def is_primitive(self):
return False return False
...@@ -38,19 +39,19 @@ class Method(Array): ...@@ -38,19 +39,19 @@ class Method(Array):
def get_number_of_locals(self): def get_number_of_locals(self):
# Get the number of locals (converted to a Java integer) # Get the number of locals (converted to a Java integer)
return self.get_field(self.NUMBER_OF_LOCALS_INDEX) return self._number_of_locals
def set_number_of_locals(self, value): def set_number_of_locals(self, value):
# Set the number of locals # Set the number of locals
self.set_field(self.NUMBER_OF_LOCALS_INDEX, value) self._number_of_locals = value
def get_maximum_number_of_stack_elements(self): def get_maximum_number_of_stack_elements(self):
# Get the maximum number of stack elements # Get the maximum number of stack elements
return self.get_field(self.MAXIMUM_NUMBER_OF_STACK_ELEMENTS_INDEX) return self._maximum_number_of_stack_elements
def set_maximum_number_of_stack_elements(self, value): def set_maximum_number_of_stack_elements(self, value):
# Set the maximum number of stack elements # Set the maximum number of stack elements
self.set_field(self.MAXIMUM_NUMBER_OF_STACK_ELEMENTS_INDEX, value) self._maximum_number_of_stack_elements = value
def get_signature(self): def get_signature(self):
# Get the signature of this method by reading the field with signature # Get the signature of this method by reading the field with 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