Author: hager <[email protected]>
Branch: ppc-jit-backend
Changeset: r46163:816756135bd7
Date: 2011-08-01 18:06 +0200
http://bitbucket.org/pypy/pypy/changeset/816756135bd7/
Log: Added some helper methods to Assembler class
diff --git a/pypy/jit/backend/ppc/ppcgen/assembler.py
b/pypy/jit/backend/ppc/ppcgen/assembler.py
--- a/pypy/jit/backend/ppc/ppcgen/assembler.py
+++ b/pypy/jit/backend/ppc/ppcgen/assembler.py
@@ -29,6 +29,16 @@
return ln
i += 1
+ def get_number_of_ops(self):
+ return len(self.insts)
+
+ def get_relative_pos(self):
+ return 4 * len(self.insts)
+
+ def patch_op(self, index):
+ last = self.insts.pop()
+ self.insts[index] = last
+
def assemble0(self, dump=os.environ.has_key('PPY_DEBUG')):
for i, inst in enumerate(self.insts):
for f in inst.lfields:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit