From cfbolz at codespeak.net Mon Feb 1 11:49:01 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Mon, 1 Feb 2010 11:49:01 +0100 (CET) Subject: [pypy-svn] r71025 - pypy/trunk/pypy/interpreter Message-ID: <20100201104901.13BD71680A3@codespeak.net> Author: cfbolz Date: Mon Feb 1 11:49:01 2010 New Revision: 71025 Modified: pypy/trunk/pypy/interpreter/gateway.py Log: ouch-ish: the functions in the Python interpreter written at app-level didn't use a module dict for their globals, which makes the code in them a lot slower when jitted. Modified: pypy/trunk/pypy/interpreter/gateway.py ============================================================================== --- pypy/trunk/pypy/interpreter/gateway.py (original) +++ pypy/trunk/pypy/interpreter/gateway.py Mon Feb 1 11:49:01 2010 @@ -917,7 +917,7 @@ def build_applevel_dict(self, space): "NOT_RPYTHON" from pypy.interpreter.pycode import PyCode - w_glob = space.newdict() + w_glob = space.newdict(module=True) space.setitem(w_glob, space.wrap('__name__'), space.wrap(self.modname)) space.exec_(self.code, w_glob, w_glob, hidden_applevel=self.hidden_applevel) From cfbolz at codespeak.net Mon Feb 1 11:53:39 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Mon, 1 Feb 2010 11:53:39 +0100 (CET) Subject: [pypy-svn] r71027 - pypy/trunk/pypy/rlib Message-ID: <20100201105339.3166A1680A3@codespeak.net> Author: cfbolz Date: Mon Feb 1 11:53:38 2010 New Revision: 71027 Modified: pypy/trunk/pypy/rlib/runicode.py Log: an XXX: some of the unicode codecs should really use string builders Modified: pypy/trunk/pypy/rlib/runicode.py ============================================================================== --- pypy/trunk/pypy/rlib/runicode.py (original) +++ pypy/trunk/pypy/rlib/runicode.py Mon Feb 1 11:53:38 2010 @@ -40,6 +40,8 @@ UNICHR = unichr ORD = ord +# XXX review the functions below and think about using stringbuilders for them + def raise_unicode_exception_decode(errors, encoding, msg, s, startingpos, endingpos): From arigo at codespeak.net Mon Feb 1 13:21:43 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 1 Feb 2010 13:21:43 +0100 (CET) Subject: [pypy-svn] r71028 - pypy/branch/rsre Message-ID: <20100201122143.35AA516807A@codespeak.net> Author: arigo Date: Mon Feb 1 13:21:41 2010 New Revision: 71028 Added: pypy/branch/rsre/ - copied from r71027, pypy/trunk/ Log: A branch to attempt to speed up rsre. From arigo at codespeak.net Mon Feb 1 13:47:35 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 1 Feb 2010 13:47:35 +0100 (CET) Subject: [pypy-svn] r71029 - pypy/branch/rsre/pypy/rlib/rsre/test Message-ID: <20100201124735.8BB59168074@codespeak.net> Author: arigo Date: Mon Feb 1 13:47:34 2010 New Revision: 71029 Added: pypy/branch/rsre/pypy/rlib/rsre/test/test_search.py (contents, props changed) Log: A real test for searching. Added: pypy/branch/rsre/pypy/rlib/rsre/test/test_search.py ============================================================================== --- (empty file) +++ pypy/branch/rsre/pypy/rlib/rsre/test/test_search.py Mon Feb 1 13:47:34 2010 @@ -0,0 +1,28 @@ +from pypy.rlib.rsre import rsre + + +# \s*(.*?) +r_code1 = [17, 18, 1, 21, 131091, 6, 6, 60, 105, 116, 101, 109, 62, 0, +0, 0, 0, 0, 0, 19, 60, 19, 105, 19, 116, 19, 101, 19, 109, 19, 62, 29, +9, 0, 65535, 15, 4, 9, 2, 0, 1, 19, 60, 19, 116, 19, 105, 19, 116, 19, +108, 19, 101, 19, 62, 21, 0, 31, 5, 0, 65535, 2, 1, 21, 1, 19, 60, 19, +47, 19, 116, 19, 105, 19, 116, 19, 108, 19, 101, 19, 62, 1] + + +class TestSearch: + + def test_simple(self): + state = rsre.SimpleStringState("foo abcdef") + res = state.search(r_code1) + assert res is True + groups = state.create_regs(1) + assert groups[0] == (3, 29) + assert groups[1] == (18, 21) + + +if __name__ == '__main__': + import re, _sre + def my_compile(pattern, flags, code, *args): + print code + _sre.compile = my_compile + re.compile(r'\s*(.*?)') From cfbolz at codespeak.net Mon Feb 1 13:54:25 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Mon, 1 Feb 2010 13:54:25 +0100 (CET) Subject: [pypy-svn] r71030 - pypy/branch/oprofile-support/pypy/jit/metainterp Message-ID: <20100201125425.1AC8C16804F@codespeak.net> Author: cfbolz Date: Mon Feb 1 13:54:24 2010 New Revision: 71030 Modified: pypy/branch/oprofile-support/pypy/jit/metainterp/warmspot.py Log: this belongs to r70957 Modified: pypy/branch/oprofile-support/pypy/jit/metainterp/warmspot.py ============================================================================== --- pypy/branch/oprofile-support/pypy/jit/metainterp/warmspot.py (original) +++ pypy/branch/oprofile-support/pypy/jit/metainterp/warmspot.py Mon Feb 1 13:54:24 2010 @@ -77,6 +77,7 @@ res = interp.eval_graph(graph, args) if not kwds.get('translate_support_code', False): warmrunnerdesc.metainterp_sd.profiler.finish() + warmrunnerdesc.metainterp_sd.cpu.finish_once() print '~~~ return value:', res while repeat > 1: print '~' * 79 From cfbolz at codespeak.net Mon Feb 1 13:55:31 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Mon, 1 Feb 2010 13:55:31 +0100 (CET) Subject: [pypy-svn] r71031 - pypy/branch/oprofile-support/pypy/jit/backend/x86 Message-ID: <20100201125531.C577A16804F@codespeak.net> Author: cfbolz Date: Mon Feb 1 13:55:31 2010 New Revision: 71031 Added: pypy/branch/oprofile-support/pypy/jit/backend/x86/oprofile.py (contents, props changed) Log: rffi code to interact with oprofile Added: pypy/branch/oprofile-support/pypy/jit/backend/x86/oprofile.py ============================================================================== --- (empty file) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/oprofile.py Mon Feb 1 13:55:31 2010 @@ -0,0 +1,66 @@ +from pypy.rpython.tool import rffi_platform +from pypy.rpython.lltypesystem import lltype, llmemory, rffi +from pypy.translator.tool.cbuild import ExternalCompilationInfo +from pypy.rlib.objectmodel import we_are_translated +from pypy.rlib.rposix import get_errno + +class OProfileError(Exception): + def __init__(self, errno, where): + self.errno = errno + self.where = where + + +eci = ExternalCompilationInfo(includes=['stdint.h', 'opagent.h'], + library_dirs=['/usr/local/lib/oprofile/'], + libraries=['bfd', 'opagent']) +try: + rffi_platform.verify_eci(eci) +except rffi_platform.CompilationError: + OPROFILE_AVAILABLE = False +else: + OPROFILE_AVAILABLE = True + AGENT = rffi.VOIDP + uint64_t = rffi.ULONGLONG + op_open_agent = rffi.llexternal( + "op_open_agent", + [], + AGENT, + compilation_info=eci) + op_close_agent = rffi.llexternal( + "op_close_agent", + [AGENT], + rffi.INT, + compilation_info=eci) + # arguments are: + # agent, symbol_name, address in memory, address in memory again, size + op_write_native_code = rffi.llexternal( + "op_write_native_code", + [AGENT, rffi.CCHARP, uint64_t, rffi.VOIDP, rffi.UINT], + rffi.INT, + compilation_info=eci) + +def startup(cpu): + if not OPROFILE_AVAILABLE: + return + agent = op_open_agent() + if not agent: + cpu._oprofile_agent = rffi.cast(rffi.VOIDP, 0) + raise OProfileError(get_errno(), "startup") + cpu._oprofile_agent = agent + +def shutdown(cpu): + if not OPROFILE_AVAILABLE: + return + if cpu._oprofile_agent: + success = op_close_agent(cpu._oprofile_agent) + if success != 0: + raise OProfileError(get_errno(), "shutdown") + +def native_code_written(cpu, name, address, size): + assert size > 0 + if not OPROFILE_AVAILABLE: + return + uaddress = rffi.cast(rffi.ULONG, address) + success = op_write_native_code(cpu._oprofile_agent, name, uaddress, rffi.cast(rffi.VOIDP, 0), size) + if success != 0: + raise OProfileError(get_errno(), "write") From arigo at codespeak.net Mon Feb 1 14:09:26 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 1 Feb 2010 14:09:26 +0100 (CET) Subject: [pypy-svn] r71032 - in pypy/branch/rsre/pypy/rlib/rsre: . test Message-ID: <20100201130926.5CAB0168075@codespeak.net> Author: arigo Date: Mon Feb 1 14:09:25 2010 New Revision: 71032 Added: pypy/branch/rsre/pypy/rlib/rsre/test/make_x.py (contents, props changed) pypy/branch/rsre/pypy/rlib/rsre/test/targetrsre.py (contents, props changed) Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py Log: A translation target and some translation fixes. This is all to be run manually for now, but it has a performance 5x worse on rlib/rsre than on CPython, so it's a good starting point for investigation. Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py Mon Feb 1 14:09:25 2010 @@ -47,6 +47,7 @@ def getlower(char_ord, flags): if flags & SRE_FLAG_UNICODE: + assert unicodedb is not None char_ord = unicodedb.tolower(char_ord) elif flags & SRE_FLAG_LOCALE: return tolower(char_ord) @@ -89,18 +90,21 @@ return code < 128 and (ascii_char_info[code] & 1 != 0) def is_uni_digit(code): + assert unicodedb is not None return unicodedb.isdigit(code) def is_space(code): return code < 128 and (ascii_char_info[code] & 2 != 0) def is_uni_space(code): + assert unicodedb is not None return unicodedb.isspace(code) def is_word(code): return code < 128 and (ascii_char_info[code] & 16 != 0) def is_uni_word(code): + assert unicodedb is not None return unicodedb.isalnum(code) or code == underline def is_loc_alnum(code): @@ -113,6 +117,7 @@ return code == linebreak def is_uni_linebreak(code): + assert unicodedb is not None return unicodedb.islinebreak(code) Added: pypy/branch/rsre/pypy/rlib/rsre/test/make_x.py ============================================================================== --- (empty file) +++ pypy/branch/rsre/pypy/rlib/rsre/test/make_x.py Mon Feb 1 14:09:25 2010 @@ -0,0 +1,15 @@ + + +g = open('x', 'w') + +for i in range(100000): + if i == 74747: + tag = 'title' + else: + tag = 'titl' + print >> g + print >> g, '' + print >> g, ' <%s>FooBar%d' % (tag, i, tag) + print >> g, '' + +g.close() Added: pypy/branch/rsre/pypy/rlib/rsre/test/targetrsre.py ============================================================================== --- (empty file) +++ pypy/branch/rsre/pypy/rlib/rsre/test/targetrsre.py Mon Feb 1 14:09:25 2010 @@ -0,0 +1,66 @@ +from pypy.rlib.rarithmetic import intmask +from pypy.rlib.rsre import rsre +import os, time + + +# \s*(.*?) +r_code1 = [17, 18, 1, 21, 131091, 6, 6, 60, 105, 116, 101, 109, 62, 0, +0, 0, 0, 0, 0, 19, 60, 19, 105, 19, 116, 19, 101, 19, 109, 19, 62, 29, +9, 0, 65535, 15, 4, 9, 2, 0, 1, 19, 60, 19, 116, 19, 105, 19, 116, 19, +108, 19, 101, 19, 62, 21, 0, 31, 5, 0, 65535, 2, 1, 21, 1, 19, 60, 19, +47, 19, 116, 19, 105, 19, 116, 19, 108, 19, 101, 19, 62, 1] + + +def read(filename): + fd = os.open(filename, os.O_RDONLY, 0666) + if fd < 0: + raise OSError + end = os.lseek(fd, 0, 2) + os.lseek(fd, 0, 0) + data = os.read(fd, intmask(end)) + os.close(fd) + return data + +def search_in_file(filename): + data = read(filename) + p = 0 + while True: + state = rsre.SimpleStringState(data, p) + res = state.search(r_code1) + if not res: + break + groups = state.create_regs(1) + matchstart, matchstop = groups[1] + assert 0 <= matchstart <= matchstop + print '%s: %s' % (filename, data[matchstart:matchstop]) + p = groups[0][1] + +# __________ Entry point __________ + +def entry_point(argv): + start = time.time() + for fn in argv[1:]: + search_in_file(fn) + stop = time.time() + print stop - start + return 0 + +# _____ Define and setup target ___ + +def target(*args): + return entry_point, None + +# _____ Pure Python equivalent _____ + +if __name__ == '__main__': + import re, sys + r = re.compile(r"\s*(.*?)") + start = time.time() + for fn in sys.argv[1:]: + f = open(fn, 'rb') + data = f.read() + f.close() + for title in r.findall(data): + print '%s: %s' % (fn, title) + stop = time.time() + print '%.4fs' % (stop - start,) From arigo at codespeak.net Mon Feb 1 14:33:38 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 1 Feb 2010 14:33:38 +0100 (CET) Subject: [pypy-svn] r71034 - pypy/branch/rsre/pypy/rlib/rsre Message-ID: <20100201133338.63A31168100@codespeak.net> Author: arigo Date: Mon Feb 1 14:33:37 2010 New Revision: 71034 Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Log: Avoid the slicing in fast_search. Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Mon Feb 1 14:33:37 2010 @@ -190,7 +190,8 @@ assert pattern_offset >= 0 i = 0 string_position = state.string_position - while string_position < state.end: + end = state.end + while string_position < end: while True: char_ord = state.get_char_ord(string_position) if char_ord != prefix[i]: @@ -208,20 +209,20 @@ if flags & SRE_INFO_LITERAL: return True # matched all of pure literal pattern start = pattern_offset + 2 * prefix_skip - if match(state, pattern_codes[start:]): + if match(state, pattern_codes, start): return True i = pattern_codes[overlap_offset + i] break string_position += 1 return False -def match(state, pattern_codes): +def match(state, pattern_codes, pstart=0): # Optimization: Check string length. pattern_codes[3] contains the # minimum length for a string to possibly match. - if pattern_codes[0] == OPCODE_INFO and pattern_codes[3] > 0: - if state.end - state.string_position < pattern_codes[3]: + if pattern_codes[pstart] == OPCODE_INFO and pattern_codes[pstart+3] > 0: + if state.end - state.string_position < pattern_codes[pstart+3]: return False - state.context_stack.append(MatchContext(state, pattern_codes)) + state.context_stack.append(MatchContext(state, pattern_codes, pstart)) has_matched = MatchContext.UNDECIDED while len(state.context_stack) > 0: context = state.context_stack[-1] From arigo at codespeak.net Mon Feb 1 14:43:40 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 1 Feb 2010 14:43:40 +0100 (CET) Subject: [pypy-svn] r71035 - pypy/branch/rsre/pypy/rlib/rsre Message-ID: <20100201134340.D5D821680F8@codespeak.net> Author: arigo Date: Mon Feb 1 14:43:40 2010 New Revision: 71035 Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Log: Copy for CPython. Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Mon Feb 1 14:43:40 2010 @@ -220,8 +220,10 @@ # Optimization: Check string length. pattern_codes[3] contains the # minimum length for a string to possibly match. if pattern_codes[pstart] == OPCODE_INFO and pattern_codes[pstart+3] > 0: + # <1=skip> <2=flags> <3=min> if state.end - state.string_position < pattern_codes[pstart+3]: return False + pstart += pattern_codes[pstart+1] + 1 state.context_stack.append(MatchContext(state, pattern_codes, pstart)) has_matched = MatchContext.UNDECIDED while len(state.context_stack) > 0: From arigo at codespeak.net Mon Feb 1 16:20:17 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 1 Feb 2010 16:20:17 +0100 (CET) Subject: [pypy-svn] r71037 - pypy/branch/rsre/pypy/rlib/rsre Message-ID: <20100201152017.1A31D16807A@codespeak.net> Author: arigo Date: Mon Feb 1 16:20:17 2010 New Revision: 71037 Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Log: Use unrolling_iterables. Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Mon Feb 1 16:20:17 2010 @@ -12,6 +12,7 @@ from pypy.rlib.rsre import rsre_char from pypy.rlib.rsre.rsre_char import SRE_INFO_PREFIX, SRE_INFO_LITERAL from pypy.rlib.rsre.rsre_char import OPCODE_INFO, MAXREPEAT +from pypy.rlib.unroll import unrolling_iterable #### Core classes @@ -245,9 +246,11 @@ opcode = context.resume_at_opcode else: opcode = context.peek_code() - try: - has_finished = opcode_dispatch_table[opcode](context) - except IndexError: + for i, function in opcode_dispatch_unroll: + if i == opcode and function is not None: + has_finished = function(context) + break + else: raise RuntimeError("Internal re error. Unknown opcode: %s" % opcode) if not has_finished: context.resume_at_opcode = opcode @@ -836,19 +839,15 @@ None, #SUBPATTERN, op_min_repeat_one, ] +opcode_dispatch_unroll = unrolling_iterable(enumerate(opcode_dispatch_table)) ##### At dispatch def at_dispatch(atcode, context): - try: - function, negate = at_dispatch_table[atcode] - except IndexError: - return False - result = function(context) - if negate: - return not result - else: - return result + for i, function in at_dispatch_unroll: + if i == atcode: + return function(context) + return False def at_beginning(ctx): return ctx.at_beginning() @@ -868,17 +867,27 @@ def at_boundary(ctx): return ctx.at_boundary(rsre_char.is_word) +def at_non_boundary(ctx): + return not at_boundary(ctx) + def at_loc_boundary(ctx): return ctx.at_boundary(rsre_char.is_loc_word) +def at_loc_non_boundary(ctx): + return not at_loc_boundary(ctx) + def at_uni_boundary(ctx): return ctx.at_boundary(rsre_char.is_uni_word) -# Maps opcodes by indices to (function, negate) tuples. +def at_uni_non_boundary(ctx): + return not at_uni_boundary(ctx) + +# Maps opcodes by indices to functions at_dispatch_table = [ - (at_beginning, False), (at_beginning_line, False), (at_beginning, False), - (at_boundary, False), (at_boundary, True), - (at_end, False), (at_end_line, False), (at_end_string, False), - (at_loc_boundary, False), (at_loc_boundary, True), (at_uni_boundary, False), - (at_uni_boundary, True) + at_beginning, at_beginning_line, at_beginning, + at_boundary, at_non_boundary, + at_end, at_end_line, at_end_string, + at_loc_boundary, at_loc_non_boundary, + at_uni_boundary, at_uni_non_boundary, ] +at_dispatch_unroll = unrolling_iterable(enumerate(at_dispatch_table)) From cfbolz at codespeak.net Mon Feb 1 18:10:10 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Mon, 1 Feb 2010 18:10:10 +0100 (CET) Subject: [pypy-svn] r71038 - in pypy/trunk/pypy/module/_codecs: . test Message-ID: <20100201171010.CF2E3168074@codespeak.net> Author: cfbolz Date: Mon Feb 1 18:10:08 2010 New Revision: 71038 Modified: pypy/trunk/pypy/module/_codecs/__init__.py pypy/trunk/pypy/module/_codecs/app_codecs.py pypy/trunk/pypy/module/_codecs/interp_codecs.py pypy/trunk/pypy/module/_codecs/test/test_codecs.py Log: move charmap_decode from app- to interplevel (I chose this one, because html5lib uses it a lot). More of those codecs should be rewritten that way. Modified: pypy/trunk/pypy/module/_codecs/__init__.py ============================================================================== --- pypy/trunk/pypy/module/_codecs/__init__.py (original) +++ pypy/trunk/pypy/module/_codecs/__init__.py Mon Feb 1 18:10:08 2010 @@ -5,7 +5,6 @@ appleveldefs = { '__doc__' : 'app_codecs.__doc__', '__name__' : 'app_codecs.__name__', - 'charmap_decode' : 'app_codecs.charmap_decode', 'charmap_encode' : 'app_codecs.charmap_encode', 'escape_decode' : 'app_codecs.escape_decode', 'escape_encode' : 'app_codecs.escape_encode', @@ -44,6 +43,7 @@ 'utf_16_ex_decode' : 'interp_codecs.utf_16_ex_decode', 'charbuffer_encode': 'interp_codecs.buffer_encode', 'readbuffer_encode': 'interp_codecs.buffer_encode', + 'charmap_decode' : 'interp_codecs.charmap_decode', } def __init__(self, space, *args): Modified: pypy/trunk/pypy/module/_codecs/app_codecs.py ============================================================================== --- pypy/trunk/pypy/module/_codecs/app_codecs.py (original) +++ pypy/trunk/pypy/module/_codecs/app_codecs.py Mon Feb 1 18:10:08 2010 @@ -39,7 +39,9 @@ Copyright (c) Corporation for National Research Initiatives. """ -#from unicodecodec import * + +# XXX move some of these functions to RPython (like charmap_encode, +# charmap_build) to make them faster import sys @@ -201,13 +203,6 @@ res = ''.join(res) return res, len(data) -def charmap_decode( data, errors='strict', mapping=None): - """None - """ - res = PyUnicode_DecodeCharmap(data, mapping, errors) - res = u''.join(res) - return res, len(data) - def utf_7_encode( obj, errors='strict'): """None @@ -841,44 +836,6 @@ inpos += 1 return res -def PyUnicode_DecodeCharmap(s, mapping, errors): - - size = len(s) -## /* Default to Latin-1 */ - if mapping is None: - import _codecs - return _codecs.latin_1_decode(s, errors)[0] - - if (size == 0): - return u'' - p = [] - inpos = 0 - while (inpos< len(s)): - - #/* Get mapping (char ordinal -> integer, Unicode char or None) */ - ch = s[inpos] - try: - x = mapping[ord(ch)] - if isinstance(x, int): - if x < 65536: - p += unichr(x) - else: - raise TypeError("character mapping must be in range(65536)") - elif isinstance(x, unicode): - if x == u"\ufffe": - raise KeyError - p += x - elif not x: - raise KeyError - else: - raise TypeError - inpos += 1 - except (KeyError, IndexError): - next, inpos = unicode_call_errorhandler(errors, "charmap", - "character maps to ", s, inpos, inpos+1) - p += next - inpos - return p def PyUnicode_DecodeRawUnicodeEscape(s, size, errors): Modified: pypy/trunk/pypy/module/_codecs/interp_codecs.py ============================================================================== --- pypy/trunk/pypy/module/_codecs/interp_codecs.py (original) +++ pypy/trunk/pypy/module/_codecs/interp_codecs.py Mon Feb 1 18:10:08 2010 @@ -1,6 +1,7 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.gateway import ObjSpace, NoneNotWrapped from pypy.interpreter.baseobjspace import W_Root +from pypy.rlib.rstring import StringBuilder, UnicodeBuilder class CodecState(object): def __init__(self, space): @@ -272,3 +273,77 @@ space.wrap(byteorder)]) utf_16_ex_decode.unwrap_spec = [ObjSpace, str, str, int, W_Root] +def _extract_from_mapping(space, mapping_w, w_mapping, ch): + if mapping_w is not None: + try: + return mapping_w[ord(ch)] + except IndexError: + pass + else: + try: + return space.getitem(w_mapping, space.newint(ord(ch))) + except OperationError, e: + if (not e.match(space, space.w_KeyError) and + not e.match(space, space.w_IndexError)): + raise + pass + +def _append_unicode(space, builder, w_x): + try: + x = space.unicode_w(w_x) + except OperationError, e: + if not e.match(space, space.w_TypeError): + raise + else: + if x != u"\ufffe": + builder.append(x) + return True + return False + try: + x = space.int_w(w_x) + except OperationError: + if not e.match(space, space.w_TypeError): + raise + else: + if x < 65536: + builder.append(unichr(x)) + else: + raise OperationError(space.w_TypeError, space.wrap("character mapping must be in range(65536)")) + return True + if not space.is_true(w_x): + return False + else: + raise OperationError(space.w_TypeError, space.w_None) + + +def charmap_decode(space, s, errors="strict", w_mapping=None): + size = len(s) +## /* Default to Latin-1 */ + if space.is_true(space.is_(w_mapping, space.w_None)): + return latin_1_decode(space, s, errors, space.w_False) + + if (size == 0): + return space.wrap(u'') + + # fast path for all the stuff in the encodings module + if space.is_true(space.isinstance(w_mapping, space.w_tuple)): + mapping_w = space.fixedview(w_mapping) + else: + mapping_w = None + + builder = UnicodeBuilder(size) + inpos = 0 + while (inpos < len(s)): + #/* Get mapping_w (char ordinal -> integer, Unicode char or None) */ + ch = s[inpos] + w_x = _extract_from_mapping(space, mapping_w, w_mapping, ch) + if w_x is not None and _append_unicode(space, builder, w_x): + inpos += 1 + continue + state = space.fromcache(CodecState) + next, inpos = state.decode_error_handler(errors, "charmap", + "character maps to ", s, inpos, inpos+1) + builder.append(next) + res = builder.build() + return space.newtuple([space.wrap(res), space.wrap(size)]) +charmap_decode.unwrap_spec = [ObjSpace, str, str, W_Root] Modified: pypy/trunk/pypy/module/_codecs/test/test_codecs.py ============================================================================== --- pypy/trunk/pypy/module/_codecs/test/test_codecs.py (original) +++ pypy/trunk/pypy/module/_codecs/test/test_codecs.py Mon Feb 1 18:10:08 2010 @@ -1,7 +1,7 @@ import autopath from pypy.conftest import gettestobjspace from pypy.module._codecs.app_codecs import unicode_escape_encode,\ - charmap_encode, charmap_decode, unicode_escape_decode + charmap_encode, unicode_escape_decode class AppTestCodecs: @@ -116,6 +116,14 @@ raises (ValueError, test.decode,'string-escape') + def test_charmap_decode(self): + from _codecs import charmap_decode + assert charmap_decode('xxx') == ('xxx', 3) + assert charmap_decode('xxx', 'strict', {ord('x'): u'XX'}) == ('XXXXXX', 3) + map = tuple([unichr(i) for i in range(256)]) + assert charmap_decode('xxx\xff', 'strict', map) == (u'xxx\xff', 4) + + class AppTestPartialEvaluation: def test_partial_utf8(self): @@ -551,10 +559,6 @@ assert charmap_encode(u'xxx') == ('xxx', 3) assert charmap_encode(u'xxx', 'strict', {ord('x'): 'XX'}) == ('XXXXXX', 6) - def test_charmap_decode(self): - assert charmap_decode('xxx') == ('xxx', 3) - assert charmap_decode('xxx', 'strict', {ord('x'): u'XX'}) == ('XXXXXX', 3) - def test_unicode_escape(self): assert unicode_escape_encode(u'abc') == (u'abc'.encode('unicode_escape'), 3) assert unicode_escape_decode('abc') == (u'abc'.decode('unicode_escape'), 3) From cfbolz at codespeak.net Mon Feb 1 18:13:16 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Mon, 1 Feb 2010 18:13:16 +0100 (CET) Subject: [pypy-svn] r71039 - pypy/trunk/pypy/module/__builtin__ Message-ID: <20100201171316.B88BF168074@codespeak.net> Author: cfbolz Date: Mon Feb 1 18:13:14 2010 New Revision: 71039 Modified: pypy/trunk/pypy/module/__builtin__/abstractinst.py Log: Make the JIT see isinstance(X, (a, b, c)) (it already does for issubclass). Modified: pypy/trunk/pypy/module/__builtin__/abstractinst.py ============================================================================== --- pypy/trunk/pypy/module/__builtin__/abstractinst.py (original) +++ pypy/trunk/pypy/module/__builtin__/abstractinst.py Mon Feb 1 18:13:14 2010 @@ -44,7 +44,7 @@ raise # propagate other errors return space.type(w_obj) - + at jit.unroll_safe def abstract_isinstance_w(space, w_obj, w_klass_or_tuple): """Implementation for the full 'isinstance(obj, klass_or_tuple)'.""" @@ -78,16 +78,17 @@ oldstyleinst = space.interpclass_w(w_obj) if isinstance(oldstyleinst, W_InstanceObject): return oldstyleinst.w_class.is_subclass_of(oldstyleclass) - return _abstract_isinstance_w_helper(space, w_obj, w_klass_or_tuple) - - at jit.dont_look_inside -def _abstract_isinstance_w_helper(space, w_obj, w_klass_or_tuple): # -- case (anything, tuple) + # XXX it might be risky that the JIT sees this if space.is_true(space.isinstance(w_klass_or_tuple, space.w_tuple)): for w_klass in space.fixedview(w_klass_or_tuple): if abstract_isinstance_w(space, w_obj, w_klass): return True return False + return _abstract_isinstance_w_helper(space, w_obj, w_klass_or_tuple) + + at jit.dont_look_inside +def _abstract_isinstance_w_helper(space, w_obj, w_klass_or_tuple): # -- case (anything, abstract-class) check_class(space, w_klass_or_tuple, From arigo at codespeak.net Mon Feb 1 19:18:47 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 1 Feb 2010 19:18:47 +0100 (CET) Subject: [pypy-svn] r71041 - in pypy/trunk/pypy/jit/metainterp: . test Message-ID: <20100201181847.32382168047@codespeak.net> Author: arigo Date: Mon Feb 1 19:18:45 2010 New Revision: 71041 Modified: pypy/trunk/pypy/jit/metainterp/codewriter.py pypy/trunk/pypy/jit/metainterp/pyjitpl.py pypy/trunk/pypy/jit/metainterp/test/test_warmstate.py pypy/trunk/pypy/jit/metainterp/warmstate.py Log: Probably fixes something... Hard to write tests :-( The issue is what if reds show up at places that really expect greens, like jit_merge_point or recursive_calls. I think that it's likely that one of these bytecodes might use the .value in the box without noticing that it's really a red box, leading to broken generated code. The fix is to add independent bytecodes before, each one forcing (if needed) one red box to a green box. Modified: pypy/trunk/pypy/jit/metainterp/codewriter.py ============================================================================== --- pypy/trunk/pypy/jit/metainterp/codewriter.py (original) +++ pypy/trunk/pypy/jit/metainterp/codewriter.py Mon Feb 1 19:18:45 2010 @@ -74,6 +74,7 @@ self.cpu = None self.portal_runner_ptr = None self.raise_analyzer = None + self.jitdriver = None def find_all_graphs(self, portal_graph, leave_graph, policy, supports_floats): @@ -1187,16 +1188,30 @@ self.var_position(op.args[3])) def serialize_op_jit_marker(self, op): + jitdriver = op.args[1].value + if self.codewriter.jitdriver is None: + self.codewriter.jitdriver = jitdriver + assert jitdriver is self.codewriter.jitdriver key = op.args[0].value getattr(self, 'handle_jit_marker__%s' % key)(op) + def promote_greens(self, args): + self.minimize_variables() + num_green_args = len(self.codewriter.jitdriver.greens) + for i in range(num_green_args): + pos = self.var_position(args[i]) + if (pos % 2) == 0: + self.emit('guard_green', pos//2) + def handle_jit_marker__jit_merge_point(self, op): assert self.portal, "jit_merge_point in non-main graph!" + self.promote_greens(op.args[2:]) self.emit('jit_merge_point') assert ([self.var_position(i) for i in op.args[2:]] == range(0, 2*(len(op.args) - 2), 2)) def handle_jit_marker__can_enter_jit(self, op): + self.promote_greens(op.args[2:]) self.emit('can_enter_jit') def serialize_op_direct_call(self, op): @@ -1266,6 +1281,7 @@ self.register_var(op.result) def handle_recursive_call(self, op): + self.promote_greens(op.args[1:]) self.minimize_variables() args = op.args[1:] calldescr, non_void_args = self.codewriter.getcalldescr(op.args[0], Modified: pypy/trunk/pypy/jit/metainterp/pyjitpl.py ============================================================================== --- pypy/trunk/pypy/jit/metainterp/pyjitpl.py (original) +++ pypy/trunk/pypy/jit/metainterp/pyjitpl.py Mon Feb 1 19:18:45 2010 @@ -674,10 +674,10 @@ call_position = 0 if token is not None: call_position = len(self.metainterp.history.operations) - # guard value for all green args, needed to make sure + # verify that we have all green args, needed to make sure # that assembler that we call is still correct greenargs = varargs[1:num_green_args + 1] - self.generate_guard_value_for_green_args(pc, greenargs) + self.verify_green_args(greenargs) res = self.do_residual_call(varargs, descr=calldescr, exc=True) if not self.metainterp.is_blackholing() and token is not None: # XXX fix the call position, @@ -782,6 +782,17 @@ constbox = self.implement_guard_value(pc, box) self.make_result_box(constbox) + @arguments("orgpc", "int") + def opimpl_guard_green(self, pc, boxindex): + """Like guard_value, but overwrites the original box with the const. + Used to prevent Boxes from showing up in the greenkey of some + operations, like jit_merge_point. The in-place overwriting is + convenient for jit_merge_point, which expects self.env to contain + not more than the greens+reds described in the jitdriver.""" + box = self.env[boxindex] + constbox = self.implement_guard_value(pc, box) + self.env[boxindex] = constbox + @arguments("orgpc", "box") def opimpl_guard_class(self, pc, box): clsbox = self.cls_of_box(box) @@ -803,10 +814,10 @@ def opimpl_keepalive(self, box): pass # xxx? - def generate_guard_value_for_green_args(self, pc, varargs): + def verify_green_args(self, varargs): num_green_args = self.metainterp.staticdata.num_green_args for i in range(num_green_args): - varargs[i] = self.implement_guard_value(pc, varargs[i]) + assert isinstance(varargs[i], Const) def blackhole_reached_merge_point(self, varargs): if self.metainterp.in_recursion: @@ -829,8 +840,8 @@ else: raise self.metainterp.staticdata.ContinueRunningNormally(varargs) - @arguments("orgpc") - def opimpl_can_enter_jit(self, pc): + @arguments() + def opimpl_can_enter_jit(self): # Note: when running with a BlackHole history, this 'can_enter_jit' # may be completely skipped by the logic that replaces perform_call # with rop.CALL. But in that case, no-one will check the flag anyway, @@ -840,10 +851,10 @@ raise CannotInlineCanEnterJit() self.metainterp.seen_can_enter_jit = True - @arguments("orgpc") - def opimpl_jit_merge_point(self, pc): + @arguments() + def opimpl_jit_merge_point(self): if not self.metainterp.is_blackholing(): - self.generate_guard_value_for_green_args(pc, self.env) + self.verify_green_args(self.env) # xxx we may disable the following line in some context later self.debug_merge_point() if self.metainterp.seen_can_enter_jit: @@ -1025,6 +1036,9 @@ return guard_op def implement_guard_value(self, pc, box): + """Promote the given Box into a Const. Note: be careful, it's a + bit unclear what occurs if a single opcode needs to generate + several ones and/or ones not near the beginning.""" if isinstance(box, Const): return box # no promotion needed, already a Const else: Modified: pypy/trunk/pypy/jit/metainterp/test/test_warmstate.py ============================================================================== --- pypy/trunk/pypy/jit/metainterp/test/test_warmstate.py (original) +++ pypy/trunk/pypy/jit/metainterp/test/test_warmstate.py Mon Feb 1 19:18:45 2010 @@ -145,7 +145,7 @@ green_args_spec = [lltype.Signed, lltype.Float] state = WarmEnterState(FakeWarmRunnerDesc()) unwrap_greenkey = state.make_unwrap_greenkey() - greenargs = unwrap_greenkey([BoxInt(42), BoxFloat(42.5)]) + greenargs = unwrap_greenkey([ConstInt(42), ConstFloat(42.5)]) assert greenargs == (42, 42.5) assert type(greenargs[0]) is int @@ -155,7 +155,8 @@ get_jitcell_at_ptr = None state = WarmEnterState(FakeWarmRunnerDesc()) get_jitcell = state.make_jitcell_getter() - state.attach_unoptimized_bridge_from_interp([BoxInt(5), BoxFloat(2.25)], + state.attach_unoptimized_bridge_from_interp([ConstInt(5), + ConstFloat(2.25)], "entry loop token") cell1 = get_jitcell(5, 2.25) assert cell1.counter < 0 @@ -174,9 +175,9 @@ return FakeCell() state.jit_getter = jit_getter state.make_jitdriver_callbacks() - res = state.can_inline_callable([BoxInt(5), BoxFloat(42.5)]) + res = state.can_inline_callable([ConstInt(5), ConstFloat(42.5)]) assert res is True - res = state.get_location_str([BoxInt(5), BoxFloat(42.5)]) + res = state.get_location_str([ConstInt(5), ConstFloat(42.5)]) assert res == '(no jitdriver.get_printable_location!)' def test_make_jitdriver_callbacks_2(): @@ -199,7 +200,7 @@ return FakeCell() state.jit_getter = jit_getter state.make_jitdriver_callbacks() - res = state.can_inline_callable([BoxInt(5), BoxFloat(42.5)]) + res = state.can_inline_callable([ConstInt(5), ConstFloat(42.5)]) assert res is False def test_make_jitdriver_callbacks_3(): @@ -218,7 +219,7 @@ get_jitcell_at_ptr = None state = WarmEnterState(FakeWarmRunnerDesc()) state.make_jitdriver_callbacks() - res = state.get_location_str([BoxInt(5), BoxFloat(42.5)]) + res = state.get_location_str([ConstInt(5), ConstFloat(42.5)]) assert res == "hi there" def test_make_jitdriver_callbacks_4(): Modified: pypy/trunk/pypy/jit/metainterp/warmstate.py ============================================================================== --- pypy/trunk/pypy/jit/metainterp/warmstate.py (original) +++ pypy/trunk/pypy/jit/metainterp/warmstate.py Mon Feb 1 19:18:45 2010 @@ -277,7 +277,9 @@ greenargs = () i = 0 for TYPE in green_args_spec: - value = unwrap(TYPE, greenkey[i]) + greenbox = greenkey[i] + assert isinstance(greenbox, history.Const) + value = unwrap(TYPE, greenbox) greenargs += (value,) i = i + 1 return greenargs From arigo at codespeak.net Mon Feb 1 20:22:13 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 1 Feb 2010 20:22:13 +0100 (CET) Subject: [pypy-svn] r71043 - pypy/trunk/pypy/rpython/module/test Message-ID: <20100201192213.A3EFE1683BF@codespeak.net> Author: arigo Date: Mon Feb 1 20:22:13 2010 New Revision: 71043 Modified: pypy/trunk/pypy/rpython/module/test/test_ll_time.py Log: Fix for this test on Mac OS/X. Modified: pypy/trunk/pypy/rpython/module/test/test_ll_time.py ============================================================================== --- pypy/trunk/pypy/rpython/module/test/test_ll_time.py (original) +++ pypy/trunk/pypy/rpython/module/test/test_ll_time.py Mon Feb 1 20:22:13 2010 @@ -19,14 +19,22 @@ def f(): return time.clock() t0 = time.clock() + time.sleep(0.011) t1 = self.interpret(f, []) + time.sleep(0.011) t2 = time.clock() + time.sleep(0.011) t3 = self.interpret(f, []) + time.sleep(0.011) t4 = time.clock() + time.sleep(0.011) t5 = self.interpret(f, []) + time.sleep(0.011) t6 = time.clock() # time.clock() and t1() might have a different notion of zero, so # we can only subtract two numbers returned by the same function. + # Moreover they might have different precisions, but it should + # be at least 0.01 seconds, hence the sleeps. assert 0 <= t2-t0 assert 0 <= t3-t1 <= t4-t0 assert 0 <= t4-t2 <= t5-t1 <= t6-t0 From afa at codespeak.net Mon Feb 1 21:45:14 2010 From: afa at codespeak.net (afa at codespeak.net) Date: Mon, 1 Feb 2010 21:45:14 +0100 (CET) Subject: [pypy-svn] r71044 - pypy/trunk/pypy/translator/c/gcc Message-ID: <20100201204514.D480D1683DA@codespeak.net> Author: afa Date: Mon Feb 1 21:45:13 2010 New Revision: 71044 Modified: pypy/trunk/pypy/translator/c/gcc/trackgcroot.py Log: Typo. Fortunately there is no such format='m'... Modified: pypy/trunk/pypy/translator/c/gcc/trackgcroot.py ============================================================================== --- pypy/trunk/pypy/translator/c/gcc/trackgcroot.py (original) +++ pypy/trunk/pypy/translator/c/gcc/trackgcroot.py Mon Feb 1 21:45:13 2010 @@ -656,7 +656,7 @@ target = match.group(1) - if self.format in ('msvc'): + if self.format in ('msvc',): # On win32, the address of a foreign function must be # computed, the optimizer may store it in a register. We # could ignore this, except when the function need special From arigo at codespeak.net Mon Feb 1 22:06:54 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 1 Feb 2010 22:06:54 +0100 (CET) Subject: [pypy-svn] r71045 - pypy/trunk/pypy/jit/backend/x86 Message-ID: <20100201210654.058FA1683E2@codespeak.net> Author: arigo Date: Mon Feb 1 22:06:54 2010 New Revision: 71045 Modified: pypy/trunk/pypy/jit/backend/x86/viewcode.py Log: Speed up the --text case. Modified: pypy/trunk/pypy/jit/backend/x86/viewcode.py ============================================================================== --- pypy/trunk/pypy/jit/backend/x86/viewcode.py (original) +++ pypy/trunk/pypy/jit/backend/x86/viewcode.py Mon Feb 1 22:06:54 2010 @@ -171,7 +171,7 @@ self.symbols = {} self.logentries = {} - def parse(self, f): + def parse(self, f, textonly=True): for line in f: if line.startswith('CODE_DUMP '): pieces = line.split() @@ -205,6 +205,8 @@ filename = line[len('SYS_EXECUTABLE '):].strip() self.symbols.update(load_symbols(filename)) # find cross-references between blocks + if textonly: + return fnext = 0.1 for i, r in enumerate(self.ranges): for lineno, targetaddr, _ in r.findjumps(): @@ -215,7 +217,7 @@ sys.stderr.write("%d%%" % int(f*100.0)) fnext += 0.1 sys.stderr.write(".") - sys.stderr.write("100%\n") + sys.stderr.write("100%") # split blocks at labeltargets t = self.labeltargets #print t @@ -234,6 +236,7 @@ pass break # hack hack hacked + sys.stderr.write("\n") def show(self, showtext=True, showgraph=True): if showgraph: @@ -359,5 +362,5 @@ else: f = open(sys.argv[1], 'r') world = World() - world.parse(f) + world.parse(f, textonly=not showgraph) world.show(showtext=True, showgraph=showgraph) From cfbolz at codespeak.net Tue Feb 2 10:27:42 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Tue, 2 Feb 2010 10:27:42 +0100 (CET) Subject: [pypy-svn] r71048 - pypy/extradoc/planning Message-ID: <20100202092742.EC5731683F0@codespeak.net> Author: cfbolz Date: Tue Feb 2 10:27:41 2010 New Revision: 71048 Modified: pypy/extradoc/planning/jit.txt Log: looked at the ai benchmarks, it is purely about generators Modified: pypy/extradoc/planning/jit.txt ============================================================================== --- pypy/extradoc/planning/jit.txt (original) +++ pypy/extradoc/planning/jit.txt Tue Feb 2 10:27:41 2010 @@ -62,6 +62,9 @@ - spambayes - uses regular expressions and generators a lot + - ai + - the slowness is the fault of generators and generator expressions + JIT-related Release Tasks From arigo at codespeak.net Tue Feb 2 10:34:47 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Tue, 2 Feb 2010 10:34:47 +0100 (CET) Subject: [pypy-svn] r71049 - in pypy/trunk/pypy/jit/backend/x86: . tool Message-ID: <20100202093447.5655E1683F0@codespeak.net> Author: arigo Date: Tue Feb 2 10:34:46 2010 New Revision: 71049 Added: pypy/trunk/pypy/jit/backend/x86/tool/ (props changed) pypy/trunk/pypy/jit/backend/x86/tool/autopath.py - copied unchanged from r71017, pypy/trunk/pypy/jit/backend/x86/autopath.py pypy/trunk/pypy/jit/backend/x86/tool/jumpto.py (contents, props changed) pypy/trunk/pypy/jit/backend/x86/tool/viewcode.py - copied, changed from r71045, pypy/trunk/pypy/jit/backend/x86/viewcode.py Removed: pypy/trunk/pypy/jit/backend/x86/viewcode.py Modified: pypy/trunk/pypy/jit/backend/x86/assembler.py pypy/trunk/pypy/jit/backend/x86/regalloc.py Log: The most important part of this checkin is the line that contains the bug fix, in malloc_cond_fixedsize(): missing force_mc/mc args. Also with this checkin: - make a new directory for debugging tools - check in a new tool (which turned out to be useless in my case anyway) - add an assertion against using 'self.mc' while we are busy carefully using 'self.mc._mc' to avoid a JMP (this is a test for the fix) Modified: pypy/trunk/pypy/jit/backend/x86/assembler.py ============================================================================== --- pypy/trunk/pypy/jit/backend/x86/assembler.py (original) +++ pypy/trunk/pypy/jit/backend/x86/assembler.py Tue Feb 2 10:34:46 2010 @@ -349,6 +349,21 @@ finally: Box._extended_display = _prev + def _start_block(self): + # Return a 'mc' that can be used to write an "atomic" block, + # i.e. one that will not contain any JMP. + mc = self.mc._mc + if not we_are_translated(): + self._block_started_mc = self.mc + self.mc = "block started" + return mc + + def _stop_block(self): + if not we_are_translated(): + assert self.mc == "block started" + self.mc = self._block_started_mc + del self._block_started_mc + # ------------------------------------------------------------ def mov(self, from_loc, to_loc): @@ -881,12 +896,14 @@ mc.CMP16(mem(locs[0], 0), imm32(expected_typeid)) def genop_guard_guard_class(self, ign_1, guard_op, addr, locs, ign_2): - self._cmp_guard_class(self.mc._mc, locs) + mc = self._start_block() + self._cmp_guard_class(mc, locs) + self._stop_block() return self.implement_guard(addr, self.mc.JNE) def genop_guard_guard_nonnull_class(self, ign_1, guard_op, addr, locs, ign_2): - mc = self.mc._mc + mc = self._start_block() mc.CMP(locs[0], imm8(1)) mc.write(constlistofchars('\x72\x00')) # JB later jb_location = mc.get_relative_pos() @@ -895,6 +912,7 @@ offset = mc.get_relative_pos() - jb_location assert 0 < offset <= 127 mc.overwrite(jb_location-1, [chr(offset)]) + self._stop_block() # return self.implement_guard(addr, self.mc.JNE) @@ -1189,7 +1207,8 @@ self.mc2.done() self.failure_recovery_code[exc + 2 * withfloats] = recovery_addr - def generate_failure(self, mc, fail_index, locs, exc, locs_are_ref): + def generate_failure(self, fail_index, locs, exc, locs_are_ref): + mc = self.mc for i in range(len(locs)): loc = locs[i] if isinstance(loc, REG): @@ -1225,8 +1244,6 @@ addr = self.cpu.get_on_leave_jitted_int(save_exception=exc) mc.CALL(rel32(addr)) - # don't break the following code sequence! xxx no reason any more? - mc = mc._mc mc.LEA(esp, addr_add(ebp, imm(-3 * WORD))) mc.MOV(eax, imm(fail_index)) mc.POP(edi) # [ebp-12] @@ -1284,7 +1301,7 @@ assert len(arglocs) - 2 == len(descr._x86_arglocs[0]) self._emit_call(rel32(descr._x86_direct_bootstrap_code), arglocs, 2, tmp=eax) - mc = self.mc._mc + mc = self._start_block() mc.CMP(eax, imm(self.cpu.done_with_this_frame_int_v)) mc.write(constlistofchars('\x74\x00')) # JE below je_location = mc.get_relative_pos() @@ -1299,6 +1316,7 @@ offset = mc.get_relative_pos() - jmp_location assert 0 < offset <= 127 mc.overwrite(jmp_location - 1, [chr(offset)]) + self._stop_block() if isinstance(result_loc, MODRM64): self.mc.FSTP(result_loc) else: @@ -1311,7 +1329,7 @@ # bad surprizes if the code buffer is mostly full loc_cond = arglocs[0] loc_mask = arglocs[1] - mc = self.mc._mc + mc = self._start_block() mc.TEST(loc_cond, loc_mask) mc.write(constlistofchars('\x74\x00')) # JZ after_the_call jz_location = mc.get_relative_pos() @@ -1334,6 +1352,7 @@ offset = mc.get_relative_pos() - jz_location assert 0 < offset <= 127 mc.overwrite(jz_location-1, [chr(offset)]) + self._stop_block() def genop_force_token(self, op, arglocs, resloc): self.mc.LEA(resloc, mem(ebp, FORCE_INDEX_OFS)) @@ -1369,13 +1388,14 @@ def malloc_cond_fixedsize(self, nursery_free_adr, nursery_top_adr, size, tid, slowpath_addr): # don't use self.mc - mc = self.mc._mc + mc = self._start_block() mc.MOV(eax, heap(nursery_free_adr)) mc.LEA(edx, addr_add(eax, imm(size))) mc.CMP(edx, heap(nursery_top_adr)) mc.write(constlistofchars('\x76\x00')) # JNA after the block jmp_adr = mc.get_relative_pos() - self._emit_call(rel32(slowpath_addr), [imm(size)]) + self._emit_call(rel32(slowpath_addr), [imm(size)], + force_mc=True, mc=mc) # note that slowpath_addr returns a "long long", or more precisely # two results, which end up in eax and edx. @@ -1387,6 +1407,7 @@ mc.overwrite(jmp_adr-1, [chr(offset)]) mc.MOV(addr_add(eax, imm(0)), imm(tid)) mc.MOV(heap(nursery_free_adr), edx) + self._stop_block() genop_discard_list = [Assembler386.not_implemented_op_discard] * rop._LAST genop_list = [Assembler386.not_implemented_op] * rop._LAST Modified: pypy/trunk/pypy/jit/backend/x86/regalloc.py ============================================================================== --- pypy/trunk/pypy/jit/backend/x86/regalloc.py (original) +++ pypy/trunk/pypy/jit/backend/x86/regalloc.py Tue Feb 2 10:34:46 2010 @@ -411,8 +411,8 @@ locs = [self.loc(v) for v in op.args] locs_are_ref = [v.type == REF for v in op.args] fail_index = self.assembler.cpu.get_fail_descr_number(op.descr) - self.assembler.generate_failure(self.assembler.mc, fail_index, locs, - self.exc, locs_are_ref) + self.assembler.generate_failure(fail_index, locs, self.exc, + locs_are_ref) self.possibly_free_vars(op.args) def consider_guard_no_exception(self, op): Added: pypy/trunk/pypy/jit/backend/x86/tool/jumpto.py ============================================================================== --- (empty file) +++ pypy/trunk/pypy/jit/backend/x86/tool/jumpto.py Tue Feb 2 10:34:46 2010 @@ -0,0 +1,24 @@ +"""Find where there are jumps to a given target. +Syntax: + python jumpto.py file.log b0123456 +""" +import sys, struct +from viewcode import World + + +def find_target(coderange, target): + addr = coderange.addr + data = coderange.data + for i in range(len(data)-3): + jtarg = addr + (struct.unpack("i", data[i:i+4])[0] + i + 4) + if not ((jtarg - target) & 0xFFFFFFFFL): + print hex(addr + i + 4) + + +if __name__ == '__main__': + target = int(sys.argv[2], 16) + f = open(sys.argv[1], 'r') + world = World() + world.parse(f, textonly=True) + for coderange in world.ranges: + find_target(coderange, target) Copied: pypy/trunk/pypy/jit/backend/x86/tool/viewcode.py (from r71045, pypy/trunk/pypy/jit/backend/x86/viewcode.py) ============================================================================== --- pypy/trunk/pypy/jit/backend/x86/viewcode.py (original) +++ pypy/trunk/pypy/jit/backend/x86/tool/viewcode.py Tue Feb 2 10:34:46 2010 @@ -204,9 +204,9 @@ elif line.startswith('SYS_EXECUTABLE '): filename = line[len('SYS_EXECUTABLE '):].strip() self.symbols.update(load_symbols(filename)) + + def find_cross_references(self): # find cross-references between blocks - if textonly: - return fnext = 0.1 for i, r in enumerate(self.ranges): for lineno, targetaddr, _ in r.findjumps(): @@ -362,5 +362,7 @@ else: f = open(sys.argv[1], 'r') world = World() - world.parse(f, textonly=not showgraph) + world.parse(f) + if showgraph: + world.find_cross_references() world.show(showtext=True, showgraph=showgraph) From cfbolz at codespeak.net Tue Feb 2 10:57:41 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Tue, 2 Feb 2010 10:57:41 +0100 (CET) Subject: [pypy-svn] r71050 - in pypy/trunk/pypy/module/_codecs: . test Message-ID: <20100202095741.70C081683F0@codespeak.net> Author: cfbolz Date: Tue Feb 2 10:57:40 2010 New Revision: 71050 Modified: pypy/trunk/pypy/module/_codecs/interp_codecs.py pypy/trunk/pypy/module/_codecs/test/test_codecs.py Log: fix the case where the string is empty :-( Modified: pypy/trunk/pypy/module/_codecs/interp_codecs.py ============================================================================== --- pypy/trunk/pypy/module/_codecs/interp_codecs.py (original) +++ pypy/trunk/pypy/module/_codecs/interp_codecs.py Tue Feb 2 10:57:40 2010 @@ -318,12 +318,12 @@ def charmap_decode(space, s, errors="strict", w_mapping=None): size = len(s) -## /* Default to Latin-1 */ + # Default to Latin-1 if space.is_true(space.is_(w_mapping, space.w_None)): return latin_1_decode(space, s, errors, space.w_False) if (size == 0): - return space.wrap(u'') + return space.newtuple([space.wrap(u''), space.wrap(0)]) # fast path for all the stuff in the encodings module if space.is_true(space.isinstance(w_mapping, space.w_tuple)): Modified: pypy/trunk/pypy/module/_codecs/test/test_codecs.py ============================================================================== --- pypy/trunk/pypy/module/_codecs/test/test_codecs.py (original) +++ pypy/trunk/pypy/module/_codecs/test/test_codecs.py Tue Feb 2 10:57:40 2010 @@ -118,6 +118,7 @@ def test_charmap_decode(self): from _codecs import charmap_decode + assert charmap_decode('', 'strict', 'blablabla') == ('', 0) assert charmap_decode('xxx') == ('xxx', 3) assert charmap_decode('xxx', 'strict', {ord('x'): u'XX'}) == ('XXXXXX', 3) map = tuple([unichr(i) for i in range(256)]) From arigo at codespeak.net Tue Feb 2 11:12:10 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Tue, 2 Feb 2010 11:12:10 +0100 (CET) Subject: [pypy-svn] r71051 - pypy/trunk/pypy/jit/backend/x86 Message-ID: <20100202101210.0B4831683F0@codespeak.net> Author: arigo Date: Tue Feb 2 11:12:09 2010 New Revision: 71051 Modified: pypy/trunk/pypy/jit/backend/x86/assembler.py Log: While we are at it, assert that we don't write too many bytes in a start_block/stop_block pair. Modified: pypy/trunk/pypy/jit/backend/x86/assembler.py ============================================================================== --- pypy/trunk/pypy/jit/backend/x86/assembler.py (original) +++ pypy/trunk/pypy/jit/backend/x86/assembler.py Tue Feb 2 11:12:09 2010 @@ -354,14 +354,16 @@ # i.e. one that will not contain any JMP. mc = self.mc._mc if not we_are_translated(): - self._block_started_mc = self.mc + self._block_started_mc = (self.mc, mc.tell()) self.mc = "block started" return mc def _stop_block(self): if not we_are_translated(): assert self.mc == "block started" - self.mc = self._block_started_mc + self.mc, orgpos = self._block_started_mc + assert 0 <= self.mc._mc.tell() - orgpos <= 58, ( + "too many bytes in _start_block/_stop_block pair") del self._block_started_mc # ------------------------------------------------------------ From arigo at codespeak.net Tue Feb 2 11:55:01 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Tue, 2 Feb 2010 11:55:01 +0100 (CET) Subject: [pypy-svn] r71052 - pypy/branch/rsre/pypy/rlib/rsre Message-ID: <20100202105501.D7FED1683F0@codespeak.net> Author: arigo Date: Tue Feb 2 11:55:01 2010 New Revision: 71052 Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Log: Implement one of the XXXs. Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Tue Feb 2 11:55:01 2010 @@ -791,27 +791,31 @@ """Returns the number of repetitions of a single item, starting from the current string position. The code pointer is expected to point to a REPEAT_ONE operation (with the repeated 4 ahead).""" - count = 0 real_maxcount = ctx.state.end - ctx.string_position if maxcount < real_maxcount and maxcount != MAXREPEAT: real_maxcount = maxcount - # XXX could special case every single character pattern here, as in C. - # This is a general solution, a bit hackisch, but works and should be - # efficient. - code_position = ctx.code_position + # First, special-cases for common single character patterns string_position = ctx.string_position - ctx.skip_code(4) - reset_position = ctx.code_position - while count < real_maxcount: - # this works because the single character pattern is followed by - # a success opcode - ctx.code_position = reset_position - opcode_dispatch_table[ctx.peek_code()](ctx) - if ctx.has_matched == ctx.NOT_MATCHED: - break - count += 1 - ctx.has_matched = ctx.UNDECIDED - ctx.code_position = code_position + code = ctx.peek_code(4) + for i, function in count_repetitions_unroll: + if code == i and function is not None: + count = function(ctx, real_maxcount) + else: + # This is a general solution, a bit hackisch, but works + code_position = ctx.code_position + count = 0 + ctx.skip_code(4) + reset_position = ctx.code_position + while count < real_maxcount: + # this works because the single character pattern is followed by + # a success opcode + ctx.code_position = reset_position + opcode_dispatch_table[code](ctx) + if ctx.has_matched == ctx.NOT_MATCHED: + break + count += 1 + ctx.has_matched = ctx.UNDECIDED + ctx.code_position = code_position ctx.string_position = string_position return count @@ -841,6 +845,91 @@ ] opcode_dispatch_unroll = unrolling_iterable(enumerate(opcode_dispatch_table)) +##### count_repetitions dispatch + +def general_cr_in(ctx, maxcount, ignore): + code_position = ctx.code_position + count = 0 + while count < maxcount: + ctx.code_position = code_position + ctx.skip_code(6) # set op pointer to the set code + char_code = ctx.peek_char(count) + if ignore: + char_code = ctx.state.lower(char_code) + if not rsre_char.check_charset(char_code, ctx): + break + count += 1 + ctx.code_position = code_position + return count +general_cr_in._annspecialcase_ = 'specialize:arg(2)' + +def cr_in(ctx, maxcount): + return general_cr_in(ctx, maxcount, False) + +def cr_in_ignore(ctx, maxcount): + return general_cr_in(ctx, maxcount, True) + +def cr_any(ctx, maxcount): + count = 0 + while count < maxcount: + if ctx.peek_char(count) == rsre_char.linebreak: + break + count += 1 + return count + +def cr_any_all(ctx, maxcount): + return maxcount + +def general_cr_literal(ctx, maxcount, ignore, negate): + chr = ctx.peek_code(5) + count = 0 + while count < maxcount: + char_code = ctx.peek_char(count) + if ignore: + char_code = ctx.state.lower(char_code) + if negate: + if char_code == chr: + break + else: + if char_code != chr: + break + count += 1 + return count +general_cr_literal._annspecialcase_ = 'specialize:arg(2,3)' + +def cr_literal(ctx, maxcount): + return general_cr_literal(ctx, maxcount, False, False) + +def cr_literal_ignore(ctx, maxcount): + return general_cr_literal(ctx, maxcount, True, False) + +def cr_not_literal(ctx, maxcount): + return general_cr_literal(ctx, maxcount, False, True) + +def cr_not_literal_ignore(ctx, maxcount): + return general_cr_literal(ctx, maxcount, True, True) + +count_repetitions_table = [ + None, None, + cr_any, cr_any_all, + None, None, + None, + None, + None, + None, + None, None, + None, None, None, + cr_in, cr_in_ignore, + None, None, + cr_literal, cr_literal_ignore, + None, + None, + None, + cr_not_literal, cr_not_literal_ignore, +] +count_repetitions_unroll = unrolling_iterable( + enumerate(count_repetitions_table)) + ##### At dispatch def at_dispatch(atcode, context): From arigo at codespeak.net Tue Feb 2 11:56:17 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Tue, 2 Feb 2010 11:56:17 +0100 (CET) Subject: [pypy-svn] r71053 - pypy/branch/rsre/pypy/rlib/rsre Message-ID: <20100202105617.A6D3D1683F0@codespeak.net> Author: arigo Date: Tue Feb 2 11:56:16 2010 New Revision: 71053 Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Log: Turn two more indirect function calls into unrolling_iterables. Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py Tue Feb 2 11:56:16 2010 @@ -3,6 +3,7 @@ """ import sys from pypy.rlib.rsre._rsre_platform import tolower, isalnum +from pypy.rlib.unroll import unrolling_iterable # Note: the unicode parts of this module require you to call # rsre.set_unicode_db() first, to select one of the modules @@ -124,15 +125,15 @@ #### Category dispatch def category_dispatch(category_code, char_code): - try: - function, negate = category_dispatch_table[category_code] - except IndexError: - return False - result = function(char_code) - if negate: - return not result + for i, (function, negate) in category_dispatch_unroll: + if category_code == i: + result = function(char_code) + if negate: + return not result + else: + return result else: - return result + return False # Maps opcodes by indices to (function, negate) tuples. category_dispatch_table = [ @@ -144,6 +145,8 @@ (is_uni_word, True), (is_uni_linebreak, False), (is_uni_linebreak, True) ] +category_dispatch_unroll = unrolling_iterable( + enumerate(category_dispatch_table)) ##### Charset evaluation @@ -159,11 +162,12 @@ backup_code_position = context.code_position while result == SET_NOT_FINISHED: opcode = context.peek_code() - try: - function = set_dispatch_table[opcode] - except IndexError: + for i, function in set_dispatch_unroll: + if function is not None and opcode == i: + result = function(context, char_code) + break + else: return False - result = function(context, char_code) context.code_position = backup_code_position return result == SET_OK @@ -254,3 +258,4 @@ None, None, None, None, set_literal, None, None, None, None, None, None, set_negate, set_range ] +set_dispatch_unroll = unrolling_iterable(enumerate(set_dispatch_table)) Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Tue Feb 2 11:56:16 2010 @@ -247,7 +247,7 @@ else: opcode = context.peek_code() for i, function in opcode_dispatch_unroll: - if i == opcode and function is not None: + if function is not None and i == opcode: has_finished = function(context) break else: @@ -798,7 +798,7 @@ string_position = ctx.string_position code = ctx.peek_code(4) for i, function in count_repetitions_unroll: - if code == i and function is not None: + if function is not None and code == i: count = function(ctx, real_maxcount) else: # This is a general solution, a bit hackisch, but works From arigo at codespeak.net Tue Feb 2 13:11:25 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Tue, 2 Feb 2010 13:11:25 +0100 (CET) Subject: [pypy-svn] r71055 - pypy/branch/rsre/pypy/rlib/rsre Message-ID: <20100202121125.C3BB31683F0@codespeak.net> Author: arigo Date: Tue Feb 2 13:11:24 2010 New Revision: 71055 Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Log: Optimize the saving and restoring of marks by avoiding many allocations. Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Tue Feb 2 13:11:24 2010 @@ -22,7 +22,13 @@ self.string_position = self.start self.marks = [] self.lastindex = -1 - self.marks_stack = [] + # self.saved_marks is a list of ints that stores saved marks. + # For example, if s1..sn, t1..tn are two sets of saved marks: + # [s1,..,sn,lastindex,x, t1,..,tn,lastindex,y, extra_unused...] + # ^------------------' ^------------------' + # with x and y saved indices to allow pops. + self.saved_marks = [] + self.saved_marks_top = 0 self.context_stack = [] self.repeat = None @@ -49,11 +55,12 @@ return regs def set_mark(self, mark_nr, position): + assert mark_nr >= 0 if mark_nr & 1: # This id marks the end of a group. self.lastindex = mark_nr / 2 + 1 - if mark_nr >= len(self.marks): - self.marks.extend([-1] * (mark_nr - len(self.marks) + 1)) + while mark_nr >= len(self.marks): + self.marks.append(-1) self.marks[mark_nr] = position def get_marks(self, group_index): @@ -64,17 +71,38 @@ return -1, -1 def marks_push(self): - self.marks_stack.append((self.marks[:], self.lastindex)) + # Create in saved_marks: [......, m1,..,mn,lastindex,p, ...........] + # ^p ^newsize + p = self.saved_marks_top + n = len(self.marks) + assert p >= 0 + newsize = p + n + 2 + while len(self.saved_marks) < newsize: + self.saved_marks.append(-1) + for i in range(n): + self.saved_marks[p+i] = self.marks[i] + self.saved_marks[p+n] = self.lastindex + self.saved_marks[p+n+1] = p + self.saved_marks_top = newsize def marks_pop(self): - self.marks, self.lastindex = self.marks_stack.pop() + p0 = self.marks_pop_keep() + self.saved_marks_top = p0 def marks_pop_keep(self): - marks, self.lastindex = self.marks_stack[-1] - self.marks = marks[:] + # Restore from saved_marks: [......, m1,..,mn,lastindex,p, .........] + # ^p0 ^p1 + p1 = self.saved_marks_top - 2 + assert p1 >= 0 + p0 = self.saved_marks[p1+1] + assert 0 <= p0 <= p1 + self.lastindex = self.saved_marks[p1] + self.marks = self.saved_marks[p0:p1] + return p0 def marks_pop_discard(self): - self.marks_stack.pop() + p0 = self.saved_marks[self.saved_marks_top-1] + self.saved_marks_top = p0 class MatchContext(rsre_char.MatchContextBase): From arigo at codespeak.net Tue Feb 2 13:41:25 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Tue, 2 Feb 2010 13:41:25 +0100 (CET) Subject: [pypy-svn] r71056 - pypy/branch/rsre/pypy/rlib/rsre Message-ID: <20100202124125.F1C3E1683F0@codespeak.net> Author: arigo Date: Tue Feb 2 13:41:25 2010 New Revision: 71056 Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Log: Fix a bug (missing "break"). Tweak more marks_pop_keep() to avoid creating a new list in self.marks. Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Tue Feb 2 13:41:25 2010 @@ -20,8 +20,9 @@ def reset(self): self.string_position = self.start - self.marks = [] + self.marks = [0, 0, 0, 0] self.lastindex = -1 + self.marks_count = 0 # self.saved_marks is a list of ints that stores saved marks. # For example, if s1..sn, t1..tn are two sets of saved marks: # [s1,..,sn,lastindex,x, t1,..,tn,lastindex,y, extra_unused...] @@ -45,7 +46,7 @@ for group in range(group_count): mark_index = 2 * group start = end = -1 - if mark_index + 1 < len(self.marks): + if mark_index + 1 < self.marks_count: start1 = self.marks[mark_index] end1 = self.marks[mark_index + 1] if start1 >= 0 and end1 >= 0: @@ -59,13 +60,17 @@ if mark_nr & 1: # This id marks the end of a group. self.lastindex = mark_nr / 2 + 1 - while mark_nr >= len(self.marks): - self.marks.append(-1) + if mark_nr >= self.marks_count: + for i in range(self.marks_count, mark_nr): + self.marks[i] = -1 + self.marks_count = mark_nr + 1 + while mark_nr >= len(self.marks): + self.marks = self.marks + [0] * len(self.marks) self.marks[mark_nr] = position def get_marks(self, group_index): marks_index = 2 * group_index - if len(self.marks) > marks_index + 1: + if self.marks_count > marks_index + 1: return self.marks[marks_index], self.marks[marks_index + 1] else: return -1, -1 @@ -74,7 +79,7 @@ # Create in saved_marks: [......, m1,..,mn,lastindex,p, ...........] # ^p ^newsize p = self.saved_marks_top - n = len(self.marks) + n = self.marks_count assert p >= 0 newsize = p + n + 2 while len(self.saved_marks) < newsize: @@ -95,9 +100,12 @@ p1 = self.saved_marks_top - 2 assert p1 >= 0 p0 = self.saved_marks[p1+1] - assert 0 <= p0 <= p1 + n = p1 - p0 + assert p0 >= 0 and n >= 0 self.lastindex = self.saved_marks[p1] - self.marks = self.saved_marks[p0:p1] + for i in range(n): + self.marks[i] = self.saved_marks[p0+i] + self.marks_count = n return p0 def marks_pop_discard(self): @@ -828,6 +836,7 @@ for i, function in count_repetitions_unroll: if function is not None and code == i: count = function(ctx, real_maxcount) + break else: # This is a general solution, a bit hackisch, but works code_position = ctx.code_position From arigo at codespeak.net Tue Feb 2 14:10:57 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Tue, 2 Feb 2010 14:10:57 +0100 (CET) Subject: [pypy-svn] r71057 - pypy/branch/rsre/pypy/rlib/rsre Message-ID: <20100202131057.4D16D1683F5@codespeak.net> Author: arigo Date: Tue Feb 2 14:10:56 2010 New Revision: 71057 Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Log: Fix the XXX missing optimization. Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Tue Feb 2 14:10:56 2010 @@ -461,7 +461,6 @@ ctx.has_matched = ctx.MATCHED return True ctx.state.marks_push() - # XXX literal optimization missing here # Case 2: Repetition is resumed (aka backtracked) else: @@ -474,14 +473,34 @@ ctx.skip_char(-1) count -= 1 ctx.state.marks_pop_keep() - + # Initialize the actual backtracking if count >= mincount: - ctx.state.string_position = ctx.string_position - ctx.push_new_context(ctx.peek_code(1) + 1) - ctx.backup_value(mincount) - ctx.backup_value(count) - return False + # + ok = True + nextidx = ctx.peek_code(1) + if ctx.peek_code(nextidx + 1) == 19: # 19 == OPCODES["literal"] + # tail starts with a literal. skip positions where + # the rest of the pattern cannot possibly match + chr = ctx.peek_code(nextidx + 2) + if ctx.at_end(): + ctx.skip_char(-1) + count -= 1 + ok = count >= mincount + while ok: + if ctx.peek_char() == chr: + break + ctx.skip_char(-1) + count -= 1 + ok = count >= mincount + # + + if ok: + ctx.state.string_position = ctx.string_position + ctx.push_new_context(ctx.peek_code(1) + 1) + ctx.backup_value(mincount) + ctx.backup_value(count) + return False # Backtracking failed ctx.state.marks_pop_discard() From fijal at codespeak.net Tue Feb 2 15:01:58 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Tue, 2 Feb 2010 15:01:58 +0100 (CET) Subject: [pypy-svn] r71058 - pypy/extradoc/talk/pycon2010/keynote Message-ID: <20100202140158.463461683EC@codespeak.net> Author: fijal Date: Tue Feb 2 15:01:57 2010 New Revision: 71058 Added: pypy/extradoc/talk/pycon2010/keynote/ pypy/extradoc/talk/pycon2010/keynote/outline.txt (contents, props changed) Log: Write down an outline Added: pypy/extradoc/talk/pycon2010/keynote/outline.txt ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/keynote/outline.txt Tue Feb 2 15:01:57 2010 @@ -0,0 +1,40 @@ + +We present a timeline of events that happened during last year. + +Highlights: + +* February 2009 (a year ago!) - We manage to merge armin's experiments + into PyPy, having JITted Python. + +* March 2009 - speeding up the first example, function counting integers. + + i = 0 + while i < 10000000: + i = i + 1 + +* June 2009 - solved problem with Python frames, how to avoid using them + in most common cases. + +* July 2009 - XXX [maybe] numeric experiments + +* August 2009 - Benjamin Peterson rewrites PyPy compiler, a lot of work, + little visibility outside. + +* September 2009 - We manage to speed up Richards, the first non-trivial + benchmark on top of PyPy JIT. + +* October 2009 - [XXX kill?] Improvements to the GC, float support + +* November 2009 - We publish results on computer language shootout + benchmarks, looking mostly good, with bad places. + +* December 2009 - Christmas :-) + +* January 2010 - Solved the issue of chaining frames, so exceptions can + be fast. + +* January 2010 - Nightly run of benchmarks, looking like this: xxx + +* ?March 2010 - 1.2 release - a release to try out JIT and gather feedback + +* ?later 2010 - a stable release of PyPy's JIT From arigo at codespeak.net Tue Feb 2 15:02:14 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Tue, 2 Feb 2010 15:02:14 +0100 (CET) Subject: [pypy-svn] r71059 - pypy/branch/rsre/pypy/rlib/rsre Message-ID: <20100202140214.A4BF71683F1@codespeak.net> Author: arigo Date: Tue Feb 2 15:02:14 2010 New Revision: 71059 Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py Log: Optimize a bit check_charset(). Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_char.py Tue Feb 2 15:02:14 2010 @@ -150,96 +150,88 @@ ##### Charset evaluation -SET_OK = 1 -SET_NOT_OK = -1 -SET_NOT_FINISHED = 0 +SET_OK = -1 +SET_NOT_OK = -2 def check_charset(char_code, context): """Checks whether a character matches set of arbitrary length. Currently assumes the set starts at the first member of pattern_codes.""" - result = SET_NOT_FINISHED - context.set_ok = SET_OK - backup_code_position = context.code_position - while result == SET_NOT_FINISHED: - opcode = context.peek_code() + pattern_codes = context.pattern_codes + index = context.code_position + negated = SET_OK + while index >= 0: + opcode = pattern_codes[index] for i, function in set_dispatch_unroll: if function is not None and opcode == i: - result = function(context, char_code) + index = function(pattern_codes, index, char_code) break else: - return False - context.code_position = backup_code_position - return result == SET_OK + if opcode == 26: # NEGATE + negated ^= (SET_OK ^ SET_NOT_OK) + index += 1 + else: + return False + return index == negated -def set_failure(ctx, char_code): - return -ctx.set_ok +def set_failure(pat, index, char_code): + return SET_NOT_OK -def set_literal(ctx, char_code): +def set_literal(pat, index, char_code): # - if ctx.peek_code(1) == char_code: - return ctx.set_ok + if pat[index+1] == char_code: + return SET_OK else: - ctx.skip_code(2) - return SET_NOT_FINISHED + return index + 2 -def set_category(ctx, char_code): +def set_category(pat, index, char_code): # - if category_dispatch(ctx.peek_code(1), char_code): - return ctx.set_ok + if category_dispatch(pat[index+1], char_code): + return SET_OK else: - ctx.skip_code(2) - return SET_NOT_FINISHED + return index + 2 -def set_charset(ctx, char_code): +def set_charset(pat, index, char_code): # (16 bits per code word) - ctx.skip_code(1) # point to beginning of bitmap if CODESIZE == 2: - if char_code < 256 and ctx.peek_code(char_code >> 4) \ + if char_code < 256 and pat[index+1+(char_code >> 4)] \ & (1 << (char_code & 15)): - return ctx.set_ok - ctx.skip_code(16) # skip bitmap + return SET_OK + return index + 17 # skip bitmap else: - if char_code < 256 and ctx.peek_code(char_code >> 5) \ + if char_code < 256 and pat[index+1+(char_code >> 5)] \ & (1 << (char_code & 31)): - return ctx.set_ok - ctx.skip_code(8) # skip bitmap - return SET_NOT_FINISHED + return SET_OK + return index + 9 # skip bitmap -def set_range(ctx, char_code): +def set_range(pat, index, char_code): # - if ctx.peek_code(1) <= char_code <= ctx.peek_code(2): - return ctx.set_ok - ctx.skip_code(3) - return SET_NOT_FINISHED - -def set_negate(ctx, char_code): - ctx.set_ok = -ctx.set_ok - ctx.skip_code(1) - return SET_NOT_FINISHED + if pat[index+1] <= char_code <= pat[index+2]: + return SET_OK + return index + 3 -def set_bigcharset(ctx, char_code): +def set_bigcharset(pat, index, char_code): # <256 blockindices> # XXX this function probably needs a makeover - count = ctx.peek_code(1) - ctx.skip_code(2) + count = pat[index+1] + index += 2 if char_code < 65536: block_index = char_code >> 8 # NB: there are CODESIZE block indices per bytecode - a = to_byte_array(ctx.peek_code(block_index / CODESIZE)) + a = to_byte_array(pat[index+(block_index / CODESIZE)]) block = a[block_index % CODESIZE] - ctx.skip_code(256 / CODESIZE) # skip block indices + index += 256 / CODESIZE # skip block indices if CODESIZE == 2: shift = 4 else: shift = 5 - block_value = ctx.peek_code(block * (32 / CODESIZE) - + ((char_code & 255) >> shift)) + block_value = pat[index+(block * (32 / CODESIZE) + + ((char_code & 255) >> shift))] if block_value & (1 << (char_code & ((8 * CODESIZE) - 1))): - return ctx.set_ok + return SET_OK else: - ctx.skip_code(256 / CODESIZE) # skip block indices - ctx.skip_code(count * (32 / CODESIZE)) # skip blocks - return SET_NOT_FINISHED + index += 256 / CODESIZE # skip block indices + index += count * (32 / CODESIZE) # skip blocks + return index def to_byte_array(int_value): """Creates a list of bytes out of an integer representing data that is @@ -256,6 +248,8 @@ set_failure, None, None, None, None, None, None, None, None, set_category, set_charset, set_bigcharset, None, None, None, None, None, None, None, set_literal, None, None, None, None, - None, None, set_negate, set_range + None, None, + None, # NEGATE + set_range ] set_dispatch_unroll = unrolling_iterable(enumerate(set_dispatch_table)) From fijal at codespeak.net Tue Feb 2 15:08:41 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Tue, 2 Feb 2010 15:08:41 +0100 (CET) Subject: [pypy-svn] r71060 - pypy/build/bot2/pypybuildbot Message-ID: <20100202140841.3411E1683F1@codespeak.net> Author: fijal Date: Tue Feb 2 15:08:40 2010 New Revision: 71060 Modified: pypy/build/bot2/pypybuildbot/master.py Log: I think this is enough to run apptests on top of the JIT build Modified: pypy/build/bot2/pypybuildbot/master.py ============================================================================== --- pypy/build/bot2/pypybuildbot/master.py (original) +++ pypy/build/bot2/pypybuildbot/master.py Tue Feb 2 15:08:40 2010 @@ -68,7 +68,8 @@ '--jit-debug=steps'], targetArgs = ['--withoutmod-thread'], lib_python=True, - pypyjit=True + pypyjit=True, + app_tests=True, ) pypy_OjitTranslatedTestFactory = pypybuilds.Translated( From arigo at codespeak.net Tue Feb 2 16:04:46 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Tue, 2 Feb 2010 16:04:46 +0100 (CET) Subject: [pypy-svn] r71061 - pypy/trunk/pypy/translator/c/src Message-ID: <20100202150446.259911683E6@codespeak.net> Author: arigo Date: Tue Feb 2 16:04:45 2010 New Revision: 71061 Modified: pypy/trunk/pypy/translator/c/src/debug_traceback.h Log: Fix traceback printing. Modified: pypy/trunk/pypy/translator/c/src/debug_traceback.h ============================================================================== --- pypy/trunk/pypy/translator/c/src/debug_traceback.h (original) +++ pypy/trunk/pypy/translator/c/src/debug_traceback.h Tue Feb 2 16:04:45 2010 @@ -109,6 +109,8 @@ else { /* line "NULL, &KeyError" or "RERAISE, &KeyError" */ + if (!my_etype) + my_etype = etype; if (etype != my_etype) { fprintf(stderr, " Note: this traceback is " From cfbolz at codespeak.net Tue Feb 2 16:22:08 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Tue, 2 Feb 2010 16:22:08 +0100 (CET) Subject: [pypy-svn] r71062 - in pypy/branch/oprofile-support/pypy/jit/backend/x86: . test Message-ID: <20100202152208.134701683EF@codespeak.net> Author: cfbolz Date: Tue Feb 2 16:22:08 2010 New Revision: 71062 Added: pypy/branch/oprofile-support/pypy/jit/backend/x86/profagent.py (contents, props changed) Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/assembler.py pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_assembler.py Log: Steps in the direction of nicely integrating profilers: add start/end_function methods to MachineCodeBlockWrapper, which makes it give assembler address range information to the profiler. Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/assembler.py ============================================================================== --- pypy/branch/oprofile-support/pypy/jit/backend/x86/assembler.py (original) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/assembler.py Tue Feb 2 16:22:08 2010 @@ -13,7 +13,7 @@ X86RegisterManager, X86XMMRegisterManager, get_ebp_ofs, FRAME_FIXED_SIZE,\ FORCE_INDEX_OFS from pypy.rlib.objectmodel import we_are_translated, specialize -from pypy.jit.backend.x86 import codebuf +from pypy.jit.backend.x86 import codebuf, oprofile from pypy.jit.backend.x86.ri386 import * from pypy.jit.metainterp.resoperation import rop from pypy.jit.backend.x86.support import values_array @@ -35,18 +35,43 @@ class MachineCodeBlockWrapper(object): MC_DEFAULT_SIZE = 1024*1024 - def __init__(self, bigsize): + def __init__(self, bigsize, profile_agent=None): self.old_mcs = [] # keepalive self.bigsize = bigsize - self._mc = codebuf.MachineCodeBlock(bigsize) + self._mc = self._instantiate_mc() + self.function_name = None + self.profile_agent = profile_agent + + def _instantiate_mc(self): # hook for testing + return codebuf.MachineCodeBlock(self.bigsize) + def bytes_free(self): - return self._mc._size - self._mc._pos + return self._mc._size - self._mc.get_relative_pos() + + def start_function(self, name): + self.function_name = name + self.start_pos = self._mc.get_relative_pos() + + def end_function(self, done=True): + assert self.function_name is not None + size = self._mc.get_relative_pos() - self.start_pos + address = self.tell() - size + if self.profile_agent is not None: + self.profile_agent.native_code_written(self.function_name, + address, size) + if done: + self.function_name = None def make_new_mc(self): - new_mc = codebuf.MachineCodeBlock(self.bigsize) + new_mc = self._instantiate_mc() debug_print('[new machine code block at', new_mc.tell(), ']') self._mc.JMP(rel32(new_mc.tell())) + + if self.function_name is not None: + self.end_function(done=False) + self.start_pos = new_mc.get_relative_pos() + self._mc.done() self.old_mcs.append(self._mc) self._mc = new_mc @@ -69,7 +94,7 @@ return method for name in dir(codebuf.MachineCodeBlock): - if name.upper() == name: + if name.upper() == name or name == "writechr": setattr(MachineCodeBlockWrapper, name, _new_method(name)) class Assembler386(object): Added: pypy/branch/oprofile-support/pypy/jit/backend/x86/profagent.py ============================================================================== --- (empty file) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/profagent.py Tue Feb 2 16:22:08 2010 @@ -0,0 +1,12 @@ + +class ProfileAgent(object): + """ A class that communicates to a profiler which assembler code belongs to + which functions. """ + + def startup(self): + pass + def shutdown(self): + pass + def native_code_written(self, name, address, size): + raise NotImplementedError + Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_assembler.py ============================================================================== --- pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_assembler.py (original) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_assembler.py Tue Feb 2 16:22:08 2010 @@ -1,5 +1,5 @@ from pypy.jit.backend.x86.ri386 import * -from pypy.jit.backend.x86.assembler import Assembler386 +from pypy.jit.backend.x86.assembler import Assembler386, MachineCodeBlockWrapper from pypy.jit.backend.x86.regalloc import X86FrameManager, get_ebp_ofs from pypy.jit.metainterp.history import BoxInt, BoxPtr, BoxFloat from pypy.rlib.rarithmetic import intmask @@ -11,10 +11,20 @@ supports_floats = True class FakeMC: - def __init__(self): + def __init__(self, base_address=0): self.content = [] + self._size = 100 + self.base_address = base_address def writechr(self, n): self.content.append(n) + def tell(self): + return self.base_address + len(self.content) + def get_relative_pos(self): + return len(self.content) + def JMP(self, *args): + self.content.append(("JMP", args)) + def done(self): + pass def test_write_failure_recovery_description(): @@ -233,3 +243,40 @@ # an approximate result, it might mean that only the first 32 # bits of the float were correctly saved and restored. assert assembler.fail_boxes_float.getitem(i) == expected_floats[i] + +class ProfileAgent(object): + def __init__(self): + self.functions = [] + + def native_code_written(self, name, address, size): + self.functions.append((name, address, size)) + +class FakeMCWrapper(MachineCodeBlockWrapper): + count = 0 + def _instantiate_mc(self): + self.count += 1 + return FakeMC(200 * (self.count - 1)) + +def test_mc_wrapper_profile_agent(): + agent = ProfileAgent() + mc = FakeMCWrapper(100, agent) + mc.start_function("abc") + mc.writechr("x") + mc.writechr("x") + mc.writechr("x") + mc.writechr("x") + mc.end_function() + assert agent.functions == [("abc", 0, 4)] + mc.writechr("x") + mc.start_function("cde") + mc.writechr("x") + mc.writechr("x") + mc.writechr("x") + mc.writechr("x") + mc.end_function() + assert agent.functions == [("abc", 0, 4), ("cde", 5, 4)] + mc.start_function("xyz") + for i in range(50): + mc.writechr("x") + mc.end_function() + assert agent.functions == [("abc", 0, 4), ("cde", 5, 4), ("xyz", 9, 29), ("xyz", 200, 22)] From cfbolz at codespeak.net Tue Feb 2 17:01:10 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Tue, 2 Feb 2010 17:01:10 +0100 (CET) Subject: [pypy-svn] r71064 - in pypy/branch/oprofile-support/pypy/jit/backend/x86: . test Message-ID: <20100202160110.D609A1683F8@codespeak.net> Author: cfbolz Date: Tue Feb 2 17:01:10 2010 New Revision: 71064 Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/assembler.py pypy/branch/oprofile-support/pypy/jit/backend/x86/runner.py pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_assembler.py Log: Change the assembler to pass function name information on to the profiler. Right now, the first debug_merge_point that is found is used as the name of the function. Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/assembler.py ============================================================================== --- pypy/branch/oprofile-support/pypy/jit/backend/x86/assembler.py (original) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/assembler.py Tue Feb 2 17:01:10 2010 @@ -156,7 +156,7 @@ # done # we generate the loop body in 'mc' # 'mc2' is for guard recovery code - self.mc = MachineCodeBlockWrapper(self.mc_size) + self.mc = MachineCodeBlockWrapper(self.mc_size, self.cpu.profile_agent) self.mc2 = MachineCodeBlockWrapper(self.mc_size) self._build_failure_recovery(False) self._build_failure_recovery(True) @@ -194,6 +194,8 @@ _x86_param_depth _x86_arglocs """ + funcname = self._find_debug_merge_point(operations) + self.make_sure_mc_exists() regalloc = RegAlloc(self, self.cpu.translate_support_code) arglocs = regalloc.prepare_loop(inputargs, operations, looptoken) @@ -201,6 +203,10 @@ needed_mem = len(arglocs[0]) * 16 + 16 if needed_mem >= self.mc.bytes_free(): self.mc.make_new_mc() + + # profile support + name = "Loop # %s: %s" % (looptoken.number, funcname) + self.mc.start_function(name) looptoken._x86_bootstrap_code = self.mc.tell() adr_stackadjust = self._assemble_bootstrap_code(inputargs, arglocs) curadr = self.mc.tell() @@ -221,8 +227,12 @@ frame_depth+param_depth) debug_print("Loop #", looptoken.number, "has address", looptoken._x86_loop_code, "to", self.mc.tell()) + self.mc.end_function() + def assemble_bridge(self, faildescr, inputargs, operations): + funcname = self._find_debug_merge_point(operations) + self.make_sure_mc_exists() arglocs = self.rebuild_faillocs_from_descr( faildescr._x86_failure_recovery_bytecode) @@ -233,6 +243,12 @@ fail_depths = faildescr._x86_current_depths regalloc.prepare_bridge(fail_depths, inputargs, arglocs, operations) + + # oprofile support + descr_number = self.cpu.get_fail_descr_number(faildescr) + name = "Bridge # %s: %s" % (descr_number, funcname) + self.mc.start_function(name) + adr_bridge = self.mc.tell() adr_stackadjust = self._patchable_stackadjust() frame_depth, param_depth = self._assemble(regalloc, operations) @@ -244,8 +260,16 @@ # patch the jump from original guard self.patch_jump(faildescr, adr_bridge) debug_print("Bridge out of guard", - self.cpu.get_fail_descr_number(faildescr), + descr_number, "has address", adr_bridge, "to", self.mc.tell()) + self.mc.end_function() + + def _find_debug_merge_point(self, operations): + for op in operations: + if op.opnum == rop.DEBUG_MERGE_POINT: + return op.args[0]._get_str() + return "" + def patch_jump(self, faildescr, adr_new_target): adr_jump_offset = faildescr._x86_adr_jump_offset Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/runner.py ============================================================================== --- pypy/branch/oprofile-support/pypy/jit/backend/x86/runner.py (original) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/runner.py Tue Feb 2 17:01:10 2010 @@ -20,6 +20,13 @@ gcdescr=None): AbstractLLCPU.__init__(self, rtyper, stats, opts, translate_support_code, gcdescr) + profile_agent = None + if rtyper is not None: + config = rtyper.annotator.translator.config + if config.translation.jit_profiler == "oprofile": + from pypy.jit.backend.x86 import oprofile + profile_agent = oprofile.OProfileAgent() + self._profile_agent = profile_agent def setup(self): if self.opts is not None: @@ -33,7 +40,12 @@ return self.assembler.leave_jitted_hook def setup_once(self): - pass + if self._profile_agent is not None: + self._profile_agent.setup() + + def finish_once(self): + if self._profile_agent is not None: + self._profile_agent.shutdown() def compile_loop(self, inputargs, operations, looptoken): self.assembler.assemble_loop(inputargs, operations, looptoken) Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_assembler.py ============================================================================== --- pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_assembler.py (original) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_assembler.py Tue Feb 2 17:01:10 2010 @@ -244,7 +244,7 @@ # bits of the float were correctly saved and restored. assert assembler.fail_boxes_float.getitem(i) == expected_floats[i] -class ProfileAgent(object): +class FakeProfileAgent(object): def __init__(self): self.functions = [] From arigo at codespeak.net Tue Feb 2 17:10:45 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Tue, 2 Feb 2010 17:10:45 +0100 (CET) Subject: [pypy-svn] r71065 - in pypy/trunk/pypy/jit/backend: test x86 Message-ID: <20100202161045.1FE7D1683E0@codespeak.net> Author: arigo Date: Tue Feb 2 17:10:44 2010 New Revision: 71065 Modified: pypy/trunk/pypy/jit/backend/test/runner_test.py pypy/trunk/pypy/jit/backend/x86/regalloc.py Log: Test and fix: setfield_gc and setarrayitem_gc failed if the field's value we try to set is a ConstFloat. Modified: pypy/trunk/pypy/jit/backend/test/runner_test.py ============================================================================== --- pypy/trunk/pypy/jit/backend/test/runner_test.py (original) +++ pypy/trunk/pypy/jit/backend/test/runner_test.py Tue Feb 2 17:10:44 2010 @@ -546,6 +546,12 @@ res = self.execute_operation(rop.GETFIELD_GC, [t_box], 'float', descr=floatdescr) assert res.value == 3.4 + # + self.execute_operation(rop.SETFIELD_GC, [t_box, ConstFloat(-3.6)], + 'void', descr=floatdescr) + res = self.execute_operation(rop.GETFIELD_GC, [t_box], + 'float', descr=floatdescr) + assert res.value == -3.6 def test_passing_guards(self): @@ -553,7 +559,7 @@ nullbox = self.null_instance() all = [(rop.GUARD_TRUE, [BoxInt(1)]), (rop.GUARD_FALSE, [BoxInt(0)]), - (rop.GUARD_VALUE, [BoxInt(42), BoxInt(42)]), + (rop.GUARD_VALUE, [BoxInt(42), ConstInt(42)]), ] if not self.avoid_instances: all.extend([ @@ -561,7 +567,7 @@ (rop.GUARD_ISNULL, [nullbox]) ]) if self.cpu.supports_floats: - all.append((rop.GUARD_VALUE, [BoxFloat(3.5), BoxFloat(3.5)])) + all.append((rop.GUARD_VALUE, [BoxFloat(3.5), ConstFloat(3.5)])) for (opname, args) in all: assert self.execute_operation(opname, args, 'void') == None assert not self.guard_failed @@ -580,14 +586,14 @@ nullbox = self.null_instance() all = [(rop.GUARD_TRUE, [BoxInt(0)]), (rop.GUARD_FALSE, [BoxInt(1)]), - (rop.GUARD_VALUE, [BoxInt(42), BoxInt(41)]), + (rop.GUARD_VALUE, [BoxInt(42), ConstInt(41)]), ] if not self.avoid_instances: all.extend([ (rop.GUARD_NONNULL, [nullbox]), (rop.GUARD_ISNULL, [t_box])]) if self.cpu.supports_floats: - all.append((rop.GUARD_VALUE, [BoxFloat(-1.0), BoxFloat(1.0)])) + all.append((rop.GUARD_VALUE, [BoxFloat(-1.0), ConstFloat(1.0)])) for opname, args in all: assert self.execute_operation(opname, args, 'void') == None assert self.guard_failed @@ -740,7 +746,7 @@ BoxFloat(3.5)], 'void', descr=arraydescr) self.execute_operation(rop.SETARRAYITEM_GC, [a_box, BoxInt(2), - BoxFloat(4.5)], + ConstFloat(4.5)], 'void', descr=arraydescr) r = self.execute_operation(rop.GETARRAYITEM_GC, [a_box, BoxInt(1)], 'float', descr=arraydescr) Modified: pypy/trunk/pypy/jit/backend/x86/regalloc.py ============================================================================== --- pypy/trunk/pypy/jit/backend/x86/regalloc.py (original) +++ pypy/trunk/pypy/jit/backend/x86/regalloc.py Tue Feb 2 17:10:44 2010 @@ -216,8 +216,9 @@ selected_reg=None, imm_fine=True, need_lower_byte=False): if var.type == FLOAT: + # always pass imm_fine=False for now in this case return self.xrm.make_sure_var_in_reg(var, forbidden_vars, - selected_reg, imm_fine, + selected_reg, False, need_lower_byte) else: return self.rm.make_sure_var_in_reg(var, forbidden_vars, From cfbolz at codespeak.net Tue Feb 2 17:38:46 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Tue, 2 Feb 2010 17:38:46 +0100 (CET) Subject: [pypy-svn] r71066 - pypy/branch/oprofile-support/pypy/jit/backend/x86/test Message-ID: <20100202163846.947831683C5@codespeak.net> Author: cfbolz Date: Tue Feb 2 17:38:46 2010 New Revision: 71066 Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_runner.py Log: oops, this belongs to the last commit Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_runner.py ============================================================================== --- pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_runner.py (original) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/test/test_runner.py Tue Feb 2 17:38:46 2010 @@ -310,6 +310,59 @@ else: assert result != expected + def test_compile_bridge_check_profile_info(self): + from pypy.jit.backend.x86.test.test_assembler import FakeProfileAgent + self.cpu.profile_agent = agent = FakeProfileAgent() + + i0 = BoxInt() + i1 = BoxInt() + i2 = BoxInt() + faildescr1 = BasicFailDescr(1) + faildescr2 = BasicFailDescr(2) + looptoken = LoopToken() + class FakeString(object): + def __init__(self, val): + self.val = val + + def _get_str(self): + return self.val + + operations = [ + ResOperation(rop.DEBUG_MERGE_POINT, [FakeString("hello")], None), + ResOperation(rop.INT_ADD, [i0, ConstInt(1)], i1), + ResOperation(rop.INT_LE, [i1, ConstInt(9)], i2), + ResOperation(rop.GUARD_TRUE, [i2], None, descr=faildescr1), + ResOperation(rop.JUMP, [i1], None, descr=looptoken), + ] + inputargs = [i0] + operations[3].fail_args = [i1] + self.cpu.compile_loop(inputargs, operations, looptoken) + name, loopaddress, loopsize = agent.functions[0] + assert name == "Loop # 0: hello" + assert loopaddress <= looptoken._x86_loop_code + assert loopsize >= 40 # randomish number + + i1b = BoxInt() + i3 = BoxInt() + bridge = [ + ResOperation(rop.INT_LE, [i1b, ConstInt(19)], i3), + ResOperation(rop.GUARD_TRUE, [i3], None, descr=faildescr2), + ResOperation(rop.DEBUG_MERGE_POINT, [FakeString("bye")], None), + ResOperation(rop.JUMP, [i1b], None, descr=looptoken), + ] + bridge[1].fail_args = [i1b] + + self.cpu.compile_bridge(faildescr1, [i1b], bridge) + name, address, size = agent.functions[1] + assert name == "Bridge # 0: bye" + assert address == loopaddress + loopsize + assert size >= 10 # randomish number + + self.cpu.set_future_value_int(0, 2) + fail = self.cpu.execute_token(looptoken) + assert fail.identifier == 2 + res = self.cpu.get_latest_value_int(0) + assert res == 20 class TestX86OverflowMC(TestX86): From cfbolz at codespeak.net Tue Feb 2 17:40:30 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Tue, 2 Feb 2010 17:40:30 +0100 (CET) Subject: [pypy-svn] r71067 - in pypy/branch/oprofile-support/pypy: config jit/backend/x86 Message-ID: <20100202164030.EAB791683DE@codespeak.net> Author: cfbolz Date: Tue Feb 2 17:40:30 2010 New Revision: 71067 Modified: pypy/branch/oprofile-support/pypy/config/translationoption.py pypy/branch/oprofile-support/pypy/jit/backend/x86/oprofile.py pypy/branch/oprofile-support/pypy/jit/backend/x86/profagent.py pypy/branch/oprofile-support/pypy/jit/backend/x86/runner.py Log: integrate oprofile Modified: pypy/branch/oprofile-support/pypy/config/translationoption.py ============================================================================== --- pypy/branch/oprofile-support/pypy/config/translationoption.py (original) +++ pypy/branch/oprofile-support/pypy/config/translationoption.py Tue Feb 2 17:40:30 2010 @@ -108,6 +108,9 @@ ["off", "profile", "steps", "detailed"], default="profile", # XXX for now cmdline="--jit-debug"), + ChoiceOption("jit_profiler", "integrate profiler support into the JIT", + ["off", "oprofile"], + default="off"), # misc BoolOption("verbose", "Print extra information", default=False), Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/oprofile.py ============================================================================== --- pypy/branch/oprofile-support/pypy/jit/backend/x86/oprofile.py (original) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/oprofile.py Tue Feb 2 17:40:30 2010 @@ -3,6 +3,7 @@ from pypy.translator.tool.cbuild import ExternalCompilationInfo from pypy.rlib.objectmodel import we_are_translated from pypy.rlib.rposix import get_errno +from pypy.jit.backend.x86 import profagent class OProfileError(Exception): def __init__(self, errno, where): @@ -39,28 +40,29 @@ rffi.INT, compilation_info=eci) -def startup(cpu): - if not OPROFILE_AVAILABLE: - return - agent = op_open_agent() - if not agent: - cpu._oprofile_agent = rffi.cast(rffi.VOIDP, 0) - raise OProfileError(get_errno(), "startup") - cpu._oprofile_agent = agent - -def shutdown(cpu): - if not OPROFILE_AVAILABLE: - return - if cpu._oprofile_agent: - success = op_close_agent(cpu._oprofile_agent) + +class OProfileAgent(profagent.ProfileAgent): + + def startup(self): + if not OPROFILE_AVAILABLE: + return + agent = op_open_agent() + if not agent: + raise OProfileError(get_errno(), "startup") + self.agent = agent + + def shutdown(self): + if not OPROFILE_AVAILABLE: + return + success = op_close_agent(self.agent) if success != 0: raise OProfileError(get_errno(), "shutdown") -def native_code_written(cpu, name, address, size): - assert size > 0 - if not OPROFILE_AVAILABLE: - return - uaddress = rffi.cast(rffi.ULONG, address) - success = op_write_native_code(cpu._oprofile_agent, name, uaddress, rffi.cast(rffi.VOIDP, 0), size) - if success != 0: - raise OProfileError(get_errno(), "write") + def native_code_written(self, name, address, size): + assert size > 0 + if not OPROFILE_AVAILABLE: + return + uaddress = rffi.cast(rffi.ULONG, address) + success = op_write_native_code(self.agent, name, uaddress, rffi.cast(rffi.VOIDP, 0), size) + if success != 0: + raise OProfileError(get_errno(), "write") Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/profagent.py ============================================================================== --- pypy/branch/oprofile-support/pypy/jit/backend/x86/profagent.py (original) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/profagent.py Tue Feb 2 17:40:30 2010 @@ -8,5 +8,5 @@ def shutdown(self): pass def native_code_written(self, name, address, size): - raise NotImplementedError + pass Modified: pypy/branch/oprofile-support/pypy/jit/backend/x86/runner.py ============================================================================== --- pypy/branch/oprofile-support/pypy/jit/backend/x86/runner.py (original) +++ pypy/branch/oprofile-support/pypy/jit/backend/x86/runner.py Tue Feb 2 17:40:30 2010 @@ -7,6 +7,7 @@ from pypy.jit.metainterp import history from pypy.jit.backend.x86.assembler import Assembler386 from pypy.jit.backend.x86.regalloc import FORCE_INDEX_OFS +from pypy.jit.backend.x86.profagent import ProfileAgent from pypy.jit.backend.llsupport.llmodel import AbstractLLCPU class CPU386(AbstractLLCPU): @@ -20,13 +21,15 @@ gcdescr=None): AbstractLLCPU.__init__(self, rtyper, stats, opts, translate_support_code, gcdescr) - profile_agent = None + + profile_agent = ProfileAgent() if rtyper is not None: config = rtyper.annotator.translator.config if config.translation.jit_profiler == "oprofile": from pypy.jit.backend.x86 import oprofile profile_agent = oprofile.OProfileAgent() - self._profile_agent = profile_agent + + self.profile_agent = profile_agent def setup(self): if self.opts is not None: @@ -40,12 +43,10 @@ return self.assembler.leave_jitted_hook def setup_once(self): - if self._profile_agent is not None: - self._profile_agent.setup() + self.profile_agent.startup() def finish_once(self): - if self._profile_agent is not None: - self._profile_agent.shutdown() + self.profile_agent.shutdown() def compile_loop(self, inputargs, operations, looptoken): self.assembler.assemble_loop(inputargs, operations, looptoken) From arigo at codespeak.net Wed Feb 3 12:54:49 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Wed, 3 Feb 2010 12:54:49 +0100 (CET) Subject: [pypy-svn] r71079 - in pypy/branch/rsre/pypy/rlib/rsre: . test Message-ID: <20100203115449.004061683DA@codespeak.net> Author: arigo Date: Wed Feb 3 12:54:49 2010 New Revision: 71079 Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py pypy/branch/rsre/pypy/rlib/rsre/test/test_search.py Log: Test and fix. Modified: pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/rsre_core.py Wed Feb 3 12:54:49 2010 @@ -61,11 +61,12 @@ # This id marks the end of a group. self.lastindex = mark_nr / 2 + 1 if mark_nr >= self.marks_count: - for i in range(self.marks_count, mark_nr): - self.marks[i] = -1 + count = self.marks_count self.marks_count = mark_nr + 1 while mark_nr >= len(self.marks): self.marks = self.marks + [0] * len(self.marks) + for i in range(count, mark_nr): + self.marks[i] = -1 self.marks[mark_nr] = position def get_marks(self, group_index): Modified: pypy/branch/rsre/pypy/rlib/rsre/test/test_search.py ============================================================================== --- pypy/branch/rsre/pypy/rlib/rsre/test/test_search.py (original) +++ pypy/branch/rsre/pypy/rlib/rsre/test/test_search.py Wed Feb 3 12:54:49 2010 @@ -1,17 +1,27 @@ +import re, _sre from pypy.rlib.rsre import rsre -# \s*(.*?) -r_code1 = [17, 18, 1, 21, 131091, 6, 6, 60, 105, 116, 101, 109, 62, 0, -0, 0, 0, 0, 0, 19, 60, 19, 105, 19, 116, 19, 101, 19, 109, 19, 62, 29, -9, 0, 65535, 15, 4, 9, 2, 0, 1, 19, 60, 19, 116, 19, 105, 19, 116, 19, -108, 19, 101, 19, 62, 21, 0, 31, 5, 0, 65535, 2, 1, 21, 1, 19, 60, 19, -47, 19, 116, 19, 105, 19, 116, 19, 108, 19, 101, 19, 62, 1] - - class TestSearch: - def test_simple(self): + def get_code(self, regexp): + class GotIt(Exception): + pass + def my_compile(pattern, flags, code, *args): + raise GotIt(code) + saved = _sre.compile + try: + _sre.compile = my_compile + try: + re.compile(regexp) + except GotIt, e: + return e.args[0] + finally: + _sre.compile = saved + assert 0, "did not reach my_compile()?" + + def test_code1(self): + r_code1 = self.get_code(r'\s*(.*?)') state = rsre.SimpleStringState("foo abcdef") res = state.search(r_code1) assert res is True @@ -19,10 +29,21 @@ assert groups[0] == (3, 29) assert groups[1] == (18, 21) - -if __name__ == '__main__': - import re, _sre - def my_compile(pattern, flags, code, *args): - print code - _sre.compile = my_compile - re.compile(r'\s*(.*?)') + def test_code2_fail(self): + r_code2 = self.get_code(r'x((a)|(b)|(c)|(d)|(e)|(f)|(g)|(h)|(i))|(j)') + state = rsre.SimpleStringState("i") + res = state.match(r_code2) + assert res is False + + def test_code2_success(self): + r_code2 = self.get_code(r'x((a)|(b)|(c)|(d)|(e)|(f)|(g)|(h)|(i))|(j)') + state = rsre.SimpleStringState("j") + res = state.match(r_code2) + assert res is True + groups = state.create_regs(11) + assert groups[0] == (0, 1) + for i in range(1, 12): + if i == 11: + assert groups[i] == (0, 1) + else: + assert groups[i] == (-1, -1) From arigo at codespeak.net Wed Feb 3 13:01:02 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Wed, 3 Feb 2010 13:01:02 +0100 (CET) Subject: [pypy-svn] r71080 - pypy/branch/rsre/pypy/rlib/rsre/test Message-ID: <20100203120102.128411683CE@codespeak.net> Author: arigo Date: Wed Feb 3 13:01:01 2010 New Revision: 71080 Added: pypy/branch/rsre/pypy/rlib/rsre/test/test_zinterp.py (contents, props changed) Log: Add a minimal test that verifies that rsre is RPython. Added: pypy/branch/rsre/pypy/rlib/rsre/test/test_zinterp.py ============================================================================== --- (empty file) +++ pypy/branch/rsre/pypy/rlib/rsre/test/test_zinterp.py Wed Feb 3 13:01:01 2010 @@ -0,0 +1,12 @@ +# minimal test: just checks that (parts of) rsre can be translated + +from pypy.rpython.test.test_llinterp import gengraph +from pypy.rlib.rsre.test import targetrsre + +def main(n): + state = targetrsre.rsre.SimpleStringState(str(n)) + return state.search(targetrsre.r_code1) + + +def test_gengraph(): + t, typer, graph = gengraph(main, [int]) From pedronis at codespeak.net Wed Feb 3 13:32:04 2010 From: pedronis at codespeak.net (pedronis at codespeak.net) Date: Wed, 3 Feb 2010 13:32:04 +0100 (CET) Subject: [pypy-svn] r71081 - pypy/trunk/pypy/interpreter Message-ID: <20100203123204.7F7121683D6@codespeak.net> Author: pedronis Date: Wed Feb 3 13:32:04 2010 New Revision: 71081 Modified: pypy/trunk/pypy/interpreter/pyframe.py Log: remove 2.4 compatibility code Modified: pypy/trunk/pypy/interpreter/pyframe.py ============================================================================== --- pypy/trunk/pypy/interpreter/pyframe.py (original) +++ pypy/trunk/pypy/interpreter/pyframe.py Wed Feb 3 13:32:04 2010 @@ -124,10 +124,7 @@ return self.execute_frame() def execute_generator_frame(self, w_inputvalue, ex=False): - # opcode semantic change in CPython 2.5: we must pass an input value - # when resuming a generator, which goes into the value stack. - # It's not working because the value of magic must be changed in PyCode - if self.pycode.magic >= 0xa0df294 and self.last_instr != -1 and not ex: + if self.last_instr != -1 and not ex: self.pushvalue(w_inputvalue) return self.execute_frame() From arigo at codespeak.net Wed Feb 3 15:46:59 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Wed, 3 Feb 2010 15:46:59 +0100 (CET) Subject: [pypy-svn] r71086 - in pypy/trunk/pypy/rlib/rsre: . test Message-ID: <20100203144659.54204168040@codespeak.net> Author: arigo Date: Wed Feb 3 15:46:58 2010 New Revision: 71086 Added: pypy/trunk/pypy/rlib/rsre/test/make_x.py - copied unchanged from r71085, pypy/branch/rsre/pypy/rlib/rsre/test/make_x.py pypy/trunk/pypy/rlib/rsre/test/targetrsre.py - copied unchanged from r71085, pypy/branch/rsre/pypy/rlib/rsre/test/targetrsre.py pypy/trunk/pypy/rlib/rsre/test/test_search.py - copied unchanged from r71085, pypy/branch/rsre/pypy/rlib/rsre/test/test_search.py pypy/trunk/pypy/rlib/rsre/test/test_zinterp.py - copied unchanged from r71085, pypy/branch/rsre/pypy/rlib/rsre/test/test_zinterp.py Modified: pypy/trunk/pypy/rlib/rsre/rsre_char.py pypy/trunk/pypy/rlib/rsre/rsre_core.py Log: Merge branch/rsre, making our regular expressions more speedy. They are now "only" about 2x slower than CPython. Modified: pypy/trunk/pypy/rlib/rsre/rsre_char.py ============================================================================== --- pypy/trunk/pypy/rlib/rsre/rsre_char.py (original) +++ pypy/trunk/pypy/rlib/rsre/rsre_char.py Wed Feb 3 15:46:58 2010 @@ -3,6 +3,7 @@ """ import sys from pypy.rlib.rsre._rsre_platform import tolower, isalnum +from pypy.rlib.unroll import unrolling_iterable # Note: the unicode parts of this module require you to call # rsre.set_unicode_db() first, to select one of the modules @@ -47,6 +48,7 @@ def getlower(char_ord, flags): if flags & SRE_FLAG_UNICODE: + assert unicodedb is not None char_ord = unicodedb.tolower(char_ord) elif flags & SRE_FLAG_LOCALE: return tolower(char_ord) @@ -89,18 +91,21 @@ return code < 128 and (ascii_char_info[code] & 1 != 0) def is_uni_digit(code): + assert unicodedb is not None return unicodedb.isdigit(code) def is_space(code): return code < 128 and (ascii_char_info[code] & 2 != 0) def is_uni_space(code): + assert unicodedb is not None return unicodedb.isspace(code) def is_word(code): return code < 128 and (ascii_char_info[code] & 16 != 0) def is_uni_word(code): + assert unicodedb is not None return unicodedb.isalnum(code) or code == underline def is_loc_alnum(code): @@ -113,21 +118,22 @@ return code == linebreak def is_uni_linebreak(code): + assert unicodedb is not None return unicodedb.islinebreak(code) #### Category dispatch def category_dispatch(category_code, char_code): - try: - function, negate = category_dispatch_table[category_code] - except IndexError: - return False - result = function(char_code) - if negate: - return not result + for i, (function, negate) in category_dispatch_unroll: + if category_code == i: + result = function(char_code) + if negate: + return not result + else: + return result else: - return result + return False # Maps opcodes by indices to (function, negate) tuples. category_dispatch_table = [ @@ -139,98 +145,93 @@ (is_uni_word, True), (is_uni_linebreak, False), (is_uni_linebreak, True) ] +category_dispatch_unroll = unrolling_iterable( + enumerate(category_dispatch_table)) ##### Charset evaluation -SET_OK = 1 -SET_NOT_OK = -1 -SET_NOT_FINISHED = 0 +SET_OK = -1 +SET_NOT_OK = -2 def check_charset(char_code, context): """Checks whether a character matches set of arbitrary length. Currently assumes the set starts at the first member of pattern_codes.""" - result = SET_NOT_FINISHED - context.set_ok = SET_OK - backup_code_position = context.code_position - while result == SET_NOT_FINISHED: - opcode = context.peek_code() - try: - function = set_dispatch_table[opcode] - except IndexError: - return False - result = function(context, char_code) - context.code_position = backup_code_position - return result == SET_OK + pattern_codes = context.pattern_codes + index = context.code_position + negated = SET_OK + while index >= 0: + opcode = pattern_codes[index] + for i, function in set_dispatch_unroll: + if function is not None and opcode == i: + index = function(pattern_codes, index, char_code) + break + else: + if opcode == 26: # NEGATE + negated ^= (SET_OK ^ SET_NOT_OK) + index += 1 + else: + return False + return index == negated -def set_failure(ctx, char_code): - return -ctx.set_ok +def set_failure(pat, index, char_code): + return SET_NOT_OK -def set_literal(ctx, char_code): +def set_literal(pat, index, char_code): # - if ctx.peek_code(1) == char_code: - return ctx.set_ok + if pat[index+1] == char_code: + return SET_OK else: - ctx.skip_code(2) - return SET_NOT_FINISHED + return index + 2 -def set_category(ctx, char_code): +def set_category(pat, index, char_code): # - if category_dispatch(ctx.peek_code(1), char_code): - return ctx.set_ok + if category_dispatch(pat[index+1], char_code): + return SET_OK else: - ctx.skip_code(2) - return SET_NOT_FINISHED + return index + 2 -def set_charset(ctx, char_code): +def set_charset(pat, index, char_code): # (16 bits per code word) - ctx.skip_code(1) # point to beginning of bitmap if CODESIZE == 2: - if char_code < 256 and ctx.peek_code(char_code >> 4) \ + if char_code < 256 and pat[index+1+(char_code >> 4)] \ & (1 << (char_code & 15)): - return ctx.set_ok - ctx.skip_code(16) # skip bitmap + return SET_OK + return index + 17 # skip bitmap else: - if char_code < 256 and ctx.peek_code(char_code >> 5) \ + if char_code < 256 and pat[index+1+(char_code >> 5)] \ & (1 << (char_code & 31)): - return ctx.set_ok - ctx.skip_code(8) # skip bitmap - return SET_NOT_FINISHED + return SET_OK + return index + 9 # skip bitmap -def set_range(ctx, char_code): +def set_range(pat, index, char_code): # - if ctx.peek_code(1) <= char_code <= ctx.peek_code(2): - return ctx.set_ok - ctx.skip_code(3) - return SET_NOT_FINISHED - -def set_negate(ctx, char_code): - ctx.set_ok = -ctx.set_ok - ctx.skip_code(1) - return SET_NOT_FINISHED + if pat[index+1] <= char_code <= pat[index+2]: + return SET_OK + return index + 3 -def set_bigcharset(ctx, char_code): +def set_bigcharset(pat, index, char_code): # <256 blockindices> # XXX this function probably needs a makeover - count = ctx.peek_code(1) - ctx.skip_code(2) + count = pat[index+1] + index += 2 if char_code < 65536: block_index = char_code >> 8 # NB: there are CODESIZE block indices per bytecode - a = to_byte_array(ctx.peek_code(block_index / CODESIZE)) + a = to_byte_array(pat[index+(block_index / CODESIZE)]) block = a[block_index % CODESIZE] - ctx.skip_code(256 / CODESIZE) # skip block indices + index += 256 / CODESIZE # skip block indices if CODESIZE == 2: shift = 4 else: shift = 5 - block_value = ctx.peek_code(block * (32 / CODESIZE) - + ((char_code & 255) >> shift)) + block_value = pat[index+(block * (32 / CODESIZE) + + ((char_code & 255) >> shift))] if block_value & (1 << (char_code & ((8 * CODESIZE) - 1))): - return ctx.set_ok + return SET_OK else: - ctx.skip_code(256 / CODESIZE) # skip block indices - ctx.skip_code(count * (32 / CODESIZE)) # skip blocks - return SET_NOT_FINISHED + index += 256 / CODESIZE # skip block indices + index += count * (32 / CODESIZE) # skip blocks + return index def to_byte_array(int_value): """Creates a list of bytes out of an integer representing data that is @@ -247,5 +248,8 @@ set_failure, None, None, None, None, None, None, None, None, set_category, set_charset, set_bigcharset, None, None, None, None, None, None, None, set_literal, None, None, None, None, - None, None, set_negate, set_range + None, None, + None, # NEGATE + set_range ] +set_dispatch_unroll = unrolling_iterable(enumerate(set_dispatch_table)) Modified: pypy/trunk/pypy/rlib/rsre/rsre_core.py ============================================================================== --- pypy/trunk/pypy/rlib/rsre/rsre_core.py (original) +++ pypy/trunk/pypy/rlib/rsre/rsre_core.py Wed Feb 3 15:46:58 2010 @@ -12,6 +12,7 @@ from pypy.rlib.rsre import rsre_char from pypy.rlib.rsre.rsre_char import SRE_INFO_PREFIX, SRE_INFO_LITERAL from pypy.rlib.rsre.rsre_char import OPCODE_INFO, MAXREPEAT +from pypy.rlib.unroll import unrolling_iterable #### Core classes @@ -19,9 +20,16 @@ def reset(self): self.string_position = self.start - self.marks = [] + self.marks = [0, 0, 0, 0] self.lastindex = -1 - self.marks_stack = [] + self.marks_count = 0 + # self.saved_marks is a list of ints that stores saved marks. + # For example, if s1..sn, t1..tn are two sets of saved marks: + # [s1,..,sn,lastindex,x, t1,..,tn,lastindex,y, extra_unused...] + # ^------------------' ^------------------' + # with x and y saved indices to allow pops. + self.saved_marks = [] + self.saved_marks_top = 0 self.context_stack = [] self.repeat = None @@ -38,7 +46,7 @@ for group in range(group_count): mark_index = 2 * group start = end = -1 - if mark_index + 1 < len(self.marks): + if mark_index + 1 < self.marks_count: start1 = self.marks[mark_index] end1 = self.marks[mark_index + 1] if start1 >= 0 and end1 >= 0: @@ -48,32 +56,62 @@ return regs def set_mark(self, mark_nr, position): + assert mark_nr >= 0 if mark_nr & 1: # This id marks the end of a group. self.lastindex = mark_nr / 2 + 1 - if mark_nr >= len(self.marks): - self.marks.extend([-1] * (mark_nr - len(self.marks) + 1)) + if mark_nr >= self.marks_count: + count = self.marks_count + self.marks_count = mark_nr + 1 + while mark_nr >= len(self.marks): + self.marks = self.marks + [0] * len(self.marks) + for i in range(count, mark_nr): + self.marks[i] = -1 self.marks[mark_nr] = position def get_marks(self, group_index): marks_index = 2 * group_index - if len(self.marks) > marks_index + 1: + if self.marks_count > marks_index + 1: return self.marks[marks_index], self.marks[marks_index + 1] else: return -1, -1 def marks_push(self): - self.marks_stack.append((self.marks[:], self.lastindex)) + # Create in saved_marks: [......, m1,..,mn,lastindex,p, ...........] + # ^p ^newsize + p = self.saved_marks_top + n = self.marks_count + assert p >= 0 + newsize = p + n + 2 + while len(self.saved_marks) < newsize: + self.saved_marks.append(-1) + for i in range(n): + self.saved_marks[p+i] = self.marks[i] + self.saved_marks[p+n] = self.lastindex + self.saved_marks[p+n+1] = p + self.saved_marks_top = newsize def marks_pop(self): - self.marks, self.lastindex = self.marks_stack.pop() + p0 = self.marks_pop_keep() + self.saved_marks_top = p0 def marks_pop_keep(self): - marks, self.lastindex = self.marks_stack[-1] - self.marks = marks[:] + # Restore from saved_marks: [......, m1,..,mn,lastindex,p, .........] + # ^p0 ^p1 + p1 = self.saved_marks_top - 2 + assert p1 >= 0 + p0 = self.saved_marks[p1+1] + n = p1 - p0 + assert p0 >= 0 and n >= 0 + self.lastindex = self.saved_marks[p1] + for i in range(n): + self.marks[i] = self.saved_marks[p0+i] + self.marks_count = n + return p0 def marks_pop_discard(self): - self.marks_stack.pop() + p0 = self.saved_marks[self.saved_marks_top-1] + self.saved_marks_top = p0 class MatchContext(rsre_char.MatchContextBase): @@ -190,7 +228,8 @@ assert pattern_offset >= 0 i = 0 string_position = state.string_position - while string_position < state.end: + end = state.end + while string_position < end: while True: char_ord = state.get_char_ord(string_position) if char_ord != prefix[i]: @@ -208,20 +247,22 @@ if flags & SRE_INFO_LITERAL: return True # matched all of pure literal pattern start = pattern_offset + 2 * prefix_skip - if match(state, pattern_codes[start:]): + if match(state, pattern_codes, start): return True i = pattern_codes[overlap_offset + i] break string_position += 1 return False -def match(state, pattern_codes): +def match(state, pattern_codes, pstart=0): # Optimization: Check string length. pattern_codes[3] contains the # minimum length for a string to possibly match. - if pattern_codes[0] == OPCODE_INFO and pattern_codes[3] > 0: - if state.end - state.string_position < pattern_codes[3]: + if pattern_codes[pstart] == OPCODE_INFO and pattern_codes[pstart+3] > 0: + # <1=skip> <2=flags> <3=min> + if state.end - state.string_position < pattern_codes[pstart+3]: return False - state.context_stack.append(MatchContext(state, pattern_codes)) + pstart += pattern_codes[pstart+1] + 1 + state.context_stack.append(MatchContext(state, pattern_codes, pstart)) has_matched = MatchContext.UNDECIDED while len(state.context_stack) > 0: context = state.context_stack[-1] @@ -242,9 +283,11 @@ opcode = context.resume_at_opcode else: opcode = context.peek_code() - try: - has_finished = opcode_dispatch_table[opcode](context) - except IndexError: + for i, function in opcode_dispatch_unroll: + if function is not None and i == opcode: + has_finished = function(context) + break + else: raise RuntimeError("Internal re error. Unknown opcode: %s" % opcode) if not has_finished: context.resume_at_opcode = opcode @@ -419,7 +462,6 @@ ctx.has_matched = ctx.MATCHED return True ctx.state.marks_push() - # XXX literal optimization missing here # Case 2: Repetition is resumed (aka backtracked) else: @@ -432,14 +474,34 @@ ctx.skip_char(-1) count -= 1 ctx.state.marks_pop_keep() - + # Initialize the actual backtracking if count >= mincount: - ctx.state.string_position = ctx.string_position - ctx.push_new_context(ctx.peek_code(1) + 1) - ctx.backup_value(mincount) - ctx.backup_value(count) - return False + # + ok = True + nextidx = ctx.peek_code(1) + if ctx.peek_code(nextidx + 1) == 19: # 19 == OPCODES["literal"] + # tail starts with a literal. skip positions where + # the rest of the pattern cannot possibly match + chr = ctx.peek_code(nextidx + 2) + if ctx.at_end(): + ctx.skip_char(-1) + count -= 1 + ok = count >= mincount + while ok: + if ctx.peek_char() == chr: + break + ctx.skip_char(-1) + count -= 1 + ok = count >= mincount + # + + if ok: + ctx.state.string_position = ctx.string_position + ctx.push_new_context(ctx.peek_code(1) + 1) + ctx.backup_value(mincount) + ctx.backup_value(count) + return False # Backtracking failed ctx.state.marks_pop_discard() @@ -785,27 +847,32 @@ """Returns the number of repetitions of a single item, starting from the current string position. The code pointer is expected to point to a REPEAT_ONE operation (with the repeated 4 ahead).""" - count = 0 real_maxcount = ctx.state.end - ctx.string_position if maxcount < real_maxcount and maxcount != MAXREPEAT: real_maxcount = maxcount - # XXX could special case every single character pattern here, as in C. - # This is a general solution, a bit hackisch, but works and should be - # efficient. - code_position = ctx.code_position + # First, special-cases for common single character patterns string_position = ctx.string_position - ctx.skip_code(4) - reset_position = ctx.code_position - while count < real_maxcount: - # this works because the single character pattern is followed by - # a success opcode - ctx.code_position = reset_position - opcode_dispatch_table[ctx.peek_code()](ctx) - if ctx.has_matched == ctx.NOT_MATCHED: + code = ctx.peek_code(4) + for i, function in count_repetitions_unroll: + if function is not None and code == i: + count = function(ctx, real_maxcount) break - count += 1 - ctx.has_matched = ctx.UNDECIDED - ctx.code_position = code_position + else: + # This is a general solution, a bit hackisch, but works + code_position = ctx.code_position + count = 0 + ctx.skip_code(4) + reset_position = ctx.code_position + while count < real_maxcount: + # this works because the single character pattern is followed by + # a success opcode + ctx.code_position = reset_position + opcode_dispatch_table[code](ctx) + if ctx.has_matched == ctx.NOT_MATCHED: + break + count += 1 + ctx.has_matched = ctx.UNDECIDED + ctx.code_position = code_position ctx.string_position = string_position return count @@ -833,19 +900,100 @@ None, #SUBPATTERN, op_min_repeat_one, ] +opcode_dispatch_unroll = unrolling_iterable(enumerate(opcode_dispatch_table)) + +##### count_repetitions dispatch + +def general_cr_in(ctx, maxcount, ignore): + code_position = ctx.code_position + count = 0 + while count < maxcount: + ctx.code_position = code_position + ctx.skip_code(6) # set op pointer to the set code + char_code = ctx.peek_char(count) + if ignore: + char_code = ctx.state.lower(char_code) + if not rsre_char.check_charset(char_code, ctx): + break + count += 1 + ctx.code_position = code_position + return count +general_cr_in._annspecialcase_ = 'specialize:arg(2)' + +def cr_in(ctx, maxcount): + return general_cr_in(ctx, maxcount, False) + +def cr_in_ignore(ctx, maxcount): + return general_cr_in(ctx, maxcount, True) + +def cr_any(ctx, maxcount): + count = 0 + while count < maxcount: + if ctx.peek_char(count) == rsre_char.linebreak: + break + count += 1 + return count + +def cr_any_all(ctx, maxcount): + return maxcount + +def general_cr_literal(ctx, maxcount, ignore, negate): + chr = ctx.peek_code(5) + count = 0 + while count < maxcount: + char_code = ctx.peek_char(count) + if ignore: + char_code = ctx.state.lower(char_code) + if negate: + if char_code == chr: + break + else: + if char_code != chr: + break + count += 1 + return count +general_cr_literal._annspecialcase_ = 'specialize:arg(2,3)' + +def cr_literal(ctx, maxcount): + return general_cr_literal(ctx, maxcount, False, False) + +def cr_literal_ignore(ctx, maxcount): + return general_cr_literal(ctx, maxcount, True, False) + +def cr_not_literal(ctx, maxcount): + return general_cr_literal(ctx, maxcount, False, True) + +def cr_not_literal_ignore(ctx, maxcount): + return general_cr_literal(ctx, maxcount, True, True) + +count_repetitions_table = [ + None, None, + cr_any, cr_any_all, + None, None, + None, + None, + None, + None, + None, None, + None, None, None, + cr_in, cr_in_ignore, + None, None, + cr_literal, cr_literal_ignore, + None, + None, + None, + cr_not_literal, cr_not_literal_ignore, +] +count_repetitions_unroll = unrolling_iterable( + enumerate(count_repetitions_table)) ##### At dispatch def at_dispatch(atcode, context): - try: - function, negate = at_dispatch_table[atcode] - except IndexError: - return False - result = function(context) - if negate: - return not result - else: - return result + for i, function in at_dispatch_unroll: + if i == atcode: + return function(context) + return False def at_beginning(ctx): return ctx.at_beginning() @@ -865,17 +1013,27 @@ def at_boundary(ctx): return ctx.at_boundary(rsre_char.is_word) +def at_non_boundary(ctx): + return not at_boundary(ctx) + def at_loc_boundary(ctx): return ctx.at_boundary(rsre_char.is_loc_word) +def at_loc_non_boundary(ctx): + return not at_loc_boundary(ctx) + def at_uni_boundary(ctx): return ctx.at_boundary(rsre_char.is_uni_word) -# Maps opcodes by indices to (function, negate) tuples. +def at_uni_non_boundary(ctx): + return not at_uni_boundary(ctx) + +# Maps opcodes by indices to functions at_dispatch_table = [ - (at_beginning, False), (at_beginning_line, False), (at_beginning, False), - (at_boundary, False), (at_boundary, True), - (at_end, False), (at_end_line, False), (at_end_string, False), - (at_loc_boundary, False), (at_loc_boundary, True), (at_uni_boundary, False), - (at_uni_boundary, True) + at_beginning, at_beginning_line, at_beginning, + at_boundary, at_non_boundary, + at_end, at_end_line, at_end_string, + at_loc_boundary, at_loc_non_boundary, + at_uni_boundary, at_uni_non_boundary, ] +at_dispatch_unroll = unrolling_iterable(enumerate(at_dispatch_table)) From arigo at codespeak.net Wed Feb 3 15:57:37 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Wed, 3 Feb 2010 15:57:37 +0100 (CET) Subject: [pypy-svn] r71087 - pypy/branch/rsre Message-ID: <20100203145737.2B7461680F1@codespeak.net> Author: arigo Date: Wed Feb 3 15:57:36 2010 New Revision: 71087 Removed: pypy/branch/rsre/ Log: Remove merged branch. From afa at codespeak.net Thu Feb 4 13:00:09 2010 From: afa at codespeak.net (afa at codespeak.net) Date: Thu, 4 Feb 2010 13:00:09 +0100 (CET) Subject: [pypy-svn] r71098 - pypy/trunk/pypy/translator/c/gcc Message-ID: <20100204120009.E0FCE168020@codespeak.net> Author: afa Date: Thu Feb 4 13:00:09 2010 New Revision: 71098 Modified: pypy/trunk/pypy/translator/c/gcc/trackgcroot.py Log: Handle more cmove* operations, allow the 'l' suffix Modified: pypy/trunk/pypy/translator/c/gcc/trackgcroot.py ============================================================================== --- pypy/trunk/pypy/translator/c/gcc/trackgcroot.py (original) +++ pypy/trunk/pypy/translator/c/gcc/trackgcroot.py Thu Feb 4 13:00:09 2010 @@ -408,22 +408,12 @@ visit_xorl = binary_insn # used in "xor reg, reg" to create a NULL GC ptr visit_orl = binary_insn - visit_cmove = binary_insn - visit_cmovne = binary_insn - visit_cmovg = binary_insn - visit_cmovge = binary_insn - visit_cmovl = binary_insn - visit_cmovle = binary_insn - visit_cmova = binary_insn - visit_cmovae = binary_insn - visit_cmovb = binary_insn - visit_cmovbe = binary_insn - visit_cmovp = binary_insn - visit_cmovnp = binary_insn - visit_cmovs = binary_insn - visit_cmovns = binary_insn - visit_cmovo = binary_insn - visit_cmovno = binary_insn + # The various cmov* operations + for name in ''' + e ne g ge l le a ae b be p np s ns o no + '''.split(): + locals()['visit_cmov' + name] = binary_insn + locals()['visit_cmov' + name + 'l'] = binary_insn def visit_andl(self, line): match = self.r_binaryinsn.match(line) From afa at codespeak.net Fri Feb 5 14:43:25 2010 From: afa at codespeak.net (afa at codespeak.net) Date: Fri, 5 Feb 2010 14:43:25 +0100 (CET) Subject: [pypy-svn] r71107 - in pypy/trunk/pypy/lib: _ctypes app_test/ctypes_tests Message-ID: <20100205134325.3419B282BD4@codespeak.net> Author: afa Date: Fri Feb 5 14:43:23 2010 New Revision: 71107 Modified: pypy/trunk/pypy/lib/_ctypes/structure.py pypy/trunk/pypy/lib/_ctypes/union.py pypy/trunk/pypy/lib/app_test/ctypes_tests/test_structures.py Log: Another fix in ctypes when a Structure also defines __slots__: getattr(self.__class__, name) won't call __getattribute__. Always use _fieldtypes, this will even be faster. This fixes the pyglet "Hello world" sample, on Windows at least Modified: pypy/trunk/pypy/lib/_ctypes/structure.py ============================================================================== --- pypy/trunk/pypy/lib/_ctypes/structure.py (original) +++ pypy/trunk/pypy/lib/_ctypes/structure.py Fri Feb 5 14:43:23 2010 @@ -180,12 +180,13 @@ def __setattr__(self, name, value): try: - fieldtype = self._fieldtypes[name].ctype + field = self._fieldtypes[name] except KeyError: return _CData.__setattr__(self, name, value) + fieldtype = field.ctype cobj = fieldtype.from_param(value) if ensure_objects(cobj) is not None: - key = keepalive_key(getattr(self.__class__, name).num) + key = keepalive_key(field.num) store_reference(self, key, cobj._objects) arg = cobj._get_buffer_value() if fieldtype._fficompositesize is not None: @@ -199,10 +200,11 @@ if name == '_fieldtypes': return _CData.__getattribute__(self, '_fieldtypes') try: - fieldtype = self._fieldtypes[name].ctype + field = self._fieldtypes[name] except KeyError: return _CData.__getattribute__(self, name) - offset = self.__class__._fieldtypes[name].num + fieldtype = field.ctype + offset = field.num suba = self._subarray(fieldtype, name) return fieldtype._CData_output(suba, self, offset) Modified: pypy/trunk/pypy/lib/_ctypes/union.py ============================================================================== --- pypy/trunk/pypy/lib/_ctypes/union.py (original) +++ pypy/trunk/pypy/lib/_ctypes/union.py Fri Feb 5 14:43:23 2010 @@ -87,21 +87,23 @@ def __getattr__(self, name): try: - fieldtype = self._fieldtypes[name].ctype + field = self._fieldtypes[name] except KeyError: raise AttributeError(name) + fieldtype = field.ctype val = self._ffiarrays[name].fromaddress(self._buffer.buffer, 1) - offset = self.__class__._fieldtypes[name].num + offset = field.num return fieldtype._CData_output(val, self, offset) def __setattr__(self, name, value): try: - fieldtype = self._fieldtypes[name].ctype + field = self._fieldtypes[name] except KeyError: raise AttributeError(name) + fieldtype = field.ctype cobj = fieldtype.from_param(value) if ensure_objects(cobj) is not None: - key = keepalive_key(getattr(self.__class__, name).num) + key = keepalive_key(field.num) store_reference(self, key, cobj._objects) arg = cobj._get_buffer_value() if fieldtype._fficompositesize is not None: Modified: pypy/trunk/pypy/lib/app_test/ctypes_tests/test_structures.py ============================================================================== --- pypy/trunk/pypy/lib/app_test/ctypes_tests/test_structures.py (original) +++ pypy/trunk/pypy/lib/app_test/ctypes_tests/test_structures.py Fri Feb 5 14:43:23 2010 @@ -392,6 +392,15 @@ x.other = 42 assert x.other == 42 + def test_withslots(self): + class X(Structure): + _fields_ = [("a", c_int * 2)] + __slots__ = ['a'] + + x = X() + x.a = (42, 43) + assert tuple(x.a) == (42, 43) + def test_getattr_recursion(self): # Structure.__getattr__ used to call itself recursively # and hit the recursion limit. From fijal at codespeak.net Fri Feb 5 15:49:26 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Fri, 5 Feb 2010 15:49:26 +0100 (CET) Subject: [pypy-svn] r71108 - pypy/extradoc/talk/pycon2010/pypyspeed Message-ID: <20100205144926.5D150282BD4@codespeak.net> Author: fijal Date: Fri Feb 5 15:49:24 2010 New Revision: 71108 Added: pypy/extradoc/talk/pycon2010/pypyspeed/ pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt (contents, props changed) Log: Start writing slides, not really having enough vision so far Added: pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt Fri Feb 5 15:49:24 2010 @@ -0,0 +1,54 @@ +============= +Speed of PyPy +============= + +JIT - what's that about? +======================== + +* removing bytecode-dispatch overhead + +* removing frame overhead + +* other optimizations which can be derived + from the two above + +The main idea +============= + +* python has advanced features (frame introspection, + arbitrary code execution, overloading globals) + +* with JIT, you don't pay for them if you don't use + them + +* however, you pay if you use them + +Tracing JIT - short intro +========================= + +XXX too advanced? + +* the main idea being speeding up loops + +* only linear trace of code that was + actually executed + +* mostly can trace loops and to certain + extent recursion + +Removing frame overhead +======================= + +XXX simple example + +Removing object boxing +====================== + +XXX example + +Local access costs nothing +========================== + +xxx + +xxx From fijal at codespeak.net Fri Feb 5 15:51:26 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Fri, 5 Feb 2010 15:51:26 +0100 (CET) Subject: [pypy-svn] r71109 - pypy/extradoc/talk/pycon2010/keynote Message-ID: <20100205145126.E9D28282BD4@codespeak.net> Author: fijal Date: Fri Feb 5 15:51:25 2010 New Revision: 71109 Modified: pypy/extradoc/talk/pycon2010/keynote/outline.txt Log: rephrase Modified: pypy/extradoc/talk/pycon2010/keynote/outline.txt ============================================================================== --- pypy/extradoc/talk/pycon2010/keynote/outline.txt (original) +++ pypy/extradoc/talk/pycon2010/keynote/outline.txt Fri Feb 5 15:51:25 2010 @@ -3,8 +3,8 @@ Highlights: -* February 2009 (a year ago!) - We manage to merge armin's experiments - into PyPy, having JITted Python. +* February 2009 (a year ago!) - we merge a very experimental JIT approach + into PyPy. * March 2009 - speeding up the first example, function counting integers. From fijal at codespeak.net Fri Feb 5 15:58:38 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Fri, 5 Feb 2010 15:58:38 +0100 (CET) Subject: [pypy-svn] r71110 - pypy/extradoc/talk/pycon2010/keynote Message-ID: <20100205145838.B21F9282BD4@codespeak.net> Author: fijal Date: Fri Feb 5 15:58:37 2010 New Revision: 71110 Modified: pypy/extradoc/talk/pycon2010/keynote/outline.txt Log: Add a slide I think makes sense, but wording is not too good Modified: pypy/extradoc/talk/pycon2010/keynote/outline.txt ============================================================================== --- pypy/extradoc/talk/pycon2010/keynote/outline.txt (original) +++ pypy/extradoc/talk/pycon2010/keynote/outline.txt Fri Feb 5 15:58:37 2010 @@ -35,6 +35,9 @@ * January 2010 - Nightly run of benchmarks, looking like this: xxx +* February 2010 - JIT achieves a level of stability comparable to CPython. + (or baseline pypy???) + * ?March 2010 - 1.2 release - a release to try out JIT and gather feedback * ?later 2010 - a stable release of PyPy's JIT From fijal at codespeak.net Fri Feb 5 15:58:55 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Fri, 5 Feb 2010 15:58:55 +0100 (CET) Subject: [pypy-svn] r71111 - pypy/extradoc/talk/pycon2010/keynote Message-ID: <20100205145855.EEB56282BD4@codespeak.net> Author: fijal Date: Fri Feb 5 15:58:54 2010 New Revision: 71111 Modified: pypy/extradoc/talk/pycon2010/keynote/outline.txt Log: Strike the last slide - predictions of future is hard Modified: pypy/extradoc/talk/pycon2010/keynote/outline.txt ============================================================================== --- pypy/extradoc/talk/pycon2010/keynote/outline.txt (original) +++ pypy/extradoc/talk/pycon2010/keynote/outline.txt Fri Feb 5 15:58:54 2010 @@ -39,5 +39,3 @@ (or baseline pypy???) * ?March 2010 - 1.2 release - a release to try out JIT and gather feedback - -* ?later 2010 - a stable release of PyPy's JIT From antocuni at codespeak.net Fri Feb 5 16:03:42 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Fri, 5 Feb 2010 16:03:42 +0100 (CET) Subject: [pypy-svn] r71112 - pypy/extradoc/talk/pycon2010/keynote Message-ID: <20100205150342.BE7C1282BD4@codespeak.net> Author: antocuni Date: Fri Feb 5 16:03:41 2010 New Revision: 71112 Modified: pypy/extradoc/talk/pycon2010/keynote/outline.txt Log: mention pypy-cli-jit Modified: pypy/extradoc/talk/pycon2010/keynote/outline.txt ============================================================================== --- pypy/extradoc/talk/pycon2010/keynote/outline.txt (original) +++ pypy/extradoc/talk/pycon2010/keynote/outline.txt Fri Feb 5 16:03:41 2010 @@ -23,7 +23,9 @@ * September 2009 - We manage to speed up Richards, the first non-trivial benchmark on top of PyPy JIT. -* October 2009 - [XXX kill?] Improvements to the GC, float support +* October 2009 - [XXX kill?] Improvements to the GC, float support. Antonio + finally finishes to port the JIT to CLI: the resulting pypy-cli-jit is + faster than IronPython on a couple of benchmarks, including Richards. * November 2009 - We publish results on computer language shootout benchmarks, looking mostly good, with bad places. From fijal at codespeak.net Fri Feb 5 16:15:37 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Fri, 5 Feb 2010 16:15:37 +0100 (CET) Subject: [pypy-svn] r71113 - pypy/branch/abort-no-asm Message-ID: <20100205151537.CD3BE282BD4@codespeak.net> Author: fijal Date: Fri Feb 5 16:15:36 2010 New Revision: 71113 Added: pypy/branch/abort-no-asm/ - copied from r71112, pypy/trunk/ Log: A tentative branch to checkin my changes From fijal at codespeak.net Fri Feb 5 16:16:34 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Fri, 5 Feb 2010 16:16:34 +0100 (CET) Subject: [pypy-svn] r71114 - pypy/branch/abort-no-asm/pypy/jit/metainterp Message-ID: <20100205151634.54EED282BD4@codespeak.net> Author: fijal Date: Fri Feb 5 16:16:32 2010 New Revision: 71114 Modified: pypy/branch/abort-no-asm/pypy/jit/metainterp/pyjitpl.py Log: abort tracing if no asm present Modified: pypy/branch/abort-no-asm/pypy/jit/metainterp/pyjitpl.py ============================================================================== --- pypy/branch/abort-no-asm/pypy/jit/metainterp/pyjitpl.py (original) +++ pypy/branch/abort-no-asm/pypy/jit/metainterp/pyjitpl.py Fri Feb 5 16:16:32 2010 @@ -12,7 +12,7 @@ from pypy.jit.metainterp.logger import Logger from pypy.jit.metainterp.jitprof import BLACKHOLED_OPS, EmptyProfiler from pypy.jit.metainterp.jitprof import GUARDS, RECORDED_OPS, ABORT_ESCAPE -from pypy.jit.metainterp.jitprof import ABORT_TOO_LONG, ABORT_BRIDGE +from pypy.jit.metainterp.jitprof import ABORT_TOO_LONG, ABORT_BRIDGE, ABORT_NOASM from pypy.rlib.rarithmetic import intmask from pypy.rlib.objectmodel import specialize from pypy.rlib.jit import DEBUG_OFF, DEBUG_PROFILE, DEBUG_STEPS, DEBUG_DETAILED @@ -678,6 +678,8 @@ # that assembler that we call is still correct greenargs = varargs[1:num_green_args + 1] self.verify_green_args(greenargs) + else: + self.metainterp.switch_to_blackhole(ABORT_NOASM) res = self.do_residual_call(varargs, descr=calldescr, exc=True) if not self.metainterp.is_blackholing() and token is not None: # XXX fix the call position, From fijal at codespeak.net Fri Feb 5 16:19:07 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Fri, 5 Feb 2010 16:19:07 +0100 (CET) Subject: [pypy-svn] r71115 - pypy/branch/abort-no-asm/pypy/jit/metainterp Message-ID: <20100205151907.9547F282BD4@codespeak.net> Author: fijal Date: Fri Feb 5 16:19:06 2010 New Revision: 71115 Modified: pypy/branch/abort-no-asm/pypy/jit/metainterp/jitprof.py Log: oops, belonging to previous commit Modified: pypy/branch/abort-no-asm/pypy/jit/metainterp/jitprof.py ============================================================================== --- pypy/branch/abort-no-asm/pypy/jit/metainterp/jitprof.py (original) +++ pypy/branch/abort-no-asm/pypy/jit/metainterp/jitprof.py Fri Feb 5 16:19:06 2010 @@ -21,6 +21,7 @@ ABORT_TOO_LONG ABORT_BRIDGE ABORT_ESCAPE +ABORT_NOASM NVIRTUALS NVHOLES NVREUSED From cfbolz at codespeak.net Fri Feb 5 16:21:57 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Fri, 5 Feb 2010 16:21:57 +0100 (CET) Subject: [pypy-svn] r71116 - pypy/extradoc/planning Message-ID: <20100205152157.9AF57282BD4@codespeak.net> Author: cfbolz Date: Fri Feb 5 16:21:56 2010 New Revision: 71116 Modified: pypy/extradoc/planning/jit.txt Log: a note on stupidity Modified: pypy/extradoc/planning/jit.txt ============================================================================== --- pypy/extradoc/planning/jit.txt (original) +++ pypy/extradoc/planning/jit.txt Fri Feb 5 16:21:56 2010 @@ -64,6 +64,7 @@ - ai - the slowness is the fault of generators and generator expressions + - many of the generator expressions are a bit stupid (like tuple()) From afa at codespeak.net Fri Feb 5 17:54:55 2010 From: afa at codespeak.net (afa at codespeak.net) Date: Fri, 5 Feb 2010 17:54:55 +0100 (CET) Subject: [pypy-svn] r71118 - pypy/trunk/pypy/lib/_ctypes Message-ID: <20100205165455.83A33282BD4@codespeak.net> Author: afa Date: Fri Feb 5 17:54:53 2010 New Revision: 71118 Modified: pypy/trunk/pypy/lib/_ctypes/array.py Log: Considerable speed-up of the c_char_Array.raw getter Modified: pypy/trunk/pypy/lib/_ctypes/array.py ============================================================================== --- pypy/trunk/pypy/lib/_ctypes/array.py (original) +++ pypy/trunk/pypy/lib/_ctypes/array.py Fri Feb 5 17:54:53 2010 @@ -36,7 +36,8 @@ res.value = property(getvalue, setvalue) def getraw(self): - return "".join([self[i] for i in range(self._length_)]) + return rawffi.charp2rawstring(self._buffer.buffer, + self._length_) def setraw(self, buffer): for i in range(len(buffer)): From afa at codespeak.net Fri Feb 5 17:56:10 2010 From: afa at codespeak.net (afa at codespeak.net) Date: Fri, 5 Feb 2010 17:56:10 +0100 (CET) Subject: [pypy-svn] r71119 - pypy/trunk/pypy/lib/_ctypes Message-ID: <20100205165610.F4162282BD4@codespeak.net> Author: afa Date: Fri Feb 5 17:56:09 2010 New Revision: 71119 Modified: pypy/trunk/pypy/lib/_ctypes/array.py Log: oops Modified: pypy/trunk/pypy/lib/_ctypes/array.py ============================================================================== --- pypy/trunk/pypy/lib/_ctypes/array.py (original) +++ pypy/trunk/pypy/lib/_ctypes/array.py Fri Feb 5 17:56:09 2010 @@ -36,8 +36,8 @@ res.value = property(getvalue, setvalue) def getraw(self): - return rawffi.charp2rawstring(self._buffer.buffer, - self._length_) + return _rawffi.charp2rawstring(self._buffer.buffer, + self._length_) def setraw(self, buffer): for i in range(len(buffer)): From dan at codespeak.net Sat Feb 6 06:39:26 2010 From: dan at codespeak.net (dan at codespeak.net) Date: Sat, 6 Feb 2010 06:39:26 +0100 (CET) Subject: [pypy-svn] r71122 - pypy/branch/micronumpy/pypy/module/micronumpy/test Message-ID: <20100206053926.B9F0C282BD5@codespeak.net> Author: dan Date: Sat Feb 6 06:39:24 2010 New Revision: 71122 Modified: pypy/branch/micronumpy/pypy/module/micronumpy/test/test_numpy.py Log: Added tests for non-square multi-dimensional arrays, currently skipping them. Modified: pypy/branch/micronumpy/pypy/module/micronumpy/test/test_numpy.py ============================================================================== --- pypy/branch/micronumpy/pypy/module/micronumpy/test/test_numpy.py (original) +++ pypy/branch/micronumpy/pypy/module/micronumpy/test/test_numpy.py Sat Feb 6 06:39:24 2010 @@ -131,6 +131,22 @@ class AppTestMultiDim(object): def setup_class(cls): cls.space = gettestobjspace(usemodules=('micronumpy',)) + cls.w_gen_array = cls.space.appexec([], + """(): + def gen_array(shape, data_type=int, start=0): + if len(shape) == 1: + return [data_type(x) for x in xrange(start, start+shape[0])] + else: + stride = 1 + for dim in shape[1:]: + stride *= dim + result = [] + for i in xrange(shape[0]): + result.append(gen_array(shape[1:], data_type, start + i*stride)) + return result + return gen_array + """) + def test_multidim(self): from numpy import zeros @@ -139,7 +155,26 @@ raises(IndexError, ar.__getitem__, (3, 0)) assert ar[-2, 1] == 0 - def test_multidim_getset(self): + def test_construction(self): + from numpy import array + gen_array = self.gen_array + + #3x3 + ar = array(gen_array((3,3))) + assert len(ar) == 3 + + skip("Non-square matrices throw IndexError") + #2x3 + ar = array(gen_array((2,3))) + assert len(ar) == 2 + assert ar.shape == (2, 3) + + #3x2 + ar = array(gen_array((3,2))) + assert len(ar) == 3 + assert ar.shape == (3, 2) + + def test_getset(self): from numpy import zeros ar = zeros((3, 3, 3), dtype=int) ar[1, 2, 1] = 3 @@ -156,13 +191,16 @@ from numpy import array ar = array([range(i*3, i*3+3) for i in range(3)]) assert len(ar) == 3 + skip("mdarray.shape currently is a list instead of a tuple as it should be") + assert ar.shape == (3, 3) for i in range(3): for j in range(3): assert ar[i, j] == i*3+j def test_various_slices(self): from numpy import array - ar = array([range(i*3, i*3+3) for i in range(3)]) + gen_array = self.gen_array + ar = array(gen_array((3,3))) s1 = ar[0] assert s1[1]==1 s2 = ar[1:3] From dan at codespeak.net Sat Feb 6 06:42:28 2010 From: dan at codespeak.net (dan at codespeak.net) Date: Sat, 6 Feb 2010 06:42:28 +0100 (CET) Subject: [pypy-svn] r71123 - in pypy/branch/micronumpy/pypy/module/micronumpy: . test Message-ID: <20100206054228.A8847282BD5@codespeak.net> Author: dan Date: Sat Feb 6 06:42:26 2010 New Revision: 71123 Modified: pypy/branch/micronumpy/pypy/module/micronumpy/mdarray.py pypy/branch/micronumpy/pypy/module/micronumpy/test/test_numpy.py Log: Converted mdarray.shape to tuple. Un-skipped test that depended on it. Modified: pypy/branch/micronumpy/pypy/module/micronumpy/mdarray.py ============================================================================== --- pypy/branch/micronumpy/pypy/module/micronumpy/mdarray.py (original) +++ pypy/branch/micronumpy/pypy/module/micronumpy/mdarray.py Sat Feb 6 06:42:26 2010 @@ -93,7 +93,7 @@ return self.dtype def descr_shape(space, self): - return space.wrap(self.shape) + return space.newtuple([space.wrap(dim) for dim in self.shape]) def create_mdarray(data_type, unwrap, coerce): class MultiDimArray(BaseMultiDimArray): Modified: pypy/branch/micronumpy/pypy/module/micronumpy/test/test_numpy.py ============================================================================== --- pypy/branch/micronumpy/pypy/module/micronumpy/test/test_numpy.py (original) +++ pypy/branch/micronumpy/pypy/module/micronumpy/test/test_numpy.py Sat Feb 6 06:42:26 2010 @@ -191,7 +191,7 @@ from numpy import array ar = array([range(i*3, i*3+3) for i in range(3)]) assert len(ar) == 3 - skip("mdarray.shape currently is a list instead of a tuple as it should be") + #skip("mdarray.shape currently is a list instead of a tuple as it should be") assert ar.shape == (3, 3) for i in range(3): for j in range(3): From dan at codespeak.net Sat Feb 6 09:24:25 2010 From: dan at codespeak.net (dan at codespeak.net) Date: Sat, 6 Feb 2010 09:24:25 +0100 (CET) Subject: [pypy-svn] r71124 - pypy/branch/micronumpy/pypy/module/micronumpy Message-ID: <20100206082425.42A2E282BD5@codespeak.net> Author: dan Date: Sat Feb 6 09:24:23 2010 New Revision: 71124 Modified: pypy/branch/micronumpy/pypy/module/micronumpy/dtype.py pypy/branch/micronumpy/pypy/module/micronumpy/mdarray.py pypy/branch/micronumpy/pypy/module/micronumpy/sdarray.py Log: Shortened array factory code. Modified: pypy/branch/micronumpy/pypy/module/micronumpy/dtype.py ============================================================================== --- pypy/branch/micronumpy/pypy/module/micronumpy/dtype.py (original) +++ pypy/branch/micronumpy/pypy/module/micronumpy/dtype.py Sat Feb 6 09:24:23 2010 @@ -38,3 +38,11 @@ atype = iterable_type(space, xs[i]) result_type = result_mapping(space, (result_type, atype)) return result_type + +def create_factory(dict_filler): + result_factory = {} + def result(space, t): + if not result_factory: + result_factory.update(dict_filler(space)) + return result_factory[t] + return result Modified: pypy/branch/micronumpy/pypy/module/micronumpy/mdarray.py ============================================================================== --- pypy/branch/micronumpy/pypy/module/micronumpy/mdarray.py (original) +++ pypy/branch/micronumpy/pypy/module/micronumpy/mdarray.py Sat Feb 6 09:24:23 2010 @@ -12,6 +12,7 @@ from pypy.module.micronumpy.dtype import unwrap_int, coerce_int from pypy.module.micronumpy.dtype import unwrap_float, coerce_float +from pypy.module.micronumpy.dtype import create_factory def compute_pos(space, indexes, dim): current = 1 @@ -248,18 +249,4 @@ MultiDimIntArray = create_mdarray(int, unwrap_int, coerce_int) MultiDimFloatArray = create_mdarray(float, unwrap_float, coerce_float) -class ResultFactory(object): - def __init__(self, space): - self.space = space - - self.types = { - space.w_int: MultiDimIntArray, - space.w_float: MultiDimFloatArray, - } - -result_factory = None -def mdresult(space, t): - global result_factory - if result_factory is None: - result_factory = ResultFactory(space) - return result_factory.types[t] +mdresult = create_factory(lambda space: {space.w_int: MultiDimIntArray, space.w_float: MultiDimFloatArray}) Modified: pypy/branch/micronumpy/pypy/module/micronumpy/sdarray.py ============================================================================== --- pypy/branch/micronumpy/pypy/module/micronumpy/sdarray.py (original) +++ pypy/branch/micronumpy/pypy/module/micronumpy/sdarray.py Sat Feb 6 09:24:23 2010 @@ -16,6 +16,8 @@ unwrap_float32, coerce_float32, float32 from pypy.module.micronumpy.dtype import result_mapping, iterable_type +from pypy.module.micronumpy.dtype import create_factory + #TODO: merge unwrap_spec decorator # from pypy.interpreter.gateway import unwrap_spec @@ -279,16 +281,4 @@ Float32Array = create_sdarray(float32, unwrap_float32, coerce_float32) GenericArray = None -class ResultFactory(object): - def __init__(self, space): - self.types = { - space.w_int: IntArray, - space.w_float: FloatArray, - } - -result_factory = None -def sdresult(space, t): - global result_factory - if result_factory is None: - result_factory = ResultFactory(space) - return result_factory.types[t] +sdresult = create_factory(lambda space: {space.w_int: IntArray, space.w_float: FloatArray}) From fijal at codespeak.net Sat Feb 6 18:08:15 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sat, 6 Feb 2010 18:08:15 +0100 (CET) Subject: [pypy-svn] r71128 - pypy/benchmarks/own Message-ID: <20100206170815.6AB1A282BD5@codespeak.net> Author: fijal Date: Sat Feb 6 18:08:13 2010 New Revision: 71128 Modified: pypy/benchmarks/own/gcbench.py Log: fix comment Modified: pypy/benchmarks/own/gcbench.py ============================================================================== --- pypy/benchmarks/own/gcbench.py (original) +++ pypy/benchmarks/own/gcbench.py Sat Feb 6 18:08:13 2010 @@ -191,7 +191,7 @@ parser = optparse.OptionParser( usage="%prog [options]", - description="Test the performance of the Telco decimal benchmark") + description="Test the performance of the garbage collector benchmark") util.add_standard_options_to(parser) parser.add_option('--threads', default=0, action="store", help="provide number of threads (default 1)") From fijal at codespeak.net Sat Feb 6 18:29:59 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sat, 6 Feb 2010 18:29:59 +0100 (CET) Subject: [pypy-svn] r71129 - in pypy/benchmarks: . own Message-ID: <20100206172959.5392E282BD5@codespeak.net> Author: fijal Date: Sat Feb 6 18:29:57 2010 New Revision: 71129 Added: pypy/benchmarks/own/spitfire.py (contents, props changed) Modified: pypy/benchmarks/benchmarks.py Log: Add running the original version of spitfire, named spitfire and spitfire_cstringio Modified: pypy/benchmarks/benchmarks.py ============================================================================== --- pypy/benchmarks/benchmarks.py (original) +++ pypy/benchmarks/benchmarks.py Sat Feb 6 18:29:57 2010 @@ -5,7 +5,7 @@ def relative(*args): return os.path.join(os.path.dirname(os.path.abspath(__file__)), *args) -def _register_new_bm(name, d, **opts): +def _register_new_bm(name, bm_name, d, **opts): def Measure(python, options): bm_path = relative('own', name + '.py') return MeasureGeneric(python, options, bm_path, **opts) @@ -13,7 +13,7 @@ def BM(*args, **kwds): return SimpleBenchmark(Measure, *args, **kwds) - BM.func_name = 'BM_' + name + BM.func_name = 'BM_' + bm_name d[BM.func_name] = BM @@ -23,4 +23,9 @@ for name in ['float', 'nbody_modified', 'meteor-contest', 'fannkuch', 'spectral-norm', 'chaos', 'telco', 'gcbench']: - _register_new_bm(name, globals(), **opts.get(name, {})) + _register_new_bm(name, name, globals(), **opts.get(name, {})) +_register_new_bm('spitfire', 'spitfire', globals(), + extra_args=['--benchmark=spitfire_o4']) +_register_new_bm('spitfire', 'spitfire_cstringio', globals(), + extra_args=['--benchmark=python_cstringio']) + Added: pypy/benchmarks/own/spitfire.py ============================================================================== --- (empty file) +++ pypy/benchmarks/own/spitfire.py Sat Feb 6 18:29:57 2010 @@ -0,0 +1,43 @@ + +import sys +import os +import util +import time +import optparse +from StringIO import StringIO + +def relative(*args): + return os.path.join(os.path.dirname(os.path.abspath(__file__)), *args) + +class FakePsyco(object): + def bind(self, *args, **kwargs): + pass +sys.modules["psyco"] = FakePsyco() + +testdir = relative('..', 'unladen_swallow', 'lib', 'spitfire', 'tests', 'perf') +sys.path.insert(0, testdir) +sys.path.insert(0, relative('..', 'unladen_swallow', 'lib', 'spitfire')) +import bigtable +# bummer, timeit module is stupid +from bigtable import test_python_cstringio, test_spitfire_o4, test_spitfire + +def runtest(n, benchmark): + times = [] + for i in range(n): + sys.stdout = StringIO() + bigtable.run([benchmark], 100) + times.append(float(sys.stdout.getvalue().split(" ")[-2])) + sys.stdout = sys.__stdout__ + return times + +if __name__ == '__main__': + parser = optparse.OptionParser( + usage="%prog [options]", + description="Test the performance of the spitfire benchmark") + parser.add_option('--benchmark', type="choice", + choices=['python_cstringio', 'spitfire_o4'], + default="spitfire_o4", + help="choose between cstringio and spitfire_o4") + util.add_standard_options_to(parser) + options, args = parser.parse_args(sys.argv) + util.run_benchmark(options, options.num_runs, runtest, options.benchmark) From fijal at codespeak.net Sat Feb 6 19:09:03 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sat, 6 Feb 2010 19:09:03 +0100 (CET) Subject: [pypy-svn] r71130 - pypy/build/bot2/jsplot/css Message-ID: <20100206180903.D0BA6282BD5@codespeak.net> Author: fijal Date: Sat Feb 6 19:09:02 2010 New Revision: 71130 Modified: pypy/build/bot2/jsplot/css/main.css Log: an attempt to put text closer to graphs Modified: pypy/build/bot2/jsplot/css/main.css ============================================================================== --- pypy/build/bot2/jsplot/css/main.css (original) +++ pypy/build/bot2/jsplot/css/main.css Sat Feb 6 19:09:02 2010 @@ -22,4 +22,6 @@ font-size: 10pt; font-family: Verdana; text-align: center; + margin-bottom: 0px; + margin-top: 10px; } From fijal at codespeak.net Sat Feb 6 19:35:17 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sat, 6 Feb 2010 19:35:17 +0100 (CET) Subject: [pypy-svn] r71131 - pypy/build/bot2/pypybuildbot Message-ID: <20100206183517.9369D282BD5@codespeak.net> Author: fijal Date: Sat Feb 6 19:35:16 2010 New Revision: 71131 Modified: pypy/build/bot2/pypybuildbot/builds.py Log: Add a step that runs benchmarks agains pypy without jit as well Modified: pypy/build/bot2/pypybuildbot/builds.py ============================================================================== --- pypy/build/bot2/pypybuildbot/builds.py (original) +++ pypy/build/bot2/pypybuildbot/builds.py Sat Feb 6 19:35:16 2010 @@ -166,7 +166,7 @@ workdir='.')) self.addStep(Translate(['-Ojit'], [])) self.addStep(ShellCmd( - description="run more benchmarks", + description="run more benchmarks on top of pypy-c-jit", command=["python", "runner.py", '--output-filename', 'result.json', '--pypy-c', '../build/pypy/translator/goal/pypy-c', '--revision', WithProperties('%(got_revision)s')], @@ -178,7 +178,20 @@ masterdest=WithProperties(resfile), workdir=".")) self.addStep(ShellCmd( - description="run benchmarks 1", + description="run more benchmarks on top of pypy-c no jit", + command=["python", "runner.py", '--output-filename', 'result.json', + '--pypy-c', '../build/pypy/translator/goal/pypy-c', + '--revision', WithProperties('%(got_revision)s'), + '--args', ',--jit threshold=1000000000'], + workdir='./benchmarks', + haltOnFailure=True)) + resfile = os.path.expanduser("~/bench_results_nojit/%(got_revision)s.json") + self.addStep(transfer.FileUpload(slavesrc="benchmarks/result.json", + masterdest=WithProperties(resfile), + workdir=".")) + + self.addStep(ShellCmd( + descritpion="run benchmarks 1", command=["python", "pypy/translator/benchmark/jitbench.py", "pypy/translator/goal/pypy-c"])) From fijal at codespeak.net Sat Feb 6 20:08:49 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sat, 6 Feb 2010 20:08:49 +0100 (CET) Subject: [pypy-svn] r71132 - pypy/build/bot2/jsplot/js Message-ID: <20100206190849.1C25C282BD5@codespeak.net> Author: fijal Date: Sat Feb 6 20:08:47 2010 New Revision: 71132 Modified: pypy/build/bot2/jsplot/js/plot.js Log: A hack to allow displaying nonjit results. We might want further integration at some point. Modified: pypy/build/bot2/jsplot/js/plot.js ============================================================================== --- pypy/build/bot2/jsplot/js/plot.js (original) +++ pypy/build/bot2/jsplot/js/plot.js Sat Feb 6 20:08:47 2010 @@ -2,7 +2,11 @@ var JSON_DIR_URL; var JSON_DIR_LIST; if (window.location.toString().indexOf('file:///') == -1) { - JSON_DIR_URL = "bench_results/"; + if (window.location.toString().indexOf("nojit") == -1) { + JSON_DIR_URL = "bench_results/"; + } else { + JSON_DIR_URL = "bench_results_nojit/"; + } JSON_DIR_LIST = JSON_DIR_URL; } else { JSON_DIR_URL = "test/data/"; From fijal at codespeak.net Sat Feb 6 20:49:13 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sat, 6 Feb 2010 20:49:13 +0100 (CET) Subject: [pypy-svn] r71134 - pypy/trunk/pypy/objspace/std Message-ID: <20100206194913.C5DDB282BD5@codespeak.net> Author: fijal Date: Sat Feb 6 20:49:11 2010 New Revision: 71134 Modified: pypy/trunk/pypy/objspace/std/stringobject.py Log: Use stringbuilder for string join Modified: pypy/trunk/pypy/objspace/std/stringobject.py ============================================================================== --- pypy/trunk/pypy/objspace/std/stringobject.py (original) +++ pypy/trunk/pypy/objspace/std/stringobject.py Sat Feb 6 20:49:11 2010 @@ -351,12 +351,9 @@ def str_join__String_ANY(space, w_self, w_list): list_w = space.listview(w_list) - str_w = space.str_w if list_w: self = w_self._value - listlen = 0 reslen = 0 - l = [None] * len(list_w) for i in range(len(list_w)): w_s = list_w[i] if not space.is_true(space.isinstance(w_s, space.w_str)): @@ -370,8 +367,14 @@ space.w_TypeError, "sequence item %d: expected string, %s " "found", i, space.type(w_s).getname(space, '?')) - l[i] = space.str_w(w_s) - return space.wrap(self.join(l)) + reslen += len(space.str_w(w_s)) + reslen += len(self) * (len(list_w) - 1) + sb = StringBuilder(reslen) + for i in range(len(list_w)): + if self and i != 0: + sb.append(self) + sb.append(space.str_w(list_w[i])) + return space.wrap(sb.build()) else: return W_StringObject.EMPTY From benjamin at codespeak.net Sat Feb 6 21:24:52 2010 From: benjamin at codespeak.net (benjamin at codespeak.net) Date: Sat, 6 Feb 2010 21:24:52 +0100 (CET) Subject: [pypy-svn] r71135 - in pypy/trunk/pypy/objspace/std: . test Message-ID: <20100206202452.A2F26282BD5@codespeak.net> Author: benjamin Date: Sat Feb 6 21:24:48 2010 New Revision: 71135 Modified: pypy/trunk/pypy/objspace/std/test/test_typeobject.py pypy/trunk/pypy/objspace/std/typeobject.py Log: fix type.__getattr__ to only respect data descriptors if they have __get__ Modified: pypy/trunk/pypy/objspace/std/test/test_typeobject.py ============================================================================== --- pypy/trunk/pypy/objspace/std/test/test_typeobject.py (original) +++ pypy/trunk/pypy/objspace/std/test/test_typeobject.py Sat Feb 6 21:24:48 2010 @@ -705,6 +705,20 @@ pass raises(TypeError, "class D(A, C): pass") + def test_data_descriptor_without_get(self): + class Descr(object): + def __init__(self, name): + self.name = name + def __set__(self, obj, what): + pass + class Meta(type): + pass + class X(object): + __metaclass__ = Meta + X.a = 42 + Meta.a = Descr("a") + assert X.a == 42 + def test_user_defined_mro_cls_access(self): d = [] class T(type): Modified: pypy/trunk/pypy/objspace/std/typeobject.py ============================================================================== --- pypy/trunk/pypy/objspace/std/typeobject.py (original) +++ pypy/trunk/pypy/objspace/std/typeobject.py Sat Feb 6 21:24:48 2010 @@ -697,7 +697,10 @@ w_descr = space.lookup(w_type, name) if w_descr is not None: if space.is_data_descr(w_descr): - return space.get(w_descr,w_type) + w_get = space.lookup(w_descr, "__get__") + if w_get is not None: + return space.get_and_call_function(w_get, w_descr, w_type, + space.type(w_type)) w_value = w_type.lookup(name) if w_value is not None: # __get__(None, type): turns e.g. functions into unbound methods From benjamin at codespeak.net Sat Feb 6 21:25:55 2010 From: benjamin at codespeak.net (benjamin at codespeak.net) Date: Sat, 6 Feb 2010 21:25:55 +0100 (CET) Subject: [pypy-svn] r71136 - pypy/trunk/pypy/objspace/std Message-ID: <20100206202555.44479282BD5@codespeak.net> Author: benjamin Date: Sat Feb 6 21:25:53 2010 New Revision: 71136 Modified: pypy/trunk/pypy/objspace/std/objspace.py Log: kill unused import Modified: pypy/trunk/pypy/objspace/std/objspace.py ============================================================================== --- pypy/trunk/pypy/objspace/std/objspace.py (original) +++ pypy/trunk/pypy/objspace/std/objspace.py Sat Feb 6 21:25:53 2010 @@ -639,7 +639,6 @@ # an optional shortcut for performance from pypy.objspace.descroperation import raiseattrerror - from pypy.objspace.descroperation import object_getattribute w_type = self.type(w_obj) w_descr = w_type.getattribute_if_not_from_object() if w_descr is not None: From benjamin at codespeak.net Sat Feb 6 22:33:43 2010 From: benjamin at codespeak.net (benjamin at codespeak.net) Date: Sat, 6 Feb 2010 22:33:43 +0100 (CET) Subject: [pypy-svn] r71139 - pypy/trunk/pypy/objspace/std Message-ID: <20100206213343.29BC8282BD5@codespeak.net> Author: benjamin Date: Sat Feb 6 22:33:42 2010 New Revision: 71139 Modified: pypy/trunk/pypy/objspace/std/objspace.py Log: rewrite to clarify and avoid doing unneeded lookups Modified: pypy/trunk/pypy/objspace/std/objspace.py ============================================================================== --- pypy/trunk/pypy/objspace/std/objspace.py (original) +++ pypy/trunk/pypy/objspace/std/objspace.py Sat Feb 6 22:33:42 2010 @@ -650,27 +650,29 @@ w_descr = w_type.lookup(name) e = None if w_descr is not None: - if not self.is_data_descr(w_descr): + w_get = None + if self.is_data_descr(w_descr): + w_get = self.lookup(w_descr, "__get__") + if w_get is None: w_value = w_obj.getdictvalue_attr_is_in_class(self, name) if w_value is not None: return w_value - w_get = self.lookup(w_descr, "__get__") + w_get = self.lookup(w_descr, "__get__") if w_get is not None: - # __get__ is allowed to raise an AttributeError to trigger use - # of __getattr__. + # __get__ is allowed to raise an AttributeError to trigger + # use of __getattr__. try: return self.get_and_call_function(w_get, w_descr, w_obj, w_type) except OperationError, e: if not e.match(self, self.w_AttributeError): raise - if e is None: + else: + return w_descr + else: w_value = w_obj.getdictvalue(self, name) if w_value is not None: return w_value - # No value in __dict__. Fallback to the descriptor if we have it. - if w_descr is not None: - return w_descr w_descr = self.lookup(w_obj, '__getattr__') if w_descr is not None: From fijal at codespeak.net Sun Feb 7 01:31:31 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sun, 7 Feb 2010 01:31:31 +0100 (CET) Subject: [pypy-svn] r71140 - pypy/trunk/pypy/rlib/rsre Message-ID: <20100207003131.38B70282BD5@codespeak.net> Author: fijal Date: Sun Feb 7 01:31:29 2010 New Revision: 71140 Modified: pypy/trunk/pypy/rlib/rsre/rsre_char.py Log: Eh. unrolling iterable is not too happy with enumerate way of counting items Modified: pypy/trunk/pypy/rlib/rsre/rsre_char.py ============================================================================== --- pypy/trunk/pypy/rlib/rsre/rsre_char.py (original) +++ pypy/trunk/pypy/rlib/rsre/rsre_char.py Sun Feb 7 01:31:29 2010 @@ -125,13 +125,15 @@ #### Category dispatch def category_dispatch(category_code, char_code): - for i, (function, negate) in category_dispatch_unroll: + i = 0 + for function, negate in category_dispatch_unroll: if category_code == i: result = function(char_code) if negate: return not result else: return result + i = i + 1 else: return False @@ -145,8 +147,7 @@ (is_uni_word, True), (is_uni_linebreak, False), (is_uni_linebreak, True) ] -category_dispatch_unroll = unrolling_iterable( - enumerate(category_dispatch_table)) +category_dispatch_unroll = unrolling_iterable(category_dispatch_table) ##### Charset evaluation @@ -161,10 +162,12 @@ negated = SET_OK while index >= 0: opcode = pattern_codes[index] - for i, function in set_dispatch_unroll: + i = 0 + for function in set_dispatch_unroll: if function is not None and opcode == i: index = function(pattern_codes, index, char_code) break + i = i + 1 else: if opcode == 26: # NEGATE negated ^= (SET_OK ^ SET_NOT_OK) @@ -252,4 +255,4 @@ None, # NEGATE set_range ] -set_dispatch_unroll = unrolling_iterable(enumerate(set_dispatch_table)) +set_dispatch_unroll = unrolling_iterable(set_dispatch_table) From fijal at codespeak.net Sun Feb 7 17:59:11 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sun, 7 Feb 2010 17:59:11 +0100 (CET) Subject: [pypy-svn] r71147 - pypy/extradoc/talk/pycon2010/keynote Message-ID: <20100207165911.9E559282BD5@codespeak.net> Author: fijal Date: Sun Feb 7 17:59:09 2010 New Revision: 71147 Added: pypy/extradoc/talk/pycon2010/keynote/beamerouterthememy.sty pypy/extradoc/talk/pycon2010/keynote/beamerthemeWarsaw.sty pypy/extradoc/talk/pycon2010/keynote/merlinux-logo.png (contents, props changed) pypy/extradoc/talk/pycon2010/keynote/pypy-logo.png (contents, props changed) pypy/extradoc/talk/pycon2010/keynote/talk.pdf (contents, props changed) pypy/extradoc/talk/pycon2010/keynote/talk.tex Modified: pypy/extradoc/talk/pycon2010/keynote/outline.txt Log: Stuff I did so far Added: pypy/extradoc/talk/pycon2010/keynote/beamerouterthememy.sty ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/keynote/beamerouterthememy.sty Sun Feb 7 17:59:09 2010 @@ -0,0 +1,39 @@ +\ProvidesPackageRCS $Header: /cvsroot/latex-beamer/latex-beamer/themes/outer/beamerouterthemesplit.sty,v 1.4 2004/10/07 22:21:16 tantau Exp $ + +% Copyright 2003 by Till Tantau +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. + +\mode + +\setbeamercolor{section in head/foot}{parent=palette quaternary} +\setbeamercolor{subsection in head/foot}{parent=palette primary} + +\setbeamercolor{author in head/foot}{parent=section in head/foot} +\setbeamercolor{title in head/foot}{parent=subsection in head/foot} + + + +\usesectionheadtemplate + {\hfill\insertsectionhead} + {\hfill\color{fg!50!bg}\insertsectionhead} + + + + +\defbeamertemplate*{footline}{split theme} +{% + \leavevmode% + \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm plus1fill,rightskip=.3cm]{author in head/foot}% + \usebeamerfont{author in head/foot}\insertshortauthor + \end{beamercolorbox}% + \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}% + \usebeamerfont{title in head/foot}\insertshorttitle + \end{beamercolorbox}}% + \vskip0pt% +} + + +\mode + Added: pypy/extradoc/talk/pycon2010/keynote/beamerthemeWarsaw.sty ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/keynote/beamerthemeWarsaw.sty Sun Feb 7 17:59:09 2010 @@ -0,0 +1,18 @@ +\ProvidesPackageRCS $Header: /cvsroot/latex-beamer/latex-beamer/themes/theme/beamerthemeWarsaw.sty,v 1.8 2004/10/07 20:53:10 tantau Exp $ + +% Copyright 2003 by Till Tantau +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. + +\mode + +\useinnertheme[shadow=true]{rounded} +\useoutertheme{my} +\usecolortheme{orchid} +\usecolortheme{whale} + +\setbeamerfont{block title}{size={}} + +\mode + Added: pypy/extradoc/talk/pycon2010/keynote/merlinux-logo.png ============================================================================== Binary file. No diff available. Modified: pypy/extradoc/talk/pycon2010/keynote/outline.txt ============================================================================== --- pypy/extradoc/talk/pycon2010/keynote/outline.txt (original) +++ pypy/extradoc/talk/pycon2010/keynote/outline.txt Sun Feb 7 17:59:09 2010 @@ -40,4 +40,4 @@ * February 2010 - JIT achieves a level of stability comparable to CPython. (or baseline pypy???) -* ?March 2010 - 1.2 release - a release to try out JIT and gather feedback +* March 2010 - 1.2 release - a release to try out JIT and gather feedback Added: pypy/extradoc/talk/pycon2010/keynote/pypy-logo.png ============================================================================== Binary file. No diff available. Added: pypy/extradoc/talk/pycon2010/keynote/talk.pdf ============================================================================== Binary file. No diff available. Added: pypy/extradoc/talk/pycon2010/keynote/talk.tex ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/keynote/talk.tex Sun Feb 7 17:59:09 2010 @@ -0,0 +1,153 @@ + +\documentclass[utf8x, 14pt]{beamer} + +\mode +{ + \usetheme{Warsaw} +} + +\usepackage[english]{babel} + +\usepackage[utf8x]{inputenc} +\usepackage{tikz} + +\usepackage{times} +\usepackage[T1]{fontenc} +\usepackage{color} + +\setbeamerfont{big}{size*={64pt}{0pt}} + +\title{The status of PyPy} + +\author{Maciej Fija?kowski} + +\institute[merlinux GmbH] +{ merlinux GmbH } + +\date{Pycon 2010, February 20th 2010, Atlanta} + +\begin{document} + +\begin{frame} + \titlepage + \begin{figure} + \begin{tabular}{c c c} + \includegraphics[width=.30\textwidth]{pypy-logo.png} + & + \hspace{2cm} + & + \includegraphics[width=.25\textwidth]{merlinux-logo.png} + \end{tabular} + \end{figure} +\end{frame} + +\begin{frame} + \frametitle{Introduction} + \begin{itemize} + \item What we did in the last year? + \item What we achieved? + \item Plans for near future + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Last year highlits} + \pause + \usebeamerfont{big} + JIT +\end{frame} + +\begin{frame} + \frametitle{February 2009} + \begin{tikzpicture}[remember picture, overlay] + \node [shift={(1cm, -4cm)}] at (current page.north west) { + \begin{tikzpicture}[remember picture, overlay, font={\fontsize{8pt}{0pt} \ttfamily}] + \node [shift={(-1cm, 1.4cm)}, above right] { + \includegraphics[width=.15\textwidth]{pypy-logo.png}}; + \draw [thick, ->] (1.2cm, 2.5cm) -- (10cm, 2.5cm); + \end{tikzpicture} + }; + \end{tikzpicture} + \begin{itemize} + \item We merge experiments into mailine PyPy + \item xxx + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{March 2009} + \begin{tikzpicture}[remember picture, overlay] + \node [shift={(1cm, -4cm)}] at (current page.north west) { + \begin{tikzpicture}[remember picture, overlay, font={\fontsize{8pt}{0pt} \ttfamily}] + \node [shift={(-1cm, 1.4cm)}, above right] { + \includegraphics[width=.15\textwidth]{pypy-logo.png}}; + \draw [thick, ->] (1.2cm, 2.5cm) -- (10cm, 2.5cm); + \draw [fill=blue!20,very thin] (1.7cm, 2.5cm) circle (.06cm); + \draw (1.7cm, 2.44cm) -- (1.7cm, 2.0cm); + \draw (1.5cm, 1.5cm) node [rotate=45] {JIT merge}; + \end{tikzpicture} + }; + \end{tikzpicture} + \begin{itemize} + \item first python example works! + \begin{verbatim} +i = 0 +while i < 1000000: + i = i + 1 + \end{verbatim} + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{June 2009} + \begin{tikzpicture}[remember picture, overlay] + \node [shift={(1cm, -4cm)}] at (current page.north west) { + \begin{tikzpicture}[remember picture, overlay, font={\fontsize{8pt}{0pt} \ttfamily}] + \node [shift={(-1cm, 1.4cm)}, above right] { + \includegraphics[width=.15\textwidth]{pypy-logo.png}}; + \draw [thick, ->] (1.2cm, 2.5cm) -- (10cm, 2.5cm); + \draw [fill=blue!20,very thin] (1.7cm, 2.5cm) circle (.06cm); + \draw (1.7cm, 2.44cm) -- (1.7cm, 2.0cm); + \draw (1.5cm, 1.5cm) node [rotate=45] {JIT merge}; + \draw [fill=blue!20,very thin] (2.3cm, 2.5cm) circle (.06cm); + \draw (2.3cm, 2.44cm) -- (2.3cm, 2.0cm); + \draw (1.95cm, 1.5cm) node [rotate=45] {first example}; + \end{tikzpicture} + }; + \end{tikzpicture} + xxx +\end{frame} + +\begin{frame} + \frametitle{Nice graphs} +\end{frame} + +\begin{frame} + \frametitle{Status} + \begin{block}{Status of today} + \begin{itemize} + \item JIT is fairly good + \pause + \item sometimes can consume a lot of memory + \pause + \item sometimes keep on compiling all the time + \pause + \item GCs are pretty good + \pause + \item VMs algorithms are not as polished as CPython + ones [xxx reword] + \end{itemize} + \end{block} +\end{frame} + +\begin{frame} + \frametitle{Near future} + \begin{itemize} + \item release March 2010 + \pause + \item first PyPy release to contain JIT! + \item mostly to try it out + \end{itemize} +\end{frame} + +\end{document} From fijal at codespeak.net Sun Feb 7 19:13:17 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sun, 7 Feb 2010 19:13:17 +0100 (CET) Subject: [pypy-svn] r71148 - in pypy/build/bot2/jsplot: css js Message-ID: <20100207181317.072C9282BD8@codespeak.net> Author: fijal Date: Sun Feb 7 19:13:16 2010 New Revision: 71148 Modified: pypy/build/bot2/jsplot/css/main.css pypy/build/bot2/jsplot/js/plot.js Log: Play a bit with CSS, not too happy about the result so far Modified: pypy/build/bot2/jsplot/css/main.css ============================================================================== --- pypy/build/bot2/jsplot/css/main.css (original) +++ pypy/build/bot2/jsplot/css/main.css Sun Feb 7 19:13:16 2010 @@ -18,6 +18,11 @@ font-size: 14pt; font-family: Verdana; } +.tickLabelY { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} .smallcaption { font-size: 10pt; font-family: Verdana; Modified: pypy/build/bot2/jsplot/js/plot.js ============================================================================== --- pypy/build/bot2/jsplot/js/plot.js (original) +++ pypy/build/bot2/jsplot/js/plot.js Sun Feb 7 19:13:16 2010 @@ -209,4 +209,6 @@ hoverable: true, } }); + $('.tickLabel[style*=center]').addClass('tickLabelY'); + $('.tickLabelY').css('text-align', 'left'); } From fijal at codespeak.net Sun Feb 7 20:30:50 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sun, 7 Feb 2010 20:30:50 +0100 (CET) Subject: [pypy-svn] r71149 - pypy/build/bot2/jsplot/js Message-ID: <20100207193050.9A992282BD8@codespeak.net> Author: fijal Date: Sun Feb 7 20:30:49 2010 New Revision: 71149 Modified: pypy/build/bot2/jsplot/js/plot.js Log: Improve CSS Modified: pypy/build/bot2/jsplot/js/plot.js ============================================================================== --- pypy/build/bot2/jsplot/js/plot.js (original) +++ pypy/build/bot2/jsplot/js/plot.js Sun Feb 7 20:30:49 2010 @@ -209,6 +209,12 @@ hoverable: true, } }); - $('.tickLabel[style*=center]').addClass('tickLabelY'); - $('.tickLabelY').css('text-align', 'left'); + var canvas_bottom = $("canvas:last").position().top + + $("canvas:last").height(); + $('.tickLabel[style*=center]').each(function() { + var width = $(this).width(); + $(this).css("top", canvas_bottom + width - 50); + $(this).addClass('tickLabelY'); + }); + $('.tickLabelY').css('text-align', 'right'); } From fijal at codespeak.net Sun Feb 7 20:32:00 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Sun, 7 Feb 2010 20:32:00 +0100 (CET) Subject: [pypy-svn] r71150 - pypy/build/bot2/jsplot/js Message-ID: <20100207193200.580D0282BDA@codespeak.net> Author: fijal Date: Sun Feb 7 20:31:58 2010 New Revision: 71150 Modified: pypy/build/bot2/jsplot/js/plot.js Log: kill arbitrary adjustment Modified: pypy/build/bot2/jsplot/js/plot.js ============================================================================== --- pypy/build/bot2/jsplot/js/plot.js (original) +++ pypy/build/bot2/jsplot/js/plot.js Sun Feb 7 20:31:58 2010 @@ -213,7 +213,7 @@ $("canvas:last").height(); $('.tickLabel[style*=center]').each(function() { var width = $(this).width(); - $(this).css("top", canvas_bottom + width - 50); + $(this).css("top", canvas_bottom + width); $(this).addClass('tickLabelY'); }); $('.tickLabelY').css('text-align', 'right'); From benjamin at codespeak.net Sun Feb 7 20:37:52 2010 From: benjamin at codespeak.net (benjamin at codespeak.net) Date: Sun, 7 Feb 2010 20:37:52 +0100 (CET) Subject: [pypy-svn] r71151 - pypy/trunk/pypy/jit/backend/x86/test Message-ID: <20100207193752.0BE57282BDB@codespeak.net> Author: benjamin Date: Sun Feb 7 20:37:51 2010 New Revision: 71151 Modified: pypy/trunk/pypy/jit/backend/x86/test/test_assembler.py Log: I assume FakeProfileAgent was meant here Modified: pypy/trunk/pypy/jit/backend/x86/test/test_assembler.py ============================================================================== --- pypy/trunk/pypy/jit/backend/x86/test/test_assembler.py (original) +++ pypy/trunk/pypy/jit/backend/x86/test/test_assembler.py Sun Feb 7 20:37:51 2010 @@ -258,7 +258,7 @@ return FakeMC(200 * (self.count - 1)) def test_mc_wrapper_profile_agent(): - agent = ProfileAgent() + agent = FakeProfileAgent() mc = FakeMCWrapper(100, agent) mc.start_function("abc") mc.writechr("x") From benjamin at codespeak.net Sun Feb 7 20:40:17 2010 From: benjamin at codespeak.net (benjamin at codespeak.net) Date: Sun, 7 Feb 2010 20:40:17 +0100 (CET) Subject: [pypy-svn] r71152 - pypy/trunk/pypy/doc/config Message-ID: <20100207194017.2621B282BDC@codespeak.net> Author: benjamin Date: Sun Feb 7 20:40:15 2010 New Revision: 71152 Added: pypy/trunk/pypy/doc/config/translation.jit_profiler.txt Log: document --jit-profiler Added: pypy/trunk/pypy/doc/config/translation.jit_profiler.txt ============================================================================== --- (empty file) +++ pypy/trunk/pypy/doc/config/translation.jit_profiler.txt Sun Feb 7 20:40:15 2010 @@ -0,0 +1 @@ +Integrate profiler support into the JIT From fijal at codespeak.net Mon Feb 8 01:18:05 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Mon, 8 Feb 2010 01:18:05 +0100 (CET) Subject: [pypy-svn] r71154 - pypy/extradoc/talk/pycon2010/keynote Message-ID: <20100208001805.193BA282BD8@codespeak.net> Author: fijal Date: Mon Feb 8 01:18:03 2010 New Revision: 71154 Modified: pypy/extradoc/talk/pycon2010/keynote/talk.pdf pypy/extradoc/talk/pycon2010/keynote/talk.tex Log: I'm sort of happy with slides as they're now. Modified: pypy/extradoc/talk/pycon2010/keynote/talk.pdf ============================================================================== Binary files. No diff available. Modified: pypy/extradoc/talk/pycon2010/keynote/talk.tex ============================================================================== --- pypy/extradoc/talk/pycon2010/keynote/talk.tex (original) +++ pypy/extradoc/talk/pycon2010/keynote/talk.tex Mon Feb 8 01:18:03 2010 @@ -69,7 +69,7 @@ }; \end{tikzpicture} \begin{itemize} - \item We merge experiments into mailine PyPy + \item we merge experiments into mailine PyPy \item xxx \end{itemize} \end{frame} @@ -99,7 +99,7 @@ \end{frame} \begin{frame} - \frametitle{June 2009} + \frametitle{September 2009} \begin{tikzpicture}[remember picture, overlay] \node [shift={(1cm, -4cm)}] at (current page.north west) { \begin{tikzpicture}[remember picture, overlay, font={\fontsize{8pt}{0pt} \ttfamily}] @@ -109,17 +109,40 @@ \draw [fill=blue!20,very thin] (1.7cm, 2.5cm) circle (.06cm); \draw (1.7cm, 2.44cm) -- (1.7cm, 2.0cm); \draw (1.5cm, 1.5cm) node [rotate=45] {JIT merge}; - \draw [fill=blue!20,very thin] (2.3cm, 2.5cm) circle (.06cm); - \draw (2.3cm, 2.44cm) -- (2.3cm, 2.0cm); - \draw (1.95cm, 1.5cm) node [rotate=45] {first example}; + \draw [fill=blue!20,very thin] (4.3cm, 2.5cm) circle (.06cm); + \draw (4.3cm, 2.44cm) -- (4.3cm, 2.0cm); + \draw (3.95cm, 1.5cm) node [rotate=45] {first example}; \end{tikzpicture} }; \end{tikzpicture} - xxx + \begin{itemize} + \item we manage to speed first non-trivial benchmark + \item richards - a simple, object oriented code + \item a variety of optimizations involved + \end{itemize} \end{frame} \begin{frame} - \frametitle{Nice graphs} + \frametitle{February 2010 - now} + \begin{tikzpicture}[remember picture, overlay] + \node [shift={(1cm, -4cm)}] at (current page.north west) { + \begin{tikzpicture}[remember picture, overlay, font={\fontsize{8pt}{0pt} \ttfamily}] + \node [shift={(-1cm, 1.4cm)}, above right] { + \includegraphics[width=.15\textwidth]{pypy-logo.png}}; + \draw [thick, ->] (1.2cm, 2.5cm) -- (10cm, 2.5cm); + \draw [fill=blue!20,very thin] (1.7cm, 2.5cm) circle (.06cm); + \draw (1.7cm, 2.44cm) -- (1.7cm, 2.0cm); + \draw (1.5cm, 1.5cm) node [rotate=45] {JIT merge}; + \draw [fill=blue!20,very thin] (4.3cm, 2.5cm) circle (.06cm); + \draw (4.3cm, 2.44cm) -- (4.3cm, 2.0cm); + \draw (3.95cm, 1.5cm) node [rotate=45] {first example}; + \draw [fill=blue!20,very thin] (7.3cm, 2.5cm) circle (.06cm); + \draw (7.3cm, 2.44cm) -- (7.3cm, 2.0cm); + \draw (6.95cm, 1.5cm) node [rotate=45] {richards}; + \end{tikzpicture} + }; + \end{tikzpicture} + We run a variety of benchmarks nightly. \end{frame} \begin{frame} @@ -128,14 +151,14 @@ \begin{itemize} \item JIT is fairly good \pause - \item sometimes can consume a lot of memory + \item can consume a lot of memory \pause - \item sometimes keep on compiling all the time + \item can recompile code too many times \pause \item GCs are pretty good \pause - \item VMs algorithms are not as polished as CPython - ones [xxx reword] + \item runtime algorithms are not as polished as CPython + ones (ie strings, regexes) \end{itemize} \end{block} \end{frame} @@ -147,6 +170,27 @@ \pause \item first PyPy release to contain JIT! \item mostly to try it out + \pause + \item we just got a bit more {\bf EU funding} + \item we're actively looking for {\bf sponsoring} to continue PyPy development + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Come to my next talk!} + \begin{block}{speed of PyPy} + ... or how to write programs that play well with the JIT + \end{block} +\end{frame} + +\begin{frame} + \frametitle{That's all} + Thank you for your attention + \begin{itemize} + \item http://morepypy.blogspot.com + \item http://pypy.org + \item http://merlinux.de + \item these slides are already online \end{itemize} \end{frame} From benjamin at codespeak.net Mon Feb 8 03:20:19 2010 From: benjamin at codespeak.net (benjamin at codespeak.net) Date: Mon, 8 Feb 2010 03:20:19 +0100 (CET) Subject: [pypy-svn] r71157 - pypy/trunk/pypy/doc/jit Message-ID: <20100208022019.4FA5B282BD8@codespeak.net> Author: benjamin Date: Mon Feb 8 03:20:17 2010 New Revision: 71157 Modified: pypy/trunk/pypy/doc/jit/pyjitpl5.txt Log: kill some xxxs Modified: pypy/trunk/pypy/doc/jit/pyjitpl5.txt ============================================================================== --- pypy/trunk/pypy/doc/jit/pyjitpl5.txt (original) +++ pypy/trunk/pypy/doc/jit/pyjitpl5.txt Mon Feb 8 03:20:17 2010 @@ -31,8 +31,8 @@ the JIT to bail back to the interpreter in case running machine code is no longer suitable. can_enter_jit goes at the end of a application level loop. In the Python interpreter, this is the JUMP_ABSOLUTE bytecode. The Python -interpreter defines its hints in pypy/module/pypyjit/interp_jit.py. -XXX by overloading default frame behavior from pyframe +interpreter defines its hints in pypy/module/pypyjit/interp_jit.py in a few +overriden methods of the defaut interpreter loop. The interpreter wishing to use the PyPy's JIT must define a list of *green* variables and a list of *red* variables. The *green* variables are loop @@ -98,9 +98,8 @@ for optimization purposes, are also stored in constant boxes. Normal boxes contain values that may change during the running of a loop. There are three kinds of normal boxes: BoxInt, BoxPtr, and BoxFloat, and four kinds of constant -boxes: ConstInt, ConstPtr, ConstFloat, and ConstAddr. -XXX ConstAddr is only a hack for translation not to translate pointers, -XXX nothing more +boxes: ConstInt, ConstPtr, ConstFloat, and ConstAddr. (ConstAddr is only used +to get around a limitation in the translation toolchain.) The meta-interpreter starts interpreting the JIT bytecode. Each operation is executed and then recorded in a list of operations, called the trace. From fijal at codespeak.net Mon Feb 8 04:08:52 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Mon, 8 Feb 2010 04:08:52 +0100 (CET) Subject: [pypy-svn] r71160 - pypy/extradoc/talk/pycon2010/keynote Message-ID: <20100208030852.BC87D282BD8@codespeak.net> Author: fijal Date: Mon Feb 8 04:08:51 2010 New Revision: 71160 Modified: pypy/extradoc/talk/pycon2010/keynote/talk.tex Log: (alexgaynor) fix Modified: pypy/extradoc/talk/pycon2010/keynote/talk.tex ============================================================================== --- pypy/extradoc/talk/pycon2010/keynote/talk.tex (original) +++ pypy/extradoc/talk/pycon2010/keynote/talk.tex Mon Feb 8 04:08:51 2010 @@ -158,7 +158,7 @@ \item GCs are pretty good \pause \item runtime algorithms are not as polished as CPython - ones (ie strings, regexes) + ones (eg strings, regexes) \end{itemize} \end{block} \end{frame} From cfbolz at codespeak.net Mon Feb 8 10:43:17 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Mon, 8 Feb 2010 10:43:17 +0100 (CET) Subject: [pypy-svn] r71161 - pypy/trunk/pypy/interpreter Message-ID: <20100208094317.E9FAF282BD8@codespeak.net> Author: cfbolz Date: Mon Feb 8 10:43:16 2010 New Revision: 71161 Modified: pypy/trunk/pypy/interpreter/generator.py Log: as long as we need to promote the last_instr anyway, let's at least get rid of a few guards. Modified: pypy/trunk/pypy/interpreter/generator.py ============================================================================== --- pypy/trunk/pypy/interpreter/generator.py (original) +++ pypy/trunk/pypy/interpreter/generator.py Mon Feb 8 10:43:16 2010 @@ -44,7 +44,10 @@ space.wrap('generator already executing')) if self.frame.frame_finished_execution: raise OperationError(space.w_StopIteration, space.w_None) - if self.frame.last_instr == -1: + # XXX it's not clear that last_instr should be promoted at all + # but as long as it is necessary for call_assembler, let's do it early + last_instr = hint(self.frame.last_instr, promote=True) + if last_instr == -1: if w_arg and not space.is_w(w_arg, space.w_None): msg = "can't send non-None value to a just-started generator" raise OperationError(space.w_TypeError, space.wrap(msg)) From afa at codespeak.net Mon Feb 8 11:48:16 2010 From: afa at codespeak.net (afa at codespeak.net) Date: Mon, 8 Feb 2010 11:48:16 +0100 (CET) Subject: [pypy-svn] r71162 - pypy/trunk/pypy/lib/app_test/ctypes_tests Message-ID: <20100208104816.1952B282BDA@codespeak.net> Author: afa Date: Mon Feb 8 11:48:15 2010 New Revision: 71162 Modified: pypy/trunk/pypy/lib/app_test/ctypes_tests/test_funcptr.py Log: Disable the test for CFUNCTYPE.from_address, I can't make it work on Linux with cpython anyway. The samples in http://thread.gmane.org/gmane.comp.python.ctypes.user/3548/focus=3549 does not seem to work. Modified: pypy/trunk/pypy/lib/app_test/ctypes_tests/test_funcptr.py ============================================================================== --- pypy/trunk/pypy/lib/app_test/ctypes_tests/test_funcptr.py (original) +++ pypy/trunk/pypy/lib/app_test/ctypes_tests/test_funcptr.py Mon Feb 8 11:48:15 2010 @@ -142,4 +142,7 @@ func.__keep = ptr # keep ptr alive return func f = make_function() - assert f() == 0x12345678 + # This assembler should also work on Linux 32bit, + # but it segfaults for some reason. + if sys.platform == 'win32': + assert f() == 0x12345678 From tobami at codespeak.net Mon Feb 8 12:17:50 2010 From: tobami at codespeak.net (tobami at codespeak.net) Date: Mon, 8 Feb 2010 12:17:50 +0100 (CET) Subject: [pypy-svn] r71163 - codespeed/pyspeed/fixtures Message-ID: <20100208111750.E4194282BD8@codespeak.net> Author: tobami Date: Mon Feb 8 12:17:49 2010 New Revision: 71163 Added: codespeed/pyspeed/fixtures/initial_data.json Log: Initial data with real benchmark data Added: codespeed/pyspeed/fixtures/initial_data.json ============================================================================== --- (empty file) +++ codespeed/pyspeed/fixtures/initial_data.json Mon Feb 8 12:17:49 2010 @@ -0,0 +1 @@ +[{"pk": 22, "model": "auth.permission", "fields": {"codename": "add_logentry", "name": "Can add log entry", "content_type": 8}}, {"pk": 23, "model": "auth.permission", "fields": {"codename": "change_logentry", "name": "Can change log entry", "content_type": 8}}, {"pk": 24, "model": "auth.permission", "fields": {"codename": "delete_logentry", "name": "Can delete log entry", "content_type": 8}}, {"pk": 4, "model": "auth.permission", "fields": {"codename": "add_group", "name": "Can add group", "content_type": 2}}, {"pk": 10, "model": "auth.permission", "fields": {"codename": "add_message", "name": "Can add message", "content_type": 4}}, {"pk": 1, "model": "auth.permission", "fields": {"codename": "add_permission", "name": "Can add permission", "content_type": 1}}, {"pk": 7, "model": "auth.permission", "fields": {"codename": "add_user", "name": "Can add user", "content_type": 3}}, {"pk": 5, "model": "auth.permission", "fields": {"codename": "change_group", "name": "Can change group", "content_type": 2}}, {"pk": 11, "model": "auth.permission", "fields": {"codename": "change_message", "name": "Can change message", "content_type": 4}}, {"pk": 2, "model": "auth.permission", "fields": {"codename": "change_permission", "name": "Can change permission", "content_type": 1}}, {"pk": 8, "model": "auth.permission", "fields": {"codename": "change_user", "name": "Can change user", "content_type": 3}}, {"pk": 6, "model": "auth.permission", "fields": {"codename": "delete_group", "name": "Can delete group", "content_type": 2}}, {"pk": 12, "model": "auth.permission", "fields": {"codename": "delete_message", "name": "Can delete message", "content_type": 4}}, {"pk": 3, "model": "auth.permission", "fields": {"codename": "delete_permission", "name": "Can delete permission", "content_type": 1}}, {"pk": 9, "model": "auth.permission", "fields": {"codename": "delete_user", "name": "Can delete user", "content_type": 3}}, {"pk": 31, "model": "auth.permission", "fields": {"codename": "add_benchmark", "name": "Can add benchmark", "content_type": 11}}, {"pk": 34, "model": "auth.permission", "fields": {"codename": "add_environment", "name": "Can add environment", "content_type": 12}}, {"pk": 28, "model": "auth.permission", "fields": {"codename": "add_interpreter", "name": "Can add interpreter", "content_type": 10}}, {"pk": 37, "model": "auth.permission", "fields": {"codename": "add_result", "name": "Can add result", "content_type": 13}}, {"pk": 25, "model": "auth.permission", "fields": {"codename": "add_revision", "name": "Can add revision", "content_type": 9}}, {"pk": 32, "model": "auth.permission", "fields": {"codename": "change_benchmark", "name": "Can change benchmark", "content_type": 11}}, {"pk": 35, "model": "auth.permission", "fields": {"codename": "change_environment", "name": "Can change environment", "content_type": 12}}, {"pk": 29, "model": "auth.permission", "fields": {"codename": "change_interpreter", "name": "Can change interpreter", "content_type": 10}}, {"pk": 38, "model": "auth.permission", "fields": {"codename": "change_result", "name": "Can change result", "content_type": 13}}, {"pk": 26, "model": "auth.permission", "fields": {"codename": "change_revision", "name": "Can change revision", "content_type": 9}}, {"pk": 33, "model": "auth.permission", "fields": {"codename": "delete_benchmark", "name": "Can delete benchmark", "content_type": 11}}, {"pk": 36, "model": "auth.permission", "fields": {"codename": "delete_environment", "name": "Can delete environment", "content_type": 12}}, {"pk": 30, "model": "auth.permission", "fields": {"codename": "delete_interpreter", "name": "Can delete interpreter", "content_type": 10}}, {"pk": 39, "model": "auth.permission", "fields": {"codename": "delete_result", "name": "Can delete result", "content_type": 13}}, {"pk": 27, "model": "auth.permission", "fields": {"codename": "delete_revision", "name": "Can delete revision", "content_type": 9}}, {"pk": 13, "model": "auth.permission", "fields": {"codename": "add_contenttype", "name": "Can add content type", "content_type": 5}}, {"pk": 14, "model": "auth.permission", "fields": {"codename": "change_contenttype", "name": "Can change content type", "content_type": 5}}, {"pk": 15, "model": "auth.permission", "fields": {"codename": "delete_contenttype", "name": "Can delete content type", "content_type": 5}}, {"pk": 16, "model": "auth.permission", "fields": {"codename": "add_session", "name": "Can add session", "content_type": 6}}, {"pk": 17, "model": "auth.permission", "fields": {"codename": "change_session", "name": "Can change session", "content_type": 6}}, {"pk": 18, "model": "auth.permission", "fields": {"codename": "delete_session", "name": "Can delete session", "content_type": 6}}, {"pk": 19, "model": "auth.permission", "fields": {"codename": "add_site", "name": "Can add site", "content_type": 7}}, {"pk": 20, "model": "auth.permission", "fields": {"codename": "change_site", "name": "Can change site", "content_type": 7}}, {"pk": 21, "model": "auth.permission", "fields": {"codename": "delete_site", "name": "Can delete site", "content_type": 7}}, {"pk": 1, "model": "auth.user", "fields": {"username": "admin", "first_name": "", "last_name": "", "is_active": 1, "is_superuser": 1, "is_staff": 1, "last_login": "2010-01-26 06:07:11", "groups": [], "user_permissions": [], "password": "sha1$fe3db$f113035e546a78ce8884f3a5f90b5e4ce3b12374", "email": "a at a.es", "date_joined": "2010-01-26 06:05:17"}}, {"pk": 11, "model": "contenttypes.contenttype", "fields": {"model": "benchmark", "name": "benchmark", "app_label": "codespeed"}}, {"pk": 5, "model": "contenttypes.contenttype", "fields": {"model": "contenttype", "name": "content type", "app_label": "contenttypes"}}, {"pk": 12, "model": "contenttypes.contenttype", "fields": {"model": "environment", "name": "environment", "app_label": "codespeed"}}, {"pk": 2, "model": "contenttypes.contenttype", "fields": {"model": "group", "name": "group", "app_label": "auth"}}, {"pk": 10, "model": "contenttypes.contenttype", "fields": {"model": "interpreter", "name": "interpreter", "app_label": "codespeed"}}, {"pk": 8, "model": "contenttypes.contenttype", "fields": {"model": "logentry", "name": "log entry", "app_label": "admin"}}, {"pk": 4, "model": "contenttypes.contenttype", "fields": {"model": "message", "name": "message", "app_label": "auth"}}, {"pk": 1, "model": "contenttypes.contenttype", "fields": {"model": "permission", "name": "permission", "app_label": "auth"}}, {"pk": 13, "model": "contenttypes.contenttype", "fields": {"model": "result", "name": "result", "app_label": "codespeed"}}, {"pk": 9, "model": "contenttypes.contenttype", "fields": {"model": "revision", "name": "revision", "app_label": "codespeed"}}, {"pk": 6, "model": "contenttypes.contenttype", "fields": {"model": "session", "name": "session", "app_label": "sessions"}}, {"pk": 7, "model": "contenttypes.contenttype", "fields": {"model": "site", "name": "site", "app_label": "sites"}}, {"pk": 3, "model": "contenttypes.contenttype", "fields": {"model": "user", "name": "user", "app_label": "auth"}}, {"pk": "459091210dde06b3f6d9ec26151831de", "model": "sessions.session", "fields": {"expire_date": "2010-02-09 06:07:11", "session_data": "gAJ9cQEoVRJfYXV0aF91c2VyX2JhY2tlbmRxAlUpZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5k\ncy5Nb2RlbEJhY2tlbmRxA1UNX2F1dGhfdXNlcl9pZHEEigEBdS5lMzBlMjdkMjI0MTk5MzIwODE3\nNTI4ZDMyZjRlODQzZQ==\n"}}, {"pk": 1, "model": "sites.site", "fields": {"domain": "example.com", "name": "example.com"}}, {"pk": 4, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2010-02-08 05:07:36", "object_repr": "pypy-c-jit gc=hybrid", "object_id": "2", "change_message": "Changed coptions.", "user": 1, "content_type": 10}}, {"pk": 3, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2010-01-27 05:42:38", "object_repr": "262", "object_id": "3", "change_message": "Changed tag.", "user": 1, "content_type": 9}}, {"pk": 2, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2010-01-27 05:42:21", "object_repr": "2620", "object_id": "1", "change_message": "", "user": 1, "content_type": 9}}, {"pk": 1, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2010-01-26 06:07:22", "object_repr": "Dual Core Linux", "object_id": "1", "change_message": "", "user": 1, "content_type": 12}}, {"pk": 2, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70632}}, {"pk": 3, "model": "codespeed.revision", "fields": {"project": "cpython", "date": null, "message": "", "tag": "2.6.2", "number": 262}}, {"pk": 4, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70634}}, {"pk": 5, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70641}}, {"pk": 6, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70643}}, {"pk": 7, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70671}}, {"pk": 8, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70678}}, {"pk": 9, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70688}}, {"pk": 10, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70694}}, {"pk": 11, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70721}}, {"pk": 12, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70740}}, {"pk": 13, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70764}}, {"pk": 14, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70789}}, {"pk": 15, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70794}}, {"pk": 16, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70813}}, {"pk": 17, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70831}}, {"pk": 18, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70857}}, {"pk": 19, "model": "codespeed.revision", "fields": {"project": "pypy", "date": null, "message": "", "tag": "", "number": 70901}}, {"pk": 1, "model": "codespeed.interpreter", "fields": {"coptions": "default", "name": "cpython"}}, {"pk": 2, "model": "codespeed.interpreter", "fields": {"coptions": "gc=hybrid", "name": "pypy-c-jit"}}, {"pk": 1, "model": "codespeed.benchmark", "fields": {"name": "ai", "benchmark_type": "T", "description": ""}}, {"pk": 2, "model": "codespeed.benchmark", "fields": {"name": "django", "benchmark_type": "T", "description": ""}}, {"pk": 3, "model": "codespeed.benchmark", "fields": {"name": "html5lib", "benchmark_type": "T", "description": ""}}, {"pk": 4, "model": "codespeed.benchmark", "fields": {"name": "richards", "benchmark_type": "T", "description": ""}}, {"pk": 5, "model": "codespeed.benchmark", "fields": {"name": "rietveld", "benchmark_type": "T", "description": ""}}, {"pk": 6, "model": "codespeed.benchmark", "fields": {"name": "slowspitfire", "benchmark_type": "T", "description": ""}}, {"pk": 7, "model": "codespeed.benchmark", "fields": {"name": "spambayes", "benchmark_type": "T", "description": ""}}, {"pk": 8, "model": "codespeed.benchmark", "fields": {"name": "float", "benchmark_type": "T", "description": ""}}, {"pk": 9, "model": "codespeed.benchmark", "fields": {"name": "chaos", "benchmark_type": "T", "description": ""}}, {"pk": 10, "model": "codespeed.benchmark", "fields": {"name": "fannkuch", "benchmark_type": "T", "description": ""}}, {"pk": 11, "model": "codespeed.benchmark", "fields": {"name": "meteor-contest", "benchmark_type": "T", "description": ""}}, {"pk": 12, "model": "codespeed.benchmark", "fields": {"name": "nbody_modified", "benchmark_type": "T", "description": ""}}, {"pk": 13, "model": "codespeed.benchmark", "fields": {"name": "spectral-norm", "benchmark_type": "T", "description": ""}}, {"pk": 14, "model": "codespeed.benchmark", "fields": {"name": "telco", "benchmark_type": "T", "description": ""}}, {"pk": 15, "model": "codespeed.benchmark", "fields": {"name": "gcbench", "benchmark_type": "T", "description": ""}}, {"pk": 1, "model": "codespeed.environment", "fields": {"memory": "2Gb", "os": "Linux", "name": "Dual Core Linux", "cpu": "Core 2 Duo 2.66Mhz"}}, {"pk": 1, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.43707809448200002, "environment": 1, "date": "2010-01-27 09:41:22", "interpreter": 2, "result_type": "T", "revision": 2}}, {"pk": 2, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.65519900322000002, "environment": 1, "date": "2010-01-27 09:41:22", "interpreter": 2, "result_type": "T", "revision": 2}}, {"pk": 3, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.343158960299998, "environment": 1, "date": "2010-01-27 09:41:22", "interpreter": 2, "result_type": "T", "revision": 2}}, {"pk": 4, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.029869985580400001, "environment": 1, "date": "2010-01-27 09:41:22", "interpreter": 2, "result_type": "T", "revision": 2}}, {"pk": 5, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.36875300408, "environment": 1, "date": "2010-01-27 09:41:22", "interpreter": 2, "result_type": "T", "revision": 2}}, {"pk": 6, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.9608736038200001, "environment": 1, "date": "2010-01-27 09:41:22", "interpreter": 2, "result_type": "T", "revision": 2}}, {"pk": 7, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.2217754364, "environment": 1, "date": "2010-01-27 09:41:22", "interpreter": 2, "result_type": "T", "revision": 2}}, {"pk": 8, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.42399716377300001, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 9, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.81054883003199996, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 10, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 12.267576932900001, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 11, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.29155521392799999, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 12, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 0.47792563438399999, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 13, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 0.68440842628499998, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 14, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 0.27043123245200001, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 15, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.42492904663100001, "environment": 1, "date": "2010-01-27 09:41:23", "interpreter": 2, "result_type": "T", "revision": 4}}, {"pk": 16, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.62576680183400002, "environment": 1, "date": "2010-01-27 09:41:23", "interpreter": 2, "result_type": "T", "revision": 4}}, {"pk": 17, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.203540086699999, "environment": 1, "date": "2010-01-27 09:41:23", "interpreter": 2, "result_type": "T", "revision": 4}}, {"pk": 18, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.029346752166800001, "environment": 1, "date": "2010-01-27 09:41:23", "interpreter": 2, "result_type": "T", "revision": 4}}, {"pk": 19, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.3492350578300001, "environment": 1, "date": "2010-01-27 09:41:23", "interpreter": 2, "result_type": "T", "revision": 4}}, {"pk": 20, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.9761237621300001, "environment": 1, "date": "2010-01-27 09:41:23", "interpreter": 2, "result_type": "T", "revision": 4}}, {"pk": 21, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.3172614097599999, "environment": 1, "date": "2010-01-27 09:41:23", "interpreter": 2, "result_type": "T", "revision": 4}}, {"pk": 22, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.442705011368, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 5}}, {"pk": 23, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.69898595809899999, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 5}}, {"pk": 24, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 19.623087883, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 5}}, {"pk": 25, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.031779193878200003, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 5}}, {"pk": 26, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.35385112762, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 5}}, {"pk": 27, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 2.0196122646300001, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 5}}, {"pk": 28, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.2326191902200001, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 5}}, {"pk": 29, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.427397823334, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 6}}, {"pk": 30, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.64163026809699997, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 6}}, {"pk": 31, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.129413127900001, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 6}}, {"pk": 32, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.031384038925200003, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 6}}, {"pk": 33, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.38800883293, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 6}}, {"pk": 34, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.97738900185, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 6}}, {"pk": 35, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.2374196052499999, "environment": 1, "date": "2010-01-27 09:41:24", "interpreter": 2, "result_type": "T", "revision": 6}}, {"pk": 36, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.44572839736999997, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 7}}, {"pk": 37, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.619217777252, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 7}}, {"pk": 38, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.536835908899999, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 7}}, {"pk": 39, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.031195306778, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 7}}, {"pk": 40, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.37284536361, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 7}}, {"pk": 41, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.9654173851000001, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 7}}, {"pk": 42, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.21845993996, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 7}}, {"pk": 43, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.43448724746700002, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 8}}, {"pk": 44, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.65551400184599995, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 8}}, {"pk": 45, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.218690061569, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 8}}, {"pk": 46, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.542385101299999, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 8}}, {"pk": 47, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.030475807189899999, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 8}}, {"pk": 48, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.34365615845, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 8}}, {"pk": 49, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 2.00317382812, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 8}}, {"pk": 50, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.2182968139699999, "environment": 1, "date": "2010-01-27 09:41:25", "interpreter": 2, "result_type": "T", "revision": 8}}, {"pk": 51, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.422487783432, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 52, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.121007490158, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 53, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.64096617698699998, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 54, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.37990322113000002, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 55, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.135547828674, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 56, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.0433809757, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 57, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.37866396903999999, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 58, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.076025152206400007, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 59, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.029587221145600001, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 60, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.33778300285, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 61, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.95510158539, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 62, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.21777257919, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 63, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.062807464599600002, "environment": 1, "date": "2010-01-27 09:41:26", "interpreter": 2, "result_type": "T", "revision": 9}}, {"pk": 64, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.42574295997599998, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 65, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.116217041016, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 66, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.67578072547900003, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 67, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.391155767441, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 68, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.12938299179099999, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 69, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.0490338802, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 70, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.38244643211399998, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 71, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.075785207748500005, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 72, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.030660200118999999, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 73, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.33663039207, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 74, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.9485769748699999, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 75, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.22385950089, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 76, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.063131237029999995, "environment": 1, "date": "2010-01-27 09:41:27", "interpreter": 2, "result_type": "T", "revision": 10}}, {"pk": 77, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.43206744194000002, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 78, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.120690727234, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 79, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.62421946525600003, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 80, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.373276233673, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 81, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.15013499259999999, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 82, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.6344439983, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 83, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.38476510047899998, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 84, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.077058410644600006, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 85, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.030047035217300001, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 86, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.3758056163800001, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 87, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 2.0055235862699998, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 88, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.2375351429000001, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 89, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.063822555542000003, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 90, "model": "codespeed.result", "fields": {"benchmark": 14, "value": 0.65200000000000002, "environment": 1, "date": "2010-01-27 09:41:28", "interpreter": 2, "result_type": "T", "revision": 11}}, {"pk": 91, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.43032097816499998, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 92, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.11874918937700001, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 93, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.65952877998299997, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 94, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.38479938507099998, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 95, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.148169994354, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 96, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.341817855799999, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 97, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.38457193374600002, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 98, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.079361963272, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 99, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.030018854141200001, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 100, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.3934579849299999, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 101, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.9659803867300001, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 102, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.24824433327, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 103, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.0622970581055, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 104, "model": "codespeed.result", "fields": {"benchmark": 14, "value": 0.624, "environment": 1, "date": "2010-01-27 09:41:29", "interpreter": 2, "result_type": "T", "revision": 12}}, {"pk": 105, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.42947344780000002, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 106, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.118019390106, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 107, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.64448981285100004, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 108, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.39367756843500001, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 109, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.131764364243, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 110, "model": "codespeed.result", "fields": {"benchmark": 15, "value": 7.6069629192399999, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 111, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.664299011200001, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 112, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.38062396049500002, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 113, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.079070186614999996, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 114, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.029060602188099999, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 115, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.36374936104, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 116, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.9975749492599999, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 117, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.2262028217300001, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 118, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.067093992233299996, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 119, "model": "codespeed.result", "fields": {"benchmark": 14, "value": 0.63600000000000001, "environment": 1, "date": "2010-01-27 09:41:30", "interpreter": 2, "result_type": "T", "revision": 13}}, {"pk": 120, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.43611154556300002, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 121, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.122742033005, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 122, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.67777743339499996, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 123, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.38444399833699999, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 124, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.146523761749, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 125, "model": "codespeed.result", "fields": {"benchmark": 15, "value": 7.8365619182600001, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 126, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 19.585288047799999, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 127, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.39473080635000002, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 128, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.074167156219499999, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 129, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.0297776699066, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 130, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.45638175011, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 131, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.9965989589699999, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 132, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.26717119217, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 133, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.065821361541800003, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 134, "model": "codespeed.result", "fields": {"benchmark": 14, "value": 0.63400000000000001, "environment": 1, "date": "2010-01-27 09:41:31", "interpreter": 2, "result_type": "T", "revision": 14}}, {"pk": 135, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.426050901413, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 136, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.122226619721, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 137, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.67538876533500003, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 138, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.38024778366099998, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 139, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.142001438141, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 140, "model": "codespeed.result", "fields": {"benchmark": 15, "value": 7.6646499633799996, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 141, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 19.0767159462, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 142, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.38860616683999999, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 143, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.074223804473800004, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 144, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.030911397933999999, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 145, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.4178003788, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 146, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.95840940476, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 147, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.2289570808400001, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 148, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.068292617797899996, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 149, "model": "codespeed.result", "fields": {"benchmark": 14, "value": 0.64400000000000002, "environment": 1, "date": "2010-01-27 09:41:32", "interpreter": 2, "result_type": "T", "revision": 15}}, {"pk": 150, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.43184123039299999, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 151, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.128963375091, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 152, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.67031297683699997, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 153, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.37783699035599999, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 154, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.14520840644800001, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 155, "model": "codespeed.result", "fields": {"benchmark": 15, "value": 7.7148549556699999, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 156, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 19.313369989400002, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 157, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.40089354515100001, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 158, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.076049709320000006, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 159, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.030450057983399999, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 160, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.41337842941, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 161, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 2.0009929657000001, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 162, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.2717852592500001, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 163, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.067063713073700001, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 164, "model": "codespeed.result", "fields": {"benchmark": 14, "value": 0.68799999999999994, "environment": 1, "date": "2010-01-27 09:41:33", "interpreter": 2, "result_type": "T", "revision": 16}}, {"pk": 165, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.428143215179, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 166, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.117868947983, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 167, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.585657787323, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 168, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.38937940597499998, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 169, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.130286979675, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 170, "model": "codespeed.result", "fields": {"benchmark": 15, "value": 5.4381451606800004, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 171, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 19.300865888600001, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 172, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.39005379676800001, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 173, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.073681354522599996, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 174, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.027494049072299999, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 175, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.39566936493, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 176, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.9981239795700001, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 177, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.21310677528, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 178, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.0675278663635, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 179, "model": "codespeed.result", "fields": {"benchmark": 14, "value": 0.53000000000000003, "environment": 1, "date": "2010-01-27 09:41:34", "interpreter": 2, "result_type": "T", "revision": 17}}, {"pk": 180, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.42251968383799998, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 181, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.11669778823800001, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 182, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.629346036911, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 183, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.39522018432599998, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 184, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.14308924675000001, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 185, "model": "codespeed.result", "fields": {"benchmark": 15, "value": 5.0056009292599999, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 186, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.969789028200001, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 187, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.38797254562400002, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 188, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.072004508972299999, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 189, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.027719545364400001, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 190, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.4016525745399999, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 191, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 2.0152218341800001, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 192, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.2458042144799999, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 193, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.066313076019300005, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 194, "model": "codespeed.result", "fields": {"benchmark": 14, "value": 0.52000000000000002, "environment": 1, "date": "2010-01-27 09:41:35", "interpreter": 2, "result_type": "T", "revision": 18}}, {"pk": 195, "model": "codespeed.result", "fields": {"benchmark": 1, "value": 0.44146103859000002, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 196, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.116399478912, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 197, "model": "codespeed.result", "fields": {"benchmark": 2, "value": 0.56150536537200002, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 198, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 0.37951617240899999, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 199, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.14459261894200001, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 200, "model": "codespeed.result", "fields": {"benchmark": 15, "value": 5.2366421222700001, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 201, "model": "codespeed.result", "fields": {"benchmark": 3, "value": 18.872216939899999, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 202, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.386883449554, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 203, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.077071142196599995, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 204, "model": "codespeed.result", "fields": {"benchmark": 4, "value": 0.029833173751799998, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 205, "model": "codespeed.result", "fields": {"benchmark": 5, "value": 1.35280065537, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 206, "model": "codespeed.result", "fields": {"benchmark": 6, "value": 1.9402369976, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 207, "model": "codespeed.result", "fields": {"benchmark": 7, "value": 1.1963545799299999, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 208, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.066495370864899997, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 209, "model": "codespeed.result", "fields": {"benchmark": 14, "value": 0.46600000000000003, "environment": 1, "date": "2010-01-27 09:59:21", "interpreter": 2, "result_type": "T", "revision": 19}}, {"pk": 210, "model": "codespeed.result", "fields": {"benchmark": 9, "value": 0.41664323806800002, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 211, "model": "codespeed.result", "fields": {"benchmark": 10, "value": 1.8286975860600001, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 212, "model": "codespeed.result", "fields": {"benchmark": 8, "value": 0.50340080261200004, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 213, "model": "codespeed.result", "fields": {"benchmark": 15, "value": 27.453859090800002, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 214, "model": "codespeed.result", "fields": {"benchmark": 11, "value": 0.31127257347100001, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 215, "model": "codespeed.result", "fields": {"benchmark": 12, "value": 0.54108843803399997, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 216, "model": "codespeed.result", "fields": {"benchmark": 13, "value": 0.484123945236, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}, {"pk": 217, "model": "codespeed.result", "fields": {"benchmark": 14, "value": 1.006, "environment": 1, "date": "2010-01-27 15:02:32", "interpreter": 1, "result_type": "T", "revision": 3}}] From cfbolz at codespeak.net Mon Feb 8 12:24:12 2010 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Mon, 8 Feb 2010 12:24:12 +0100 (CET) Subject: [pypy-svn] r71164 - pypy/branch/abort-no-asm/pypy/jit/metainterp/test Message-ID: <20100208112412.C6EE7282BD8@codespeak.net> Author: cfbolz Date: Mon Feb 8 12:24:11 2010 New Revision: 71164 Modified: pypy/branch/abort-no-asm/pypy/jit/metainterp/test/test_recursive.py Log: a test for r71114 Modified: pypy/branch/abort-no-asm/pypy/jit/metainterp/test/test_recursive.py ============================================================================== --- pypy/branch/abort-no-asm/pypy/jit/metainterp/test/test_recursive.py (original) +++ pypy/branch/abort-no-asm/pypy/jit/metainterp/test/test_recursive.py Mon Feb 8 12:24:11 2010 @@ -666,6 +666,26 @@ self.meta_interp(portal, [2], inline=True) self.check_history(call_assembler=1) + def test_directly_call_assembler_abort_calltarget_not_present(self): + driver = JitDriver(greens = ['codeno'], reds = ['i'], + get_printable_location = lambda codeno : str(codeno), + can_inline = lambda codeno : False) + + def portal(codeno): + i = 0 + while i < 10: + driver.can_enter_jit(codeno = codeno, i = i) + driver.jit_merge_point(codeno = codeno, i = i) + if codeno == 2: + if i >= 2: + portal(1) + else: + return + i += 1 + + self.meta_interp(portal, [2], inline=True) + self.check_history(call_assembler=1) + def test_directly_call_assembler_return(self): driver = JitDriver(greens = ['codeno'], reds = ['i', 'k'], get_printable_location = lambda codeno : str(codeno), From afa at codespeak.net Mon Feb 8 18:27:38 2010 From: afa at codespeak.net (afa at codespeak.net) Date: Mon, 8 Feb 2010 18:27:38 +0100 (CET) Subject: [pypy-svn] r71173 - pypy/trunk/pypy/translator/c/gcc Message-ID: <20100208172738.CD13B282BD8@codespeak.net> Author: afa Date: Mon Feb 8 18:27:35 2010 New Revision: 71173 Modified: pypy/trunk/pypy/translator/c/gcc/trackgcroot.py Log: Ignore one more floating-point instruction in trackgcroot. Modified: pypy/trunk/pypy/translator/c/gcc/trackgcroot.py ============================================================================== --- pypy/trunk/pypy/translator/c/gcc/trackgcroot.py (original) +++ pypy/trunk/pypy/translator/c/gcc/trackgcroot.py Mon Feb 8 18:27:35 2010 @@ -348,7 +348,7 @@ # floating-point operations cannot produce GC pointers 'f', 'cvt', 'ucomi', 'subs', 'subp' , 'adds', 'addp', 'xorp', 'movap', - 'movd', 'sqrtsd', + 'movd', 'movlp', 'sqrtsd', 'mins', 'minp', 'maxs', 'maxp', 'unpck', 'pxor', 'por', # sse2 # arithmetic operations should not produce GC pointers 'inc', 'dec', 'not', 'neg', 'or', 'and', 'sbb', 'adc', From afa at codespeak.net Tue Feb 9 09:51:35 2010 From: afa at codespeak.net (afa at codespeak.net) Date: Tue, 9 Feb 2010 09:51:35 +0100 (CET) Subject: [pypy-svn] r71176 - pypy/trunk/pypy/interpreter Message-ID: <20100209085135.2E9B6282BDE@codespeak.net> Author: afa Date: Tue Feb 9 09:51:33 2010 New Revision: 71176 Modified: pypy/trunk/pypy/interpreter/generator.py Log: Fix the NameError Modified: pypy/trunk/pypy/interpreter/generator.py ============================================================================== --- pypy/trunk/pypy/interpreter/generator.py (original) +++ pypy/trunk/pypy/interpreter/generator.py Tue Feb 9 09:51:33 2010 @@ -46,7 +46,7 @@ raise OperationError(space.w_StopIteration, space.w_None) # XXX it's not clear that last_instr should be promoted at all # but as long as it is necessary for call_assembler, let's do it early - last_instr = hint(self.frame.last_instr, promote=True) + last_instr = jit.hint(self.frame.last_instr, promote=True) if last_instr == -1: if w_arg and not space.is_w(w_arg, space.w_None): msg = "can't send non-None value to a just-started generator" From afa at codespeak.net Tue Feb 9 17:55:15 2010 From: afa at codespeak.net (afa at codespeak.net) Date: Tue, 9 Feb 2010 17:55:15 +0100 (CET) Subject: [pypy-svn] r71180 - pypy/trunk/pypy/translator/c/src Message-ID: <20100209165515.2F6CB282BDF@codespeak.net> Author: afa Date: Tue Feb 9 17:55:14 2010 New Revision: 71180 Modified: pypy/trunk/pypy/translator/c/src/g_include.h Log: Suppress a compilation warning Modified: pypy/trunk/pypy/translator/c/src/g_include.h ============================================================================== --- pypy/trunk/pypy/translator/c/src/g_include.h (original) +++ pypy/trunk/pypy/translator/c/src/g_include.h Tue Feb 9 17:55:14 2010 @@ -17,7 +17,9 @@ #include "src/mem.h" #include "src/exception.h" #include "src/support.h" +#ifndef PY_LONG_LONG #define PY_LONG_LONG long long +#endif #ifndef PYPY_STANDALONE # include "src/pyobj.h" From afa at codespeak.net Tue Feb 9 17:57:57 2010 From: afa at codespeak.net (afa at codespeak.net) Date: Tue, 9 Feb 2010 17:57:57 +0100 (CET) Subject: [pypy-svn] r71181 - pypy/trunk/pypy/translator/c Message-ID: <20100209165757.02224282BDF@codespeak.net> Author: afa Date: Tue Feb 9 17:57:56 2010 New Revision: 71181 Modified: pypy/trunk/pypy/translator/c/funcgen.py Log: Suppress *many* compilation warnings on Windows, where a uninitialized variable is used. gcc seems to be smarter and notices that this appears after a call to abort()... Modified: pypy/trunk/pypy/translator/c/funcgen.py ============================================================================== --- pypy/trunk/pypy/translator/c/funcgen.py (original) +++ pypy/trunk/pypy/translator/c/funcgen.py Tue Feb 9 17:57:56 2010 @@ -778,7 +778,13 @@ return 'fprintf(stderr, "%%s\\n", %s); abort();' % msg def OP_DEBUG_LLINTERPCALL(self, op): - return 'abort(); /* debug_llinterpcall should be unreachable */' + result = 'abort(); /* debug_llinterpcall should be unreachable */' + TYPE = self.lltypemap(op.result) + if TYPE is not Void: + typename = self.db.gettype(TYPE) + result += '\n%s = (%s)0;' % (self.expr(op.result), + cdecl(typename, '')) + return result def OP_INSTRUMENT_COUNT(self, op): counter_label = op.args[1].value From pedronis at codespeak.net Fri Feb 12 14:35:22 2010 From: pedronis at codespeak.net (pedronis at codespeak.net) Date: Fri, 12 Feb 2010 14:35:22 +0100 (CET) Subject: [pypy-svn] r71204 - in pypy/extradoc/talk/pycon2010: crossinterp vmsummit Message-ID: <20100212133522.93033282BED@codespeak.net> Author: pedronis Date: Fri Feb 12 14:35:21 2010 New Revision: 71204 Added: pypy/extradoc/talk/pycon2010/crossinterp/ pypy/extradoc/talk/pycon2010/vmsummit/ Log: directories for the other talks From pedronis at codespeak.net Fri Feb 12 14:42:11 2010 From: pedronis at codespeak.net (pedronis at codespeak.net) Date: Fri, 12 Feb 2010 14:42:11 +0100 (CET) Subject: [pypy-svn] r71205 - pypy/extradoc/talk/pycon2010/vmsummit Message-ID: <20100212134211.D1AE6282BED@codespeak.net> Author: pedronis Date: Fri Feb 12 14:42:10 2010 New Revision: 71205 Added: pypy/extradoc/talk/pycon2010/vmsummit/outline.txt (contents, props changed) Log: brief outline Added: pypy/extradoc/talk/pycon2010/vmsummit/outline.txt ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/outline.txt Fri Feb 12 14:42:10 2010 @@ -0,0 +1,8 @@ +* briefly what is PyPy +* generating tracing jit +* find allocation that can be avoided, data flow around the loop +* virtualizables (?) +* trace example +* results +* challenges + From fijal at codespeak.net Fri Feb 12 16:59:06 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Fri, 12 Feb 2010 16:59:06 +0100 (CET) Subject: [pypy-svn] r71207 - pypy/extradoc/talk/pycon2010/pypyspeed Message-ID: <20100212155906.83F78282BED@codespeak.net> Author: fijal Date: Fri Feb 12 16:59:05 2010 New Revision: 71207 Modified: pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt Log: Progress on this talk, a bit chaotic Modified: pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt ============================================================================== --- pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt (original) +++ pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt Fri Feb 12 16:59:05 2010 @@ -23,11 +23,16 @@ * however, you pay if you use them +So, the general advice +====================== + +* don't use advanced feature if you don't use them + +* don't try to outsmart your compiler + Tracing JIT - short intro ========================= -XXX too advanced? - * the main idea being speeding up loops * only linear trace of code that was @@ -36,19 +41,96 @@ * mostly can trace loops and to certain extent recursion +XXX example of tracing, maybe + Removing frame overhead ======================= -XXX simple example +* frames are costly + +* *x = y + z* has 5 frame accesses + +* it all can be removed! Removing object boxing ====================== -XXX example +* intermediate values does not need to be allocated + +* integer can stay in the register + +XXX maybe demo assembler, maaaaybe Local access costs nothing ========================== +* local variables are not stored on the frame, + unless *sys._getframe()* is called + +* ... or *sys.exc_info()* or exception escapes + +XXX picture exception escaping + +Shared dicts (aka hidden classes) +================================= + xxx +... only for newstyle classes +============================= + xxx + +Generators are tricky (for now) +=============================== + +xxxx + +Generator expressions are even trickier +======================================= + +xxx + +Don't try to outsmart your compiler +=================================== + +xxx + +Solution: move back code to python +================================== + +xxx + +Never use id(obj), unless you really have to +============================================ + +xxx + +Allocation patterns +=================== + +xxx + +Bad case for a moving GC +======================== + +xxx + +Problems +======== + +* long traces + +* megamorphic calls + +Future +====== + +* release + +* xxx + +Q&A +=== + +* xxx From fijal at codespeak.net Fri Feb 12 17:22:23 2010 From: fijal at codespeak.net (fijal at codespeak.net) Date: Fri, 12 Feb 2010 17:22:23 +0100 (CET) Subject: [pypy-svn] r71208 - pypy/extradoc/talk/pycon2010/pypyspeed Message-ID: <20100212162223.16C64282BED@codespeak.net> Author: fijal Date: Fri Feb 12 17:22:21 2010 New Revision: 71208 Modified: pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt Log: more slides Modified: pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt ============================================================================== --- pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt (original) +++ pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt Fri Feb 12 17:22:21 2010 @@ -74,42 +74,65 @@ Shared dicts (aka hidden classes) ================================= -xxx +* instance *__dict__* access becomes a list + lookup + +* however, if you do evil hacks, + it'll bail down back ... only for newstyle classes ============================= -xxx +* there are few minor, but annoying, differencies + +* while it can be done, we ask you to not use + old style classes instead :-) Generators are tricky (for now) =============================== -xxxx +* they can't be as fast, because generator + frame needs to be allocated + +* they still can be sped up by a bit and + that's a current limitation Generator expressions are even trickier ======================================= -xxx +* for now, if possible, use list comprehension Don't try to outsmart your compiler =================================== -xxx +* simple loop is better than a complex + map/lambda/reduce combination -Solution: move back code to python -================================== +* even if on CPython the latter is faster -xxx +* general rule: if it's easier to read, it's easier + to read by the JIT -Never use id(obj), unless you really have to -============================================ +Solution: move back code to python +================================== -xxx +XXX remove this slide Allocation patterns =================== -xxx +* PyPy uses a moving GC (like JVM, .NET, etc.) + +* pretty efficient for usecases with a lot of + short-living objects + +* objects are smaller than on CPython + +Never use id(obj), unless you really have to +============================================ + +* contrary to popular belief, *id* semantics make + that a complex operation on a moving GC Bad case for a moving GC ======================== @@ -133,4 +156,7 @@ Q&A === -* xxx +* http://morepypy.blogspot.com + +* http://merlinux.eu + From pedronis at codespeak.net Fri Feb 12 17:41:24 2010 From: pedronis at codespeak.net (pedronis at codespeak.net) Date: Fri, 12 Feb 2010 17:41:24 +0100 (CET) Subject: [pypy-svn] r71209 - pypy/extradoc/talk/pycon2010/pypyspeed Message-ID: <20100212164124.AAC29282BED@codespeak.net> Author: pedronis Date: Fri Feb 12 17:41:23 2010 New Revision: 71209 Modified: pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt Log: typo Modified: pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt ============================================================================== --- pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt (original) +++ pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt Fri Feb 12 17:41:23 2010 @@ -83,7 +83,7 @@ ... only for newstyle classes ============================= -* there are few minor, but annoying, differencies +* there are few minor, but annoying, differences * while it can be done, we ask you to not use old style classes instead :-) From pedronis at codespeak.net Fri Feb 12 17:43:36 2010 From: pedronis at codespeak.net (pedronis at codespeak.net) Date: Fri, 12 Feb 2010 17:43:36 +0100 (CET) Subject: [pypy-svn] r71210 - pypy/extradoc/talk/pycon2010/pypyspeed Message-ID: <20100212164336.95CB9282BED@codespeak.net> Author: pedronis Date: Fri Feb 12 17:43:35 2010 New Revision: 71210 Modified: pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt Log: some more points Modified: pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt ============================================================================== --- pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt (original) +++ pypy/extradoc/talk/pycon2010/pypyspeed/talk.txt Fri Feb 12 17:43:35 2010 @@ -160,3 +160,10 @@ * http://merlinux.eu +XXX more: + +(versiontag stuff basically) + +- counters on classes are bad +- we don't do well with metaclasses + From tobami at codespeak.net Sat Feb 13 10:49:14 2010 From: tobami at codespeak.net (tobami at codespeak.net) Date: Sat, 13 Feb 2010 10:49:14 +0100 (CET) Subject: [pypy-svn] r71213 - codespeed/tools Message-ID: <20100213094914.EA9FE2E2BA5@codespeak.net> Author: tobami Date: Sat Feb 13 10:49:12 2010 New Revision: 71213 Added: codespeed/tools/import_from_json.py Modified: codespeed/tools/save_result.py Log: new tool to import result data from json files Added: codespeed/tools/import_from_json.py ============================================================================== --- (empty file) +++ codespeed/tools/import_from_json.py Sat Feb 13 10:49:12 2010 @@ -0,0 +1,104 @@ +# -*- coding: utf-8 -*- +import simplejson, urllib, urllib2, pprint +import sys +from xml.dom.minidom import parse +from datetime import datetime + +RESULTS_URL = 'http://buildbot.pypy.org/bench_results/' +SPEEDURL = 'http://localhost:8080/'# This will be pyspeed.pypy.org/ +SAVE_CPYTHON = False +START_REV = 71154 + +def saveresult(data): + params = urllib.urlencode(data) + f = None + response = "None" + print "Interpreter %s, revision %s, benchmark %s" % (data['interpreter_name'], data['revision_number'], data['benchmark_name']) + try: + f = urllib2.urlopen(SPEEDURL + 'result/add/', params) + response = f.read() + f.close() + except urllib2.URLError, e: + if hasattr(e, 'reason'): + response = '\n We failed to reach a server\n' + response += ' Reason: ' + str(e.reason) + elif hasattr(e, 'code'): + response = '\n The server couldn\'t fulfill the request\n' + response += ' Error code: ' + str(e) + print "Server (%s) response: %s\n" % (SPEEDURL, response) + +# get json filenames +filelist = [] +try: + datasource = urllib2.urlopen(RESULTS_URL) + dom = parse(datasource) + for elem in dom.getElementsByTagName('td'): + for e in elem.childNodes: + if len(e.childNodes): + filename = e.firstChild.toxml() + if e.tagName == "a" and ".json" in filename: + if int(filename.replace(".json", "")) >= START_REV: + filelist.append(filename) + datasource.close() +except urllib2.URLError, e: + response = "None" + if hasattr(e, 'reason'): + response = '\n We failed to reach ' + RESULTS_URL + '\n' + response += ' Reason: ' + str(e.reason) + elif hasattr(e, 'code'): + response = '\n The server couldn\'t fulfill the request\n' + response += ' Error code: ' + str(e) + print "Results Server (%s) response: %s\n" % (RESULTS_URL, response) + sys.exit(1) + +# read json result and save to speed.pypy.org +for filename in filelist: + print "Reading %s..." % filename + f = urllib2.urlopen(RESULTS_URL + filename) + result = simplejson.load(f) + current_date = datetime.today() + proj = 'pypy' + revision = result['revision'] + interpreter = "pypy-c-jit" + int_options = "gc=hybrid" + if result.has_key('branch'): + if result['branch'] != 'trunk': + interpreter = result['branch'] + int_options = "" + if SAVE_CPYTHON: + proj = 'cpython' + interpreter = 'cpython' + int_options = 'default' + revision = 262 + + for b in result['results']: + bench_name = b[0] + res_type = b[1] + results = b[2] + value = 0 + if res_type == "SimpleComparisonResult": + if SAVE_CPYTHON: + value = results['base_time'] + else: + value = results['changed_time'] + elif res_type == "ComparisonResult": + if SAVE_CPYTHON: + value = results['avg_base'] + else: + value = results['avg_changed'] + else: + print "ERROR: result type unknown", b[1] + sys.exit(1) + data = { + 'revision_number': revision, + 'revision_project': proj, + 'interpreter_name': interpreter, + 'interpreter_coptions': int_options, + 'benchmark_name': bench_name, + 'environment': "Dual Core Linux", + 'result_value': value, + 'result_date': current_date, + } + saveresult(data) + f.close() +print "\nOK" Modified: codespeed/tools/save_result.py ============================================================================== --- codespeed/tools/save_result.py (original) +++ codespeed/tools/save_result.py Sat Feb 13 10:49:12 2010 @@ -2,30 +2,39 @@ from datetime import datetime import urllib, urllib2 -BASEURL = 'http://localhost:8080/'# This will be pyspeed.pypy.org/ +SPEEDURL = 'http://localhost:8080/'# This will be pyspeed.pypy.org/ -def add_result(): - data = { - 'revision_number': '23238', - 'revision_project': 'pypy', - 'revision_date': "2009-11-15 18:11:29", # Optional. Make mandatory? - 'interpreter_name': 'pypy-c-jit', - 'interpreter_coptions': 'gc=Boehm', - 'benchmark_name': 'Richards', - 'benchmark_type': 'P',# Optional. Default is T for Trunk. (Trunk, Debug, Python, Multilanguage) - 'environment': "Dual Core Linux", - 'result_key': 'total', - 'result_value': 400, - 'result_type': 'M',# Optional. Default is 'T' for Time in milliseconds. (Time, Memory, Score) - 'result_date': datetime.today(), - } - - # TODO add HTTPError try +data = { + 'revision_number': '23238', + 'revision_project': 'pypy', + 'revision_date': "2009-11-15 18:11:29", # Optional. Make mandatory? + 'interpreter_name': 'pypy-c-jit', + 'interpreter_coptions': 'gc=Hybrid', + 'benchmark_name': 'Richards', + 'benchmark_type': 'P',# Optional. Default is T for Trunk. (Trunk, Debug, Python, Multilanguage) + 'environment': "Dual Core Linux", + 'result_value': 400, + 'result_type': 'M',# Optional. Default is 'T' for Time in milliseconds. (Time, Memory, Score) + 'result_date': datetime.today(), +} + +def add(data): params = urllib.urlencode(data) - f = urllib2.urlopen(BASEURL + 'result/add/', params) - response = f.read() - print "Server response:", response - f.close() + f = None + response = "None" + print "Interpreter %s, revision %s, benchmark %s" % (data['interpreter_name'], data['revision_number'], data['benchmark_name']) + try: + f = urllib2.urlopen(SPEEDURL + 'result/add/', params) + response = f.read() + f.close() + except urllib2.URLError, e: + if hasattr(e, 'reason'): + response = '\n We failed to reach a server\n' + response += ' Reason: ' + str(e.reason) + elif hasattr(e, 'code'): + response = '\n The server couldn\'t fulfill the request\n' + response += ' Error code: ' + str(e) + print "Server (%s) response: %s\n" % (SPEEDURL, response) if __name__ == "__main__": - add_result() + add_result(data) From arigo at codespeak.net Sat Feb 13 11:33:06 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Sat, 13 Feb 2010 11:33:06 +0100 (CET) Subject: [pypy-svn] r71214 - in pypy/trunk/pypy/translator: . c/test Message-ID: <20100213103306.C89752E2BA5@codespeak.net> Author: arigo Date: Sat Feb 13 11:33:05 2010 New Revision: 71214 Modified: pypy/trunk/pypy/translator/c/test/test_standalone.py pypy/trunk/pypy/translator/exceptiontransform.py Log: Compile differently AssertionErrors/NotImplementedErrors in debug mode and in non-debug mode. Test and explanation. Modified: pypy/trunk/pypy/translator/c/test/test_standalone.py ============================================================================== --- pypy/trunk/pypy/translator/c/test/test_standalone.py (original) +++ pypy/trunk/pypy/translator/c/test/test_standalone.py Sat Feb 13 11:33:05 2010 @@ -16,13 +16,16 @@ class StandaloneTests(object): config = None - def compile(self, entry_point): + def compile(self, entry_point, debug=True): t = TranslationContext(self.config) t.buildannotator().build_types(entry_point, [s_list_of_strings]) t.buildrtyper().specialize() cbuilder = CStandaloneBuilder(t, entry_point, t.config) - cbuilder.generate_source(defines=cbuilder.DEBUG_DEFINES) + if debug: + cbuilder.generate_source(defines=cbuilder.DEBUG_DEFINES) + else: + cbuilder.generate_source() cbuilder.compile() if option.view: t.view() @@ -511,7 +514,17 @@ assert re.match(r' File "\w+.c", line \d+, in h', l2) assert re.match(r' File "\w+.c", line \d+, in raiseme', l3) - def test_assertion_error(self): + def test_assertion_error_debug(self): + def entry_point(argv): + assert len(argv) != 1 + return 0 + t, cbuilder = self.compile(entry_point, debug=True) + out, err = cbuilder.cmdexec("", expect_crash=True) + assert out.strip() == '' + lines = err.strip().splitlines() + assert lines[-1] == 'in pypy_g_RPyRaiseException: AssertionError' + + def test_assertion_error_nondebug(self): def g(x): assert x != 1 def f(argv): @@ -522,7 +535,7 @@ def entry_point(argv): f(argv) return 0 - t, cbuilder = self.compile(entry_point) + t, cbuilder = self.compile(entry_point, debug=False) out, err = cbuilder.cmdexec("", expect_crash=True) assert out.strip() == '' lines = err.strip().splitlines() @@ -535,7 +548,17 @@ # The traceback stops at f() because it's the first function that # captures the AssertionError, which makes the program abort. - def test_ll_assert_error(self): + def test_ll_assert_error_debug(self): + def entry_point(argv): + ll_assert(len(argv) != 1, "foobar") + return 0 + t, cbuilder = self.compile(entry_point, debug=True) + out, err = cbuilder.cmdexec("", expect_crash=True) + assert out.strip() == '' + lines = err.strip().splitlines() + assert lines[-1] == 'in pypy_g_entry_point: foobar' + + def test_ll_assert_error_nondebug(self): py.test.skip("implement later, maybe: tracebacks even with ll_assert") def g(x): ll_assert(x != 1, "foobar") Modified: pypy/trunk/pypy/translator/exceptiontransform.py ============================================================================== --- pypy/trunk/pypy/translator/exceptiontransform.py (original) +++ pypy/trunk/pypy/translator/exceptiontransform.py Sat Feb 13 11:33:05 2010 @@ -86,7 +86,15 @@ exc_data.exc_value = null_value def rpyexc_raise(etype, evalue): - # assert(!RPyExceptionOccurred()); + # When compiling in debug mode, the following ll_asserts will + # crash the program as soon as it raises AssertionError or + # NotImplementedError. Useful when you are in a debugger. + # When compiling in release mode, AssertionErrors and + # NotImplementedErrors are raised normally, and only later + # caught by debug_catch_exception and printed, which allows + # us to see at least part of the traceback for them. + ll_assert(etype != assertion_error_ll_exc_type, "AssertionError") + ll_assert(etype != n_i_error_ll_exc_type, "NotImplementedError") exc_data.exc_type = etype exc_data.exc_value = evalue lloperation.llop.debug_start_traceback(lltype.Void, etype) From tobami at codespeak.net Sat Feb 13 11:57:09 2010 From: tobami at codespeak.net (tobami at codespeak.net) Date: Sat, 13 Feb 2010 11:57:09 +0100 (CET) Subject: [pypy-svn] r71215 - codespeed/tools Message-ID: <20100213105709.03E2C2E2BA5@codespeak.net> Author: tobami Date: Sat Feb 13 11:57:08 2010 New Revision: 71215 Added: codespeed/tools/save_single_result.py codespeed/tools/saveresults.py codespeed/tools/test.py Removed: codespeed/tools/save_result.py Modified: codespeed/tools/import_from_json.py Log: integrate saveresults with runner.py Modified: codespeed/tools/import_from_json.py ============================================================================== --- codespeed/tools/import_from_json.py (original) +++ codespeed/tools/import_from_json.py Sat Feb 13 11:57:08 2010 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -import simplejson, urllib, urllib2, pprint +import simplejson, urllib, urllib2 import sys from xml.dom.minidom import parse from datetime import datetime @@ -7,7 +7,7 @@ RESULTS_URL = 'http://buildbot.pypy.org/bench_results/' SPEEDURL = 'http://localhost:8080/'# This will be pyspeed.pypy.org/ SAVE_CPYTHON = False -START_REV = 71154 +START_REV = 71212 def saveresult(data): params = urllib.urlencode(data) @@ -56,6 +56,9 @@ print "Reading %s..." % filename f = urllib2.urlopen(RESULTS_URL + filename) result = simplejson.load(f) + f.close() + print filename + print result current_date = datetime.today() proj = 'pypy' revision = result['revision'] @@ -100,5 +103,4 @@ 'result_date': current_date, } saveresult(data) - f.close() print "\nOK" Added: codespeed/tools/save_single_result.py ============================================================================== --- (empty file) +++ codespeed/tools/save_single_result.py Sat Feb 13 11:57:08 2010 @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +from datetime import datetime +import urllib, urllib2 + +SPEEDURL = 'http://localhost:8080/'# This will be pyspeed.pypy.org/ + +data = { + 'revision_number': '23238', + 'revision_project': 'pypy', + 'revision_date': "2009-11-15 18:11:29", # Optional. Make mandatory? + 'interpreter_name': 'pypy-c-jit', + 'interpreter_coptions': 'gc=Hybrid', + 'benchmark_name': 'Richards', + 'benchmark_type': 'P',# Optional. Default is T for Trunk. (Trunk, Debug, Python, Multilanguage) + 'environment': "Dual Core Linux", + 'result_value': 400, + 'result_type': 'M',# Optional. Default is 'T' for Time in milliseconds. (Time, Memory, Score) + 'result_date': datetime.today(), +} + +def add(data): + params = urllib.urlencode(data) + f = None + response = "None" + print "Interpreter %s, revision %s, benchmark %s" % (data['interpreter_name'], data['revision_number'], data['benchmark_name']) + try: + f = urllib2.urlopen(SPEEDURL + 'result/add/', params) + response = f.read() + f.close() + except urllib2.URLError, e: + if hasattr(e, 'reason'): + response = '\n We failed to reach a server\n' + response += ' Reason: ' + str(e.reason) + elif hasattr(e, 'code'): + response = '\n The server couldn\'t fulfill the request\n' + response += ' Error code: ' + str(e) + print "Server (%s) response: %s\n" % (SPEEDURL, response) + +if __name__ == "__main__": + add_result(data) Added: codespeed/tools/saveresults.py ============================================================================== --- (empty file) +++ codespeed/tools/saveresults.py Sat Feb 13 11:57:08 2010 @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +import urllib, urllib2 +from datetime import datetime +import logging, logging.handlers + +## SETUP LOGS ## +LOG_FILENAME = 'pyspeed.log' +logger = logging.getLogger('MyLogger') +logger.setLevel(logging.DEBUG) +# Add the log message handler to the logger +handler = logging.handlers.RotatingFileHandler( + LOG_FILENAME, maxBytes=100000, backupCount=1) +logger.addHandler(handler) +################ + +SPEEDURL = "http://localhost:8080/"# This will be pyspeed.pypy.org/ +HOST = "Dual Core Linux" + +def save(revision, results, options, branch): + #Parse data + data = {} + current_date = datetime.today() + proj = "pypy" + interpreter = "pypy-c-jit" + int_options = "gc=hybrid" + if branch != "" and branch != "trunk": + interpreter = branch + int_options = "" + + for b in results: + bench_name = b[0] + res_type = b[1] + results = b[2] + value = 0 + if res_type == "SimpleComparisonResult": + value = results['changed_time'] + elif res_type == "ComparisonResult": + value = results['avg_changed'] + else: + logger.critical("ERROR: result type unknown " + b[1]) + return 1 + data = { + 'revision_number': revision, + 'revision_project': proj, + 'interpreter_name': interpreter, + 'interpreter_coptions': int_options, + 'benchmark_name': bench_name, + 'environment': HOST, + 'result_value': value, + 'result_date': current_date, + } + send(data) + +def send(data): + #save results + params = urllib.urlencode(data) + f = None + response = "None" + info = "Saving result for " + data['interpreter_name'] + " revision " + info += str(data['revision_number']) + ", benchmark " + data['benchmark_name'] + logger.info(info) + try: + f = urllib2.urlopen(SPEEDURL + 'result/add/', params) + response = f.read() + f.close() + except urllib2.URLError, e: + if hasattr(e, 'reason'): + response = '\n We failed to reach a server\n' + response += ' Reason: ' + str(e.reason) + elif hasattr(e, 'code'): + response = '\n The server couldn\'t fulfill the request\n' + response += ' Error code: ' + str(e) + logger.critical("Server (%s) response: %s\n" % (SPEEDURL, response)) + + Added: codespeed/tools/test.py ============================================================================== --- (empty file) +++ codespeed/tools/test.py Sat Feb 13 11:57:08 2010 @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +import saveresults + +results = [['ai', 'ComparisonResult', {'avg_base': 0.42950453758219992, 'timeline_link': None, 'avg_changed': 0.43322672843939997, 'min_base': 0.42631793022199999, 'delta_min': '1.0065x faster', 'delta_avg': '1.0087x slower', 'std_changed': 0.0094009621054567376, 'min_changed': 0.423564910889, 'delta_std': '2.7513x larger', 'std_base': 0.0034169249420902843, 't_msg': 'Not significant\n'}], ['chaos', 'ComparisonResult', {'avg_base': 0.41804099082939999, 'timeline_link': None, 'avg_changed': 0.11744904518135998, 'min_base': 0.41700506210299998, 'delta_min': '9.0148x faster', 'delta_avg': '3.5593x faster', 'std_changed': 0.14350186143481433, 'min_changed': 0.046257972717299999, 'delta_std': '108.8162x larger', 'std_base': 0.0013187546718754512, 't_msg': 'Significant (t=4.683672, a=0.95)\n'}], ['django', 'ComparisonResult', {'avg_base': 0.83651852607739996, 'timeline_link': None, 'avg_changed': 0.48571481704719999, 'min_base': 0.82990884780899998, 'delta_min': '1.7315x faster', 'delta_avg': '1.7222x faster', 'std_changed': 0.006386606999421761, 'min_changed': 0.47929787635799997, 'delta_std': '1.7229x smaller', 'std_base': 0.011003382690633789, 't_msg': 'Significant (t=61.655971, a=0.95)\n'}], ['fannkuch', 'ComparisonResult', {'avg_base': 1.8561528205879998, 'timeline_link': None, 'avg_changed': 0.38401727676399999, 'min_base': 1.84801197052, 'delta_min': '5.0064x faster', 'delta_avg': '4.8335x faster', 'std_changed': 0.029594360755246251, 'min_changed': 0.36913013458299998, 'delta_std': '3.2353x larger', 'std_base': 0.0091472519207758066, 't_msg': 'Significant (t=106.269998, a=0.95)\n'}], ['float', 'ComparisonResult', {'avg_base': 0.50523018836940004, 'timeline_link': None, 'avg_changed': 0.15490598678593998, 'min_base': 0.49911379814099999, 'delta_min': '6.2651x faster', 'delta_avg': '3.2615x faster', 'std_changed': 0.057739598339608837, 'min_changed': 0.079665899276699995, 'delta_std': '7.7119x larger', 'std_base': 0.007487037523761327, 't_msg': 'Significant (t=13.454285, a=0.95)\n'}], ['gcbench', 'SimpleComparisonResult', {'base_time': 27.236408948899999, 'changed_time': 5.3500790595999996, 'time_delta': '5.0908x faster'}], ['html5lib', 'SimpleComparisonResult', {'base_time': 11.666918992999999, 'changed_time': 12.6703209877, 'time_delta': '1.0860x slower'}], ['meteor-contest', 'ComparisonResult', {'avg_base': 0.31436119079579999, 'timeline_link': None, 'avg_changed': 0.38782238960260002, 'min_base': 0.30970501899699998, 'delta_min': '1.1797x slower', 'delta_avg': '1.2337x slower', 'std_changed': 0.031661664106086736, 'min_changed': 0.36536192894000002, 'delta_std': '5.8221x larger', 'std_base': 0.0054382066306700701, 't_msg': 'Significant (t=-5.113235, a=0.95)\n'}], ['nbody_modified', 'ComparisonResult', {'avg_base': 0.53968458175659995, 'timeline_link': None, 'avg_changed': 0.078919744491499993, 'min_base': 0.53349304199199998, 'delta_min': '7.4887x faster', 'delta_avg': '6.8384x faster', 'std_changed': 0.012773911876380514, 'min_changed': 0.071239948272699999, 'delta_std': '3.3435x larger', 'std_base': 0.0038204885103676109, 't_msg': 'Significant (t=77.274529, a=0.95)\n'}], ['richards', 'ComparisonResult', {'avg_base': 0.29083266258220003, 'timeline_link': None, 'avg_changed': 0.029299402236939998, 'min_base': 0.29025602340700002, 'delta_min': '10.7327x faster', 'delta_avg': '9.9262x faster', 'std_changed': 0.0033452973342946888, 'min_changed': 0.027044057846099999, 'delta_std': '5.6668x larger', 'std_base': 0.00059033067516221327, 't_msg': 'Significant (t=172.154488, a=0.95)\n'}], ['rietveld', 'ComparisonResult', {'avg_base': 0.46909418106079998, 'timeline_link': None, 'avg_changed': 1.312631273269, 'min_base': 0.46490097045899997, 'delta_min': '2.1137x slower', 'delta_avg': '2.7982x slower', 'std_changed': 0.44401595627955542, 'min_changed': 0.98267102241500004, 'delta_std': '76.0238x larger', 'std_base': 0.0058404831974135556, 't_msg': 'Significant (t=-4.247692, a=0.95)\n'}], ['slowspitfire', 'ComparisonResult', {'avg_base': 0.66740002632140005, 'timeline_link': None, 'avg_changed': 1.6204295635219998, 'min_base': 0.65965509414699997, 'delta_min': '1.9126x slower', 'delta_avg': '2.4280x slower', 'std_changed': 0.27415559151786589, 'min_changed': 1.26167798042, 'delta_std': '20.1860x larger', 'std_base': 0.013581457669479846, 't_msg': 'Significant (t=-7.763579, a=0.95)\n'}], ['spambayes', 'ComparisonResult', {'avg_base': 0.279049730301, 'timeline_link': None, 'avg_changed': 1.0178018569945999, 'min_base': 0.27623891830399999, 'delta_min': '3.3032x slower', 'delta_avg': '3.6474x slower', 'std_changed': 0.064953583956645466, 'min_changed': 0.91246294975300002, 'delta_std': '28.9417x larger', 'std_base': 0.0022442880892229711, 't_msg': 'Significant (t=-25.416839, a=0.95)\n'}], ['spectral-norm', 'ComparisonResult', {'avg_base': 0.48315834999099999, 'timeline_link': None, 'avg_changed': 0.066225481033300004, 'min_base': 0.476922035217, 'delta_min': '8.0344x faster', 'delta_avg': '7.2957x faster', 'std_changed': 0.013425108838933627, 'min_changed': 0.059360027313200003, 'delta_std': '1.9393x larger', 'std_base': 0.0069225510731835901, 't_msg': 'Significant (t=61.721418, a=0.95)\n'}], ['spitfire', 'ComparisonResult', {'avg_base': 7.1179999999999994, 'timeline_link': None, 'avg_changed': 7.2780000000000005, 'min_base': 7.04, 'delta_min': '1.0072x faster', 'delta_avg': '1.0225x slower', 'std_changed': 0.30507376157250898, 'min_changed': 6.9900000000000002, 'delta_std': '3.4948x larger', 'std_base': 0.08729261137118062, 't_msg': 'Not significant\n'}], ['spitfire_cstringio', 'ComparisonResult', {'avg_base': 8.4520000000000017, 'timeline_link': None, 'avg_changed': 4.306, 'min_base': 8.4199999999999999, 'delta_min': '2.0637x faster', 'delta_avg': '1.9628x faster', 'std_changed': 0.3298181317029128, 'min_changed': 4.0800000000000001, 'delta_std': '9.8552x larger', 'std_base': 0.033466401061363157, 't_msg': 'Significant (t=27.965041, a=0.95)\n'}], ['telco', 'ComparisonResult', {'avg_base': 0.99600000000000011, 'timeline_link': None, 'avg_changed': 0.42199999999999999, 'min_base': 0.98999999999999999, 'delta_min': '2.4146x faster', 'delta_avg': '2.3602x faster', 'std_changed': 0.010954451150103331, 'min_changed': 0.40999999999999998, 'delta_std': '2.0000x larger', 'std_base': 0.0054772255750516665, 't_msg': 'Significant (t=104.797583, a=0.95)\n'}], ['twisted_iteration', 'SimpleComparisonResult', {'base_time': 0.148289627437, 'changed_time': 0.035354803126799998, 'time_delta': '4.1943x faster'}], ['twisted_web', 'SimpleComparisonResult', {'base_time': 0.11312217194599999, 'changed_time': 0.625, 'time_delta': '5.5250x slower'}]] + +saveresults.save(71212, results, "", "trunk") From tobami at codespeak.net Sat Feb 13 11:58:28 2010 From: tobami at codespeak.net (tobami at codespeak.net) Date: Sat, 13 Feb 2010 11:58:28 +0100 (CET) Subject: [pypy-svn] r71216 - codespeed/tools Message-ID: <20100213105828.008A52E2BA5@codespeak.net> Author: tobami Date: Sat Feb 13 11:58:27 2010 New Revision: 71216 Modified: codespeed/tools/saveresults.py Log: improve error handling Modified: codespeed/tools/saveresults.py ============================================================================== --- codespeed/tools/saveresults.py (original) +++ codespeed/tools/saveresults.py Sat Feb 13 11:58:27 2010 @@ -49,7 +49,7 @@ 'result_value': value, 'result_date': current_date, } - send(data) + return send(data) def send(data): #save results @@ -71,5 +71,6 @@ response = '\n The server couldn\'t fulfill the request\n' response += ' Error code: ' + str(e) logger.critical("Server (%s) response: %s\n" % (SPEEDURL, response)) - + return 1 + return 0 From tobami at codespeak.net Sat Feb 13 12:00:10 2010 From: tobami at codespeak.net (tobami at codespeak.net) Date: Sat, 13 Feb 2010 12:00:10 +0100 (CET) Subject: [pypy-svn] r71217 - codespeed/tools Message-ID: <20100213110010.527EB2E2BA5@codespeak.net> Author: tobami Date: Sat Feb 13 12:00:08 2010 New Revision: 71217 Modified: codespeed/tools/saveresults.py Log: fix return Modified: codespeed/tools/saveresults.py ============================================================================== --- codespeed/tools/saveresults.py (original) +++ codespeed/tools/saveresults.py Sat Feb 13 12:00:08 2010 @@ -49,7 +49,8 @@ 'result_value': value, 'result_date': current_date, } - return send(data) + send(data) + return 0 def send(data): #save results @@ -71,6 +72,4 @@ response = '\n The server couldn\'t fulfill the request\n' response += ' Error code: ' + str(e) logger.critical("Server (%s) response: %s\n" % (SPEEDURL, response)) - return 1 - return 0 - + return 1 From benjamin at codespeak.net Sun Feb 14 01:07:46 2010 From: benjamin at codespeak.net (benjamin at codespeak.net) Date: Sun, 14 Feb 2010 01:07:46 +0100 (CET) Subject: [pypy-svn] r71218 - pypy/trunk/pypy/objspace/std Message-ID: <20100214000746.8F2BD282BD8@codespeak.net> Author: benjamin Date: Sun Feb 14 01:07:45 2010 New Revision: 71218 Modified: pypy/trunk/pypy/objspace/std/objspace.py Log: remove set compatibility code Modified: pypy/trunk/pypy/objspace/std/objspace.py ============================================================================== --- pypy/trunk/pypy/objspace/std/objspace.py (original) +++ pypy/trunk/pypy/objspace/std/objspace.py Sun Feb 14 01:07:45 2010 @@ -24,19 +24,6 @@ import os import __builtin__ -#check for sets -try: - s = set() - del s -except NameError: - try: - from sets import Set as set - from sets import ImmutableSet as frozenset - except ImportError: - class DummySet(object):pass - set = DummySet - frozenset = DummySet - _registered_implementations = {} def registerimplementation(implcls): # hint to objspace.std.model to register the implementation class From benjamin at codespeak.net Sun Feb 14 01:38:50 2010 From: benjamin at codespeak.net (benjamin at codespeak.net) Date: Sun, 14 Feb 2010 01:38:50 +0100 (CET) Subject: [pypy-svn] r71219 - pypy/trunk/pypy/objspace/test Message-ID: <20100214003850.BC44A282BD8@codespeak.net> Author: benjamin Date: Sun Feb 14 01:38:49 2010 New Revision: 71219 Modified: pypy/trunk/pypy/objspace/test/test_descriptor.py Log: be more robust when the long hash changes Modified: pypy/trunk/pypy/objspace/test/test_descriptor.py ============================================================================== --- pypy/trunk/pypy/objspace/test/test_descriptor.py (original) +++ pypy/trunk/pypy/objspace/test/test_descriptor.py Sun Feb 14 01:38:49 2010 @@ -125,7 +125,7 @@ class F: # can return long def __hash__(self): return long(2**33) - assert hash(F()) == 2 # 2.5 behavior + assert hash(F()) == hash(2**33) # 2.5 behavior class G: def __hash__(self): From benjamin at codespeak.net Sun Feb 14 01:46:59 2010 From: benjamin at codespeak.net (benjamin at codespeak.net) Date: Sun, 14 Feb 2010 01:46:59 +0100 (CET) Subject: [pypy-svn] r71220 - pypy/trunk/pypy/objspace/test Message-ID: <20100214004659.E24D3282BD8@codespeak.net> Author: benjamin Date: Sun Feb 14 01:46:58 2010 New Revision: 71220 Modified: pypy/trunk/pypy/objspace/test/test_descriptor.py Log: remove pointless import Modified: pypy/trunk/pypy/objspace/test/test_descriptor.py ============================================================================== --- pypy/trunk/pypy/objspace/test/test_descriptor.py (original) +++ pypy/trunk/pypy/objspace/test/test_descriptor.py Sun Feb 14 01:46:58 2010 @@ -1,4 +1,3 @@ -import py from pypy.conftest import gettestobjspace class AppTest_Descriptor: From arigo at codespeak.net Sun Feb 14 10:48:16 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Sun, 14 Feb 2010 10:48:16 +0100 (CET) Subject: [pypy-svn] r71221 - pypy/trunk/pypy/jit/metainterp Message-ID: <20100214094816.5F23E282BDA@codespeak.net> Author: arigo Date: Sun Feb 14 10:48:13 2010 New Revision: 71221 Modified: pypy/trunk/pypy/jit/metainterp/optimizeopt.py pypy/trunk/pypy/jit/metainterp/virtualref.py Log: Some more asserts, trying to close in on one of the bugs that causes "pypy-c-jit translate.py" to occasionally crash. Modified: pypy/trunk/pypy/jit/metainterp/optimizeopt.py ============================================================================== --- pypy/trunk/pypy/jit/metainterp/optimizeopt.py (original) +++ pypy/trunk/pypy/jit/metainterp/optimizeopt.py Sun Feb 14 10:48:13 2010 @@ -783,6 +783,7 @@ # typically a PyPy PyFrame, and now is the end of its execution, so # forcing it now does not have catastrophic effects. vrefinfo = self.metainterp_sd.virtualref_info + assert op.args[1].nonnull() # - set 'forced' to point to the real object op1 = ResOperation(rop.SETFIELD_GC, op.args, None, descr = vrefinfo.descr_forced) Modified: pypy/trunk/pypy/jit/metainterp/virtualref.py ============================================================================== --- pypy/trunk/pypy/jit/metainterp/virtualref.py (original) +++ pypy/trunk/pypy/jit/metainterp/virtualref.py Sun Feb 14 10:48:13 2010 @@ -92,6 +92,7 @@ if not self.is_virtual_ref(gcref): return False vref = lltype.cast_opaque_ptr(lltype.Ptr(self.JIT_VIRTUAL_REF), gcref) + assert vref.forced if vref.virtual_token: # not modified by the residual call; assert that it is still # set to TOKEN_TRACING_RESCALL and clear it. @@ -115,6 +116,7 @@ def continue_tracing(self, gcref, real_object): if not self.is_virtual_ref(gcref): return + assert real_object vref = lltype.cast_opaque_ptr(lltype.Ptr(self.JIT_VIRTUAL_REF), gcref) assert vref.virtual_token != self.TOKEN_TRACING_RESCALL vref.virtual_token = self.TOKEN_NONE @@ -144,12 +146,15 @@ # We only need to reset virtual_token to TOKEN_NONE # as a marker for the tracing, to tell it that this # "virtual" escapes. + assert vref.forced vref.virtual_token = self.TOKEN_NONE else: assert not vref.forced from pypy.jit.metainterp.compile import ResumeGuardForcedDescr ResumeGuardForcedDescr.force_now(self.cpu, token) assert vref.virtual_token == self.TOKEN_NONE - assert vref.forced + assert vref.forced + else: + assert vref.forced return vref.forced force_virtual._dont_inline_ = True From arigo at codespeak.net Sun Feb 14 11:18:59 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Sun, 14 Feb 2010 11:18:59 +0100 (CET) Subject: [pypy-svn] r71222 - in pypy/trunk/pypy/annotation: . test Message-ID: <20100214101859.B9D41282BDA@codespeak.net> Author: arigo Date: Sun Feb 14 11:18:58 2010 New Revision: 71222 Modified: pypy/trunk/pypy/annotation/test/test_annrpython.py pypy/trunk/pypy/annotation/unaryop.py Log: Test and fix. Modified: pypy/trunk/pypy/annotation/test/test_annrpython.py ============================================================================== --- pypy/trunk/pypy/annotation/test/test_annrpython.py (original) +++ pypy/trunk/pypy/annotation/test/test_annrpython.py Sun Feb 14 11:18:58 2010 @@ -485,6 +485,19 @@ assert not isinstance(dictkey(s), annmodel.SomeString) assert not isinstance(dictvalue(s), annmodel.SomeString) + def test_dict_update_2(self): + a = self.RPythonAnnotator() + def g(n): + if n: + return {3: 4} + def f(n): + g(0) + d = {} + d.update(g(n)) + return d + s = a.build_types(f, [int]) + assert dictkey(s).knowntype == int + def test_dict_keys(self): a = self.RPythonAnnotator() s = a.build_types(snippet.dict_keys, []) Modified: pypy/trunk/pypy/annotation/unaryop.py ============================================================================== --- pypy/trunk/pypy/annotation/unaryop.py (original) +++ pypy/trunk/pypy/annotation/unaryop.py Sun Feb 14 11:18:58 2010 @@ -409,6 +409,8 @@ return SomeDict(dct.dictdef) def method_update(dct1, dct2): + if s_None.contains(dct2): + return SomeImpossibleValue() dct1.dictdef.union(dct2.dictdef) def method_keys(dct): From arigo at codespeak.net Sun Feb 14 11:20:24 2010 From: arigo at codespeak.net (arigo at codespeak.net) Date: Sun, 14 Feb 2010 11:20:24 +0100 (CET) Subject: [pypy-svn] r71223 - in pypy/trunk/pypy/annotation: . test Message-ID: <20100214102024.B1255282BDA@codespeak.net> Author: arigo Date: Sun Feb 14 11:20:23 2010 New Revision: 71223 Modified: pypy/trunk/pypy/annotation/test/test_annrpython.py pypy/trunk/pypy/annotation/unaryop.py Log: Test and fix. Modified: pypy/trunk/pypy/annotation/test/test_annrpython.py ============================================================================== --- pypy/trunk/pypy/annotation/test/test_annrpython.py (original) +++ pypy/trunk/pypy/annotation/test/test_annrpython.py Sun Feb 14 11:20:23 2010 @@ -425,6 +425,17 @@ s_meth = s_example.getattr(iv(methname)) assert isinstance(s_constmeth, annmodel.SomeBuiltin) + def test_str_join(self): + a = self.RPythonAnnotator() + def g(n): + if n: + return ["foo", "bar"] + def f(n): + g(0) + return ''.join(g(n)) + s = a.build_types(f, [int]) + assert s.knowntype == str + def test_str_splitlines(self): a = self.RPythonAnnotator() def f(a_str): Modified: pypy/trunk/pypy/annotation/unaryop.py ============================================================================== --- pypy/trunk/pypy/annotation/unaryop.py (original) +++ pypy/trunk/pypy/annotation/unaryop.py Sun Feb 14 11:20:23 2010 @@ -477,6 +477,8 @@ return str.basestringclass() def method_join(str, s_list): + if s_None.contains(s_list): + return SomeImpossibleValue() getbookkeeper().count("str_join", str) s_item = s_list.listdef.read_item() if isinstance(s_item, SomeImpossibleValue): From pedronis at codespeak.net Sun Feb 14 12:14:07 2010 From: pedronis at codespeak.net (pedronis at codespeak.net) Date: Sun, 14 Feb 2010 12:14:07 +0100 (CET) Subject: [pypy-svn] r71225 - in pypy/extradoc/talk/pycon2010/vmsummit: . ui ui/default Message-ID: <20100214111407.33AF5282BDA@codespeak.net> Author: pedronis Date: Sun Feb 14 12:14:06 2010 New Revision: 71225 Added: pypy/extradoc/talk/pycon2010/vmsummit/graph.dot pypy/extradoc/talk/pycon2010/vmsummit/talk.html pypy/extradoc/talk/pycon2010/vmsummit/talk.txt pypy/extradoc/talk/pycon2010/vmsummit/ui/ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/blank.gif (contents, props changed) pypy/extradoc/talk/pycon2010/vmsummit/ui/default/framing.css pypy/extradoc/talk/pycon2010/vmsummit/ui/default/iepngfix.htc pypy/extradoc/talk/pycon2010/vmsummit/ui/default/opera.css pypy/extradoc/talk/pycon2010/vmsummit/ui/default/outline.css pypy/extradoc/talk/pycon2010/vmsummit/ui/default/pretty.css pypy/extradoc/talk/pycon2010/vmsummit/ui/default/print.css pypy/extradoc/talk/pycon2010/vmsummit/ui/default/s5-core.css pypy/extradoc/talk/pycon2010/vmsummit/ui/default/slides.css pypy/extradoc/talk/pycon2010/vmsummit/ui/default/slides.js pypy/extradoc/talk/pycon2010/vmsummit/ui/py-web.png (contents, props changed) pypy/extradoc/talk/pycon2010/vmsummit/ui/py.css Log: drafted talk Added: pypy/extradoc/talk/pycon2010/vmsummit/graph.dot ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/graph.dot Sun Feb 14 12:14:06 2010 @@ -0,0 +1,32 @@ +digraph _resop { +clusterrank="local" +subgraph cluster0 { +_graph0 [shape="octagon", label="Loop #0\n[p0, p1, p2, p3, i4, p5, p6, p7, p8, p9, p10, p11, p12, i13, p14]", color="black", fillcolor="#f084c2", style="filled", width="0.75"]; +_g0op0 [shape="box", label="debug_merge_point(Const(\" #3 LOAD_FAST\"))\ldebug_merge_point(Const(\" #6 LOAD_FAST\"))\lLOAD_FAST__AccessDirect_star_1:4 guard_nonnull_class(p12, Const(253), descr=)\l", color="black", fillcolor="white", style="filled", width="0.75"]; +_g0op3 [shape="box", label="debug_merge_point(Const(\" #9 COMPARE_OP\"))\llt__Int_Int:6 i15 = getfield_gc_pure(p12, descr=)\llt__Int_Int:9 i16 = int_lt(i13, i15)\lObjSpace.newbool:0 guard_true(i16, descr=)\l", color="black", fillcolor="white", style="filled", width="0.75"]; +_g0op39 [shape="box", label="debug_merge_point(Const(\" #0 LOAD_FAST\"))\ldebug_merge_point(Const(\" #3 LOAD_FAST\"))\ldebug_merge_point(Const(\" #6 BINARY_ADD\"))\ladd__Int_Int:16 i17 = int_add_ovf(i13, Const(1))\ladd__Int_Int:16 guard_no_overflow(, descr=)\l", color="black", fillcolor="white", style="filled", width="0.75"]; +_g0op7 [shape="box", label="debug_merge_point(Const(\" #12 JUMP_IF_FALSE\"))\ldebug_merge_point(Const(\" #15 POP_TOP\"))\ldebug_merge_point(Const(\" #16 LOAD_GLOBAL\"))\lLOAD_GLOBAL__AccessDirect_star_1:3 p18 = getfield_gc(p0, descr=)\lLOAD_GLOBAL__AccessDirect_star_1:11 p19 = getarrayitem_gc(p18, Const(0), descr=)\lLOAD_GLOBAL__AccessDirect_star_1:14 p20 = getfield_gc(p19, descr=)\lLOAD_GLOBAL__AccessDirect_star_1:14 guard_nonnull_class(p20, Const(42), descr=)\l", color="black", fillcolor="white", style="filled", width="0.75"]; +_g0op44 [shape="box", label="debug_merge_point(Const(\" #7 RETURN_VALUE\"))\lExecutionContext.leave:3 i21 = getfield_gc(p22, descr=)\lExecutionContext.leave:3 guard_isnull(i21, descr=)\l_extract_back_from_frame:33 i23 = oois(p24, p0)\l_extract_back_from_frame:30 guard_true(i23, descr=)\lExecutionContext._unchain:29 i25 = int_sub(i26, Const(1))\lExecutionContext._unchain:33 setfield_gc(p22, i25, descr=)\lExecutionContext.leave:29 p27 = getfield_gc(p22, descr=)\lExecutionContext.leave:29 guard_isnull(p27, descr=)\l", color="black", fillcolor="white", style="filled", width="0.75"]; +_g0op14 [shape="box", label="debug_merge_point(Const(\" #19 LOAD_FAST\"))\ldebug_merge_point(Const(\" #22 LOAD_CONST\"))\ldebug_merge_point(Const(\" #25 LOAD_CONST\"))\ldebug_merge_point(Const(\" #28 CALL_FUNCTION\"))\lFunction.getcode:24 p28 = getfield_gc(p20, descr=)\lFunction.getcode:26 guard_value(p28, Const(*pypy.interpreter.pycode.PyCode), descr=)\lPyCode.funcrun:3 p29 = getfield_gc(p20, descr=)\lPyCode.funcrun:6 p30 = getfield_gc(p20, descr=)\lPyCode.funcrun:21 p31 = getfield_gc(p20, descr=)\lPyCode.funcrun:24 p32 = getfield_gc(p20, descr=)\lArguments._match_signature:620 i33 = arraylen_gc(p32, descr=)\lArguments._match_signature:623 i34 = int_sub(Const(2), i33)\lThreadLocals.getvalue:3 p22 = getfield_gc(Const(*pypy.interpreter.miscutils.ThreadLocals), descr=)\lObjSpace.getexecutioncontext:4 guard_nonnull(p22, descr=)\lExecutionContext.enter:3 i35 = getfield_gc(p22, descr=)\lExecutionContext.enter:6 i36 = getfield_gc(Const(*pypy.module.sys.Module), descr=)\lExecutionContext.enter:9 i37 = int_gt(i35, i36)\lExecutionContext.enter:9 guard_false(i37, descr=)\lExecutionContext._chain:6 i26 = int_add(i35, Const(1))\lExecutionContext._chain:10 setfield_gc(p22, i26, descr=)\lExecutionContext._chain:13 p24 = getfield_gc(p22, descr=)\lExecutionContext.gettopframe:3 guard_nonnull(p24, descr=)\lExecutionContext.gettopframe:16 i38 = oois(p24, p0)\lExecutionContext.gettopframe:13 guard_true(i38, descr=)\lExecutionContext.gettopframe:16 guard_isnull(p2, descr=)\l", color="black", fillcolor="white", style="filled", width="0.75"]; +_g0op53 [shape="box", label="debug_merge_point(Const(\" #31 STORE_FAST\"))\ldebug_merge_point(Const(\" #34 JUMP_ABSOLUTE\"))\lActionFlag.get:3 i39 = getfield_gc(Const(*pypy.interpreter.executioncontext.ActionFlag), descr=)\lbytecode_trace__AccessDirect_None:7 i40 = int_and(i39, Const(6291456))\lbytecode_trace__AccessDirect_None:9 i41 = int_is_true(i40)\lbytecode_trace__AccessDirect_None:9 guard_false(i41, descr=)\l", color="black", fillcolor="white", style="filled", width="0.75"]; +_g0op59 [shape="box", label="debug_merge_point(Const(\" #3 LOAD_FAST\"))\ljump(p0, p1, Const(* None), p3, Const(3), Const(* None), Const(* None), Const(* None), Const(* None), p9, p10, p11, p12, i17, p14, descr=)\l", color="black", fillcolor="white", style="filled", width="0.75"]; +} +edge [label="", style="dashed", color="black", dir="forward", weight="5"]; +_graph0 -> _g0op0 +edge [label="", style="dashed", color="black", dir="forward", weight="5"]; +_g0op0 -> _g0op3 +edge [label="", style="dashed", color="black", dir="forward", weight="5"]; +_g0op3 -> _g0op7 +edge [label="", style="dashed", color="black", dir="forward", weight="5"]; +_g0op39 -> _g0op44 +edge [label="", style="dashed", color="black", dir="forward", weight="5"]; +_g0op7 -> _g0op14 +edge [label="", style="dashed", color="black", dir="forward", weight="5"]; +_g0op44 -> _g0op53 +edge [label="", style="dashed", color="black", dir="forward", weight="5"]; +_g0op14 -> _g0op39 +edge [label="", style="dashed", color="black", dir="forward", weight="5"]; +_g0op53 -> _g0op59 +edge [label="", style="dashed", color="black", dir="forward", weight="0"]; +_g0op59 -> _g0op0 +} \ No newline at end of file Added: pypy/extradoc/talk/pycon2010/vmsummit/talk.html ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/talk.html Sun Feb 14 12:14:06 2010 @@ -0,0 +1,408 @@ + + + + + + + +PyPy and Its Generated Tracing JIT + + + + + + + + + + + + + + + + +
+
+
+ + +
+
+
+

PyPy and Its Generated Tracing JIT

+ +++ + + + + + +
Authors:Samuele Pedroni (Open End AB) +
Maciej Fija?kowski (xxx)
Date:VM Summit '10
+ + + + + + + + + + +
+
+

What is PyPy?

+
    +
  • Python in Python
  • +
  • Translation (RPython -> e.g. C)
  • +
  • Generating dynamic compilers
  • +
  • Open Source: MIT
  • +
+

=> Toolkit for building dynamic languages

+
+
+

Generating a Tracing JIT

+
    +
  • +
    produce traces: (meta)interpreter through low-level operations
    +

    that make up the language inter peter

    +
    +
    +
  • +
  • identify loops: hints for start of dispatch loop, backedges

    +
  • +
+
+
+

Optimisations

+
    +
  • unify head and tail of the loop data-flow, find non-escaping values: +virtual objects instead of allocations
  • +
  • virtualizables: e.g. mirror Python frames of the CPU stack
  • +
+
+
+

Trace example

+
+
+

Results (current)

+

benchmarks

+
+
+

Challenges

+
    +
  • megamorphic sites/complex control flow
  • +
  • unmerged tails of control flow
  • +
  • too long traces
  • +
  • always failing guards
  • +
  • bookkeeping memory consumption
  • +
  • GC pressure
  • +
+
+ +
+ + Added: pypy/extradoc/talk/pycon2010/vmsummit/talk.txt ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/talk.txt Sun Feb 14 12:14:06 2010 @@ -0,0 +1,59 @@ +.. include:: + +========================================================= +PyPy and Its Generated Tracing JIT +========================================================= + +:Authors: Samuele Pedroni (Open End AB), Maciej Fija?kowski (xxx) +:Date: VM Summit '10 + +What is PyPy? +=================== + +- Python in Python +- Translation (RPython -> e.g. C) +- Generating dynamic compilers +- Open Source: MIT + +=> Toolkit for building dynamic languages + +Generating a Tracing JIT +=========================== + +- produce traces: (meta)interpreter through low-level operations + that make up the language inter peter +- identify loops: hints for start of dispatch loop, backedges + +Optimisations +================= + +- unify head and tail of the loop data-flow, find non-escaping values: + virtual objects instead of allocations +- virtualizables: e.g. mirror Python frames of the CPU stack + +Trace example +=============== + +Results (current) +================== + +benchmarks + +Challenges +============== + +- megamorphic sites/complex control flow +- unmerged tails of control flow +- too long traces +- always failing guards +- bookkeeping memory consumption +- GC pressure + +Links +============ + +Status blog +http://morepypy.blogspot.com + +Website +http://codespeak.net/pypy Added: pypy/extradoc/talk/pycon2010/vmsummit/ui/default/blank.gif ============================================================================== Binary file. No diff available. Added: pypy/extradoc/talk/pycon2010/vmsummit/ui/default/framing.css ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/framing.css Sun Feb 14 12:14:06 2010 @@ -0,0 +1,25 @@ +/* This file has been placed in the public domain. */ +/* The following styles size, place, and layer the slide components. + Edit these if you want to change the overall slide layout. + The commented lines can be uncommented (and modified, if necessary) + to help you with the rearrangement process. */ + +/* target = 1024x768 */ + +div#header, div#footer, .slide {width: 100%; top: 0; left: 0;} +div#header {position: fixed; top: 0; height: 3em; z-index: 1;} +div#footer {top: auto; bottom: 0; height: 2.5em; z-index: 5;} +.slide {top: 0; width: 92%; padding: 2.5em 4% 4%; z-index: 2;} +div#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;} +div#controls form {position: absolute; bottom: 0; right: 0; width: 100%; + margin: 0;} +#currentSlide {position: absolute; width: 10%; left: 45%; bottom: 1em; + z-index: 10;} +html>body #currentSlide {position: fixed;} + +/* +div#header {background: #FCC;} +div#footer {background: #CCF;} +div#controls {background: #BBD;} +div#currentSlide {background: #FFC;} +*/ Added: pypy/extradoc/talk/pycon2010/vmsummit/ui/default/iepngfix.htc ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/iepngfix.htc Sun Feb 14 12:14:06 2010 @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file Added: pypy/extradoc/talk/pycon2010/vmsummit/ui/default/opera.css ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/opera.css Sun Feb 14 12:14:06 2010 @@ -0,0 +1,8 @@ +/* This file has been placed in the public domain. */ +/* DO NOT CHANGE THESE unless you really want to break Opera Show */ +.slide { + visibility: visible !important; + position: static !important; + page-break-before: always; +} +#slide0 {page-break-before: avoid;} Added: pypy/extradoc/talk/pycon2010/vmsummit/ui/default/outline.css ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/outline.css Sun Feb 14 12:14:06 2010 @@ -0,0 +1,16 @@ +/* This file has been placed in the public domain. */ +/* Don't change this unless you want the layout stuff to show up in the + outline view! */ + +.layout div, #footer *, #controlForm * {display: none;} +#footer, #controls, #controlForm, #navLinks, #toggle { + display: block; visibility: visible; margin: 0; padding: 0;} +#toggle {float: right; padding: 0.5em;} +html>body #toggle {position: fixed; top: 0; right: 0;} + +/* making the outline look pretty-ish */ + +#slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;} +#toggle {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;} + +.outline {display: inline ! important;} Added: pypy/extradoc/talk/pycon2010/vmsummit/ui/default/pretty.css ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/pretty.css Sun Feb 14 12:14:06 2010 @@ -0,0 +1,121 @@ +/* This file has been placed in the public domain. */ +/* Following are the presentation styles -- edit away! */ + +html, body {margin: 0; padding: 0;} +body {background: #fff color: #222; font-size: 2em;} +/* Replace the background style above with the style below (and again for + div#header) for a graphic: */ +/* background: white url(bodybg.gif) -16px 0 no-repeat; */ +:link, :visited {text-decoration: none; color: #00C;} +#controls :active {color: #88A !important;} +#controls :focus {outline: 1px dotted #227;} +h1, h2, h3, h4 {font-size: 100%; margin: 0; padding: 0; font-weight: inherit;} + +blockquote {padding: 0 2em 0.5em; margin: 0 1.5em 0.5em;} +blockquote p {margin: 0;} + +kbd {font-weight: bold; font-size: 1em;} +sup {font-size: smaller; line-height: 1px;} + +.slide pre {padding: 0; margin-left: 0; margin-right: 0; font-size: 90%;} +.slide ul ul li {list-style: square; } +.slide img.leader {display: block; margin: 0 auto;} +.slide tt {font-size: 90%;} + +div#header, div#footer {background: #005; color: #AAB; font-family: sans-serif;} +/* background: #005 url(bodybg.gif) -16px 0 no-repeat; */ +div#footer {font-size: 0.5em; font-weight: bold; padding: 1em 0;} +#footer h1 {display: block; padding: 0 1em;} +#footer h2 {display: block; padding: 0.8em 1em 0;} + +.slide {font-size: 1.5em;} +.slide li {font-size: 1.0em; padding-bottom: 0.2em;} +.slide h1 {position: absolute; top: 0.45em; z-index: 1; + margin: 0; padding-left: 0.7em; white-space: nowrap; + font: bold 110% sans-serif; color: #DDE; background: #005;} +.slide h2 {font: bold 120%/1em sans-serif; padding-top: 0.5em;} +.slide h3 {font: bold 100% sans-serif; padding-top: 0.5em;} +h1 abbr {font-variant: small-caps;} + +div#controls {position: absolute; left: 50%; bottom: 0; + width: 50%; text-align: right; font: bold 0.9em sans-serif;} +html>body div#controls {position: fixed; padding: 0 0 1em 0; top: auto;} +div#controls form {position: absolute; bottom: 0; right: 0; width: 100%; + margin: 0; padding: 0;} +#controls #navLinks a {padding: 0; margin: 0 0.5em; + background: #005; border: none; color: #779; cursor: pointer;} +#controls #navList {height: 1em;} +#controls #navList #jumplist {position: absolute; bottom: 0; right: 0; + background: #DDD; color: #227;} + +#currentSlide {text-align: center; font-size: 0.5em; color: #449; + font-family: sans-serif; font-weight: bold;} + +#slide0 {padding-top: 1.5em} +#slide0 h1 {position: static; margin: 1em 0 0; padding: 0; color: #000; + font: bold 2em sans-serif; white-space: normal; background: transparent;} +#slide0 h2 {font: bold italic 1em sans-serif; margin: 0.25em;} +#slide0 h3 {margin-top: 1.5em; font-size: 1.5em;} +#slide0 h4 {margin-top: 0; font-size: 1em;} + +ul.urls {list-style: none; display: inline; margin: 0;} +.urls li {display: inline; margin: 0;} +.external {border-bottom: 1px dotted gray;} +html>body .external {border-bottom: none;} +.external:after {content: " \274F"; font-size: smaller; color: #77B;} + +.incremental, .incremental *, .incremental *:after {visibility: visible; + color: white; border: 0;} +img.incremental {visibility: hidden;} +.slide .current {color: green;} + +.slide-display {display: inline ! important;} + +.huge {font-family: sans-serif; font-weight: bold; font-size: 150%;} +.big {font-family: sans-serif; font-weight: bold; font-size: 120%;} +.small {font-size: 75%;} +.tiny {font-size: 50%;} +.huge tt, .big tt, .small tt, .tiny tt {font-size: 115%;} +.huge pre, .big pre, .small pre, .tiny pre {font-size: 115%;} + +.maroon {color: maroon;} +.red {color: red;} +.magenta {color: magenta;} +.fuchsia {color: fuchsia;} +.pink {color: #FAA;} +.orange {color: orange;} +.yellow {color: yellow;} +.lime {color: lime;} +.green {color: green;} +.olive {color: olive;} +.teal {color: teal;} +.cyan {color: cyan;} +.aqua {color: aqua;} +.blue {color: blue;} +.navy {color: navy;} +.purple {color: purple;} +.black {color: black;} +.gray {color: gray;} +.silver {color: silver;} +.white {color: white;} + +.left {text-align: left ! important;} +.center {text-align: center ! important;} +.right {text-align: right ! important;} + +.animation {position: relative; margin: 1em 0; padding: 0;} +.animation img {position: absolute;} + +/* Docutils-specific overrides */ + +.slide table.docinfo {margin: 1em 0 0.5em 2em;} + +pre.literal-block, pre.doctest-block {background-color: white;} + +tt.docutils {background-color: white;} + +/* diagnostics */ +/* +li:after {content: " [" attr(class) "]"; color: #F88;} +div:before {content: "[" attr(class) "]"; color: #F88;} +*/ Added: pypy/extradoc/talk/pycon2010/vmsummit/ui/default/print.css ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/print.css Sun Feb 14 12:14:06 2010 @@ -0,0 +1,24 @@ +/* This file has been placed in the public domain. */ +/* The following rule is necessary to have all slides appear in print! + DO NOT REMOVE IT! */ +.slide, ul {page-break-inside: avoid; visibility: visible !important;} +h1 {page-break-after: avoid;} + +body {font-size: 12pt; background: white;} +* {color: black;} + +#slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;} +#slide0 h3 {margin: 0; padding: 0;} +#slide0 h4 {margin: 0 0 0.5em; padding: 0;} +#slide0 {margin-bottom: 3em;} + +#header {display: none;} +#footer h1 {margin: 0; border-bottom: 1px solid; color: gray; + font-style: italic;} +#footer h2, #controls {display: none;} + +.print {display: inline ! important;} + +/* The following rule keeps the layout stuff out of print. + Remove at your own risk! */ +.layout, .layout * {display: none !important;} Added: pypy/extradoc/talk/pycon2010/vmsummit/ui/default/s5-core.css ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/s5-core.css Sun Feb 14 12:14:06 2010 @@ -0,0 +1,11 @@ +/* This file has been placed in the public domain. */ +/* Do not edit or override these styles! + The system will likely break if you do. */ + +div#header, div#footer, div#controls, .slide {position: absolute;} +html>body div#header, html>body div#footer, + html>body div#controls, html>body .slide {position: fixed;} +.handout {display: none;} +.layout {display: block;} +.slide, .hideme, .incremental {visibility: hidden;} +#slide0 {visibility: visible;} Added: pypy/extradoc/talk/pycon2010/vmsummit/ui/default/slides.css ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/slides.css Sun Feb 14 12:14:06 2010 @@ -0,0 +1,13 @@ +/* This file has been placed in the public domain. */ + +/* required to make the slide show run at all */ + at import url(s5-core.css); + +/* sets basic placement and size of slide components */ + at import url(framing.css); + +/* styles that make the slides look good */ + at import url(pretty.css); + +/* pypy override */ + at import url(../py.css); Added: pypy/extradoc/talk/pycon2010/vmsummit/ui/default/slides.js ============================================================================== --- (empty file) +++ pypy/extradoc/talk/pycon2010/vmsummit/ui/default/slides.js Sun Feb 14 12:14:06 2010 @@ -0,0 +1,558 @@ +// S5 v1.1 slides.js -- released into the Public Domain +// Modified for Docutils (http://docutils.sf.net) by David Goodger +// +// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for +// information about all the wonderful and talented contributors to this code! + +var undef; +var slideCSS = ''; +var snum = 0; +var smax = 1; +var slideIDs = new Array(); +var incpos = 0; +var number = undef; +var s5mode = true; +var defaultView = 'slideshow'; +var controlVis = 'visible'; + +var isIE = navigator.appName == 'Microsoft Internet Explorer' ? 1 : 0; +var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0; +var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0; + +function hasClass(object, className) { + if (!object.className) return false; + return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1); +} + +function hasValue(object, value) { + if (!object) return false; + return (object.search('(^|\\s)' + value + '(\\s|$)') != -1); +} + +function removeClass(object,className) { + if (!object) return; + object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2); +} + +function addClass(object,className) { + if (!object || hasClass(object, className)) return; + if (object.className) { + object.className += ' '+className; + } else { + object.className = className; + } +} + +function GetElementsWithClassName(elementName,className) { + var allElements = document.getElementsByTagName(elementName); + var elemColl = new Array(); + for (var i = 0; i< allElements.length; i++) { + if (hasClass(allElements[i], className)) { + elemColl[elemColl.length] = allElements[i]; + } + } + return elemColl; +} + +function isParentOrSelf(element, id) { + if (element == null || element.nodeName=='BODY') return false; + else if (element.id == id) return true; + else return isParentOrSelf(element.parentNode, id); +} + +function nodeValue(node) { + var result = ""; + if (node.nodeType == 1) { + var children = node.childNodes; + for (var i = 0; i < children.length; ++i) { + result += nodeValue(children[i]); + } + } + else if (node.nodeType == 3) { + result = node.nodeValue; + } + return(result); +} + +function slideLabel() { + var slideColl = GetElementsWithClassName('*','slide'); + var list = document.getElementById('jumplist'); + smax = slideColl.length; + for (var n = 0; n < smax; n++) { + var obj = slideColl[n]; + + var did = 'slide' + n.toString(); + if (obj.getAttribute('id')) { + slideIDs[n] = obj.getAttribute('id'); + } + else { + obj.setAttribute('id',did); + slideIDs[n] = did; + } + if (isOp) continue; + + var otext = ''; + var menu = obj.firstChild; + if (!menu) continue; // to cope with empty slides + while (menu && menu.nodeType == 3) { + menu = menu.nextSibling; + } + if (!menu) continue; // to cope with slides with only text nodes + + var menunodes = menu.childNodes; + for (var o = 0; o < menunodes.length; o++) { + otext += nodeValue(menunodes[o]); + } + list.options[list.length] = new Option(n + ' : ' + otext, n); + } +} + +function currentSlide() { + var cs; + var footer_nodes; + var vis = 'visible'; + if (document.getElementById) { + cs = document.getElementById('currentSlide'); + footer_nodes = document.getElementById('footer').childNodes; + } else { + cs = document.currentSlide; + footer = document.footer.childNodes; + } + cs.innerHTML = '' + snum + '<\/span> ' + + '\/<\/span> ' + + '' + (smax-1) + '<\/span>'; + if (snum == 0) { + vis = 'hidden'; + } + cs.style.visibility = vis; + for (var i = 0; i < footer_nodes.length; i++) { + if (footer_nodes[i].nodeType == 1) { + footer_nodes[i].style.visibility = vis; + } + } +} + +function go(step) { + if (document.getElementById('slideProj').disabled || step == 0) return; + var jl = document.getElementById('jumplist'); + var cid = slideIDs[snum]; + var ce = document.getElementById(cid); + if (incrementals[snum].length > 0) { + for (var i = 0; i < incrementals[snum].length; i++) { + removeClass(incrementals[snum][i], 'current'); + removeClass(incrementals[snum][i], 'incremental'); + } + } + if (step != 'j') { + snum += step; + lmax = smax - 1; + if (snum > lmax) snum = lmax; + if (snum < 0) snum = 0; + } else + snum = parseInt(jl.value); + var nid = slideIDs[snum]; + var ne = document.getElementById(nid); + if (!ne) { + ne = document.getElementById(slideIDs[0]); + snum = 0; + } + if (step < 0) {incpos = incrementals[snum].length} else {incpos = 0;} + if (incrementals[snum].length > 0 && incpos == 0) { + for (var i = 0; i < incrementals[snum].length; i++) { + if (hasClass(incrementals[snum][i], 'current')) + incpos = i + 1; + else + addClass(incrementals[snum][i], 'incremental'); + } + } + if (incrementals[snum].length > 0 && incpos > 0) + addClass(incrementals[snum][incpos - 1], 'current'); + ce.style.visibility = 'hidden'; + ne.style.visibility = 'visible'; + jl.selectedIndex = snum; + currentSlide(); + number = 0; +} + +function goTo(target) { + if (target >= smax || target == snum) return; + go(target - snum); +} + +function subgo(step) { + if (step > 0) { + removeClass(incrementals[snum][incpos - 1],'current'); + removeClass(incrementals[snum][incpos], 'incremental'); + addClass(incrementals[snum][incpos],'current'); + incpos++; + } else { + incpos--; + removeClass(incrementals[snum][incpos],'current'); + addClass(incrementals[snum][incpos], 'incremental'); + addClass(incrementals[snum][incpos - 1],'current'); + } +} + +function toggle() { + var slideColl = GetElementsWithClassName('*','slide'); + var slides = document.getElementById('slideProj'); + var outline = document.getElementById('outlineStyle'); + if (!slides.disabled) { + slides.disabled = true; + outline.disabled = false; + s5mode = false; + fontSize('1em'); + for (var n = 0; n < smax; n++) { + var slide = slideColl[n]; + slide.style.visibility = 'visible'; + } + } else { + slides.disabled = false; + outline.disabled = true; + s5mode = true; + fontScale(); + for (var n = 0; n < smax; n++) { + var slide = slideColl[n]; + slide.style.visibility = 'hidden'; + } + slideColl[snum].style.visibility = 'visible'; + } +} + +function showHide(action) { + var obj = GetElementsWithClassName('*','hideme')[0]; + switch (action) { + case 's': obj.style.visibility = 'visible'; break; + case 'h': obj.style.visibility = 'hidden'; break; + case 'k': + if (obj.style.visibility != 'visible') { + obj.style.visibility = 'visible'; + } else { + obj.style.visibility = 'hidden'; + } + break; + } +} + +// 'keys' code adapted from MozPoint (http://mozpoint.mozdev.org/) +function keys(key) { + if (!key) { + key = event; + key.which = key.keyCode; + } + if (key.which == 84) { + toggle(); + return; + } + if (s5mode) { + switch (key.which) { + case 10: // return + case 13: // enter + if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return; + if (key.target && isParentOrSelf(key.target, 'controls')) return; + if(number != undef) { + goTo(number); + break; + } + case 32: // spacebar + case 34: // page down + case 39: // rightkey + case 40: // downkey + if(number != undef) { + go(number); + } else if (!incrementals[snum] || incpos >= incrementals[snum].length) { + go(1); + } else { + subgo(1); + } + break; + case 33: // page up + case 37: // leftkey + case 38: // upkey + if(number != undef) { + go(-1 * number); + } else if (!incrementals[snum] || incpos <= 0) { + go(-1); + } else { + subgo(-1); + } + break; + case 36: // home + goTo(0); + break; + case 35: // end + goTo(smax-1); + break; + case 67: // c + showHide('k'); + break; + } + if (key.which < 48 || key.which > 57) { + number = undef; + } else { + if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return; + if (key.target && isParentOrSelf(key.target, 'controls')) return; + number = (((number != undef) ? number : 0) * 10) + (key.which - 48); + } + } + return false; +} + +function clicker(e) { + number = undef; + var target; + if (window.event) { + target = window.event.srcElement; + e = window.event; + } else target = e.target; + if (target.href != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target, 'object')) return true; + if (!e.which || e.which == 1) { + if (!incrementals[snum] || incpos >= incrementals[snum].length) { + go(1); + } else { + subgo(1); + } + } +} + +function findSlide(hash) { + var target = document.getElementById(hash); + if (target) { + for (var i = 0; i < slideIDs.length; i++) { + if (target.id == slideIDs[i]) return i; + } + } + return null; +} + +function slideJump() { + if (window.location.hash == null || window.location.hash == '') { + currentSlide(); + return; + } + if (window.location.hash == null) return; + var dest = null; + dest = findSlide(window.location.hash.slice(1)); + if (dest == null) { + dest = 0; + } + go(dest - snum); +} + +function fixLinks() { + var thisUri = window.location.href; + thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length); + var aelements = document.getElementsByTagName('A'); + for (var i = 0; i < aelements.length; i++) { + var a = aelements[i].href; + var slideID = a.match('\#.+'); + if ((slideID) && (slideID[0].slice(0,1) == '#')) { + var dest = findSlide(slideID[0].slice(1)); + if (dest != null) { + if (aelements[i].addEventListener) { + aelements[i].addEventListener("click", new Function("e", + "if (document.getElementById('slideProj').disabled) return;" + + "go("+dest+" - snum); " + + "if (e.preventDefault) e.preventDefault();"), true); + } else if (aelements[i].attachEvent) { + aelements[i].attachEvent("onclick", new Function("", + "if (document.getElementById('slideProj').disabled) return;" + + "go("+dest+" - snum); " + + "event.returnValue = false;")); + } + } + } + } +} + +function externalLinks() { + if (!document.getElementsByTagName) return; + var anchors = document.getElementsByTagName('a'); + for (var i=0; i' + + '