[pypy-commit] lang-smalltalk rbitblt: fix switching to 32bit depth in the mini-image
timfel
noreply at buildbot.pypy.org
Fri Jan 3 16:45:40 CET 2014
Author: Tim Felgentreff <timfelgentreff at gmail.com>
Branch: rbitblt
Changeset: r547:bafeaf582cff
Date: 2014-01-03 09:28 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/bafeaf582cff/
Log: fix switching to 32bit depth in the mini-image
diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -965,7 +965,7 @@
return w_rcvr
def fake_bytes_left(interp):
- return interp.space.wrap_int(2**20) # XXX we don't know how to do this :-(
+ return interp.space.wrap_int(2**29) # XXX we don't know how to do this :-(
@expose_primitive(SPECIAL_OBJECTS_ARRAY, unwrap_spec=[object])
def func(interp, s_frame, w_rcvr):
@@ -974,7 +974,8 @@
@expose_primitive(INC_GC, unwrap_spec=[object])
@expose_primitive(FULL_GC, unwrap_spec=[object])
@jit.dont_look_inside
-def func(interp, s_frame, w_arg): # Squeak pops the arg and ignores it ... go figure
+# def func(interp, s_frame, w_arg): # Squeak pops the arg and ignores it ... go figure
+def func(interp, s_frame, w_rcvr):
from rpython.rlib import rgc
rgc.collect()
return fake_bytes_left(interp)
diff --git a/spyvm/shadow.py b/spyvm/shadow.py
--- a/spyvm/shadow.py
+++ b/spyvm/shadow.py
@@ -1425,7 +1425,7 @@
nPix = startBits
words = self.nWords
# Here is the horizontal loop...
- for word in range(words + 1):
+ for word in range(words):
skewWord = self.pickSourcePixels(nPix, sourcePixMask, destPixMask, srcShiftInc, dstShiftInc)
# align next word to leftmost pixel
self.dstBitShift = dstShiftLeft
@@ -1460,7 +1460,7 @@
nPix = nPixels
# always > 0 so we can use do { } while(--nPix);
if (self.w_cmLookupTable): # a little optimization for (pretty crucial) blits using indexed lookups only
- for px in range(nPix + 1):
+ for px in range(nPix):
sourcePix = self.rshift(rarithmetic.r_uint(sourceWord), srcShift) & srcMask
destPix = self.w_cmLookupTable.getword(rarithmetic.intmask(sourcePix & self.cmMask))
# adjust dest pix index
@@ -1693,6 +1693,8 @@
w_self._shadow = None
raise error.PrimitiveFailedError
self.w_bits = self.fetch(0)
+ if self.w_bits is self.space.w_nil:
+ return
if not (isinstance(self.w_bits, model.W_WordsObject) or isinstance(self.w_bits, model.W_DisplayBitmap)):
w_self = self.w_self()
assert isinstance(w_self, model.W_PointersObject)
@@ -1716,7 +1718,8 @@
self.pixPerWord = 32 / self.depth
self.pitch = (self.width + (self.pixPerWord - 1)) / self.pixPerWord | 0
if self.w_bits.size() != (self.pitch * self.height):
- raise error.PrimitiveFailedError()
+ # raise error.PrimitiveFailedError()
+ pass # - we'll be updated again
# def replace_bits(self):
# w_bits = self.w_bits
More information about the pypy-commit
mailing list