Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r63781:6a38c7006aed
Date: 2013-04-30 18:18 -0700
http://bitbucket.org/pypy/pypy/changeset/6a38c7006aed/
Log: merge default
diff --git a/pypy/module/pypyjit/interp_jit.py
b/pypy/module/pypyjit/interp_jit.py
--- a/pypy/module/pypyjit/interp_jit.py
+++ b/pypy/module/pypyjit/interp_jit.py
@@ -37,15 +37,16 @@
return '%s #%d %s' % (reprs, next_instr, name)
def get_jitcell_at(next_instr, is_being_profiled, bytecode):
- return bytecode.jit_cells.get((next_instr, is_being_profiled), None)
+ # use only uints as keys in the jit_cells dict, rather than
+ # a tuple (next_instr, is_being_profiled)
+ key = (next_instr << 1) | r_uint(intmask(is_being_profiled))
+ return bytecode.jit_cells.get(key, None)
def set_jitcell_at(newcell, next_instr, is_being_profiled, bytecode):
- bytecode.jit_cells[next_instr, is_being_profiled] = newcell
+ key = (next_instr << 1) | r_uint(intmask(is_being_profiled))
+ bytecode.jit_cells[key] = newcell
-def can_never_inline(next_instr, is_being_profiled, bytecode):
- return False
-
def should_unroll_one_iteration(next_instr, is_being_profiled, bytecode):
return (bytecode.co_flags & CO_GENERATOR) != 0
@@ -57,7 +58,6 @@
pypyjitdriver = PyPyJitDriver(get_printable_location = get_printable_location,
get_jitcell_at = get_jitcell_at,
set_jitcell_at = set_jitcell_at,
- can_never_inline = can_never_inline,
should_unroll_one_iteration =
should_unroll_one_iteration,
name='pypyjit')
diff --git a/pypy/objspace/std/bytearrayobject.py
b/pypy/objspace/std/bytearrayobject.py
--- a/pypy/objspace/std/bytearrayobject.py
+++ b/pypy/objspace/std/bytearrayobject.py
@@ -1,28 +1,21 @@
+"""The builtin bytearray implementation"""
+
+from pypy.interpreter.buffer import RWBuffer
from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.objspace.std.model import registerimplementation, W_Object
-from pypy.objspace.std.register_all import register_all
+from pypy.objspace.std import stringobject
+from pypy.objspace.std.bytearraytype import new_bytearray
from pypy.objspace.std.inttype import wrapint
+from pypy.objspace.std.listobject import get_list_index, get_positive_index
+from pypy.objspace.std.longobject import W_LongObject
+from pypy.objspace.std.model import W_Object, registerimplementation
from pypy.objspace.std.multimethod import FailedToImplement
from pypy.objspace.std.noneobject import W_NoneObject
-from rpython.rlib.rarithmetic import intmask
+from pypy.objspace.std.register_all import register_all
+from pypy.objspace.std.sliceobject import W_SliceObject
+from pypy.objspace.std.stringobject import W_StringObject
+from pypy.objspace.std.stringtype import getbytevalue, makebytesdata_w
+from pypy.objspace.std.tupleobject import W_TupleObject
from rpython.rlib.rstring import StringBuilder
-from rpython.rlib.debug import check_annotation
-from pypy.objspace.std import stringobject
-from pypy.objspace.std.intobject import W_IntObject
-from pypy.objspace.std.longobject import W_LongObject
-from pypy.objspace.std.listobject import get_positive_index, get_list_index
-from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice
-from pypy.objspace.std.stringobject import W_StringObject
-from pypy.objspace.std.strutil import ParseStringError
-from pypy.objspace.std.strutil import string_to_float
-from pypy.objspace.std.tupleobject import W_TupleObject
-from pypy.objspace.std.unicodeobject import W_UnicodeObject
-from pypy.objspace.std import slicetype
-from pypy.interpreter import gateway
-from pypy.interpreter.buffer import RWBuffer
-from pypy.objspace.std.stringtype import makebytesdata_w, getbytevalue
-from pypy.objspace.std.bytearraytype import new_bytearray
-from rpython.tool.sourcetools import func_with_new_name
class W_BytearrayObject(W_Object):
diff --git a/pypy/objspace/std/stringobject.py
b/pypy/objspace/std/stringobject.py
--- a/pypy/objspace/std/stringobject.py
+++ b/pypy/objspace/std/stringobject.py
@@ -1,24 +1,24 @@
-from pypy.objspace.std.model import registerimplementation, W_Object
+"""The builtin bytes implementation"""
+
+from pypy.interpreter.buffer import StringBuffer
+from pypy.interpreter.error import OperationError, operationerrfmt
+from pypy.objspace.std import slicetype
+from pypy.objspace.std.inttype import wrapint
+from pypy.objspace.std.longobject import W_LongObject
+from pypy.objspace.std.model import W_Object, registerimplementation
+from pypy.objspace.std.multimethod import FailedToImplement
+from pypy.objspace.std.noneobject import W_NoneObject
from pypy.objspace.std.register_all import register_all
-from pypy.objspace.std.multimethod import FailedToImplement
-from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.interpreter import gateway
+from pypy.objspace.std.sliceobject import W_SliceObject
+from pypy.objspace.std.stringtype import (
+ joined2, sliced, stringendswith, stringstartswith, wrapstr)
+from pypy.objspace.std.tupleobject import W_TupleObject
+from rpython.rlib import jit
+from rpython.rlib.objectmodel import (
+ compute_hash, compute_unique_id, specialize)
from rpython.rlib.rarithmetic import ovfcheck
-from rpython.rlib.objectmodel import we_are_translated, compute_hash,
specialize
-from rpython.rlib.objectmodel import compute_unique_id
-from pypy.objspace.std.inttype import wrapint
-from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice
-from pypy.objspace.std import slicetype, newformat
-from pypy.objspace.std.longobject import W_LongObject
-from pypy.objspace.std.listobject import W_ListObject
-from pypy.objspace.std.noneobject import W_NoneObject
-from pypy.objspace.std.tupleobject import W_TupleObject
-from rpython.rlib.rstring import StringBuilder, split
-from pypy.interpreter.buffer import StringBuffer
-from rpython.rlib import jit
+from rpython.rlib.rstring import StringBuilder
-from pypy.objspace.std.stringtype import sliced, wrapstr, wrapchar, \
- stringendswith, stringstartswith, joined2
class W_AbstractStringObject(W_Object):
__slots__ = ()
diff --git a/pypy/objspace/std/unicodeobject.py
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -1,24 +1,25 @@
-from pypy.objspace.std.model import registerimplementation, W_Object
+"""The builtin str implementation"""
+
+from pypy.interpreter.error import OperationError, operationerrfmt
+from pypy.module.unicodedata import unicodedb
+from pypy.objspace.std import newformat, slicetype
+from pypy.objspace.std.formatting import mod_format
+from pypy.objspace.std.model import W_Object, registerimplementation
+from pypy.objspace.std.multimethod import FailedToImplement
+from pypy.objspace.std.noneobject import W_NoneObject
+from pypy.objspace.std.sliceobject import W_SliceObject
+from pypy.objspace.std.stringobject import make_rsplit_with_delim
+from pypy.objspace.std.stringtype import stringendswith, stringstartswith
from pypy.objspace.std.register_all import register_all
-from pypy.objspace.std.multimethod import FailedToImplement
-from pypy.interpreter import gateway
-from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.objspace.std.stringobject import W_StringObject,
make_rsplit_with_delim
-from pypy.objspace.std.noneobject import W_NoneObject
-from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice
-from pypy.objspace.std import slicetype, newformat
from pypy.objspace.std.tupleobject import W_TupleObject
-from rpython.rlib.rarithmetic import intmask, ovfcheck
-from rpython.rlib.objectmodel import compute_hash, specialize
-from rpython.rlib.objectmodel import compute_unique_id
+from rpython.rlib import jit
+from rpython.rlib.rarithmetic import ovfcheck
+from rpython.rlib.objectmodel import (
+ compute_hash, compute_unique_id, specialize)
from rpython.rlib.rstring import UnicodeBuilder
from rpython.rlib.runicode import make_unicode_escape_function
-from pypy.module.unicodedata import unicodedb
from rpython.tool.sourcetools import func_with_new_name
-from rpython.rlib import jit
-from pypy.objspace.std.formatting import mod_format
-from pypy.objspace.std.stringtype import stringstartswith, stringendswith
class W_AbstractUnicodeObject(W_Object):
__slots__ = ()
diff --git a/rpython/rlib/types.py b/rpython/rlib/types.py
--- a/rpython/rlib/types.py
+++ b/rpython/rlib/types.py
@@ -7,6 +7,10 @@
return model.s_None
+def impossible():
+ return model.s_ImpossibleValue
+
+
def float():
return model.SomeFloat()
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
@@ -934,8 +934,8 @@
if tp is lltype.SingleFloat:
return 4
if tp is lltype.LongFloat:
- import ctypes # :-/
- return ctypes.sizeof(ctypes.c_longdouble)
+ # :-/
+ return sizeof_c_type("long double")
assert isinstance(tp, lltype.Number)
if tp is lltype.Signed:
return LONG_BIT/8
diff --git a/rpython/translator/cli/test/test_list.py
b/rpython/translator/cli/test/test_list.py
--- a/rpython/translator/cli/test/test_list.py
+++ b/rpython/translator/cli/test/test_list.py
@@ -13,6 +13,9 @@
def test_getitem_exc_2(self):
py.test.skip('fixme!')
+ def test_reversed(self):
+ py.test.skip("unsupported")
+
def test_list_unsigned(self):
def fn(x):
lst = [r_uint(0), r_uint(1)]
diff --git a/rpython/translator/jvm/test/test_list.py
b/rpython/translator/jvm/test/test_list.py
--- a/rpython/translator/jvm/test/test_list.py
+++ b/rpython/translator/jvm/test/test_list.py
@@ -15,6 +15,9 @@
def test_r_short_list(self):
py.test.skip('fixme!')
+ def test_reversed(self):
+ py.test.skip("unsupported")
+
def test_zeroed_list(self):
def fn():
lst = [0] * 16
diff --git a/rpython/translator/oosupport/test/test_treebuilder.py
b/rpython/translator/oosupport/test/test_treebuilder.py
--- a/rpython/translator/oosupport/test/test_treebuilder.py
+++ b/rpython/translator/oosupport/test/test_treebuilder.py
@@ -13,7 +13,7 @@
t = TranslationContext()
t.buildannotator().build_types(func, argtypes)
t.buildrtyper(type_system='ootype').specialize()
-
+
if backendopt: backend_optimizations(t, merge_if_blocks=True)
return t
@@ -121,4 +121,5 @@
return interp.eval_graph(graph, args)
class TestBuildTreeList(BuildTreeRtypingTest, BaseTestRlist):
- pass
+ def test_reversed(self):
+ py.test.skip("unsupported on ootype")
diff --git a/rpython/translator/platform/arm.py
b/rpython/translator/platform/arm.py
--- a/rpython/translator/platform/arm.py
+++ b/rpython/translator/platform/arm.py
@@ -18,9 +18,13 @@
class ARM(Linux):
name = "arm"
- available_includedirs = (SB2 + '/usr/include', '/tmp')
+ available_librarydirs = [SB2 + '/usr/lib/arm-linux-gnueabi/',
+ SB2 + '/usr/lib/arm-linux-gnueabihf/']
+ available_includedirs = [SB2 + '/usr/include/arm-linux-gnueabi/',
+ SB2 + '/usr/include/arm-linux-gnueabihf/']
copied_cache = {}
+
def _invent_new_name(self, basepath, base):
pth = basepath.join(base)
num = 0
@@ -47,12 +51,13 @@
return ExecutionResult(returncode, stdout, stderr)
def include_dirs_for_libffi(self):
- return [SB2 + '/usr/include/arm-linux-gnueabi/',
- SB2 + '/usr/include/arm-linux-gnueabihf/']
+ return self.available_includedirs
def library_dirs_for_libffi(self):
- return [SB2 + '/usr/lib/arm-linux-gnueabi/',
- SB2 + '/usr/lib/arm-linux-gnueabihf/']
+ return self.available_librarydirs
+
+ def _preprocess_library_dirs(self, library_dirs):
+ return list(library_dirs) + self.available_librarydirs
def execute_makefile(self, path_to_makefile, extra_opts=[]):
if isinstance(path_to_makefile, GnuMakefile):
diff --git a/rpython/translator/sandbox/rsandbox.py
b/rpython/translator/sandbox/rsandbox.py
--- a/rpython/translator/sandbox/rsandbox.py
+++ b/rpython/translator/sandbox/rsandbox.py
@@ -100,7 +100,7 @@
else: raise RuntimeError
-@signature(types.str(), returns=types.none())
+@signature(types.str(), returns=types.impossible())
def not_implemented_stub(msg):
STDERR = 2
buf = rffi.str2charp(msg + '\n')
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit