[pypy-commit] pypy llimpl: Remove undocumented and unused alternative input types for 'args' in register_external()

2016-02-08 Thread rlamy
Author: Ronan Lamy 
Branch: llimpl
Changeset: r82115:729ec6bd5cd5
Date: 2016-02-08 15:50 +
http://bitbucket.org/pypy/pypy/changeset/729ec6bd5cd5/

Log:Remove undocumented and unused alternative input types for 'args' in
register_external()

diff --git a/rpython/rtyper/extfunc.py b/rpython/rtyper/extfunc.py
--- a/rpython/rtyper/extfunc.py
+++ b/rpython/rtyper/extfunc.py
@@ -1,4 +1,3 @@
-from rpython.tool.sourcetools import func_with_new_name
 from rpython.rtyper.extregistry import ExtRegistryEntry
 from rpython.rtyper.lltypesystem.lltype import typeOf, FuncType, functionptr, 
_ptr
 from rpython.annotator.model import unionof
@@ -88,16 +87,7 @@
 class FunEntry(ExtFuncEntry):
 _about_ = function
 safe_not_sandboxed = sandboxsafe
-
-if args is None:
-def normalize_args(self, *args_s):
-return args_s# accept any argument unmodified
-elif callable(args):
-# custom annotation normalizer (see e.g. os.utime())
-normalize_args = staticmethod(args)
-else: # use common case behavior
-signature_args = args
-
+signature_args = args
 signature_result = annotation(result, None)
 name = export_name
 if llimpl:
diff --git a/rpython/rtyper/test/test_extfunc.py 
b/rpython/rtyper/test/test_extfunc.py
--- a/rpython/rtyper/test/test_extfunc.py
+++ b/rpython/rtyper/test/test_extfunc.py
@@ -121,23 +121,6 @@
 s = a.build_types(f, [])
 assert isinstance(s, SomeInteger)
 
-def test_register_external_specialcase(self):
-"""
-When args=None, the external function accepts any arguments unmodified.
-"""
-def function_withspecialcase(arg):
-return repr(arg)
-register_external(function_withspecialcase, args=None, result=str)
-
-def f():
-x = function_withspecialcase
-return x(33) + x("aaa") + x([]) + "\n"
-
-policy = AnnotatorPolicy()
-a = RPythonAnnotator(policy=policy)
-s = a.build_types(f, [])
-assert isinstance(s, SomeString)
-
 def test_str0(self):
 str0 = SomeString(no_nul=True)
 def os_open(s):
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy.org extradoc: update the values

2016-02-08 Thread arigo
Author: Armin Rigo 
Branch: extradoc
Changeset: r700:dcc5d23c5099
Date: 2016-02-08 13:40 +0100
http://bitbucket.org/pypy/pypy.org/changeset/dcc5d23c5099/

Log:update the values

diff --git a/don1.html b/don1.html
--- a/don1.html
+++ b/don1.html
@@ -9,13 +9,13 @@
 
   $(function() {
 $("#progressbar").progressbar({
-  value: 59.8
+  value: 59.9
});
   });
 
 

-   $62841 of $105000 (59.8%)
+   $62850 of $105000 (59.9%)


 
@@ -23,7 +23,7 @@
   
   This donation goes towards supporting Python 3 in 
PyPy.
   Current status:
-we have $8008 left
+we have $8016 left
   in the account. Read proposal
   
   
diff --git a/don3.html b/don3.html
--- a/don3.html
+++ b/don3.html
@@ -15,7 +15,7 @@
 
 

-   $53142 of $6 (88.6%)
+   $53152 of $6 (88.6%)


 
@@ -23,7 +23,7 @@
   
   This donation goes towards supporting NumPy in PyPy.
   Current status:
-we have $7933 left
+we have $7941 left
   in the account. Read proposal
   
   
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy llimpl: Compute signature eagerly in register_external()

2016-02-08 Thread rlamy
Author: Ronan Lamy 
Branch: llimpl
Changeset: r82119:c1b013088ffd
Date: 2016-02-09 02:13 +
http://bitbucket.org/pypy/pypy/changeset/c1b013088ffd/

Log:Compute signature eagerly in register_external()

diff --git a/rpython/rtyper/extfunc.py b/rpython/rtyper/extfunc.py
--- a/rpython/rtyper/extfunc.py
+++ b/rpython/rtyper/extfunc.py
@@ -6,31 +6,29 @@
 class ExtFuncEntry(ExtRegistryEntry):
 safe_not_sandboxed = False
 
-# common case: args is a list of annotation or types
-def normalize_args(self, *args_s):
-args = self.signature_args
-signature_args = [annotation(arg, None) for arg in args]
-assert len(args_s) == len(signature_args),\
+def check_args(self, *args_s):
+params_s = self.signature_args
+assert len(args_s) == len(params_s),\
"Argument number mismatch"
 
-for i, expected in enumerate(signature_args):
-arg = unionof(args_s[i], expected)
-if not expected.contains(arg):
+for i, s_param in enumerate(params_s):
+arg = unionof(args_s[i], s_param)
+if not s_param.contains(arg):
 raise SignatureError("In call to external function %r:\n"
 "arg %d must be %s,\n"
 "  got %s" % (
-self.name, i+1, expected, args_s[i]))
-return signature_args
+self.name, i+1, s_param, args_s[i]))
+return params_s
 
 def compute_result_annotation(self, *args_s):
-self.normalize_args(*args_s)   # check arguments
+self.check_args(*args_s)
 return self.signature_result
 
 def specialize_call(self, hop):
 from rpython.rtyper.rtyper import llinterp_backend
 rtyper = hop.rtyper
-signature_args = self.normalize_args(*hop.args_s)
-args_r = [rtyper.getrepr(s_arg) for s_arg in signature_args]
+signature_args = self.signature_args
+args_r = [rtyper.getrepr(s_arg) for s_arg in self.signature_args]
 args_ll = [r_arg.lowleveltype for r_arg in args_r]
 s_result = hop.s_result
 r_result = rtyper.getrepr(s_result)
@@ -83,23 +81,20 @@
 
 if export_name is None:
 export_name = function.__name__
+params_s = [annotation(arg) for arg in args]
+s_result = annotation(result)
 
 class FunEntry(ExtFuncEntry):
 _about_ = function
 safe_not_sandboxed = sandboxsafe
-signature_args = args
-signature_result = annotation(result, None)
+signature_args = params_s
+signature_result = s_result
 name = export_name
 if llimpl:
 lltypeimpl = staticmethod(llimpl)
 if llfakeimpl:
 lltypefakeimpl = staticmethod(llfakeimpl)
 
-if export_name:
-FunEntry.__name__ = export_name
-else:
-FunEntry.__name__ = function.func_name
-
 def is_external(func):
 if hasattr(func, 'value'):
 func = func.value
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy llimpl: Test register_external(), not its internal implementation

2016-02-08 Thread rlamy
Author: Ronan Lamy 
Branch: llimpl
Changeset: r82116:d159c6726d45
Date: 2016-02-08 17:04 +
http://bitbucket.org/pypy/pypy/changeset/d159c6726d45/

Log:Test register_external(), not its internal implementation

diff --git a/rpython/rtyper/test/test_extfunc.py 
b/rpython/rtyper/test/test_extfunc.py
--- a/rpython/rtyper/test/test_extfunc.py
+++ b/rpython/rtyper/test/test_extfunc.py
@@ -1,7 +1,6 @@
 import py
 
-from rpython.rtyper.extfunc import ExtFuncEntry, register_external,\
- is_external
+from rpython.rtyper.extfunc import register_external
 from rpython.annotator.model import SomeInteger, SomeString, AnnotatorError
 from rpython.annotator.annrpython import RPythonAnnotator
 from rpython.annotator.policy import AnnotatorPolicy
@@ -19,11 +18,7 @@
 "NOT_RPYTHON"
 return eval("x+40")
 
-class BTestFuncEntry(ExtFuncEntry):
-_about_ = b
-name = 'b'
-signature_args = [SomeInteger()]
-signature_result = SomeInteger()
+register_external(b, [int], result=int)
 
 def f():
 return b(2)
@@ -43,15 +38,11 @@
 def c(y, x):
 yyy
 
-class CTestFuncEntry(ExtFuncEntry):
-_about_ = c
-name = 'ccc'
-signature_args = [SomeInteger()] * 2
-signature_result = SomeInteger()
+def llimpl(y, x):
+return y + x
 
-def lltypeimpl(y, x):
-return y + x
-lltypeimpl = staticmethod(lltypeimpl)
+register_external(c, [int, int], result=int, llimpl=llimpl,
+  export_name='ccc')
 
 def f():
 return c(3, 4)
@@ -59,22 +50,6 @@
 res = interpret(f, [])
 assert res == 7
 
-def test_register_external_signature(self):
-"""
-Test the standard interface for external functions.
-"""
-def dd():
-pass
-register_external(dd, [int], int)
-
-def f():
-return dd(3)
-
-policy = AnnotatorPolicy()
-a = RPythonAnnotator(policy=policy)
-s = a.build_types(f, [])
-assert isinstance(s, SomeInteger)
-
 def test_register_external_tuple_args(self):
 """
 Verify the annotation of a registered external function which takes a
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] buildbot default: try to make LINUX32 run an hour later

2016-02-08 Thread fijal
Author: fijal
Branch: 
Changeset: r982:5ae8ba9b9554
Date: 2016-02-08 19:34 +0100
http://bitbucket.org/pypy/buildbot/changeset/5ae8ba9b9554/

Log:try to make LINUX32 run an hour later

diff --git a/bot2/pypybuildbot/master.py b/bot2/pypybuildbot/master.py
--- a/bot2/pypybuildbot/master.py
+++ b/bot2/pypybuildbot/master.py
@@ -270,7 +270,6 @@
 Nightly("nightly-0-00", [
 # benchmarks
 # linux tests
-LINUX32,   # on tannit32, uses all cores
 LINUX64,   # on speed-old, uses all cores
 JITLINUX32,# on tannit32, uses 1 core
 JITLINUX64,# on speed-old, uses 1 core
@@ -295,6 +294,7 @@
 ], branch='s390x-backend', hour=2, minute=0),
 
 Nightly("nightly-1-00", [
+LINUX32,   # on tannit32, uses all cores
 JITBENCH,  # on tannit32, uses 1 core (in part 
exclusively)
 JITBENCH64,# on tannit64, uses 1 core (in part 
exclusively)
 JITBENCH64_NEW,# on speed64, uses 1 core (in part 
exclusively)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] buildbot default: Backed out changeset 5ae8ba9b9554

2016-02-08 Thread fijal
Author: fijal
Branch: 
Changeset: r983:f76d0f67ea99
Date: 2016-02-08 19:34 +0100
http://bitbucket.org/pypy/buildbot/changeset/f76d0f67ea99/

Log:Backed out changeset 5ae8ba9b9554

diff --git a/bot2/pypybuildbot/master.py b/bot2/pypybuildbot/master.py
--- a/bot2/pypybuildbot/master.py
+++ b/bot2/pypybuildbot/master.py
@@ -270,6 +270,7 @@
 Nightly("nightly-0-00", [
 # benchmarks
 # linux tests
+LINUX32,   # on tannit32, uses all cores
 LINUX64,   # on speed-old, uses all cores
 JITLINUX32,# on tannit32, uses 1 core
 JITLINUX64,# on speed-old, uses 1 core
@@ -294,7 +295,6 @@
 ], branch='s390x-backend', hour=2, minute=0),
 
 Nightly("nightly-1-00", [
-LINUX32,   # on tannit32, uses all cores
 JITBENCH,  # on tannit32, uses 1 core (in part 
exclusively)
 JITBENCH64,# on tannit64, uses 1 core (in part 
exclusively)
 JITBENCH64_NEW,# on speed64, uses 1 core (in part 
exclusively)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] buildbot default: move LINUX64 to run an hour later

2016-02-08 Thread fijal
Author: fijal
Branch: 
Changeset: r984:d3ca85cd39a5
Date: 2016-02-08 19:35 +0100
http://bitbucket.org/pypy/buildbot/changeset/d3ca85cd39a5/

Log:move LINUX64 to run an hour later

diff --git a/bot2/pypybuildbot/master.py b/bot2/pypybuildbot/master.py
--- a/bot2/pypybuildbot/master.py
+++ b/bot2/pypybuildbot/master.py
@@ -271,7 +271,6 @@
 # benchmarks
 # linux tests
 LINUX32,   # on tannit32, uses all cores
-LINUX64,   # on speed-old, uses all cores
 JITLINUX32,# on tannit32, uses 1 core
 JITLINUX64,# on speed-old, uses 1 core
 #APPLVLLINUX32,# on tannit32, uses 1 core
@@ -295,6 +294,7 @@
 ], branch='s390x-backend', hour=2, minute=0),
 
 Nightly("nightly-1-00", [
+LINUX64,   # on speed-old, uses all cores
 JITBENCH,  # on tannit32, uses 1 core (in part 
exclusively)
 JITBENCH64,# on tannit64, uses 1 core (in part 
exclusively)
 JITBENCH64_NEW,# on speed64, uses 1 core (in part 
exclusively)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: kill some special code that we're not using any more

2016-02-08 Thread fijal
Author: fijal
Branch: 
Changeset: r82118:a204ce60d060
Date: 2016-02-08 22:03 +0100
http://bitbucket.org/pypy/pypy/changeset/a204ce60d060/

Log:kill some special code that we're not using any more

diff --git a/rpython/rlib/rvmprof/src/vmprof_getpc.h 
b/rpython/rlib/rvmprof/src/vmprof_getpc.h
--- a/rpython/rlib/rvmprof/src/vmprof_getpc.h
+++ b/rpython/rlib/rvmprof/src/vmprof_getpc.h
@@ -111,47 +111,9 @@
 // PC_FROM_UCONTEXT in config.h.  The only thing we need to do here,
 // then, is to do the magic call-unrolling for systems that support it.
 
-// -- Special case 1: linux x86, for which we have CallUnrollInfo
 #if defined(__linux) && defined(__i386) && defined(__GNUC__)
-static const CallUnrollInfo callunrollinfo[] = {
-  // Entry to a function:  push %ebp;  mov  %esp,%ebp
-  // Top-of-stack contains the caller IP.
-  { 0,
-{0x55, 0x89, 0xe5}, 3,
-0
-  },
-  // Entry to a function, second instruction:  push %ebp;  mov  %esp,%ebp
-  // Top-of-stack contains the old frame, caller IP is +4.
-  { -1,
-{0x55, 0x89, 0xe5}, 3,
-4
-  },
-  // Return from a function: RET.
-  // Top-of-stack contains the caller IP.
-  { 0,
-{0xc3}, 1,
-0
-  }
-};
-
 intptr_t GetPC(ucontext_t *signal_ucontext) {
-  // See comment above struct CallUnrollInfo.  Only try instruction
-  // flow matching if both eip and esp looks reasonable.
-  const int eip = signal_ucontext->uc_mcontext.gregs[REG_EIP];
-  const int esp = signal_ucontext->uc_mcontext.gregs[REG_ESP];
-  if ((eip & 0x) != 0 && (~eip & 0x) != 0 &&
-  (esp & 0x) != 0) {
-char* eip_char = reinterpret_cast(eip);
-for (int i = 0; i < sizeof(callunrollinfo)/sizeof(*callunrollinfo); ++i) {
-  if (!memcmp(eip_char + callunrollinfo[i].pc_offset,
-  callunrollinfo[i].ins, callunrollinfo[i].ins_size)) {
-// We have a match.
-intptr_t *retaddr = (intptr_t*)(esp + 
callunrollinfo[i].return_sp_offset);
-return *retaddr;
-  }
-}
-  }
-  return eip;
+  return signal_ucontext->uc_mcontext.gregs[REG_EIP];
 }
 
 // Special case #2: Windows, which has to do something totally different.
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix a test

2016-02-08 Thread fijal
Author: fijal
Branch: 
Changeset: r82117:b88cc59e72a4
Date: 2016-02-08 20:54 +0100
http://bitbucket.org/pypy/pypy/changeset/b88cc59e72a4/

Log:fix a test

diff --git a/rpython/tool/jitlogparser/test/logtest2.log 
b/rpython/tool/jitlogparser/test/logtest2.log
--- a/rpython/tool/jitlogparser/test/logtest2.log
+++ b/rpython/tool/jitlogparser/test/logtest2.log
@@ -139,7 +139,7 @@
 debug_merge_point(0, 0, ' #12 LOAD_CONST')
 +289: guard_value(p4, ConstPtr(ptr22), descr=) [p1, p0, 
p4, p2, p3, p6, p11, p13, p17]
 debug_merge_point(0, 0, ' #15 COMPARE_OP')
-+308: i23 = getfield_gc_pure_i(p11, descr=)
++308: i23 = getfield_gc_i(p11, descr=)
 +312: i25 = int_lt(i23, 10)
 guard_true(i25, descr=) [p1, p0, p11, p2, p3, p6, p13]
 debug_merge_point(0, 0, ' #18 
POP_JUMP_IF_FALSE')
@@ -285,9 +285,9 @@
 +283: p23 = getfield_gc_r(p21, descr=)
 +287: guard_class(p23, 26517736, descr=) [p1, p0, p15, 
i22, p23, p21, p2, p3, p4, i5, p6, p11, p13, p17]
 +299: p25 = getfield_gc_r(p21, descr=)
-+303: i26 = getfield_gc_pure_i(p25, descr=)
-+307: i27 = getfield_gc_pure_i(p25, descr=)
-+311: i28 = getfield_gc_pure_i(p25, descr=)
++303: i26 = getfield_gc_i(p25, descr=)
++307: i27 = getfield_gc_i(p25, descr=)
++311: i28 = getfield_gc_i(p25, descr=)
 +315: i30 = int_lt(i22, 0)
 guard_false(i30, descr=) [p1, p0, p15, i22, i28, i27, 
i26, p2, p3, p4, i5, p6, p11, p13, p17]
 +325: i31 = int_ge(i22, i28)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit