Commit fb5eccfe authored by Carl Friedrich Bolz's avatar Carl Friedrich Bolz

make reading of signature and constants elidable

this is not a fully transparent annotation, as it means that if the user
changes the method it has no effect on already compiled code. This can
be fixed properly, once the object model is made less funny.
parent fde1d988
......@@ -49,6 +49,8 @@ class Method(Array):
# Get the maximum number of stack elements
return self._maximum_number_of_stack_elements
# XXX this means that the JIT doesn't see changes to the method object
@jit.elidable_promote('all')
def get_signature(self):
# Get the signature of this method by reading the field with signature
# index
......@@ -72,6 +74,8 @@ class Method(Array):
if self.get_indexable_field(i).is_invokable():
self.get_indexable_field(i).set_holder(value)
# XXX this means that the JIT doesn't see changes to the constants
@jit.elidable_promote('all')
def get_constant(self, bytecode_index):
# Get the constant associated to a given bytecode index
return self.get_indexable_field(self.get_bytecode(bytecode_index + 1))
......@@ -88,7 +92,7 @@ class Method(Array):
# Get the number of bytecodes in this method
return len(self._bytecodes)
@jit.elidable
@jit.elidable_promote('all')
def get_bytecode(self, index):
# Get the bytecode at the given index
assert 0 <= index and index < len(self._bytecodes)
......
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