Author: Maciej Fijalkowski <[email protected]>
Branch: numpy-multidim-shards
Changeset: r49584:249dc7d8f9cb
Date: 2011-11-20 18:13 +0200
http://bitbucket.org/pypy/pypy/changeset/249dc7d8f9cb/
Log: merge default in
diff --git a/pypy/doc/coding-guide.rst b/pypy/doc/coding-guide.rst
--- a/pypy/doc/coding-guide.rst
+++ b/pypy/doc/coding-guide.rst
@@ -270,7 +270,12 @@
- *slicing*:
the slice start must be within bounds. The stop doesn't need to, but it
must
not be smaller than the start. All negative indexes are disallowed,
except for
- the [:-1] special case. No step.
+ the [:-1] special case. No step. Slice deletion follows the same rules.
+
+ - *slice assignment*:
+ only supports ``lst[x:y] = sublist``, if ``len(sublist) == y - x``.
+ In other words, slice assignment cannot change the total length of the
list,
+ but just replace items.
- *other operators*:
``+``, ``+=``, ``in``, ``*``, ``*=``, ``==``, ``!=`` work as expected.
diff --git a/pypy/doc/release-1.7.0.rst b/pypy/doc/release-1.7.0.rst
--- a/pypy/doc/release-1.7.0.rst
+++ b/pypy/doc/release-1.7.0.rst
@@ -12,6 +12,9 @@
* windows fixes
* stackless and JIT integration
+ (stackless is now in the same executable, but any loop using
+ stackless features will interrupt the JIT for now, so no real
+ performance improvement for now)
* numpy progress - dtypes, numpy -> numpypy renaming
diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py
b/pypy/module/pypyjit/test_pypy_c/test_string.py
--- a/pypy/module/pypyjit/test_pypy_c/test_string.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_string.py
@@ -147,8 +147,8 @@
i31 = int_gt(i30, 23)
guard_false(i31, descr=...)
copystrcontent(p9, p21, 0, i25, i10)
- i33 = int_eq(i30, 23)
- guard_false(i33, descr=...)
+ i33 = int_lt(i30, 23)
+ guard_true(i33, descr=...)
p35 = call(ConstClass(ll_shrink_array__rpy_stringPtr_Signed), p21,
i30, descr=<GcPtrCallDescr>)
guard_no_exception(descr=...)
i37 = strlen(p35)
diff --git a/pypy/rlib/_rffi_stacklet.py b/pypy/rlib/_rffi_stacklet.py
--- a/pypy/rlib/_rffi_stacklet.py
+++ b/pypy/rlib/_rffi_stacklet.py
@@ -8,16 +8,21 @@
cdir = py.path.local(pypydir) / 'translator' / 'c'
-_sep_mods = []
-if sys.platform == 'win32':
- _sep_mods = [cdir / "src/stacklet/switch_x86_msvc.asm"]
-
eci = ExternalCompilationInfo(
include_dirs = [cdir],
includes = ['src/stacklet/stacklet.h'],
separate_module_sources = ['#include "src/stacklet/stacklet.c"\n'],
- separate_module_files = _sep_mods
)
+if sys.platform == 'win32':
+ eci.separate_module_files += (cdir / "src/stacklet/switch_x86_msvc.asm", )
+ eci.export_symbols += (
+ 'stacklet_newthread',
+ 'stacklet_deletethread',
+ 'stacklet_new',
+ 'stacklet_switch',
+ 'stacklet_destroy',
+ '_stacklet_translate_pointer',
+ )
rffi_platform.verify_eci(eci.convert_sources_to_files())
diff --git a/pypy/translator/platform/windows.py
b/pypy/translator/platform/windows.py
--- a/pypy/translator/platform/windows.py
+++ b/pypy/translator/platform/windows.py
@@ -172,6 +172,12 @@
def _compile_c_file(self, cc, cfile, compile_args):
oname = cfile.new(ext='obj')
+ # notabene: (tismer)
+ # This function may be called for .c but also .asm files.
+ # The c compiler accepts any order of arguments, while
+ # the assembler still has the old behavior that all options
+ # must come first, and after the file name all options are ignored.
+ # So please be careful with the oder of parameters! ;-)
args = ['/nologo', '/c'] + compile_args + ['/Fo%s' % (oname,),
str(cfile)]
self._execute_c_compiler(cc, args, oname)
return oname
diff --git a/pypy/translator/simplify.py b/pypy/translator/simplify.py
--- a/pypy/translator/simplify.py
+++ b/pypy/translator/simplify.py
@@ -697,10 +697,12 @@
if op.opname == 'getattr' and op.args[1] == c_append:
vlist = variable_families.find_rep(op.args[0])
if vlist in newlist_v:
- op2 = block.operations[i+1]
- if (op2.opname == 'simple_call' and len(op2.args) == 2
- and op2.args[0] is op.result):
- append_v.append((op.args[0], op.result, block))
+ for j in range(i + 1, len(block.operations)):
+ op2 = block.operations[j]
+ if (op2.opname == 'simple_call' and len(op2.args) == 2
+ and op2.args[0] is op.result):
+ append_v.append((op.args[0], op.result, block))
+ break
if not append_v:
return
detector = ListComprehensionDetector(graph, loops, newlist_v,
diff --git a/pypy/translator/test/test_simplify.py
b/pypy/translator/test/test_simplify.py
--- a/pypy/translator/test/test_simplify.py
+++ b/pypy/translator/test/test_simplify.py
@@ -305,6 +305,27 @@
'hint': 2,
})
+ def test_iterate_over_list(self):
+ def wrap(elem):
+ return elem
+
+ def f(i):
+ new_l = []
+ l = range(4)
+ for elem in l:
+ new_l.append(wrap(elem))
+ return new_l
+
+ self.check(f, {
+ 'hint': 2,
+ 'newlist': 1,
+ 'iter': 1,
+ 'next': 1,
+ 'getattr': 1,
+ 'simple_call': 3,
+ })
+
+
class TestLLSpecializeListComprehension:
typesystem = 'lltype'
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit