Author: Richard Plangger <[email protected]>
Branch: strbuf-as-buffer
Changeset: r89209:101c94950d90
Date: 2016-12-20 18:55 +0100
http://bitbucket.org/pypy/pypy/changeset/101c94950d90/
Log: pass the test with incminimark enabled
diff --git a/rpython/memory/gctransform/framework.py
b/rpython/memory/gctransform/framework.py
--- a/rpython/memory/gctransform/framework.py
+++ b/rpython/memory/gctransform/framework.py
@@ -1599,6 +1599,7 @@
v_ret = hop.genop("direct_call", [self.move_out_of_nursery_ptr,
self.c_const_gc, v_adr],
resulttype=llmemory.Address)
+ import pdb; pdb.set_trace()
hop.genop("cast_adr_to_ptr", [v_ret],
resultvar = hop.spaceop.result)
diff --git a/rpython/rlib/rgc.py b/rpython/rlib/rgc.py
--- a/rpython/rlib/rgc.py
+++ b/rpython/rlib/rgc.py
@@ -543,8 +543,17 @@
NOTE: Only use for immutable objects!
"""
- from rpython.rtyper.lltypesystem.lloperation import llop
- return llop.gc_move_out_of_nursery(lltype.Void, obj)
+ pass
+
+class MoveOutOfNurseryEntry(ExtRegistryEntry):
+ _about_ = move_out_of_nursery
+
+ def compute_result_annotation(self, s_obj):
+ return s_obj
+
+ def specialize_call(self, hop):
+ hop.exception_cannot_occur()
+ return hop.genop('gc_move_out_of_nursery', hop.args_v,
resulttype=hop.r_result)
# ____________________________________________________________
diff --git a/rpython/rtyper/lltypesystem/rffi.py
b/rpython/rtyper/lltypesystem/rffi.py
--- a/rpython/rtyper/lltypesystem/rffi.py
+++ b/rpython/rtyper/lltypesystem/rffi.py
@@ -1343,17 +1343,16 @@
from rpython.rlib import rgc
if we_are_translated():
- newstring = string
if rgc.can_move(string):
- newstring = rgc.move_out_of_nursery(string)
+ string = rgc.move_out_of_nursery(string)
# string cannot move now! return the address
- lldata = llstr(newstring)
+ lldata = llstr(string)
data_start = (llmemory.cast_ptr_to_adr(lldata) +
offsetof(STR, 'chars') +
llmemory.itemoffsetof(STR.chars, 0))
data_start = cast(CCHARP, data_start)
- data_start[len(newstring)] = '\x00' # write the final extra null
+ data_start[len(string)] = '\x00' # write the final extra null
return data_start
else:
global TEST_RAW_ADDR_KEEP_ALIVE
diff --git a/rpython/rtyper/lltypesystem/test/test_ztranslated.py
b/rpython/rtyper/lltypesystem/test/test_ztranslated.py
--- a/rpython/rtyper/lltypesystem/test/test_ztranslated.py
+++ b/rpython/rtyper/lltypesystem/test/test_ztranslated.py
@@ -54,10 +54,6 @@
def target(driver, args):
return main
-def test_compiled():
- fn = compile(main, [], gcpolicy="minimark")
- fn()
-
def test_compiled_incminimark():
fn = compile(main, [], gcpolicy="incminimark")
fn()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit