Commit 349463b4 authored by Stefan Marr's avatar Stefan Marr

Remove replace_bytecodes, because it is not actually used

Signed-off-by: default avatarStefan Marr <git@stefan-marr.de>
parent 3610d639
......@@ -180,12 +180,5 @@ class Class(Object):
assert prims is not None, "We yet only support prims for known classes"
prims(self._universe).install_primitives_in(self)
def replace_bytecodes(self):
cnt = self.get_number_of_instance_invokables()
for i in range(0, cnt):
inv = self.get_instance_invokable(i)
if not inv.is_primitive():
inv.replace_bytecodes()
def __str__(self):
return "Class(" + self.get_name().get_string() + ")"
......@@ -2,8 +2,6 @@ from __future__ import absolute_import
from som.vmobjects.array import Array
from som.interpreter.bytecodes import bytecode_length
class Method(Array):
# Static field indices and number of method fields
......@@ -115,40 +113,6 @@ class Method(Array):
interpreter.get_universe().nilObject)
new_frame.copy_arguments_from(frame)
def replace_bytecodes(self):
newbc = ["\x00"] * len(self._bytecodes)
idx = 0
i = 0
while i < len(self._bytecodes):
bc1 = self._bytecodes[i]
len1 = bytecode_length(bc1)
if i + len1 >= len(self._bytecodes):
# we're over target, so just copy bc1
for j in range(i, i + len1):
newbc[idx] = self._bytecodes[j]
idx += 1
break
newbc[idx] = bc1
idx += 1
# copy args to bc1
for j in range(i + 1, i + len1):
newbc[idx] = self._bytecodes[j]
idx += 1
i += len1 # update i to point on bc2
# we copy the new array because it may be shorter, and we don't
# want to upset whatever dependence there is on the length
self._bytecodes = ["\x00"] * len(idx)
for i in range(0, idx):
self._bytecodes[i] = newbc[i]
# TODO: remove these things
def get_receiver_class(self, index):
return self._receiver_class_table[index]
......
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