[pypy-svn] r68292 - in pypy/branch/gc-compress/pypy: rpython/lltypesystem rpython/memory translator/c/src

arigo at codespeak.net arigo at codespeak.net
Fri Oct 9 19:59:33 CEST 2009


Author: arigo
Date: Fri Oct  9 19:59:33 2009
New Revision: 68292

Modified:
   pypy/branch/gc-compress/pypy/rpython/lltypesystem/lloperation.py
   pypy/branch/gc-compress/pypy/rpython/lltypesystem/opimpl.py
   pypy/branch/gc-compress/pypy/rpython/memory/gctypelayout.py
   pypy/branch/gc-compress/pypy/translator/c/src/llgroup.h
Log:
Invert this operation for now.


Modified: pypy/branch/gc-compress/pypy/rpython/lltypesystem/lloperation.py
==============================================================================
--- pypy/branch/gc-compress/pypy/rpython/lltypesystem/lloperation.py	(original)
+++ pypy/branch/gc-compress/pypy/rpython/lltypesystem/lloperation.py	Fri Oct  9 19:59:33 2009
@@ -410,9 +410,10 @@
     'cast_adr_to_ptr':      LLOp(canfold=True),
     'cast_adr_to_int':      LLOp(sideeffects=False),
     'cast_int_to_adr':      LLOp(canfold=True),   # not implemented in llinterp
+
     'get_group_member':     LLOp(canfold=True),
     'get_next_group_member':LLOp(canfold=True),
-    'is_group_member_zero': LLOp(canfold=True),
+    'is_group_member_nonzero':LLOp(canfold=True),
     'extract_ushort':       LLOp(canfold=True),
     'combine_ushort':       LLOp(canfold=True),
     'gc_gettypeptr_group':  LLOp(canfold=True),

Modified: pypy/branch/gc-compress/pypy/rpython/lltypesystem/opimpl.py
==============================================================================
--- pypy/branch/gc-compress/pypy/rpython/lltypesystem/opimpl.py	(original)
+++ pypy/branch/gc-compress/pypy/rpython/lltypesystem/opimpl.py	Fri Oct  9 19:59:33 2009
@@ -416,13 +416,13 @@
     return lltype.cast_pointer(TYPE, member)
 op_get_next_group_member.need_result_type = True
 
-def op_is_group_member_zero(memberoffset):
+def op_is_group_member_nonzero(memberoffset):
     from pypy.rpython.lltypesystem import llgroup
     if isinstance(memberoffset, llgroup.GroupMemberOffset):
-        return memberoffset.index == 0
+        return memberoffset.index != 0
     else:
         assert isinstance(memberoffset, int)
-        return memberoffset == 0
+        return memberoffset != 0
 
 def op_extract_ushort(combinedoffset):
     from pypy.rpython.lltypesystem import llgroup

Modified: pypy/branch/gc-compress/pypy/rpython/memory/gctypelayout.py
==============================================================================
--- pypy/branch/gc-compress/pypy/rpython/memory/gctypelayout.py	(original)
+++ pypy/branch/gc-compress/pypy/rpython/memory/gctypelayout.py	Fri Oct  9 19:59:33 2009
@@ -42,14 +42,14 @@
         self.type_info_group_ptr = type_info_group._as_ptr()
 
     def get(self, typeid):
-        ll_assert(not llop.is_group_member_zero(lltype.Bool, typeid),
+        ll_assert(llop.is_group_member_nonzero(lltype.Bool, typeid),
                   "invalid type_id")
         return llop.get_group_member(GCData.TYPE_INFO_PTR,
                                      self.type_info_group_ptr,
                                      typeid)
 
     def get_varsize(self, typeid):
-        ll_assert(not llop.is_group_member_zero(lltype.Bool, typeid),
+        ll_assert(llop.is_group_member_nonzero(lltype.Bool, typeid),
                   "invalid type_id")
         return llop.get_group_member(GCData.VARSIZE_TYPE_INFO_PTR,
                                      self.type_info_group_ptr,

Modified: pypy/branch/gc-compress/pypy/translator/c/src/llgroup.h
==============================================================================
--- pypy/branch/gc-compress/pypy/translator/c/src/llgroup.h	(original)
+++ pypy/branch/gc-compress/pypy/translator/c/src/llgroup.h	Fri Oct  9 19:59:33 2009
@@ -11,8 +11,8 @@
 #define OP_GET_NEXT_GROUP_MEMBER(groupptr, compactoffset, skipoffset, r)  \
   r = ((char*)groupptr) + ((long)compactoffset)*sizeof(long) + skipoffset
 
-#define OP_IS_GROUP_MEMBER_ZERO(compactoffset, r)  \
-  r = (compactoffset == 0)
+#define OP_IS_GROUP_MEMBER_NONZERO(compactoffset, r)  \
+  r = (compactoffset != 0)
 
 #define OP_EXTRACT_USHORT(value, r)  \
   r = (unsigned short)value



More information about the Pypy-commit mailing list