[pypy-svn] r69986 - in pypy/branch/listcopyop/pypy: rlib rpython rpython/lltypesystem rpython/memory rpython/memory/gc rpython/memory/gctransform
fijal at codespeak.net
fijal at codespeak.net
Tue Dec 8 17:07:53 CET 2009
Author: fijal
Date: Tue Dec 8 17:07:52 2009
New Revision: 69986
Modified:
pypy/branch/listcopyop/pypy/rlib/rgc.py
pypy/branch/listcopyop/pypy/rpython/llinterp.py
pypy/branch/listcopyop/pypy/rpython/lltypesystem/lloperation.py
pypy/branch/listcopyop/pypy/rpython/lltypesystem/opimpl.py
pypy/branch/listcopyop/pypy/rpython/memory/gc/generation.py
pypy/branch/listcopyop/pypy/rpython/memory/gctransform/framework.py
pypy/branch/listcopyop/pypy/rpython/memory/gctransform/transform.py
pypy/branch/listcopyop/pypy/rpython/memory/gcwrapper.py
Log:
Rename arraycopy_writebarrier to writebarrier_before_copy to reflect what
it really does
Modified: pypy/branch/listcopyop/pypy/rlib/rgc.py
==============================================================================
--- pypy/branch/listcopyop/pypy/rlib/rgc.py (original)
+++ pypy/branch/listcopyop/pypy/rlib/rgc.py Tue Dec 8 17:07:52 2009
@@ -338,7 +338,7 @@
if isinstance(TP.OF, lltype.Ptr) and TP.OF.TO._gckind == 'gc':
# perform a write barrier that copies necessary flags from
# source to dest
- llop.gc_arraycopy_writebarrier(lltype.Void, source, dest)
+ llop.gc_writebarrier_before_copy(lltype.Void, source, dest)
source_addr = llmemory.cast_ptr_to_adr(source)
dest_addr = llmemory.cast_ptr_to_adr(dest)
cp_source_addr = (source_addr + llmemory.itemoffsetof(TP, 0) +
Modified: pypy/branch/listcopyop/pypy/rpython/llinterp.py
==============================================================================
--- pypy/branch/listcopyop/pypy/rpython/llinterp.py (original)
+++ pypy/branch/listcopyop/pypy/rpython/llinterp.py Tue Dec 8 17:07:52 2009
@@ -754,9 +754,9 @@
def op_zero_gc_pointers_inside(self, obj):
raise NotImplementedError("zero_gc_pointers_inside")
- def op_gc_arraycopy_writebarrier(self, source, dest):
- if hasattr(self.heap, 'arraycopy_writebarrier'):
- self.heap.arraycopy_writebarrier(source, dest)
+ def op_gc_writebarrier_before_copy(self, source, dest):
+ if hasattr(self.heap, 'writebarrier_before_copy'):
+ self.heap.writebarrier_before_copy(source, dest)
def op_getfield(self, obj, field):
checkptr(obj)
Modified: pypy/branch/listcopyop/pypy/rpython/lltypesystem/lloperation.py
==============================================================================
--- pypy/branch/listcopyop/pypy/rpython/lltypesystem/lloperation.py (original)
+++ pypy/branch/listcopyop/pypy/rpython/lltypesystem/lloperation.py Tue Dec 8 17:07:52 2009
@@ -461,7 +461,7 @@
'gc_thread_run' : LLOp(),
'gc_thread_die' : LLOp(),
'gc_assume_young_pointers': LLOp(canrun=True),
- 'gc_arraycopy_writebarrier': LLOp(canrun=True),
+ 'gc_writebarrier_before_copy': LLOp(canrun=True),
'gc_heap_stats' : LLOp(canunwindgc=True),
# ------- JIT & GC interaction, only for some GCs ----------
Modified: pypy/branch/listcopyop/pypy/rpython/lltypesystem/opimpl.py
==============================================================================
--- pypy/branch/listcopyop/pypy/rpython/lltypesystem/opimpl.py (original)
+++ pypy/branch/listcopyop/pypy/rpython/lltypesystem/opimpl.py Tue Dec 8 17:07:52 2009
@@ -394,7 +394,7 @@
checkadr(addr2)
return addr1 - addr2
-def op_gc_arraycopy_writebarrier(source, dest):
+def op_gc_writebarrier_before_copy(source, dest):
A = lltype.typeOf(source)
assert A == lltype.typeOf(dest)
assert isinstance(A.TO, lltype.GcArray)
Modified: pypy/branch/listcopyop/pypy/rpython/memory/gc/generation.py
==============================================================================
--- pypy/branch/listcopyop/pypy/rpython/memory/gc/generation.py (original)
+++ pypy/branch/listcopyop/pypy/rpython/memory/gc/generation.py Tue Dec 8 17:07:52 2009
@@ -482,7 +482,7 @@
objhdr.tid &= ~GCFLAG_NO_HEAP_PTRS
self.last_generation_root_objects.append(addr_struct)
- def arraycopy_writebarrier(self, source_addr, dest_addr):
+ def writebarrier_before_copy(self, source_addr, dest_addr):
""" This has the same effect as calling writebarrier over
each element in dest copied from source, except it might reset
one of the following flags a bit too eagerly, which means we'll have
Modified: pypy/branch/listcopyop/pypy/rpython/memory/gctransform/framework.py
==============================================================================
--- pypy/branch/listcopyop/pypy/rpython/memory/gctransform/framework.py (original)
+++ pypy/branch/listcopyop/pypy/rpython/memory/gctransform/framework.py Tue Dec 8 17:07:52 2009
@@ -292,8 +292,9 @@
[s_gc, annmodel.SomeInteger(knowntype=rffi.r_ushort)],
annmodel.SomeInteger())
- if hasattr(GCClass, 'arraycopy_writebarrier'):
- self.arraycopy_wb_p = getfn(GCClass.arraycopy_writebarrier.im_func,
+ if hasattr(GCClass, 'writebarrier_before_copy'):
+ self.wb_before_copy_ptr = \
+ getfn(GCClass.writebarrier_before_copy.im_func,
[s_gc] + [annmodel.SomeAddress()] * 2, annmodel.s_None)
# in some GCs we can inline the common case of
@@ -780,16 +781,16 @@
TYPE = v_ob.concretetype.TO
gen_zero_gc_pointers(TYPE, v_ob, hop.llops)
- def gct_gc_arraycopy_writebarrier(self, hop):
- if not hasattr(self, 'arraycopy_wb_p'):
+ def gct_gc_writebarrier_before_copy(self, hop):
+ if not hasattr(self, 'wb_before_copy_ptr'):
# should do nothing
- return GCTransformer.gct_gc_arraycopy_writebarrier(self, hop)
+ return GCTransformer.gct_gc_writebarrier_before_copy(self, hop)
op = hop.spaceop
source_addr = hop.genop('cast_ptr_to_adr', [op.args[0]],
resulttype=llmemory.Address)
dest_addr = hop.genop('cast_ptr_to_adr', [op.args[1]],
resulttype=llmemory.Address)
- hop.genop('direct_call', [self.arraycopy_wb_p, self.c_const_gc,
+ hop.genop('direct_call', [self.wb_before_copy_ptr, self.c_const_gc,
source_addr, dest_addr])
def gct_weakref_create(self, hop):
Modified: pypy/branch/listcopyop/pypy/rpython/memory/gctransform/transform.py
==============================================================================
--- pypy/branch/listcopyop/pypy/rpython/memory/gctransform/transform.py (original)
+++ pypy/branch/listcopyop/pypy/rpython/memory/gctransform/transform.py Tue Dec 8 17:07:52 2009
@@ -380,7 +380,7 @@
def gct_zero_gc_pointers_inside(self, hop):
pass
- def gct_gc_arraycopy_writebarrier(self, hop):
+ def gct_gc_writebarrier_before_copy(self, hop):
pass
def gct_gc_identityhash(self, hop):
Modified: pypy/branch/listcopyop/pypy/rpython/memory/gcwrapper.py
==============================================================================
--- pypy/branch/listcopyop/pypy/rpython/memory/gcwrapper.py (original)
+++ pypy/branch/listcopyop/pypy/rpython/memory/gcwrapper.py Tue Dec 8 17:07:52 2009
@@ -128,11 +128,11 @@
ptr = lltype.cast_opaque_ptr(llmemory.GCREF, ptr)
return self.gc.id(ptr)
- def arraycopy_writebarrier(self, source, dest):
- if hasattr(self.gc, 'arraycopy_writebarrier'):
+ def writebarrier_before_copy(self, source, dest):
+ if hasattr(self.gc, 'writebarrier_before_copy'):
source_addr = llmemory.cast_ptr_to_adr(source)
dest_addr = llmemory.cast_ptr_to_adr(dest)
- return self.gc.arraycopy_writebarrier(source_addr, dest_addr)
+ return self.gc.writebarrier_before_copy(source_addr, dest_addr)
# ____________________________________________________________
More information about the Pypy-commit
mailing list