Author: Nicolas Truessel <[email protected]>
Branch: quad-color-gc
Changeset: r86447:227535124264
Date: 2016-08-23 15:36 +0200
http://bitbucket.org/pypy/pypy/changeset/227535124264/
Log: Replace dereference hack
diff --git a/rpython/memory/gctransform/qcgcframework.py
b/rpython/memory/gctransform/qcgcframework.py
--- a/rpython/memory/gctransform/qcgcframework.py
+++ b/rpython/memory/gctransform/qcgcframework.py
@@ -23,8 +23,8 @@
# s_gcref], s_gcref)
#
def invokecallback(root, visit_fn):
- obj = llop.qcgc_dereference(llmemory.Address, root)
- visit_fn(obj)
+ ref = llmemory.cast_adr_to_ptr(root, rffi.VOIDPP)
+ visit_fn(llmemory.cast_ptr_to_adr(ref[0]))
def pypy_trace_cb(obj, visit_fn):
gc.trace(obj, invokecallback, visit_fn)
pypy_trace_cb.c_name = "pypy_trace_cb"
diff --git a/rpython/rtyper/lltypesystem/lloperation.py
b/rpython/rtyper/lltypesystem/lloperation.py
--- a/rpython/rtyper/lltypesystem/lloperation.py
+++ b/rpython/rtyper/lltypesystem/lloperation.py
@@ -517,7 +517,6 @@
# __________ qcgc operations __________
'qcgc_allocate': LLOp(canmallocgc=True),
'qcgc_collect': LLOp(), # XXX: No allocations, so no canmallocgc ?
- 'qcgc_dereference': LLOp(),
# __________ weakrefs __________
diff --git a/rpython/translator/c/funcgen.py b/rpython/translator/c/funcgen.py
--- a/rpython/translator/c/funcgen.py
+++ b/rpython/translator/c/funcgen.py
@@ -959,8 +959,3 @@
def OP_QCGC_COLLECT(self, op):
return 'qcgc_collect();'
-
- def OP_QCGC_DEREFERENCE(self, op):
- arg = self.expr(op.args[0])
- result = self.expr(op.result)
- return '%s = *((object_t **) %s);' % (result, arg)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit