[pypy-svn] r77407 - in pypy/branch/minimark-jit/pypy: jit/backend/llsupport jit/backend/llsupport/test jit/metainterp rpython/memory/gc
arigo at codespeak.net
arigo at codespeak.net
Mon Sep 27 14:02:28 CEST 2010
Author: arigo
Date: Mon Sep 27 14:02:27 2010
New Revision: 77407
Modified:
pypy/branch/minimark-jit/pypy/jit/backend/llsupport/gc.py
pypy/branch/minimark-jit/pypy/jit/backend/llsupport/test/test_gc.py
pypy/branch/minimark-jit/pypy/jit/metainterp/gc.py
pypy/branch/minimark-jit/pypy/rpython/memory/gc/generation.py
pypy/branch/minimark-jit/pypy/rpython/memory/gc/minimark.py
Log:
Fixes.
Modified: pypy/branch/minimark-jit/pypy/jit/backend/llsupport/gc.py
==============================================================================
--- pypy/branch/minimark-jit/pypy/jit/backend/llsupport/gc.py (original)
+++ pypy/branch/minimark-jit/pypy/jit/backend/llsupport/gc.py Mon Sep 27 14:02:27 2010
@@ -133,7 +133,7 @@
# ____________________________________________________________
-# All code below is for the hybrid GC
+# All code below is for the hybrid or minimark GC
class GcRefList:
@@ -167,7 +167,7 @@
def alloc_gcref_list(self, n):
# Important: the GRREF_LISTs allocated are *non-movable*. This
- # requires support in the gc (only the hybrid GC supports it so far).
+ # requires support in the gc (hybrid GC or minimark GC so far).
if we_are_translated():
list = rgc.malloc_nonmovable(self.GCREF_LIST, n)
assert list, "malloc_nonmovable failed!"
@@ -350,8 +350,9 @@
self.translator = translator
self.llop1 = llop1
- # we need the hybrid GC for GcRefList.alloc_gcref_list() to work
- if gcdescr.config.translation.gc != 'hybrid':
+ # we need the hybrid or minimark GC for GcRefList.alloc_gcref_list()
+ # to work
+ if gcdescr.config.translation.gc not in ('hybrid', 'minimark'):
raise NotImplementedError("--gc=%s not implemented with the JIT" %
(gcdescr.config.translation.gc,))
@@ -382,8 +383,7 @@
self.gcheaderbuilder = GCHeaderBuilder(self.HDRPTR.TO)
(self.array_basesize, _, self.array_length_ofs) = \
symbolic.get_array_token(lltype.GcArray(lltype.Signed), True)
- min_ns = self.GCClass.TRANSLATION_PARAMS['min_nursery_size']
- self.max_size_of_young_obj = self.GCClass.get_young_fixedsize(min_ns)
+ self.max_size_of_young_obj = self.GCClass.JIT_max_size_of_young_obj()
# make a malloc function, with three arguments
def malloc_basic(size, tid):
Modified: pypy/branch/minimark-jit/pypy/jit/backend/llsupport/test/test_gc.py
==============================================================================
--- pypy/branch/minimark-jit/pypy/jit/backend/llsupport/test/test_gc.py (original)
+++ pypy/branch/minimark-jit/pypy/jit/backend/llsupport/test/test_gc.py Mon Sep 27 14:02:27 2010
@@ -149,11 +149,12 @@
class TestFramework:
+ gc = 'hybrid'
def setup_method(self, meth):
class config_:
class translation:
- gc = 'hybrid'
+ gc = self.gc
gcrootfinder = 'asmgcc'
gctransformer = 'framework'
gcremovetypeptr = False
@@ -387,3 +388,7 @@
assert operations[1].getarg(1) == v_index
assert operations[1].getarg(2) == v_value
assert operations[1].getdescr() == array_descr
+
+
+class TestFrameworkMiniMark(TestFramework):
+ gc = 'minimark'
Modified: pypy/branch/minimark-jit/pypy/jit/metainterp/gc.py
==============================================================================
--- pypy/branch/minimark-jit/pypy/jit/metainterp/gc.py (original)
+++ pypy/branch/minimark-jit/pypy/jit/metainterp/gc.py Mon Sep 27 14:02:27 2010
@@ -19,6 +19,9 @@
class GC_hybrid(GcDescription):
malloc_zero_filled = True
+class GC_minimark(GcDescription):
+ malloc_zero_filled = True
+
def get_description(config):
name = config.translation.gc
Modified: pypy/branch/minimark-jit/pypy/rpython/memory/gc/generation.py
==============================================================================
--- pypy/branch/minimark-jit/pypy/rpython/memory/gc/generation.py (original)
+++ pypy/branch/minimark-jit/pypy/rpython/memory/gc/generation.py Mon Sep 27 14:02:27 2010
@@ -147,6 +147,11 @@
def get_young_var_basesize(nursery_size):
return nursery_size // 4 - 1
+ @classmethod
+ def JIT_max_size_of_young_obj(cls):
+ min_nurs_size = cls.TRANSLATION_PARAMS['min_nursery_size']
+ return cls.get_young_fixedsize(min_nurs_size)
+
def is_in_nursery(self, addr):
ll_assert(llmemory.cast_adr_to_int(addr) & 1 == 0,
"odd-valued (i.e. tagged) pointer unexpected here")
Modified: pypy/branch/minimark-jit/pypy/rpython/memory/gc/minimark.py
==============================================================================
--- pypy/branch/minimark-jit/pypy/rpython/memory/gc/minimark.py (original)
+++ pypy/branch/minimark-jit/pypy/rpython/memory/gc/minimark.py Mon Sep 27 14:02:27 2010
@@ -719,6 +719,10 @@
# "if addr_struct.int0 & JIT_WB_IF_FLAG: remember_young_pointer()")
JIT_WB_IF_FLAG = GCFLAG_NO_YOUNG_PTRS
+ @classmethod
+ def JIT_max_size_of_young_obj(cls):
+ return cls.TRANSLATION_PARAMS['large_object']
+
def write_barrier(self, addr_struct):
if self.header(addr_struct).tid & GCFLAG_NO_YOUNG_PTRS:
self.remember_young_pointer(addr_struct)
More information about the Pypy-commit
mailing list