[pypy-svn] r63810 - pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86
fijal at codespeak.net
fijal at codespeak.net
Wed Apr 8 00:26:00 CEST 2009
Author: fijal
Date: Wed Apr 8 00:25:58 2009
New Revision: 63810
Modified:
pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py
pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/runner.py
Log:
remove bootstrapping cache
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py Wed Apr 8 00:25:58 2009
@@ -216,11 +216,11 @@
op.longevity = None
self.sanitize_tree(op.suboperations)
- def assemble_bootstrap_code(self, arglocs):
+ def assemble_bootstrap_code(self, jumpaddr, arglocs):
self.make_sure_mc_exists()
addr = self.mc.tell()
self.mc.SUB(esp, imm(FRAMESIZE))
- self.mc.MOV(eax, arg_pos(1))
+ self.mc.MOV(eax, arg_pos(0))
for i in range(len(arglocs)):
loc = arglocs[i]
if not isinstance(loc, REG):
@@ -230,7 +230,7 @@
loc = arglocs[i]
if isinstance(loc, REG):
self.mc.MOV(loc, mem(eax, i * WORD))
- self.mc.JMP(arg_pos(0))
+ self.mc.JMP(rel32(jumpaddr))
self.mc.done()
return addr
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/runner.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/runner.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/runner.py Wed Apr 8 00:25:58 2009
@@ -61,8 +61,7 @@
class CPU386(object):
debug = True
- BOOTSTRAP_TP = lltype.FuncType([lltype.Signed,
- lltype.Ptr(rffi.CArray(lltype.Signed))],
+ BOOTSTRAP_TP = lltype.FuncType([lltype.Ptr(rffi.CArray(lltype.Signed))],
lltype.Signed)
def __init__(self, rtyper, stats, translate_support_code=False,
@@ -86,7 +85,7 @@
TP = lltype.GcArray(llmemory.GCREF)
self.keepalives = []
self.keepalives_index = 0
- self._bootstrap_cache = {}
+ #self._bootstrap_cache = {}
self._guard_list = []
self._compiled_ops = {}
self._builtin_implementations = {}
@@ -199,16 +198,16 @@
def get_bootstrap_code(self, loop):
# key is locations of arguments
- key = ','.join([str(i) for i in loop.arglocs])
- try:
- func = self._bootstrap_cache[key]
- except KeyError:
- arglocs = loop.arglocs
- addr = self.assembler.assemble_bootstrap_code(arglocs)
- # arguments are as follows - address to jump to,
- # and a list of args
- func = rffi.cast(lltype.Ptr(self.BOOTSTRAP_TP), addr)
- self._bootstrap_cache[key] = func
+ #key = ','.join([str(i) for i in loop.arglocs])
+ #try:
+ # func = self._bootstrap_cache[key]
+ #except KeyError:
+ arglocs = loop.arglocs
+ addr = self.assembler.assemble_bootstrap_code(loop._x86_compiled,
+ arglocs)
+ # arguments are as follows - address to jump to,
+ # and a list of args
+ func = rffi.cast(lltype.Ptr(self.BOOTSTRAP_TP), addr)
return func
def get_box_value_as_int(self, box):
@@ -302,7 +301,7 @@
res = 0
try:
self.caught_exception = None
- res = func(loop._x86_compiled, values_as_int)
+ res = func(values_as_int)
self.reraise_caught_exception()
finally:
if not self.translate_support_code:
More information about the Pypy-commit
mailing list