Author: hager <[email protected]>
Branch: ppc-jit-backend
Changeset: r52454:cd1b5bef88c7
Date: 2012-02-14 16:30 +0100
http://bitbucket.org/pypy/pypy/changeset/cd1b5bef88c7/
Log: add class scratch_reg as help for management of the scratch
registers
diff --git a/pypy/jit/backend/ppc/codebuilder.py
b/pypy/jit/backend/ppc/codebuilder.py
--- a/pypy/jit/backend/ppc/codebuilder.py
+++ b/pypy/jit/backend/ppc/codebuilder.py
@@ -1174,6 +1174,16 @@
f.write(data[i])
f.close()
+class scratch_reg(object):
+ def __init__(self, mc):
+ self.mc = mc
+
+ def __enter__(self):
+ self.mc.alloc_scratch_reg()
+
+ def __exit__(self):
+ self.mc.free_scratch_reg()
+
class BranchUpdater(PPCAssembler):
def __init__(self):
PPCAssembler.__init__(self)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit