From fijal at codespeak.net Wed Nov 1 10:34:06 2006 From: fijal at codespeak.net (fijal at codespeak.net) Date: Wed, 1 Nov 2006 10:34:06 +0100 (CET) Subject: [pypy-svn] r33995 - pypy/dist/pypy/translator/stackless Message-ID: <20061101093406.C18C010070@code0.codespeak.net> Author: fijal Date: Wed Nov 1 10:34:02 2006 New Revision: 33995 Modified: pypy/dist/pypy/translator/stackless/transform.py Log: Fixed imports. Modified: pypy/dist/pypy/translator/stackless/transform.py ============================================================================== --- pypy/dist/pypy/translator/stackless/transform.py (original) +++ pypy/dist/pypy/translator/stackless/transform.py Wed Nov 1 10:34:02 2006 @@ -1,6 +1,7 @@ from pypy.rpython.lltypesystem import lltype, llmemory from pypy.rpython.lltypesystem.lloperation import LL_OPERATIONS -from pypy.rlib import rarithmetic, rclass, rmodel +from pypy.rlib import rarithmetic +from pypy.rpython import rclass, rmodel from pypy.translator.backendopt import support from pypy.objspace.flow import model from pypy.translator import unsimplify, simplify From ale at codespeak.net Wed Nov 1 10:39:03 2006 From: ale at codespeak.net (ale at codespeak.net) Date: Wed, 1 Nov 2006 10:39:03 +0100 (CET) Subject: [pypy-svn] r33996 - pypy/dist/pypy/lib/pyontology Message-ID: <20061101093903.BB80410070@code0.codespeak.net> Author: ale Date: Wed Nov 1 10:39:02 2006 New Revision: 33996 Modified: pypy/dist/pypy/lib/pyontology/pyontology.py Log: Tryingto optimise SPARQL queries Modified: pypy/dist/pypy/lib/pyontology/pyontology.py ============================================================================== --- pypy/dist/pypy/lib/pyontology/pyontology.py (original) +++ pypy/dist/pypy/lib/pyontology/pyontology.py Wed Nov 1 10:39:02 2006 @@ -603,7 +603,7 @@ prop.setValues(list(self.variables['rdf_Property'].getValues())) # Get all properties by looking at 'rdf_Property' # add a constraint trip[0] in domains[prop] and trip[2] in domains[prop].getValuesPrKey(trip[0]) - self.constraints.append(PropertyConstrain(prop_name, indi, obj)) + query_constr.append(PropertyConstrain(prop_name, indi, obj)) elif case == 3: # search for s in p @@ -630,7 +630,7 @@ obj = self.variables[self.mangle_name(trip[2])] else: obj = trip[2] - self.constraints.append(PropertyConstrain2(prop_name, sub_name, obj)) + query_constr.append(PropertyConstrain2(prop_name, sub_name, obj)) elif case == 5: # return the values of p prop = self.make_var(Property, URIRef(trip[1])) @@ -658,17 +658,17 @@ obj = self.make_var(Thing, trip[2]) self.variables[obj].setValues(things) con = Expression([sub,prop,obj], "%s[0] == %s and %s[1] == %s" %(prop, sub, prop, obj)) - self.constraints.append(con) + query_constr.append(con) # call finish on the variables in the query for v in vars: - query_dom, query_constr = self.variables[self.mangle_name(v)].finish(self.variables, self.constraints) #query_dom, query_constr) + query_dom, _ = self.variables[self.mangle_name(v)].finish(self.variables, query_constr) #query_dom, query_constr) # Build a repository with the variables in the query - #dom = dict([(self.mangle_name(v),self.variables[self.mangle_name(v)) - # for v in vars]) + dom = dict([(self.mangle_name(v),self.variables[self.mangle_name(v)]) + for v in vars]) # solve the repository and return the solution -# rep = Repository(query_dom.keys(), query_dom, query_constr) -# return Solver().solve(rep) - res_s = self.solve() + rep = Repository(dom.keys(), dom, query_constr) + res_s = Solver().solve(rep) + #res_s = self.solve() res = [] for d in res_s: for k,v in d.items(): From cfbolz at codespeak.net Wed Nov 1 10:40:41 2006 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Wed, 1 Nov 2006 10:40:41 +0100 (CET) Subject: [pypy-svn] r33997 - pypy/extradoc/sprintinfo/ddorf2006b Message-ID: <20061101094041.EEC6010072@code0.codespeak.net> Author: cfbolz Date: Wed Nov 1 10:40:37 2006 New Revision: 33997 Modified: pypy/extradoc/sprintinfo/ddorf2006b/planning.txt Log: planning for today Modified: pypy/extradoc/sprintinfo/ddorf2006b/planning.txt ============================================================================== --- pypy/extradoc/sprintinfo/ddorf2006b/planning.txt (original) +++ pypy/extradoc/sprintinfo/ddorf2006b/planning.txt Wed Nov 1 10:40:37 2006 @@ -13,28 +13,36 @@ Tasks ===== - - javascript interpreter (leonardo, maciek and armin around) + - javascript interpreter (leonardo, stephan) addition of numbers, strings (with proper, twisted semantics) works integration of the narcissus parser + nested scopes, variable declarations, functions without parameters - - jvm backend (niko, anto) + - jvm backend (niko, ) sharing code between gencli and genjvm + first tests running! + number manipulations, field access - - transparent proxies + - transparent proxies (maciek, guido, samuele around) - - apigen tool (guido, maciek around) + - apigen tool + changes to instance variables after calls to functions - build tool it's now actually building pypy, sending the usession directory back - - .net integration + - .net integration, fixing pypy.net (anto, carl friedrich) + quick hack, but pypy.net is broken :-( - jit code generation (eric, michael) lots of documentation about the jit-backend interface, fighting with ppc code generation + some refactorings + looking at whether it's possible to use the llvm code generation - jit front end (samuele, arre) IN-PROGRESS + fixed the last known bug, experimentation needed - running tests on the translated pypy-cs (related to py.test refactoring?) @@ -42,7 +50,10 @@ - lists of integers - - adding the microbenchmark results to the benchmark page (eric) - MAYBE DONE + - adding the microbenchmark results to the benchmark page + DONE - trying the jit efforts on a regex engine (richard, armin around) + kind of worked + +- fixing pypy on windows, adding some more os functions (christian) From stephan at codespeak.net Wed Nov 1 11:03:21 2006 From: stephan at codespeak.net (stephan at codespeak.net) Date: Wed, 1 Nov 2006 11:03:21 +0100 (CET) Subject: [pypy-svn] r33998 - pypy/dist/pypy/module/_stackless/test Message-ID: <20061101100321.D78E310063@code0.codespeak.net> Author: stephan Date: Wed Nov 1 11:03:19 2006 New Revision: 33998 Modified: pypy/dist/pypy/module/_stackless/test/test_stackless.py Log: test Modified: pypy/dist/pypy/module/_stackless/test/test_stackless.py ============================================================================== --- pypy/dist/pypy/module/_stackless/test/test_stackless.py (original) +++ pypy/dist/pypy/module/_stackless/test/test_stackless.py Wed Nov 1 11:03:19 2006 @@ -394,3 +394,4 @@ schedule() assert output == [('a', x) for x in "ABCDE"] + From ericvrp at codespeak.net Wed Nov 1 12:33:13 2006 From: ericvrp at codespeak.net (ericvrp at codespeak.net) Date: Wed, 1 Nov 2006 12:33:13 +0100 (CET) Subject: [pypy-svn] r34000 - in pypy/dist/pypy/jit/codegen/llvm: . lib test Message-ID: <20061101113313.CE10510060@code0.codespeak.net> Author: ericvrp Date: Wed Nov 1 12:33:10 2006 New Revision: 34000 Added: pypy/dist/pypy/jit/codegen/llvm/README.txt (contents, props changed) pypy/dist/pypy/jit/codegen/llvm/lib/ pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.cpp pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.h pypy/dist/pypy/jit/codegen/llvm/llvmjit.py (contents, props changed) pypy/dist/pypy/jit/codegen/llvm/setup.py (contents, props changed) pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py (contents, props changed) Modified: pypy/dist/pypy/jit/codegen/llvm/jitcode.py Log: (mwh, ericvrp) starting minimal llvm c-api library and ctypes wrapper Added: pypy/dist/pypy/jit/codegen/llvm/README.txt ============================================================================== --- (empty file) +++ pypy/dist/pypy/jit/codegen/llvm/README.txt Wed Nov 1 12:33:10 2006 @@ -0,0 +1,4 @@ +Create llvm c api library by running "python setup.py build_ext -i" here + +note: This library building should maybe not be done with distutils at all! + It should probably be done with the regular: ./configure;make;make install Modified: pypy/dist/pypy/jit/codegen/llvm/jitcode.py ============================================================================== --- pypy/dist/pypy/jit/codegen/llvm/jitcode.py (original) +++ pypy/dist/pypy/jit/codegen/llvm/jitcode.py Wed Nov 1 12:33:10 2006 @@ -1,4 +1,7 @@ """ +This code is not used anymore and it's tests are skipped. +Keeping it around for a while... + All code for using LLVM's JIT in one place """ Added: pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.cpp ============================================================================== --- (empty file) +++ pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.cpp Wed Nov 1 12:33:10 2006 @@ -0,0 +1,5 @@ +//implementation for using the LLVM JIT + +int testme(int n) { + return n * 2; +} Added: pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.h ============================================================================== --- (empty file) +++ pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.h Wed Nov 1 12:33:10 2006 @@ -0,0 +1,11 @@ +//for using the LLVM C++ API + +#ifdef __cplusplus +extern "C" { +#endif + +int testme(int n); + +#ifdef __cplusplus +} +#endif Added: pypy/dist/pypy/jit/codegen/llvm/llvmjit.py ============================================================================== --- (empty file) +++ pypy/dist/pypy/jit/codegen/llvm/llvmjit.py Wed Nov 1 12:33:10 2006 @@ -0,0 +1,9 @@ +''' + Another go at using the LLVM JIT as a codegenerator for PyPy. + + For now we use the LLVM C++ API as little as possible! + In future we might talk directly to the LLVM C++ API. + + This file contains the ctypes specification to use the llvmjit library! +''' + Added: pypy/dist/pypy/jit/codegen/llvm/setup.py ============================================================================== --- (empty file) +++ pypy/dist/pypy/jit/codegen/llvm/setup.py Wed Nov 1 12:33:10 2006 @@ -0,0 +1,19 @@ +from distutils.core import setup +from distutils.extension import Extension +from os import popen + +cxxflags = popen('llvm-config --cxxflags').readline().split() +ldflags = popen('llvm-config --ldflags').readline().split() +libs = popen('llvm-config --libs all').readline().split() + +opts = dict(name='llvmjit', + sources=['lib/llvmjit.cpp'], + libraries=[], + include_dirs =["include"] + [f[2:] for f in cxxflags if f.startswith('-I')], + library_dirs =[f[2:] for f in ldflags if f.startswith('-L')], + define_macros=[(f[2:], None) for f in cxxflags if f.startswith('-D')], + extra_objects=libs) + +ext_modules = Extension(**opts) + +setup(name=opts['name'], ext_modules=[ext_modules]) Added: pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py ============================================================================== From cfbolz at codespeak.net Wed Nov 1 12:49:51 2006 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Wed, 1 Nov 2006 12:49:51 +0100 (CET) Subject: [pypy-svn] r34001 - in pypy/dist/pypy: annotation annotation/test interpreter interpreter/pyparser jit/codegen jit/codegen/i386 jit/codegen/i386/test jit/codegen/llgraph jit/codegen/ppc jit/codegen/test jit/hintannotator/test jit/llabstractinterp/test jit/timeshifter/test jit/tl lang/automata lang/automata/test module/__builtin__ module/_pickle_support module/_stackless module/_weakref module/rsocket objspace/cclp objspace/cclp/constraint objspace/cpy objspace/flow objspace/std rlib rlib/test rpython rpython/lltypesystem rpython/lltypesystem/test rpython/memory rpython/memory/test rpython/ootypesystem rpython/ootypesystem/test rpython/test translator/backendopt/test translator/c translator/c/test translator/cli translator/cli/test translator/js translator/js/test translator/llvm translator/llvm/test translator/stackless translator/test Message-ID: <20061101114951.70FAC10060@code0.codespeak.net> Author: cfbolz Date: Wed Nov 1 12:49:34 2006 New Revision: 34001 Added: pypy/dist/pypy/rlib/objectmodel.py - copied unchanged from r33974, pypy/dist/pypy/rpython/objectmodel.py pypy/dist/pypy/rlib/test/test_objectmodel.py - copied, changed from r33974, pypy/dist/pypy/rpython/test/test_objectmodel.py Removed: pypy/dist/pypy/rpython/objectmodel.py pypy/dist/pypy/rpython/test/test_objectmodel.py Modified: pypy/dist/pypy/annotation/bookkeeper.py pypy/dist/pypy/annotation/builtin.py pypy/dist/pypy/annotation/test/test_annrpython.py pypy/dist/pypy/interpreter/error.py pypy/dist/pypy/interpreter/pyframe.py pypy/dist/pypy/interpreter/pyopcode.py pypy/dist/pypy/interpreter/pyparser/ebnflexer.py pypy/dist/pypy/interpreter/typedef.py pypy/dist/pypy/jit/codegen/i386/rgenop.py pypy/dist/pypy/jit/codegen/i386/test/test_genc_ts.py pypy/dist/pypy/jit/codegen/i386/test/test_operation.py pypy/dist/pypy/jit/codegen/i386/test/test_rgenop.py pypy/dist/pypy/jit/codegen/llgraph/rgenop.py pypy/dist/pypy/jit/codegen/model.py pypy/dist/pypy/jit/codegen/ppc/rgenop.py pypy/dist/pypy/jit/codegen/test/rgenop_tests.py pypy/dist/pypy/jit/hintannotator/test/test_annotator.py pypy/dist/pypy/jit/llabstractinterp/test/test_llabstractinterp.py pypy/dist/pypy/jit/llabstractinterp/test/test_vlist.py pypy/dist/pypy/jit/timeshifter/test/test_portal.py pypy/dist/pypy/jit/timeshifter/test/test_promotion.py pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py pypy/dist/pypy/jit/tl/tl.py pypy/dist/pypy/jit/tl/tlc.py pypy/dist/pypy/jit/tl/tlr.py pypy/dist/pypy/lang/automata/dfa.py pypy/dist/pypy/lang/automata/test/test_dfa.py pypy/dist/pypy/module/__builtin__/special.py pypy/dist/pypy/module/_pickle_support/maker.py pypy/dist/pypy/module/_stackless/clonable.py pypy/dist/pypy/module/_stackless/interp_clonable.py pypy/dist/pypy/module/_stackless/interp_coroutine.py pypy/dist/pypy/module/_weakref/interp__weakref.py pypy/dist/pypy/module/rsocket/rsocket.py pypy/dist/pypy/objspace/cclp/constraint/constraint.py pypy/dist/pypy/objspace/cclp/misc.py pypy/dist/pypy/objspace/cclp/scheduler.py pypy/dist/pypy/objspace/cclp/space.py pypy/dist/pypy/objspace/cclp/thread.py pypy/dist/pypy/objspace/cclp/thunk.py pypy/dist/pypy/objspace/cclp/variable.py pypy/dist/pypy/objspace/cpy/objspace.py pypy/dist/pypy/objspace/cpy/typedef.py pypy/dist/pypy/objspace/flow/framestate.py pypy/dist/pypy/objspace/std/dictmultiobject.py pypy/dist/pypy/objspace/std/dictobject.py pypy/dist/pypy/objspace/std/dictstrobject.py pypy/dist/pypy/objspace/std/objspace.py pypy/dist/pypy/objspace/std/setobject.py pypy/dist/pypy/objspace/std/smallintobject.py pypy/dist/pypy/objspace/std/stringobject.py pypy/dist/pypy/rlib/rarithmetic.py pypy/dist/pypy/rpython/llinterp.py pypy/dist/pypy/rpython/lltypesystem/llmemory.py pypy/dist/pypy/rpython/lltypesystem/lltype.py pypy/dist/pypy/rpython/lltypesystem/opimpl.py pypy/dist/pypy/rpython/lltypesystem/rbuiltin.py pypy/dist/pypy/rpython/lltypesystem/rclass.py pypy/dist/pypy/rpython/lltypesystem/rdict.py pypy/dist/pypy/rpython/lltypesystem/rstr.py pypy/dist/pypy/rpython/lltypesystem/test/test_llmemory.py pypy/dist/pypy/rpython/lltypesystem/test/test_rtagged.py pypy/dist/pypy/rpython/memory/gc.py pypy/dist/pypy/rpython/memory/lladdress.py pypy/dist/pypy/rpython/memory/support.py pypy/dist/pypy/rpython/memory/test/test_gc.py pypy/dist/pypy/rpython/memory/test/test_support.py pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py pypy/dist/pypy/rpython/normalizecalls.py pypy/dist/pypy/rpython/ootypesystem/ootype.py pypy/dist/pypy/rpython/ootypesystem/rbuiltin.py pypy/dist/pypy/rpython/ootypesystem/rdict.py pypy/dist/pypy/rpython/ootypesystem/test/test_oortype.py pypy/dist/pypy/rpython/raddress.py pypy/dist/pypy/rpython/rbuiltin.py pypy/dist/pypy/rpython/rcpy.py pypy/dist/pypy/rpython/rdict.py pypy/dist/pypy/rpython/rint.py pypy/dist/pypy/rpython/rlist.py pypy/dist/pypy/rpython/test/test_nongc.py pypy/dist/pypy/rpython/test/test_rbuiltin.py pypy/dist/pypy/rpython/test/test_rconstantdict.py pypy/dist/pypy/rpython/test/test_rpbc.py pypy/dist/pypy/translator/backendopt/test/test_canraise.py pypy/dist/pypy/translator/backendopt/test/test_constfold.py pypy/dist/pypy/translator/backendopt/test/test_escape.py pypy/dist/pypy/translator/backendopt/test/test_malloc.py pypy/dist/pypy/translator/c/gc.py pypy/dist/pypy/translator/c/primitive.py pypy/dist/pypy/translator/c/test/test_backendoptimized.py pypy/dist/pypy/translator/c/test/test_boehm.py pypy/dist/pypy/translator/c/test/test_genc.py pypy/dist/pypy/translator/c/test/test_lladdresses.py pypy/dist/pypy/translator/c/test/test_newgc.py pypy/dist/pypy/translator/c/test/test_rtagged.py pypy/dist/pypy/translator/c/test/test_symbolic.py pypy/dist/pypy/translator/c/test/test_typed.py pypy/dist/pypy/translator/cli/database.py pypy/dist/pypy/translator/cli/test/test_constant.py pypy/dist/pypy/translator/cli/test/test_objectmodel.py pypy/dist/pypy/translator/js/jts.py pypy/dist/pypy/translator/js/test/test_genllvm.py pypy/dist/pypy/translator/llvm/database.py pypy/dist/pypy/translator/llvm/test/test_lladdresses.py pypy/dist/pypy/translator/llvm/test/test_symbolic.py pypy/dist/pypy/translator/stackless/transform.py pypy/dist/pypy/translator/test/test_simplify.py Log: move objectmodel Modified: pypy/dist/pypy/annotation/bookkeeper.py ============================================================================== --- pypy/dist/pypy/annotation/bookkeeper.py (original) +++ pypy/dist/pypy/annotation/bookkeeper.py Wed Nov 1 12:49:34 2006 @@ -19,7 +19,7 @@ from pypy.interpreter.argument import Arguments, ArgErr from pypy.rlib.rarithmetic import r_int, r_uint, r_ulonglong, r_longlong from pypy.rlib.rarithmetic import base_int -from pypy.rpython.objectmodel import r_dict, Symbolic +from pypy.rlib.objectmodel import r_dict, Symbolic from pypy.tool.algo.unionfind import UnionFind from pypy.rpython.lltypesystem import lltype, llmemory from pypy.rpython.ootypesystem import ootype Modified: pypy/dist/pypy/annotation/builtin.py ============================================================================== --- pypy/dist/pypy/annotation/builtin.py (original) +++ pypy/dist/pypy/annotation/builtin.py Wed Nov 1 12:49:34 2006 @@ -16,7 +16,7 @@ from pypy.annotation import description from pypy.objspace.flow.model import Constant import pypy.rlib.rarithmetic -import pypy.rpython.objectmodel +import pypy.rlib.objectmodel import pypy.rlib.rstack # convenience only! @@ -356,13 +356,13 @@ ##BUILTIN_ANALYZERS[pypy.rlib.rarithmetic.ovfcheck] = rarith_ovfcheck ##BUILTIN_ANALYZERS[pypy.rlib.rarithmetic.ovfcheck_lshift] = rarith_ovfcheck_lshift BUILTIN_ANALYZERS[pypy.rlib.rarithmetic.intmask] = rarith_intmask -BUILTIN_ANALYZERS[pypy.rpython.objectmodel.instantiate] = robjmodel_instantiate -BUILTIN_ANALYZERS[pypy.rpython.objectmodel.we_are_translated] = ( +BUILTIN_ANALYZERS[pypy.rlib.objectmodel.instantiate] = robjmodel_instantiate +BUILTIN_ANALYZERS[pypy.rlib.objectmodel.we_are_translated] = ( robjmodel_we_are_translated) -BUILTIN_ANALYZERS[pypy.rpython.objectmodel.r_dict] = robjmodel_r_dict -BUILTIN_ANALYZERS[pypy.rpython.objectmodel.hlinvoke] = robjmodel_hlinvoke -BUILTIN_ANALYZERS[pypy.rpython.objectmodel.keepalive_until_here] = robjmodel_keepalive_until_here -BUILTIN_ANALYZERS[pypy.rpython.objectmodel.hint] = robjmodel_hint +BUILTIN_ANALYZERS[pypy.rlib.objectmodel.r_dict] = robjmodel_r_dict +BUILTIN_ANALYZERS[pypy.rlib.objectmodel.hlinvoke] = robjmodel_hlinvoke +BUILTIN_ANALYZERS[pypy.rlib.objectmodel.keepalive_until_here] = robjmodel_keepalive_until_here +BUILTIN_ANALYZERS[pypy.rlib.objectmodel.hint] = robjmodel_hint BUILTIN_ANALYZERS[pypy.rpython.lltypesystem.llmemory.cast_ptr_to_adr] = llmemory_cast_ptr_to_adr BUILTIN_ANALYZERS[pypy.rpython.lltypesystem.llmemory.cast_adr_to_ptr] = llmemory_cast_adr_to_ptr BUILTIN_ANALYZERS[pypy.rpython.lltypesystem.llmemory.cast_adr_to_int] = llmemory_cast_adr_to_int @@ -549,7 +549,7 @@ def robjmodel_free_non_gc_object(obj): pass -BUILTIN_ANALYZERS[pypy.rpython.objectmodel.free_non_gc_object] = ( +BUILTIN_ANALYZERS[pypy.rlib.objectmodel.free_non_gc_object] = ( robjmodel_free_non_gc_object) #_________________________________ Modified: pypy/dist/pypy/annotation/test/test_annrpython.py ============================================================================== --- pypy/dist/pypy/annotation/test/test_annrpython.py (original) +++ pypy/dist/pypy/annotation/test/test_annrpython.py Wed Nov 1 12:49:34 2006 @@ -11,7 +11,7 @@ from pypy.annotation.dictdef import DictDef from pypy.objspace.flow.model import * from pypy.rlib.rarithmetic import r_uint, base_int, r_longlong, r_ulonglong -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel from pypy.objspace.flow import FlowObjSpace from pypy.translator.test import snippet Modified: pypy/dist/pypy/interpreter/error.py ============================================================================== --- pypy/dist/pypy/interpreter/error.py (original) +++ pypy/dist/pypy/interpreter/error.py Wed Nov 1 12:49:34 2006 @@ -1,5 +1,5 @@ import os, sys -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated AUTO_DEBUG = os.getenv('PYPY_DEBUG') RECORD_INTERPLEVEL_TRACEBACK = True Modified: pypy/dist/pypy/interpreter/pyframe.py ============================================================================== --- pypy/dist/pypy/interpreter/pyframe.py (original) +++ pypy/dist/pypy/interpreter/pyframe.py Wed Nov 1 12:49:34 2006 @@ -7,7 +7,7 @@ from pypy.interpreter import pytraceback from pypy.rlib.rarithmetic import r_uint, intmask import opcode -from pypy.rpython.objectmodel import we_are_translated, instantiate +from pypy.rlib.objectmodel import we_are_translated, instantiate from pypy.rlib import rstack # for resume points @@ -633,7 +633,7 @@ def emptystack(self, frame): # propagate the exception to the caller - from pypy.rpython.objectmodel import we_are_translated + from pypy.rlib.objectmodel import we_are_translated if we_are_translated(): raise self.operr else: Modified: pypy/dist/pypy/interpreter/pyopcode.py ============================================================================== --- pypy/dist/pypy/interpreter/pyopcode.py (original) +++ pypy/dist/pypy/interpreter/pyopcode.py Wed Nov 1 12:49:34 2006 @@ -13,7 +13,7 @@ from pypy.interpreter.pycode import PyCode from pypy.interpreter.opcodeorder import opcodeorder from pypy.tool.sourcetools import func_with_new_name -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated from pypy.rlib.rarithmetic import intmask from pypy.tool import stdlib_opcode as pythonopcode from pypy.rlib import rstack # for resume points Modified: pypy/dist/pypy/interpreter/pyparser/ebnflexer.py ============================================================================== --- pypy/dist/pypy/interpreter/pyparser/ebnflexer.py (original) +++ pypy/dist/pypy/interpreter/pyparser/ebnflexer.py Wed Nov 1 12:49:34 2006 @@ -22,7 +22,7 @@ EOF: end of file SYMDEF: a symbol definition e.g. "file_input:" STRING: a simple string "'xxx'" - SYMBOL: a rule symbol usually appeary right of a SYMDEF + SYMBOL: a rule symbol usually appearing right of a SYMDEF tokens: '[', ']', '(' ,')', '*', '+', '|' """ def __init__(self, inpstring ): Modified: pypy/dist/pypy/interpreter/typedef.py ============================================================================== --- pypy/dist/pypy/interpreter/typedef.py (original) +++ pypy/dist/pypy/interpreter/typedef.py Wed Nov 1 12:49:34 2006 @@ -8,7 +8,7 @@ from pypy.interpreter.baseobjspace import Wrappable, W_Root, ObjSpace from pypy.interpreter.error import OperationError from pypy.tool.sourcetools import compile2, func_with_new_name -from pypy.rpython.objectmodel import instantiate +from pypy.rlib.objectmodel import instantiate from pypy.rlib.rarithmetic import intmask class TypeDef: Modified: pypy/dist/pypy/jit/codegen/i386/rgenop.py ============================================================================== --- pypy/dist/pypy/jit/codegen/i386/rgenop.py (original) +++ pypy/dist/pypy/jit/codegen/i386/rgenop.py Wed Nov 1 12:49:34 2006 @@ -1,11 +1,11 @@ import sys -from pypy.rpython.objectmodel import specialize +from pypy.rlib.objectmodel import specialize from pypy.rpython.lltypesystem import lltype, llmemory from pypy.jit.codegen.i386.ri386 import * from pypy.jit.codegen.i386.codebuf import InMemoryCodeBuilder, CodeBlockOverflow from pypy.jit.codegen.model import AbstractRGenOp, GenLabel, GenBuilder from pypy.jit.codegen.model import GenVar, GenConst, CodeGenSwitch -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel from pypy.rpython.annlowlevel import llhelper WORD = 4 Modified: pypy/dist/pypy/jit/codegen/i386/test/test_genc_ts.py ============================================================================== --- pypy/dist/pypy/jit/codegen/i386/test/test_genc_ts.py (original) +++ pypy/dist/pypy/jit/codegen/i386/test/test_genc_ts.py Wed Nov 1 12:49:34 2006 @@ -1,7 +1,7 @@ import os, sys from pypy.annotation import model as annmodel from pypy.annotation.listdef import s_list_of_strings -from pypy.rpython.objectmodel import keepalive_until_here +from pypy.rlib.objectmodel import keepalive_until_here from pypy.jit.timeshifter.test import test_timeshift from pypy.translator.c.genc import CStandaloneBuilder from pypy.rlib.unroll import unrolling_iterable Modified: pypy/dist/pypy/jit/codegen/i386/test/test_operation.py ============================================================================== --- pypy/dist/pypy/jit/codegen/i386/test/test_operation.py (original) +++ pypy/dist/pypy/jit/codegen/i386/test/test_operation.py Wed Nov 1 12:49:34 2006 @@ -1,5 +1,5 @@ import py -from pypy.rpython.objectmodel import specialize +from pypy.rlib.objectmodel import specialize from pypy.annotation import model as annmodel from pypy.rpython.lltypesystem import lltype from pypy.translator.translator import TranslationContext, graphof Modified: pypy/dist/pypy/jit/codegen/i386/test/test_rgenop.py ============================================================================== --- pypy/dist/pypy/jit/codegen/i386/test/test_rgenop.py (original) +++ pypy/dist/pypy/jit/codegen/i386/test/test_rgenop.py Wed Nov 1 12:49:34 2006 @@ -1,6 +1,6 @@ from pypy.rpython.lltypesystem import lltype from pypy.rpython.llinterp import LLInterpreter -from pypy.rpython.objectmodel import keepalive_until_here +from pypy.rlib.objectmodel import keepalive_until_here from pypy.rpython.annlowlevel import MixLevelAnnotatorPolicy from pypy.translator.c.test import test_boehm from pypy.jit.codegen.i386.rgenop import RI386GenOp Modified: pypy/dist/pypy/jit/codegen/llgraph/rgenop.py ============================================================================== --- pypy/dist/pypy/jit/codegen/llgraph/rgenop.py (original) +++ pypy/dist/pypy/jit/codegen/llgraph/rgenop.py Wed Nov 1 12:49:34 2006 @@ -1,4 +1,4 @@ -from pypy.rpython.objectmodel import specialize +from pypy.rlib.objectmodel import specialize from pypy.rpython.lltypesystem import lltype from pypy.jit.codegen.model import AbstractRGenOp, GenLabel, GenBuilder from pypy.jit.codegen.model import GenVar, GenConst, CodeGenSwitch Modified: pypy/dist/pypy/jit/codegen/model.py ============================================================================== --- pypy/dist/pypy/jit/codegen/model.py (original) +++ pypy/dist/pypy/jit/codegen/model.py Wed Nov 1 12:49:34 2006 @@ -1,4 +1,4 @@ -from pypy.rpython.objectmodel import specialize +from pypy.rlib.objectmodel import specialize class NotConstant(Exception): Modified: pypy/dist/pypy/jit/codegen/ppc/rgenop.py ============================================================================== --- pypy/dist/pypy/jit/codegen/ppc/rgenop.py (original) +++ pypy/dist/pypy/jit/codegen/ppc/rgenop.py Wed Nov 1 12:49:34 2006 @@ -1,7 +1,7 @@ from pypy.jit.codegen.model import AbstractRGenOp, GenLabel, GenBuilder from pypy.jit.codegen.model import GenVar, GenConst, CodeGenSwitch from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.rpython.objectmodel import specialize, we_are_translated +from pypy.rlib.objectmodel import specialize, we_are_translated from pypy.jit.codegen.ppc.conftest import option class Register(object): Modified: pypy/dist/pypy/jit/codegen/test/rgenop_tests.py ============================================================================== --- pypy/dist/pypy/jit/codegen/test/rgenop_tests.py (original) +++ pypy/dist/pypy/jit/codegen/test/rgenop_tests.py Wed Nov 1 12:49:34 2006 @@ -1,5 +1,5 @@ from pypy.rpython.annlowlevel import MixLevelAnnotatorPolicy -from pypy.rpython.objectmodel import keepalive_until_here +from pypy.rlib.objectmodel import keepalive_until_here from pypy.rpython.lltypesystem import lltype from pypy.translator.c.test import test_boehm from ctypes import c_void_p, cast, CFUNCTYPE, c_int Modified: pypy/dist/pypy/jit/hintannotator/test/test_annotator.py ============================================================================== --- pypy/dist/pypy/jit/hintannotator/test/test_annotator.py (original) +++ pypy/dist/pypy/jit/hintannotator/test/test_annotator.py Wed Nov 1 12:49:34 2006 @@ -4,7 +4,7 @@ from pypy.jit.hintannotator.bookkeeper import HintBookkeeper from pypy.jit.hintannotator.model import * from pypy.rpython.lltypesystem import lltype -from pypy.rpython.objectmodel import hint +from pypy.rlib.objectmodel import hint from pypy.annotation import model as annmodel from pypy.objspace.flow import model as flowmodel from pypy.annotation.policy import AnnotatorPolicy @@ -350,7 +350,7 @@ assert hs1.contentdef.degenerated def test_degenerated_merge_cross_substructure(): - from pypy.rpython import objectmodel + from pypy.rlib import objectmodel S = lltype.Struct('S', ('n', lltype.Signed)) T = lltype.GcStruct('T', ('s', S), ('s1', S), ('n', lltype.Float)) Modified: pypy/dist/pypy/jit/llabstractinterp/test/test_llabstractinterp.py ============================================================================== --- pypy/dist/pypy/jit/llabstractinterp/test/test_llabstractinterp.py (original) +++ pypy/dist/pypy/jit/llabstractinterp/test/test_llabstractinterp.py Wed Nov 1 12:49:34 2006 @@ -7,7 +7,7 @@ from pypy.annotation import model as annmodel from pypy.jit.llabstractinterp.llabstractinterp import LLAbstractInterp, Policy from pypy.objspace.flow import model as flowmodel -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel # one day maybe py.test.skip("XXX need to be ported to the newer rgenop interface") @@ -424,7 +424,7 @@ assert insns == {'int_lt': 1, 'int_add': 1, 'int_mul': 1} def test_hint(): - from pypy.rpython.objectmodel import hint + from pypy.rlib.objectmodel import hint A = lltype.GcArray(lltype.Char, hints={'immutable': True}) def ll_interp(code): accum = 0 @@ -449,7 +449,7 @@ assert insns == {'int_add': 4, 'int_lt': 1} def test_hint_across_call(): - from pypy.rpython.objectmodel import hint + from pypy.rlib.objectmodel import hint A = lltype.GcArray(lltype.Char, hints={'immutable': True}) def ll_length(a): return len(a) @@ -478,7 +478,7 @@ assert insns == {'int_add': 4, 'int_lt': 1} def test_conditional_origin(): - from pypy.rpython.objectmodel import hint + from pypy.rlib.objectmodel import hint def ll_function(x, y, variable): result = 0 i = 0 Modified: pypy/dist/pypy/jit/llabstractinterp/test/test_vlist.py ============================================================================== --- pypy/dist/pypy/jit/llabstractinterp/test/test_vlist.py (original) +++ pypy/dist/pypy/jit/llabstractinterp/test/test_vlist.py Wed Nov 1 12:49:34 2006 @@ -4,7 +4,7 @@ from pypy.jit.llabstractinterp.test.test_llabstractinterp import summary from pypy.rpython.llinterp import LLInterpreter from pypy.rpython.lltypesystem.rstr import string_repr -from pypy.rpython.objectmodel import hint +from pypy.rlib.objectmodel import hint policy = Policy(inlining=True, const_propagate=True, concrete_args=False, oopspec=True) Modified: pypy/dist/pypy/jit/timeshifter/test/test_portal.py ============================================================================== --- pypy/dist/pypy/jit/timeshifter/test/test_portal.py (original) +++ pypy/dist/pypy/jit/timeshifter/test/test_portal.py Wed Nov 1 12:49:34 2006 @@ -5,9 +5,9 @@ from pypy.jit.timeshifter.test.test_timeshift import P_NOVIRTUAL from pypy.rpython.llinterp import LLInterpreter from pypy.objspace.flow.model import checkgraph, summary -from pypy.rpython.objectmodel import hint +from pypy.rlib.objectmodel import hint -from pypy.rpython.objectmodel import hint +from pypy.rlib.objectmodel import hint import py.test Modified: pypy/dist/pypy/jit/timeshifter/test/test_promotion.py ============================================================================== --- pypy/dist/pypy/jit/timeshifter/test/test_promotion.py (original) +++ pypy/dist/pypy/jit/timeshifter/test/test_promotion.py Wed Nov 1 12:49:34 2006 @@ -2,7 +2,7 @@ from pypy.rpython.lltypesystem import lltype from pypy.jit.timeshifter.test.test_timeshift import TimeshiftingTests from pypy.jit.timeshifter.test.test_timeshift import P_NOVIRTUAL -from pypy.rpython.objectmodel import hint +from pypy.rlib.objectmodel import hint class TestPromotion(TimeshiftingTests): Modified: pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py ============================================================================== --- pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py (original) +++ pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py Wed Nov 1 12:49:34 2006 @@ -7,7 +7,7 @@ from pypy.jit.timeshifter import rtimeshift, rvalue from pypy.objspace.flow.model import summary from pypy.rpython.lltypesystem import lltype, llmemory, rstr -from pypy.rpython.objectmodel import hint, keepalive_until_here +from pypy.rlib.objectmodel import hint, keepalive_until_here from pypy.rlib.unroll import unrolling_iterable from pypy.rpython.annlowlevel import PseudoHighLevelCallable from pypy.rpython.module.support import LLSupport Modified: pypy/dist/pypy/jit/tl/tl.py ============================================================================== --- pypy/dist/pypy/jit/tl/tl.py (original) +++ pypy/dist/pypy/jit/tl/tl.py Wed Nov 1 12:49:34 2006 @@ -2,7 +2,7 @@ import py from pypy.jit.tl.opcode import * -from pypy.rpython.objectmodel import hint +from pypy.rlib.objectmodel import hint def char2int(c): t = ord(c) Modified: pypy/dist/pypy/jit/tl/tlc.py ============================================================================== --- pypy/dist/pypy/jit/tl/tlc.py (original) +++ pypy/dist/pypy/jit/tl/tlc.py Wed Nov 1 12:49:34 2006 @@ -3,7 +3,7 @@ import py from pypy.jit.tl.opcode import * from pypy.jit.tl import opcode as tlopcode -from pypy.rpython.objectmodel import hint +from pypy.rlib.objectmodel import hint class Obj(object): Modified: pypy/dist/pypy/jit/tl/tlr.py ============================================================================== --- pypy/dist/pypy/jit/tl/tlr.py (original) +++ pypy/dist/pypy/jit/tl/tlr.py Wed Nov 1 12:49:34 2006 @@ -1,4 +1,4 @@ -from pypy.rpython.objectmodel import hint +from pypy.rlib.objectmodel import hint MOV_A_R = 1 Modified: pypy/dist/pypy/lang/automata/dfa.py ============================================================================== --- pypy/dist/pypy/lang/automata/dfa.py (original) +++ pypy/dist/pypy/lang/automata/dfa.py Wed Nov 1 12:49:34 2006 @@ -1,6 +1,6 @@ " a very stripped down versio of cfbolz's algorithm/automaton module " -from pypy.rpython.objectmodel import hint +from pypy.rlib.objectmodel import hint from pypy.rpython.lltypesystem.lltype import GcArray, Signed, malloc class LexerError(Exception): Modified: pypy/dist/pypy/lang/automata/test/test_dfa.py ============================================================================== --- pypy/dist/pypy/lang/automata/test/test_dfa.py (original) +++ pypy/dist/pypy/lang/automata/test/test_dfa.py Wed Nov 1 12:49:34 2006 @@ -8,7 +8,7 @@ from pypy.jit.timeshifter.test.test_timeshift import P_NOVIRTUAL from pypy.rpython.llinterp import LLInterpreter from pypy.objspace.flow.model import checkgraph -from pypy.rpython.objectmodel import hint +from pypy.rlib.objectmodel import hint from pypy.lang.automata.dfa import * Modified: pypy/dist/pypy/module/__builtin__/special.py ============================================================================== --- pypy/dist/pypy/module/__builtin__/special.py (original) +++ pypy/dist/pypy/module/__builtin__/special.py Wed Nov 1 12:49:34 2006 @@ -26,7 +26,7 @@ def _pdb(space): """Run an interp-level pdb. This is not available in translated versions of PyPy.""" - from pypy.rpython.objectmodel import we_are_translated + from pypy.rlib.objectmodel import we_are_translated if we_are_translated(): raise OperationError(space.w_NotImplementedError, space.wrap("Cannot use interp-level pdb in translated pypy")) Modified: pypy/dist/pypy/module/_pickle_support/maker.py ============================================================================== --- pypy/dist/pypy/module/_pickle_support/maker.py (original) +++ pypy/dist/pypy/module/_pickle_support/maker.py Wed Nov 1 12:49:34 2006 @@ -5,7 +5,7 @@ from pypy.interpreter.pyframe import PyFrame from pypy.interpreter.pytraceback import PyTraceback from pypy.interpreter.generator import GeneratorIterator -from pypy.rpython.objectmodel import instantiate +from pypy.rlib.objectmodel import instantiate from pypy.interpreter.argument import Arguments from pypy.interpreter.baseobjspace import ObjSpace, W_Root from pypy.objspace.std.dicttype import dictiter_typedef Modified: pypy/dist/pypy/module/_stackless/clonable.py ============================================================================== --- pypy/dist/pypy/module/_stackless/clonable.py (original) +++ pypy/dist/pypy/module/_stackless/clonable.py Wed Nov 1 12:49:34 2006 @@ -1,7 +1,7 @@ from pypy.module._stackless.interp_coroutine import AbstractThunk, BaseCoState, Coroutine from pypy.module._stackless.interp_clonable import InterpClonableCoroutine -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated from pypy.rlib.rgc import gc_swap_pool, gc_clone from pypy.module._stackless.stackless_flags import StacklessFlags Modified: pypy/dist/pypy/module/_stackless/interp_clonable.py ============================================================================== --- pypy/dist/pypy/module/_stackless/interp_clonable.py (original) +++ pypy/dist/pypy/module/_stackless/interp_clonable.py Wed Nov 1 12:49:34 2006 @@ -1,6 +1,6 @@ from pypy.module._stackless.interp_coroutine import AbstractThunk, BaseCoState, Coroutine from pypy.rlib.rgc import gc_swap_pool, gc_clone -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated from pypy.interpreter.error import OperationError Modified: pypy/dist/pypy/module/_stackless/interp_coroutine.py ============================================================================== --- pypy/dist/pypy/module/_stackless/interp_coroutine.py (original) +++ pypy/dist/pypy/module/_stackless/interp_coroutine.py Wed Nov 1 12:49:34 2006 @@ -31,7 +31,7 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.rlib.rstack import yield_current_frame_to_caller, resume_point -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated try: from py.magic import greenlet Modified: pypy/dist/pypy/module/_weakref/interp__weakref.py ============================================================================== --- pypy/dist/pypy/module/_weakref/interp__weakref.py (original) +++ pypy/dist/pypy/module/_weakref/interp__weakref.py Wed Nov 1 12:49:34 2006 @@ -4,7 +4,7 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.typedef import GetSetProperty, TypeDef from pypy.interpreter.gateway import interp2app, ObjSpace -from pypy.rpython.objectmodel import cast_weakgcaddress_to_object, cast_object_to_weakgcaddress +from pypy.rlib.objectmodel import cast_weakgcaddress_to_object, cast_object_to_weakgcaddress from pypy.rpython.lltypesystem.llmemory import WEAKNULL Modified: pypy/dist/pypy/module/rsocket/rsocket.py ============================================================================== --- pypy/dist/pypy/module/rsocket/rsocket.py (original) +++ pypy/dist/pypy/module/rsocket/rsocket.py Wed Nov 1 12:49:34 2006 @@ -11,7 +11,7 @@ # - methods makefile(), # - SSL -from pypy.rpython.objectmodel import instantiate +from pypy.rlib.objectmodel import instantiate from pypy.module.rsocket import ctypes_socket as _c from ctypes import cast, POINTER, c_char, c_char_p, pointer, byref, c_void_p from ctypes import create_string_buffer, sizeof Modified: pypy/dist/pypy/objspace/cclp/constraint/constraint.py ============================================================================== --- pypy/dist/pypy/objspace/cclp/constraint/constraint.py (original) +++ pypy/dist/pypy/objspace/cclp/constraint/constraint.py Wed Nov 1 12:49:34 2006 @@ -1,4 +1,4 @@ -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated from pypy.interpreter.error import OperationError from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter import baseobjspace, typedef, gateway Modified: pypy/dist/pypy/objspace/cclp/misc.py ============================================================================== --- pypy/dist/pypy/objspace/cclp/misc.py (original) +++ pypy/dist/pypy/objspace/cclp/misc.py Wed Nov 1 12:49:34 2006 @@ -1,5 +1,5 @@ from pypy.interpreter import gateway, baseobjspace -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated # commonly imported there, used from types, variable, thread from pypy.module._stackless.clonable import ClonableCoroutine Modified: pypy/dist/pypy/objspace/cclp/scheduler.py ============================================================================== --- pypy/dist/pypy/objspace/cclp/scheduler.py (original) +++ pypy/dist/pypy/objspace/cclp/scheduler.py Wed Nov 1 12:49:34 2006 @@ -1,4 +1,4 @@ -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated from pypy.interpreter.error import OperationError from pypy.interpreter import gateway, baseobjspace from pypy.objspace.std.listobject import W_ListObject Modified: pypy/dist/pypy/objspace/cclp/space.py ============================================================================== --- pypy/dist/pypy/objspace/cclp/space.py (original) +++ pypy/dist/pypy/objspace/cclp/space.py Wed Nov 1 12:49:34 2006 @@ -1,4 +1,4 @@ -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated from pypy.interpreter import baseobjspace, gateway, argument, typedef from pypy.interpreter.function import Function from pypy.interpreter.pycode import PyCode Modified: pypy/dist/pypy/objspace/cclp/thread.py ============================================================================== --- pypy/dist/pypy/objspace/cclp/thread.py (original) +++ pypy/dist/pypy/objspace/cclp/thread.py Wed Nov 1 12:49:34 2006 @@ -1,5 +1,5 @@ from pypy.interpreter import gateway, baseobjspace, argument -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated from pypy.objspace.cclp.types import W_Var, W_Future, W_FailedValue from pypy.objspace.cclp.misc import w, v, AppCoroutine, get_current_cspace Modified: pypy/dist/pypy/objspace/cclp/thunk.py ============================================================================== --- pypy/dist/pypy/objspace/cclp/thunk.py (original) +++ pypy/dist/pypy/objspace/cclp/thunk.py Wed Nov 1 12:49:34 2006 @@ -10,7 +10,7 @@ from pypy.objspace.std.listobject import W_ListObject from pypy.objspace.std.listobject import W_TupleObject -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated def logic_args(args): "returns logic vars found in unpacked normalized args" Modified: pypy/dist/pypy/objspace/cclp/variable.py ============================================================================== --- pypy/dist/pypy/objspace/cclp/variable.py (original) +++ pypy/dist/pypy/objspace/cclp/variable.py Wed Nov 1 12:49:34 2006 @@ -9,7 +9,7 @@ from pypy.objspace.cclp.global_state import sched from pypy.objspace.cclp.types import deref, W_Var, W_CVar, W_Future, W_FailedValue -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated W_Root = baseobjspace.W_Root all_mms = {} Modified: pypy/dist/pypy/objspace/cpy/objspace.py ============================================================================== --- pypy/dist/pypy/objspace/cpy/objspace.py (original) +++ pypy/dist/pypy/objspace/cpy/objspace.py Wed Nov 1 12:49:34 2006 @@ -8,7 +8,7 @@ from pypy.interpreter.function import Function from pypy.interpreter.typedef import GetSetProperty from pypy.rlib.rarithmetic import r_uint, r_longlong, r_ulonglong -from pypy.rpython.objectmodel import we_are_translated, instantiate +from pypy.rlib.objectmodel import we_are_translated, instantiate class CPyObjSpace(baseobjspace.ObjSpace): Modified: pypy/dist/pypy/objspace/cpy/typedef.py ============================================================================== --- pypy/dist/pypy/objspace/cpy/typedef.py (original) +++ pypy/dist/pypy/objspace/cpy/typedef.py Wed Nov 1 12:49:34 2006 @@ -8,7 +8,7 @@ from pypy.interpreter.baseobjspace import Wrappable, SpaceCache from pypy.interpreter.function import Function from pypy.interpreter.typedef import GetSetProperty -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated from pypy.rpython.rcpy import CPyTypeInterface, cpy_export, cpy_import from pypy.rpython.rcpy import cpy_typeobject, rpython_object, cpy_allocate from pypy.rpython.rcpy import init_rpython_data, get_rpython_data Modified: pypy/dist/pypy/objspace/flow/framestate.py ============================================================================== --- pypy/dist/pypy/objspace/flow/framestate.py (original) +++ pypy/dist/pypy/objspace/flow/framestate.py Wed Nov 1 12:49:34 2006 @@ -1,6 +1,6 @@ from pypy.interpreter.pyframe import PyFrame, SuspendedUnroller from pypy.interpreter.error import OperationError -from pypy.rpython.objectmodel import instantiate +from pypy.rlib.objectmodel import instantiate from pypy.rlib.unroll import SpecTag from pypy.objspace.flow.model import * Modified: pypy/dist/pypy/objspace/std/dictmultiobject.py ============================================================================== --- pypy/dist/pypy/objspace/std/dictmultiobject.py (original) +++ pypy/dist/pypy/objspace/std/dictmultiobject.py Wed Nov 1 12:49:34 2006 @@ -2,7 +2,7 @@ from pypy.objspace.std.objspace import * from pypy.interpreter import gateway -from pypy.rpython.objectmodel import r_dict, we_are_translated +from pypy.rlib.objectmodel import r_dict, we_are_translated def _is_str(space, w_key): return space.is_w(space.type(w_key), space.w_str) Modified: pypy/dist/pypy/objspace/std/dictobject.py ============================================================================== --- pypy/dist/pypy/objspace/std/dictobject.py (original) +++ pypy/dist/pypy/objspace/std/dictobject.py Wed Nov 1 12:49:34 2006 @@ -8,7 +8,7 @@ from pypy.objspace.std.objspace import * from pypy.interpreter import gateway -from pypy.rpython.objectmodel import r_dict +from pypy.rlib.objectmodel import r_dict class W_DictObject(W_Object): Modified: pypy/dist/pypy/objspace/std/dictstrobject.py ============================================================================== --- pypy/dist/pypy/objspace/std/dictstrobject.py (original) +++ pypy/dist/pypy/objspace/std/dictstrobject.py Wed Nov 1 12:49:34 2006 @@ -1,7 +1,7 @@ from pypy.objspace.std.objspace import * from pypy.interpreter import gateway -from pypy.rpython.objectmodel import r_dict +from pypy.rlib.objectmodel import r_dict class W_DictStrObject(W_Object): from pypy.objspace.std.dicttype import dict_typedef as typedef Modified: pypy/dist/pypy/objspace/std/objspace.py ============================================================================== --- pypy/dist/pypy/objspace/std/objspace.py (original) +++ pypy/dist/pypy/objspace/std/objspace.py Wed Nov 1 12:49:34 2006 @@ -2,7 +2,7 @@ from pypy.interpreter.baseobjspace import ObjSpace, Wrappable from pypy.interpreter.error import OperationError, debug_print from pypy.interpreter.typedef import get_unique_interplevel_subclass -from pypy.rpython.objectmodel import instantiate +from pypy.rlib.objectmodel import instantiate from pypy.interpreter.gateway import PyPyCacheDir from pypy.tool.cache import Cache from pypy.tool.sourcetools import func_with_new_name Modified: pypy/dist/pypy/objspace/std/setobject.py ============================================================================== --- pypy/dist/pypy/objspace/std/setobject.py (original) +++ pypy/dist/pypy/objspace/std/setobject.py Wed Nov 1 12:49:34 2006 @@ -1,6 +1,6 @@ from pypy.objspace.std.objspace import W_Object, OperationError from pypy.objspace.std.objspace import registerimplementation, register_all -from pypy.rpython.objectmodel import r_dict +from pypy.rlib.objectmodel import r_dict from pypy.rlib.rarithmetic import intmask, r_uint from pypy.interpreter import gateway Modified: pypy/dist/pypy/objspace/std/smallintobject.py ============================================================================== --- pypy/dist/pypy/objspace/std/smallintobject.py (original) +++ pypy/dist/pypy/objspace/std/smallintobject.py Wed Nov 1 12:49:34 2006 @@ -7,7 +7,7 @@ from pypy.rlib.rarithmetic import ovfcheck, ovfcheck_lshift, LONG_BIT, r_uint from pypy.objspace.std.inttype import wrapint from pypy.objspace.std.intobject import W_IntObject -from pypy.rpython.objectmodel import UnboxedValue +from pypy.rlib.objectmodel import UnboxedValue # XXX this is a complete copy of intobject.py. Find a better but still # XXX annotator-friendly way to share code... Modified: pypy/dist/pypy/objspace/std/stringobject.py ============================================================================== --- pypy/dist/pypy/objspace/std/stringobject.py (original) +++ pypy/dist/pypy/objspace/std/stringobject.py Wed Nov 1 12:49:34 2006 @@ -3,7 +3,7 @@ from pypy.objspace.std.objspace import * from pypy.interpreter import gateway from pypy.rlib.rarithmetic import ovfcheck, _hash_string -from pypy.rpython.objectmodel import we_are_translated +from pypy.rlib.objectmodel import we_are_translated from pypy.objspace.std.inttype import wrapint from pypy.objspace.std.sliceobject import W_SliceObject from pypy.objspace.std import slicetype Modified: pypy/dist/pypy/rlib/rarithmetic.py ============================================================================== --- pypy/dist/pypy/rlib/rarithmetic.py (original) +++ pypy/dist/pypy/rlib/rarithmetic.py Wed Nov 1 12:49:34 2006 @@ -29,8 +29,9 @@ """ import math -from pypy.rpython import extregistry, objectmodel +from pypy.rpython import extregistry +from pypy.rlib import objectmodel # set up of machine internals _bits = 0 _itest = 1 Modified: pypy/dist/pypy/rpython/llinterp.py ============================================================================== --- pypy/dist/pypy/rpython/llinterp.py (original) +++ pypy/dist/pypy/rpython/llinterp.py Wed Nov 1 12:49:34 2006 @@ -3,7 +3,7 @@ from pypy.rpython.lltypesystem import lltype, llmemory, lloperation, llheap from pypy.rpython.lltypesystem import rclass from pypy.rpython.ootypesystem import ootype -from pypy.rpython.objectmodel import ComputedIntSymbolic +from pypy.rlib.objectmodel import ComputedIntSymbolic import sys, os import math Modified: pypy/dist/pypy/rpython/lltypesystem/llmemory.py ============================================================================== --- pypy/dist/pypy/rpython/lltypesystem/llmemory.py (original) +++ pypy/dist/pypy/rpython/lltypesystem/llmemory.py Wed Nov 1 12:49:34 2006 @@ -4,7 +4,7 @@ # sizeof, offsetof -from pypy.rpython.objectmodel import Symbolic +from pypy.rlib.objectmodel import Symbolic from pypy.rpython.lltypesystem import lltype class AddressOffset(Symbolic): Modified: pypy/dist/pypy/rpython/lltypesystem/lltype.py ============================================================================== --- pypy/dist/pypy/rpython/lltypesystem/lltype.py (original) +++ pypy/dist/pypy/rpython/lltypesystem/lltype.py Wed Nov 1 12:49:34 2006 @@ -2,7 +2,7 @@ from pypy.rlib.rarithmetic import r_int, r_uint, intmask from pypy.rlib.rarithmetic import r_ulonglong, r_longlong, base_int from pypy.rlib.rarithmetic import normalizedinttype -from pypy.rpython.objectmodel import Symbolic +from pypy.rlib.objectmodel import Symbolic from pypy.tool.uid import Hashable from pypy.tool.tls import tlsobject from pypy.tool.picklesupport import getstate_with_slots, setstate_with_slots, pickleable_weakref Modified: pypy/dist/pypy/rpython/lltypesystem/opimpl.py ============================================================================== --- pypy/dist/pypy/rpython/lltypesystem/opimpl.py (original) +++ pypy/dist/pypy/rpython/lltypesystem/opimpl.py Wed Nov 1 12:49:34 2006 @@ -2,7 +2,7 @@ from pypy.tool.sourcetools import func_with_new_name from pypy.rpython.lltypesystem import lltype, llmemory from pypy.rpython.lltypesystem.lloperation import opimpls -from pypy.rpython.objectmodel import CDefinedIntSymbolic +from pypy.rlib.objectmodel import CDefinedIntSymbolic # ____________________________________________________________ # Implementation of the 'canfold' operations Modified: pypy/dist/pypy/rpython/lltypesystem/rbuiltin.py ============================================================================== --- pypy/dist/pypy/rpython/lltypesystem/rbuiltin.py (original) +++ pypy/dist/pypy/rpython/lltypesystem/rbuiltin.py Wed Nov 1 12:49:34 2006 @@ -3,7 +3,7 @@ from pypy.rpython.lltypesystem import lltype from pypy.rpython.lltypesystem import rclass from pypy.rpython.lltypesystem.rdict import rtype_r_dict -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel from pypy.rpython.rmodel import TyperError, Constant from pypy.rpython.robject import pyobj_repr from pypy.rpython.rbool import bool_repr Modified: pypy/dist/pypy/rpython/lltypesystem/rclass.py ============================================================================== --- pypy/dist/pypy/rpython/lltypesystem/rclass.py (original) +++ pypy/dist/pypy/rpython/lltypesystem/rclass.py Wed Nov 1 12:49:34 2006 @@ -19,7 +19,7 @@ from pypy.rpython.robject import PyObjRepr, pyobj_repr from pypy.rpython.extregistry import ExtRegistryEntry from pypy.annotation import model as annmodel -from pypy.rpython.objectmodel import UnboxedValue +from pypy.rlib.objectmodel import UnboxedValue from pypy.rlib.rarithmetic import intmask # Modified: pypy/dist/pypy/rpython/lltypesystem/rdict.py ============================================================================== --- pypy/dist/pypy/rpython/lltypesystem/rdict.py (original) +++ pypy/dist/pypy/rpython/lltypesystem/rdict.py Wed Nov 1 12:49:34 2006 @@ -5,9 +5,9 @@ rtype_newdict, dum_variant, dum_keys, dum_values, dum_items from pypy.rpython.lltypesystem import lltype from pypy.rlib.rarithmetic import r_uint -from pypy.rpython.objectmodel import hlinvoke +from pypy.rlib.objectmodel import hlinvoke from pypy.rpython import robject -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel from pypy.rpython import rmodel # ____________________________________________________________ Modified: pypy/dist/pypy/rpython/lltypesystem/rstr.py ============================================================================== --- pypy/dist/pypy/rpython/lltypesystem/rstr.py (original) +++ pypy/dist/pypy/rpython/lltypesystem/rstr.py Wed Nov 1 12:49:34 2006 @@ -1,7 +1,7 @@ from weakref import WeakValueDictionary from pypy.annotation.pairtype import pairtype from pypy.rpython.error import TyperError -from pypy.rpython.objectmodel import malloc_zero_filled, we_are_translated +from pypy.rlib.objectmodel import malloc_zero_filled, we_are_translated from pypy.rpython.robject import PyObjRepr, pyobj_repr from pypy.rlib.rarithmetic import _hash_string from pypy.rpython.rmodel import inputconst, IntegerRepr Modified: pypy/dist/pypy/rpython/lltypesystem/test/test_llmemory.py ============================================================================== --- pypy/dist/pypy/rpython/lltypesystem/test/test_llmemory.py (original) +++ pypy/dist/pypy/rpython/lltypesystem/test/test_llmemory.py Wed Nov 1 12:49:34 2006 @@ -525,8 +525,8 @@ class TestWeakAddressLLinterp(object): def test_null(self): - from pypy.rpython.objectmodel import cast_weakgcaddress_to_object - from pypy.rpython.objectmodel import cast_object_to_weakgcaddress + from pypy.rlib.objectmodel import cast_weakgcaddress_to_object + from pypy.rlib.objectmodel import cast_object_to_weakgcaddress class A: pass def f(): @@ -534,8 +534,8 @@ assert interpret(f, []) def test_attribute(object): - from pypy.rpython.objectmodel import cast_weakgcaddress_to_object - from pypy.rpython.objectmodel import cast_object_to_weakgcaddress + from pypy.rlib.objectmodel import cast_weakgcaddress_to_object + from pypy.rlib.objectmodel import cast_object_to_weakgcaddress class A: pass class B: Modified: pypy/dist/pypy/rpython/lltypesystem/test/test_rtagged.py ============================================================================== --- pypy/dist/pypy/rpython/lltypesystem/test/test_rtagged.py (original) +++ pypy/dist/pypy/rpython/lltypesystem/test/test_rtagged.py Wed Nov 1 12:49:34 2006 @@ -1,7 +1,7 @@ import sys from pypy.rpython.test.test_llinterp import interpret, get_interpreter from pypy.rpython.lltypesystem import lltype -from pypy.rpython.objectmodel import UnboxedValue +from pypy.rlib.objectmodel import UnboxedValue from pypy.translator.translator import graphof from pypy.objspace.flow.model import summary from pypy.translator.backendopt.all import backend_optimizations Modified: pypy/dist/pypy/rpython/memory/gc.py ============================================================================== --- pypy/dist/pypy/rpython/memory/gc.py (original) +++ pypy/dist/pypy/rpython/memory/gc.py Wed Nov 1 12:49:34 2006 @@ -4,7 +4,7 @@ from pypy.rpython.memory.gcheader import GCHeaderBuilder from pypy.rpython.memory import lltypesimulation from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.rpython.objectmodel import free_non_gc_object +from pypy.rlib.objectmodel import free_non_gc_object from pypy.rpython.lltypesystem.lloperation import llop from pypy.rlib.rarithmetic import ovfcheck Modified: pypy/dist/pypy/rpython/memory/lladdress.py ============================================================================== --- pypy/dist/pypy/rpython/memory/lladdress.py (original) +++ pypy/dist/pypy/rpython/memory/lladdress.py Wed Nov 1 12:49:34 2006 @@ -4,7 +4,7 @@ from pypy.rpython.lltypesystem import llmemory from pypy.rpython.lltypesystem import lltype from pypy.rpython.memory.lltypelayout import convert_offset_to_int -from pypy.rpython.objectmodel import ComputedIntSymbolic +from pypy.rlib.objectmodel import ComputedIntSymbolic NULL = llmemory.NULL Modified: pypy/dist/pypy/rpython/memory/support.py ============================================================================== --- pypy/dist/pypy/rpython/memory/support.py (original) +++ pypy/dist/pypy/rpython/memory/support.py Wed Nov 1 12:49:34 2006 @@ -1,6 +1,6 @@ from pypy.rpython.lltypesystem import lltype, llmemory from pypy.rpython.memory.lltypelayout import sizeof -from pypy.rpython.objectmodel import free_non_gc_object +from pypy.rlib.objectmodel import free_non_gc_object INT_SIZE = sizeof(lltype.Signed) Modified: pypy/dist/pypy/rpython/memory/test/test_gc.py ============================================================================== --- pypy/dist/pypy/rpython/memory/test/test_gc.py (original) +++ pypy/dist/pypy/rpython/memory/test/test_gc.py Wed Nov 1 12:49:34 2006 @@ -13,7 +13,7 @@ from pypy.rpython.memory import gclltype from pypy.rpython.memory.test.test_llinterpsim import interpret from pypy.rpython.memory.lladdress import simulator -from pypy.rpython.objectmodel import free_non_gc_object +from pypy.rlib.objectmodel import free_non_gc_object def setup_module(mod): def stdout_ignore_ll_functions(msg): Modified: pypy/dist/pypy/rpython/memory/test/test_support.py ============================================================================== --- pypy/dist/pypy/rpython/memory/test/test_support.py (original) +++ pypy/dist/pypy/rpython/memory/test/test_support.py Wed Nov 1 12:49:34 2006 @@ -1,4 +1,4 @@ -from pypy.rpython.objectmodel import free_non_gc_object +from pypy.rlib.objectmodel import free_non_gc_object from pypy.rpython.memory.support import get_address_linked_list from pypy.rpython.test.test_llinterp import interpret Modified: pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py ============================================================================== --- pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py (original) +++ pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py Wed Nov 1 12:49:34 2006 @@ -12,7 +12,7 @@ ## from pypy.rpython.memory import gclltype ## from pypy.rpython.memory.test.test_llinterpsim import interpret ## from pypy.rpython.memory.lladdress import simulator -## from pypy.rpython.objectmodel import free_non_gc_object +## from pypy.rlib.objectmodel import free_non_gc_object ## def setup_module(mod): ## def stdout_ignore_ll_functions(msg): Modified: pypy/dist/pypy/rpython/normalizecalls.py ============================================================================== --- pypy/dist/pypy/rpython/normalizecalls.py (original) +++ pypy/dist/pypy/rpython/normalizecalls.py Wed Nov 1 12:49:34 2006 @@ -9,7 +9,7 @@ from pypy.tool.sourcetools import func_with_new_name from pypy.rpython.error import TyperError from pypy.rpython.rmodel import getgcflavor -from pypy.rpython.objectmodel import instantiate, ComputedIntSymbolic +from pypy.rlib.objectmodel import instantiate, ComputedIntSymbolic def normalize_call_familes(annotator): for callfamily in annotator.bookkeeper.pbc_maximal_call_families.infos(): Modified: pypy/dist/pypy/rpython/ootypesystem/ootype.py ============================================================================== --- pypy/dist/pypy/rpython/ootypesystem/ootype.py (original) +++ pypy/dist/pypy/rpython/ootypesystem/ootype.py Wed Nov 1 12:49:34 2006 @@ -3,7 +3,7 @@ Primitive, isCompatibleType, enforce, saferecursive, SignedLongLong, UnsignedLongLong from pypy.rpython.lltypesystem.lltype import frozendict, isCompatibleType from pypy.rlib.rarithmetic import intmask -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel from pypy.tool.uid import uid try: Modified: pypy/dist/pypy/rpython/ootypesystem/rbuiltin.py ============================================================================== --- pypy/dist/pypy/rpython/ootypesystem/rbuiltin.py (original) +++ pypy/dist/pypy/rpython/ootypesystem/rbuiltin.py Wed Nov 1 12:49:34 2006 @@ -3,7 +3,7 @@ from pypy.rpython.ootypesystem import rclass from pypy.rpython.ootypesystem.rdict import rtype_r_dict from pypy.objspace.flow.model import Constant -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel from pypy.rpython.error import TyperError def rtype_new(hop): Modified: pypy/dist/pypy/rpython/ootypesystem/rdict.py ============================================================================== --- pypy/dist/pypy/rpython/ootypesystem/rdict.py (original) +++ pypy/dist/pypy/rpython/ootypesystem/rdict.py Wed Nov 1 12:49:34 2006 @@ -9,9 +9,9 @@ from pypy.rpython.ootypesystem import ootype from pypy.rpython.ootypesystem.rlist import ll_newlist from pypy.rlib.rarithmetic import r_uint -from pypy.rpython.objectmodel import hlinvoke +from pypy.rlib.objectmodel import hlinvoke from pypy.rpython import robject -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel from pypy.rpython import rmodel from pypy.rpython import llinterp Modified: pypy/dist/pypy/rpython/ootypesystem/test/test_oortype.py ============================================================================== --- pypy/dist/pypy/rpython/ootypesystem/test/test_oortype.py (original) +++ pypy/dist/pypy/rpython/ootypesystem/test/test_oortype.py Wed Nov 1 12:49:34 2006 @@ -7,7 +7,7 @@ from pypy.objspace.flow import FlowObjSpace from pypy.translator.translator import TranslationContext, graphof from pypy.rpython.test.test_llinterp import interpret -from pypy.rpython.objectmodel import r_dict +from pypy.rlib.objectmodel import r_dict from pypy.rpython.ootypesystem import ooregistry # side effects def gengraph(f, args=[], viewBefore=False, viewAfter=False): Modified: pypy/dist/pypy/rpython/raddress.py ============================================================================== --- pypy/dist/pypy/rpython/raddress.py (original) +++ pypy/dist/pypy/rpython/raddress.py Wed Nov 1 12:49:34 2006 @@ -145,7 +145,7 @@ def convert_const(self, value): from pypy.rpython.lltypesystem import llmemory - from pypy.rpython.objectmodel import cast_object_to_weakgcaddress + from pypy.rlib.objectmodel import cast_object_to_weakgcaddress from pypy.objspace.flow.model import Constant assert isinstance(value, llmemory.fakeweakaddress) if value.ref is None: Modified: pypy/dist/pypy/rpython/rbuiltin.py ============================================================================== --- pypy/dist/pypy/rpython/rbuiltin.py (original) +++ pypy/dist/pypy/rpython/rbuiltin.py Wed Nov 1 12:49:34 2006 @@ -2,8 +2,8 @@ from pypy.annotation import model as annmodel from pypy.objspace.flow.model import Constant from pypy.rpython.lltypesystem import lltype, rclass, llmemory -from pypy.rpython import objectmodel, rint, raddress -from pypy.rlib import rarithmetic, rstack +from pypy.rpython import rint, raddress +from pypy.rlib import rarithmetic, rstack, objectmodel from pypy.rpython.error import TyperError from pypy.rpython.rmodel import Repr, IntegerRepr, inputconst from pypy.rpython.rrange import rtype_builtin_range, rtype_builtin_xrange Modified: pypy/dist/pypy/rpython/rcpy.py ============================================================================== --- pypy/dist/pypy/rpython/rcpy.py (original) +++ pypy/dist/pypy/rpython/rcpy.py Wed Nov 1 12:49:34 2006 @@ -1,7 +1,7 @@ from pypy.rpython.extregistry import ExtRegistryEntry from pypy.rpython.lltypesystem import lltype, llmemory from pypy.rpython.lltypesystem.lloperation import llop -from pypy.rpython.objectmodel import CDefinedIntSymbolic +from pypy.rlib.objectmodel import CDefinedIntSymbolic from pypy.objspace.flow.model import Constant, Variable from pypy.objspace.flow.model import FunctionGraph, Block, Link Modified: pypy/dist/pypy/rpython/rdict.py ============================================================================== --- pypy/dist/pypy/rpython/rdict.py (original) +++ pypy/dist/pypy/rpython/rdict.py Wed Nov 1 12:49:34 2006 @@ -3,9 +3,9 @@ from pypy.objspace.flow.model import Constant from pypy.rpython.lltypesystem import lltype from pypy.rlib.rarithmetic import r_uint -from pypy.rpython.objectmodel import hlinvoke +from pypy.rlib.objectmodel import hlinvoke from pypy.rpython import robject -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel from pypy.rpython import rmodel def dum_keys(): pass Modified: pypy/dist/pypy/rpython/rint.py ============================================================================== --- pypy/dist/pypy/rpython/rint.py (original) +++ pypy/dist/pypy/rpython/rint.py Wed Nov 1 12:49:34 2006 @@ -10,7 +10,7 @@ from pypy.rlib.rarithmetic import intmask, r_int, r_uint, r_ulonglong, r_longlong from pypy.rpython.error import TyperError from pypy.rpython.rmodel import log -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel _integer_reprs = {} def getintegerrepr(lltype, prefix=None): Modified: pypy/dist/pypy/rpython/rlist.py ============================================================================== --- pypy/dist/pypy/rpython/rlist.py (original) +++ pypy/dist/pypy/rpython/rlist.py Wed Nov 1 12:49:34 2006 @@ -7,7 +7,7 @@ from pypy.rpython.lltypesystem.lltype import typeOf, Ptr, Void, Signed, Bool from pypy.rpython.lltypesystem.lltype import nullptr, Char, UniChar from pypy.rpython import robject -from pypy.rpython.objectmodel import malloc_zero_filled +from pypy.rlib.objectmodel import malloc_zero_filled from pypy.rpython.annlowlevel import ADTInterface ADTIFixedList = ADTInterface(None, { Modified: pypy/dist/pypy/rpython/test/test_nongc.py ============================================================================== --- pypy/dist/pypy/rpython/test/test_nongc.py (original) +++ pypy/dist/pypy/rpython/test/test_nongc.py Wed Nov 1 12:49:34 2006 @@ -3,7 +3,7 @@ from pypy.annotation import model as annmodel from pypy.annotation.annrpython import RPythonAnnotator from pypy.rpython.rtyper import RPythonTyper -from pypy.rpython.objectmodel import free_non_gc_object +from pypy.rlib.objectmodel import free_non_gc_object from pypy.rpython.test.test_llinterp import interpret def test_free_non_gc_object(): Modified: pypy/dist/pypy/rpython/test/test_rbuiltin.py ============================================================================== --- pypy/dist/pypy/rpython/test/test_rbuiltin.py (original) +++ pypy/dist/pypy/rpython/test/test_rbuiltin.py Wed Nov 1 12:49:34 2006 @@ -1,6 +1,6 @@ from pypy.translator.translator import graphof from pypy.rpython.test import test_llinterp -from pypy.rpython.objectmodel import instantiate, we_are_translated +from pypy.rlib.objectmodel import instantiate, we_are_translated from pypy.rpython.lltypesystem import lltype from pypy.tool import udir from pypy.rlib.rarithmetic import r_uint, intmask Modified: pypy/dist/pypy/rpython/test/test_rconstantdict.py ============================================================================== --- pypy/dist/pypy/rpython/test/test_rconstantdict.py (original) +++ pypy/dist/pypy/rpython/test/test_rconstantdict.py Wed Nov 1 12:49:34 2006 @@ -1,5 +1,5 @@ import py -from pypy.rpython.objectmodel import r_dict +from pypy.rlib.objectmodel import r_dict from pypy.rpython.test.tool import BaseRtypingTest, LLRtypeMixin, OORtypeMixin class BaseTestRconstantdict(BaseRtypingTest): Modified: pypy/dist/pypy/rpython/test/test_rpbc.py ============================================================================== --- pypy/dist/pypy/rpython/test/test_rpbc.py (original) +++ pypy/dist/pypy/rpython/test/test_rpbc.py Wed Nov 1 12:49:34 2006 @@ -1456,7 +1456,7 @@ rt.specialize() def ll_h(R, f, x): - from pypy.rpython.objectmodel import hlinvoke + from pypy.rlib.objectmodel import hlinvoke return hlinvoke(R, f, x, 2) from pypy.rpython import annlowlevel @@ -1500,7 +1500,7 @@ rt.specialize() def ll_h(R, f, x): - from pypy.rpython.objectmodel import hlinvoke + from pypy.rlib.objectmodel import hlinvoke return hlinvoke(R, f, x, 2) from pypy.rpython import annlowlevel @@ -1549,7 +1549,7 @@ rt.specialize() def ll_h(R, f, a): - from pypy.rpython.objectmodel import hlinvoke + from pypy.rlib.objectmodel import hlinvoke return hlinvoke(R, f, a) from pypy.rpython import annlowlevel @@ -1599,7 +1599,7 @@ rt.specialize() def ll_h(R, f, a): - from pypy.rpython.objectmodel import hlinvoke + from pypy.rlib.objectmodel import hlinvoke return hlinvoke(R, f, a) from pypy.rpython import annlowlevel @@ -1660,7 +1660,7 @@ rt.specialize() def ll_h(R, f, a): - from pypy.rpython.objectmodel import hlinvoke + from pypy.rlib.objectmodel import hlinvoke return hlinvoke(R, f, a) from pypy.rpython import annlowlevel Modified: pypy/dist/pypy/translator/backendopt/test/test_canraise.py ============================================================================== --- pypy/dist/pypy/translator/backendopt/test/test_canraise.py (original) +++ pypy/dist/pypy/translator/backendopt/test/test_canraise.py Wed Nov 1 12:49:34 2006 @@ -74,7 +74,7 @@ assert result def test_instantiate(): - from pypy.rpython.objectmodel import instantiate + from pypy.rlib.objectmodel import instantiate class A: pass class B(A): Modified: pypy/dist/pypy/translator/backendopt/test/test_constfold.py ============================================================================== --- pypy/dist/pypy/translator/backendopt/test/test_constfold.py (original) +++ pypy/dist/pypy/translator/backendopt/test/test_constfold.py Wed Nov 1 12:49:34 2006 @@ -2,7 +2,7 @@ from pypy.translator.translator import TranslationContext, graphof from pypy.rpython.llinterp import LLInterpreter from pypy.rpython.lltypesystem import lltype -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel from pypy.translator.backendopt.constfold import constant_fold_graph from pypy import conftest Modified: pypy/dist/pypy/translator/backendopt/test/test_escape.py ============================================================================== --- pypy/dist/pypy/translator/backendopt/test/test_escape.py (original) +++ pypy/dist/pypy/translator/backendopt/test/test_escape.py Wed Nov 1 12:49:34 2006 @@ -2,7 +2,7 @@ from pypy.translator.backendopt.escape import AbstractDataFlowInterpreter, malloc_to_stack from pypy.translator.backendopt.support import find_backedges, find_loop_blocks from pypy.rpython.llinterp import LLInterpreter -from pypy.rpython.objectmodel import instantiate +from pypy.rlib.objectmodel import instantiate def build_adi(function, types): t = TranslationContext() Modified: pypy/dist/pypy/translator/backendopt/test/test_malloc.py ============================================================================== --- pypy/dist/pypy/translator/backendopt/test/test_malloc.py (original) +++ pypy/dist/pypy/translator/backendopt/test/test_malloc.py Wed Nov 1 12:49:34 2006 @@ -119,7 +119,7 @@ check(fn6, [int], [1], 12, must_be_removed=False) def test_with_keepalive(): - from pypy.rpython.objectmodel import keepalive_until_here + from pypy.rlib.objectmodel import keepalive_until_here def fn1(x, y): if x > 0: t = x+y, x-y Modified: pypy/dist/pypy/translator/c/gc.py ============================================================================== --- pypy/dist/pypy/translator/c/gc.py (original) +++ pypy/dist/pypy/translator/c/gc.py Wed Nov 1 12:49:34 2006 @@ -62,7 +62,7 @@ class RefcountingInfo: static_deallocator = None -from pypy.rpython.objectmodel import CDefinedIntSymbolic +from pypy.rlib.objectmodel import CDefinedIntSymbolic class RefcountingGcPolicy(BasicGcPolicy): transformerclass = refcounting.RefcountingGCTransformer Modified: pypy/dist/pypy/translator/c/primitive.py ============================================================================== --- pypy/dist/pypy/translator/c/primitive.py (original) +++ pypy/dist/pypy/translator/c/primitive.py Wed Nov 1 12:49:34 2006 @@ -1,6 +1,6 @@ import sys -from pypy.rpython.objectmodel import Symbolic, ComputedIntSymbolic -from pypy.rpython.objectmodel import CDefinedIntSymbolic +from pypy.rlib.objectmodel import Symbolic, ComputedIntSymbolic +from pypy.rlib.objectmodel import CDefinedIntSymbolic from pypy.rpython.lltypesystem.lltype import * from pypy.rpython.lltypesystem.llmemory import Address, fakeaddress, \ AddressOffset, ItemOffset, ArrayItemsOffset, FieldOffset, \ Modified: pypy/dist/pypy/translator/c/test/test_backendoptimized.py ============================================================================== --- pypy/dist/pypy/translator/c/test/test_backendoptimized.py (original) +++ pypy/dist/pypy/translator/c/test/test_backendoptimized.py Wed Nov 1 12:49:34 2006 @@ -1,7 +1,7 @@ import py from pypy.translator.c.test.test_typed import TestTypedTestCase as _TestTypedTestCase from pypy.translator.backendopt.all import backend_optimizations -from pypy.rpython import objectmodel +from pypy.rlib import objectmodel from pypy.rlib.rarithmetic import r_uint, r_longlong, r_ulonglong from pypy import conftest Modified: pypy/dist/pypy/translator/c/test/test_boehm.py ============================================================================== --- pypy/dist/pypy/translator/c/test/test_boehm.py (original) +++ pypy/dist/pypy/translator/c/test/test_boehm.py Wed Nov 1 12:49:34 2006 @@ -99,7 +99,7 @@ def test_weakgcaddress_is_weak(self): from pypy.rpython.lltypesystem.lloperation import llop from pypy.rpython.lltypesystem import lltype - from pypy.rpython.objectmodel import cast_object_to_weakgcaddress + from pypy.rlib.objectmodel import cast_object_to_weakgcaddress class State: pass s = State() Modified: pypy/dist/pypy/translator/c/test/test_genc.py ============================================================================== --- pypy/dist/pypy/translator/c/test/test_genc.py (original) +++ pypy/dist/pypy/translator/c/test/test_genc.py Wed Nov 1 12:49:34 2006 @@ -275,7 +275,7 @@ def test_keepalive(): - from pypy.rpython import objectmodel + from pypy.rlib import objectmodel def f(): x = [1] y = ['b'] Modified: pypy/dist/pypy/translator/c/test/test_lladdresses.py ============================================================================== --- pypy/dist/pypy/translator/c/test/test_lladdresses.py (original) +++ pypy/dist/pypy/translator/c/test/test_lladdresses.py Wed Nov 1 12:49:34 2006 @@ -1,7 +1,7 @@ from pypy.rpython.memory.lladdress import * from pypy.annotation.model import SomeAddress, SomeChar from pypy.translator.c.test.test_genc import compile -from pypy.rpython.objectmodel import free_non_gc_object +from pypy.rlib.objectmodel import free_non_gc_object def test_null(): def f(): @@ -122,8 +122,8 @@ assert fn(1) == 2 def test_weakaddress(): - from pypy.rpython.objectmodel import cast_object_to_weakgcaddress - from pypy.rpython.objectmodel import cast_weakgcaddress_to_object + from pypy.rlib.objectmodel import cast_object_to_weakgcaddress + from pypy.rlib.objectmodel import cast_weakgcaddress_to_object from pypy.rpython.lltypesystem.lloperation import llop class A(object): pass @@ -139,8 +139,8 @@ assert fn(10) def test_constant_weakaddress(): - from pypy.rpython.objectmodel import cast_object_to_weakgcaddress - from pypy.rpython.objectmodel import cast_weakgcaddress_to_object + from pypy.rlib.objectmodel import cast_object_to_weakgcaddress + from pypy.rlib.objectmodel import cast_weakgcaddress_to_object from pypy.rpython.lltypesystem.lloperation import llop class A(object): pass Modified: pypy/dist/pypy/translator/c/test/test_newgc.py ============================================================================== --- pypy/dist/pypy/translator/c/test/test_newgc.py (original) +++ pypy/dist/pypy/translator/c/test/test_newgc.py Wed Nov 1 12:49:34 2006 @@ -8,7 +8,7 @@ from pypy.translator.c import genc, gc from pypy.rpython.lltypesystem import lltype, llmemory from pypy.rpython.lltypesystem.lloperation import llop -from pypy.rpython.objectmodel import cast_weakgcaddress_to_object, cast_object_to_weakgcaddress +from pypy.rlib.objectmodel import cast_weakgcaddress_to_object, cast_object_to_weakgcaddress from pypy.config.config import Config from pypy.config.pypyoption import pypy_optiondescription from pypy import conftest Modified: pypy/dist/pypy/translator/c/test/test_rtagged.py ============================================================================== --- pypy/dist/pypy/translator/c/test/test_rtagged.py (original) +++ pypy/dist/pypy/translator/c/test/test_rtagged.py Wed Nov 1 12:49:34 2006 @@ -1,5 +1,5 @@ import sys, os -from pypy.rpython.objectmodel import UnboxedValue +from pypy.rlib.objectmodel import UnboxedValue class A(object): Modified: pypy/dist/pypy/translator/c/test/test_symbolic.py ============================================================================== --- pypy/dist/pypy/translator/c/test/test_symbolic.py (original) +++ pypy/dist/pypy/translator/c/test/test_symbolic.py Wed Nov 1 12:49:34 2006 @@ -2,7 +2,7 @@ from pypy import conftest from pypy.rpython.lltypesystem import llmemory, lltype from pypy.rpython.memory import lladdress -from pypy.rpython.objectmodel import ComputedIntSymbolic +from pypy.rlib.objectmodel import ComputedIntSymbolic def getcompiled(f, args): t = Translation(f) Modified: pypy/dist/pypy/translator/c/test/test_typed.py ============================================================================== --- pypy/dist/pypy/translator/c/test/test_typed.py (original) +++ pypy/dist/pypy/translator/c/test/test_typed.py Wed Nov 1 12:49:34 2006 @@ -711,7 +711,7 @@ assert fn(1) == 42 def test_r_dict_exceptions(self): - from pypy.rpython.objectmodel import r_dict + from pypy.rlib.objectmodel import r_dict def raising_hash(obj): if obj.startswith("bla"): Modified: pypy/dist/pypy/translator/cli/database.py ============================================================================== --- pypy/dist/pypy/translator/cli/database.py (original) +++ pypy/dist/pypy/translator/cli/database.py Wed Nov 1 12:49:34 2006 @@ -15,7 +15,7 @@ from pypy.rpython.lltypesystem import llmemory from pypy.translator.cli.opcodes import opcodes from pypy.translator.cli import dotnet -from pypy.rpython.objectmodel import CDefinedIntSymbolic +from pypy.rlib.objectmodel import CDefinedIntSymbolic try: set Modified: pypy/dist/pypy/translator/cli/test/test_constant.py ============================================================================== --- pypy/dist/pypy/translator/cli/test/test_constant.py (original) +++ pypy/dist/pypy/translator/cli/test/test_constant.py Wed Nov 1 12:49:34 2006 @@ -100,7 +100,7 @@ assert self.interpret(fn2, [1]) == True def test_customdict_circular(self): - from pypy.rpython.objectmodel import r_dict + from pypy.rlib.objectmodel import r_dict def key_eq(a, b): return a.x[0] == b.x[0] def key_hash(a): Modified: pypy/dist/pypy/translator/cli/test/test_objectmodel.py ============================================================================== --- pypy/dist/pypy/translator/cli/test/test_objectmodel.py (original) +++ pypy/dist/pypy/translator/cli/test/test_objectmodel.py Wed Nov 1 12:49:34 2006 @@ -1,8 +1,8 @@ import py from pypy.translator.cli.test.runtest import CliTest -from pypy.rpython.test.test_objectmodel import BaseTestObjectModel +from pypy.rlib.test.test_objectmodel import BaseTestObjectModel -from pypy.rpython.objectmodel import cast_object_to_weakgcaddress,\ +from pypy.rlib.objectmodel import cast_object_to_weakgcaddress,\ cast_weakgcaddress_to_object def skip_r_dict(self): @@ -12,7 +12,7 @@ test_rtype_r_dict_bm = skip_r_dict def test_rdict_of_void_copy(self): - from pypy.rpython.test.test_objectmodel import r_dict, strange_key_eq, strange_key_hash + from pypy.rlib.test.test_objectmodel import r_dict, strange_key_eq, strange_key_hash def fn(): d = r_dict(strange_key_eq, strange_key_hash) d['hello'] = None @@ -22,7 +22,7 @@ assert self.interpret(fn, []) == 2 # this test is copied from TestLLtype in - # rpython/test_objectmodel.py. It is not in TestOOtype because at + # rlib/test_objectmodel.py. It is not in TestOOtype because at # the moment llinterpret can't handle cast_*weakadr* def test_cast_to_and_from_weakaddress(self): class A(object): Modified: pypy/dist/pypy/translator/js/jts.py ============================================================================== --- pypy/dist/pypy/translator/js/jts.py (original) +++ pypy/dist/pypy/translator/js/jts.py Wed Nov 1 12:49:34 2006 @@ -9,7 +9,7 @@ from pypy.rpython.lltypesystem.lltype import SignedLongLong, UnsignedLongLong, Primitive from pypy.rpython.lltypesystem.lltype import Char, UniChar from pypy.rpython.ootypesystem.ootype import String, _string, List, StaticMethod -from pypy.rpython.objectmodel import Symbolic +from pypy.rlib.objectmodel import Symbolic from pypy.translator.js.log import log Modified: pypy/dist/pypy/translator/js/test/test_genllvm.py ============================================================================== --- pypy/dist/pypy/translator/js/test/test_genllvm.py (original) +++ pypy/dist/pypy/translator/js/test/test_genllvm.py Wed Nov 1 12:49:34 2006 @@ -436,7 +436,7 @@ assert fn() == some_test() def test_symbolic(): - from pypy.rpython.objectmodel import malloc_zero_filled + from pypy.rlib.objectmodel import malloc_zero_filled def symbolic1(): if malloc_zero_filled: Modified: pypy/dist/pypy/translator/llvm/database.py ============================================================================== --- pypy/dist/pypy/translator/llvm/database.py (original) +++ pypy/dist/pypy/translator/llvm/database.py Wed Nov 1 12:49:34 2006 @@ -14,8 +14,8 @@ from pypy.rpython.lltypesystem import lltype, llmemory from pypy.objspace.flow.model import Constant, Variable from pypy.rpython.memory.lladdress import NULL -from pypy.rpython.objectmodel import Symbolic, ComputedIntSymbolic -from pypy.rpython.objectmodel import CDefinedIntSymbolic +from pypy.rlib.objectmodel import Symbolic, ComputedIntSymbolic +from pypy.rlib.objectmodel import CDefinedIntSymbolic log = log.database Modified: pypy/dist/pypy/translator/llvm/test/test_lladdresses.py ============================================================================== --- pypy/dist/pypy/translator/llvm/test/test_lladdresses.py (original) +++ pypy/dist/pypy/translator/llvm/test/test_lladdresses.py Wed Nov 1 12:49:34 2006 @@ -1,7 +1,7 @@ import py from pypy.rpython.memory.lladdress import * from pypy.annotation.model import SomeAddress, SomeChar -from pypy.rpython.objectmodel import free_non_gc_object +from pypy.rlib.objectmodel import free_non_gc_object from pypy.translator.llvm.test.runtest import * @@ -171,8 +171,8 @@ assert f() == 579 def test_weakaddress(): - from pypy.rpython.objectmodel import cast_object_to_weakgcaddress - from pypy.rpython.objectmodel import cast_weakgcaddress_to_object + from pypy.rlib.objectmodel import cast_object_to_weakgcaddress + from pypy.rlib.objectmodel import cast_weakgcaddress_to_object from pypy.rpython.lltypesystem.lloperation import llop class A(object): pass Modified: pypy/dist/pypy/translator/llvm/test/test_symbolic.py ============================================================================== --- pypy/dist/pypy/translator/llvm/test/test_symbolic.py (original) +++ pypy/dist/pypy/translator/llvm/test/test_symbolic.py Wed Nov 1 12:49:34 2006 @@ -3,7 +3,7 @@ from pypy import conftest from pypy.rpython.lltypesystem import llmemory, lltype from pypy.rpython.memory import lladdress -from pypy.rpython.objectmodel import ComputedIntSymbolic +from pypy.rlib.objectmodel import ComputedIntSymbolic from pypy.translator.llvm.test.runtest import * Modified: pypy/dist/pypy/translator/stackless/transform.py ============================================================================== --- pypy/dist/pypy/translator/stackless/transform.py (original) +++ pypy/dist/pypy/translator/stackless/transform.py Wed Nov 1 12:49:34 2006 @@ -13,7 +13,7 @@ from pypy.rpython.rbuiltin import gen_cast from pypy.rpython.rtyper import LowLevelOpList from pypy.rpython.module import ll_stackless, ll_stack -from pypy.rpython.objectmodel import ComputedIntSymbolic +from pypy.rlib.objectmodel import ComputedIntSymbolic from pypy.translator.backendopt import graphanalyze from pypy.translator.stackless.frame import SAVED_REFERENCE, STORAGE_TYPES Modified: pypy/dist/pypy/translator/test/test_simplify.py ============================================================================== --- pypy/dist/pypy/translator/test/test_simplify.py (original) +++ pypy/dist/pypy/translator/test/test_simplify.py Wed Nov 1 12:49:34 2006 @@ -76,7 +76,7 @@ def test_remove_pointless_keepalive(): - from pypy.rpython import objectmodel + from pypy.rlib import objectmodel class C: y = None z1 = None From fijal at codespeak.net Wed Nov 1 12:51:08 2006 From: fijal at codespeak.net (fijal at codespeak.net) Date: Wed, 1 Nov 2006 12:51:08 +0100 (CET) Subject: [pypy-svn] r34002 - pypy/branch/transparent-proxy Message-ID: <20061101115108.089D610060@code0.codespeak.net> Author: fijal Date: Wed Nov 1 12:51:07 2006 New Revision: 34002 Added: pypy/branch/transparent-proxy/ - copied from r34001, pypy/dist/ Log: Branch for work on transparent proxy objspace. From cfbolz at codespeak.net Wed Nov 1 12:52:09 2006 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Wed, 1 Nov 2006 12:52:09 +0100 (CET) Subject: [pypy-svn] r34003 - pypy/dist/pypy/lang/automata/test Message-ID: <20061101115209.3067010060@code0.codespeak.net> Author: cfbolz Date: Wed Nov 1 12:52:08 2006 New Revision: 34003 Modified: pypy/dist/pypy/lang/automata/test/test_dfa.py Log: fix whitespace, docstring Modified: pypy/dist/pypy/lang/automata/test/test_dfa.py ============================================================================== --- pypy/dist/pypy/lang/automata/test/test_dfa.py (original) +++ pypy/dist/pypy/lang/automata/test/test_dfa.py Wed Nov 1 12:52:08 2006 @@ -1,10 +1,10 @@ import py from pypy import conftest -from pypy.rpython.test.test_llinterp import interpret +from pypy.rpython.test.test_llinterp import interpret from pypy.translator.translator import graphof from pypy.jit.timeshifter.test.test_timeshift import hannotate -from pypy.jit.timeshifter.rtyper import HintRTyper +from pypy.jit.timeshifter.hrtyper import HintRTyper from pypy.jit.timeshifter.test.test_timeshift import P_NOVIRTUAL from pypy.rpython.llinterp import LLInterpreter from pypy.objspace.flow.model import checkgraph From ericvrp at codespeak.net Wed Nov 1 12:59:21 2006 From: ericvrp at codespeak.net (ericvrp at codespeak.net) Date: Wed, 1 Nov 2006 12:59:21 +0100 (CET) Subject: [pypy-svn] r34006 - in pypy/dist/pypy/jit/codegen/llvm: . lib test Message-ID: <20061101115921.9566910060@code0.codespeak.net> Author: ericvrp Date: Wed Nov 1 12:59:19 2006 New Revision: 34006 Modified: pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.cpp pypy/dist/pypy/jit/codegen/llvm/llvmjit.py pypy/dist/pypy/jit/codegen/llvm/setup.py pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py Log: (mwh, ericvrp) called a simple function from the library with test and proper skip Modified: pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.cpp ============================================================================== --- pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.cpp (original) +++ pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.cpp Wed Nov 1 12:59:19 2006 @@ -1,5 +1,7 @@ //implementation for using the LLVM JIT +#include "llvmjit.h" + int testme(int n) { return n * 2; } Modified: pypy/dist/pypy/jit/codegen/llvm/llvmjit.py ============================================================================== --- pypy/dist/pypy/jit/codegen/llvm/llvmjit.py (original) +++ pypy/dist/pypy/jit/codegen/llvm/llvmjit.py Wed Nov 1 12:59:19 2006 @@ -7,3 +7,11 @@ This file contains the ctypes specification to use the llvmjit library! ''' +import ctypes +import os + +path = os.path.join(os.path.dirname(__file__), 'llvmjit_.so') +llvmjit = ctypes.cdll.LoadLibrary(os.path.abspath(path)) + +def testme(n): + return llvmjit.testme(n) Modified: pypy/dist/pypy/jit/codegen/llvm/setup.py ============================================================================== --- pypy/dist/pypy/jit/codegen/llvm/setup.py (original) +++ pypy/dist/pypy/jit/codegen/llvm/setup.py Wed Nov 1 12:59:19 2006 @@ -6,7 +6,7 @@ ldflags = popen('llvm-config --ldflags').readline().split() libs = popen('llvm-config --libs all').readline().split() -opts = dict(name='llvmjit', +opts = dict(name='llvmjit_', sources=['lib/llvmjit.cpp'], libraries=[], include_dirs =["include"] + [f[2:] for f in cxxflags if f.startswith('-I')], Modified: pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py ============================================================================== --- pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py (original) +++ pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py Wed Nov 1 12:59:19 2006 @@ -0,0 +1,9 @@ +import py + +try: + from pypy.jit.codegen.llvm import llvmjit +except OSError: + py.test.skip("llvmjit library not found (see ../README.TXT)") + +def test_testme(): + assert llvmjit.testme(10) == 20 From ale at codespeak.net Wed Nov 1 13:06:39 2006 From: ale at codespeak.net (ale at codespeak.net) Date: Wed, 1 Nov 2006 13:06:39 +0100 (CET) Subject: [pypy-svn] r34007 - pypy/dist/pypy/lib/pyontology Message-ID: <20061101120639.5D21110068@code0.codespeak.net> Author: ale Date: Wed Nov 1 13:06:38 2006 New Revision: 34007 Modified: pypy/dist/pypy/lib/pyontology/pyontology.py Log: Made the optimisation work for more cases Modified: pypy/dist/pypy/lib/pyontology/pyontology.py ============================================================================== --- pypy/dist/pypy/lib/pyontology/pyontology.py (original) +++ pypy/dist/pypy/lib/pyontology/pyontology.py Wed Nov 1 13:06:38 2006 @@ -600,8 +600,11 @@ else: obj = trip[2] prop = self.variables[prop_name] - prop.setValues(list(self.variables['rdf_Property'].getValues())) # Get all properties by looking at 'rdf_Property' + props = list(self.variables['rdf_Property'].getValues()) + prop.setValues(props) + for p in props: + query_dom[p] = self.variables[p] # add a constraint trip[0] in domains[prop] and trip[2] in domains[prop].getValuesPrKey(trip[0]) query_constr.append(PropertyConstrain(prop_name, indi, obj)) @@ -624,7 +627,10 @@ sub = self.variables[sub_name] sub.setValues(list(self.variables['owl_Thing'].getValues())) prop = self.variables[prop_name] - prop.setValues(list(self.variables['rdf_Property'].getValues())) + props = list(self.variables['rdf_Property'].getValues()) + prop.setValues(props) + for p in props: + query_dom[p] = self.variables[p] obj_name = self.mangle_name(trip[2]) if obj_name in self.variables: obj = self.variables[self.mangle_name(trip[2])] @@ -661,10 +667,12 @@ query_constr.append(con) # call finish on the variables in the query for v in vars: - query_dom, _ = self.variables[self.mangle_name(v)].finish(self.variables, query_constr) #query_dom, query_constr) + _dom, _ = self.variables[self.mangle_name(v)].finish(self.variables, query_constr) #query_dom, query_constr) + query_dom.update(_dom) # Build a repository with the variables in the query dom = dict([(self.mangle_name(v),self.variables[self.mangle_name(v)]) for v in vars]) + dom.update(query_dom) # solve the repository and return the solution rep = Repository(dom.keys(), dom, query_constr) res_s = Solver().solve(rep) From rxe at codespeak.net Wed Nov 1 13:09:56 2006 From: rxe at codespeak.net (rxe at codespeak.net) Date: Wed, 1 Nov 2006 13:09:56 +0100 (CET) Subject: [pypy-svn] r34008 - pypy/dist/pypy/jit/llabstractinterp Message-ID: <20061101120956.A71F110068@code0.codespeak.net> Author: rxe Date: Wed Nov 1 13:09:56 2006 New Revision: 34008 Removed: pypy/dist/pypy/jit/llabstractinterp/ Log: kill some dead code - help people reading the jit code for the first time From ac at codespeak.net Wed Nov 1 13:13:24 2006 From: ac at codespeak.net (ac at codespeak.net) Date: Wed, 1 Nov 2006 13:13:24 +0100 (CET) Subject: [pypy-svn] r34009 - pypy/dist/pypy/jit/timeshifter/test Message-ID: <20061101121324.D70A21006E@code0.codespeak.net> Author: ac Date: Wed Nov 1 13:13:23 2006 New Revision: 34009 Modified: pypy/dist/pypy/jit/timeshifter/test/test_portal.py pypy/dist/pypy/jit/timeshifter/test/test_promotion.py pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py Log: Move a test using the _dont_cache_ hack to use a portal and remove the hack. Modified: pypy/dist/pypy/jit/timeshifter/test/test_portal.py ============================================================================== --- pypy/dist/pypy/jit/timeshifter/test/test_portal.py (original) +++ pypy/dist/pypy/jit/timeshifter/test/test_portal.py Wed Nov 1 13:13:23 2006 @@ -130,3 +130,42 @@ res = self.timeshift_from_portal(main, recognizetable, [0], policy=P_NOVIRTUAL) assert res >= 0 + + def test_method_call_promote(self): + class Base(object): + pass + class Int(Base): + def __init__(self, n): + self.n = n + def double(self): + return Int(self.n * 2) + def get(self): + return self.n + class Str(Base): + def __init__(self, s): + self.s = s + def double(self): + return Str(self.s + self.s) + def get(self): + return ord(self.s[4]) + + def ll_make(n): + if n > 0: + return Int(n) + else: + return Str('123') + + def ll_function(n): + hint(None, global_merge_point=True) + o = ll_make(n) + hint(o.__class__, promote=True) + return o.double().get() + + res = self.timeshift_from_portal(ll_function, ll_function, [5], policy=P_NOVIRTUAL) + assert res == 10 + self.check_insns(indirect_call=0) + + res = self.timeshift_from_portal(ll_function, ll_function, [0], policy=P_NOVIRTUAL) + assert res == ord('2') + self.check_insns(indirect_call=0) + Modified: pypy/dist/pypy/jit/timeshifter/test/test_promotion.py ============================================================================== --- pypy/dist/pypy/jit/timeshifter/test/test_promotion.py (original) +++ pypy/dist/pypy/jit/timeshifter/test/test_promotion.py Wed Nov 1 13:13:23 2006 @@ -223,45 +223,6 @@ self.check_insns(indirect_call=2) - def test_method_call_promote(self): - class Base(object): - pass - class Int(Base): - def __init__(self, n): - self.n = n - def double(self): - return Int(self.n * 2) - def get(self): - return self.n - class Str(Base): - def __init__(self, s): - self.s = s - def double(self): - return Str(self.s + self.s) - def get(self): - return ord(self.s[4]) - - def ll_make(n): - if n > 0: - return Int(n) - else: - return Str('123') - - def ll_function(n): - hint(None, global_merge_point=True) - o = ll_make(n) - hint(o.__class__, promote=True) - return o.double().get() - ll_function._dont_cache_ = True - - res = self.timeshift(ll_function, [5], [], policy=P_NOVIRTUAL) - assert res == 10 - self.check_insns(indirect_call=0) - - res = self.timeshift(ll_function, [0], [], policy=P_NOVIRTUAL) - assert res == ord('2') - self.check_insns(indirect_call=0) - def test_mixed_merges(self): def ll_function(x, y, z, k): if x: Modified: pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py ============================================================================== --- pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py (original) +++ pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py Wed Nov 1 13:13:23 2006 @@ -222,14 +222,9 @@ from pypy.translator.tool.graphpage import FlowGraphPage FlowGraphPage(t, ha.translator.graphs).display() - if getattr(ll_function, '_dont_cache_', False): - # XXX TEMPORARY: for now, caching doesn't work in the presence - # of global caches - pass - else: - cache = self.__dict__.copy() - self._cache[key] = cache, getargtypes(rtyper.annotator, values) - self._cache_order.append(key) + cache = self.__dict__.copy() + self._cache[key] = cache, getargtypes(rtyper.annotator, values) + self._cache_order.append(key) return values def annotate_interface_functions(self): From cfbolz at codespeak.net Wed Nov 1 13:24:12 2006 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Wed, 1 Nov 2006 13:24:12 +0100 (CET) Subject: [pypy-svn] r34010 - in pypy/dist/pypy/config: . test Message-ID: <20061101122412.9001A10077@code0.codespeak.net> Author: cfbolz Date: Wed Nov 1 13:24:11 2006 New Revision: 34010 Modified: pypy/dist/pypy/config/config.py pypy/dist/pypy/config/test/test_config.py Log: (cfbolz, pedronis and arigo discussing) add copy method Modified: pypy/dist/pypy/config/config.py ============================================================================== --- pypy/dist/pypy/config/config.py (original) +++ pypy/dist/pypy/config/config.py Wed Nov 1 13:24:11 2006 @@ -31,6 +31,25 @@ homeconfig, name = self._cfgimpl_get_home_by_path(name) homeconfig.setoption(name, value, 'default') + def copy(self, as_default=False, parent=None): + result = Config.__new__(self.__class__) + result._cfgimpl_descr = self._cfgimpl_descr + result._cfgimpl_value_owners = owners = {} + result._cfgimpl_parent = parent + result._cfgimpl_values = v = {} + for child in self._cfgimpl_descr._children: + if isinstance(child, Option): + v[child._name] = self._cfgimpl_values[child._name] + if as_default: + owners[child._name] = 'default' + else: + owners[child._name] = ( + self._cfgimpl_value_owners[child._name]) + elif isinstance(child, OptionDescription): + v[child._name] = self._cfgimpl_values[child._name].copy( + as_default, parent=result) + return result + def __setattr__(self, name, value): if self._cfgimpl_frozen and getattr(self, name) != value: raise TypeError("trying to change a frozen option object") Modified: pypy/dist/pypy/config/test/test_config.py ============================================================================== --- pypy/dist/pypy/config/test/test_config.py (original) +++ pypy/dist/pypy/config/test/test_config.py Wed Nov 1 13:24:11 2006 @@ -424,3 +424,23 @@ d = make_dict(config) assert d == {"s1.a": True, "int": 43} +def test_copy(): + descr = OptionDescription("opt", "", [ + OptionDescription("s1", "", [ + BoolOption("a", "", default=False)]), + IntOption("int", "", default=42)]) + c1 = Config(descr) + c1.int = 43 + c2 = c1.copy() + assert c2.int == 43 + assert not c2.s1.a + c2.s1.a = True + assert c2.s1.a + py.test.raises(ValueError, "c2.int = 44") + c2 = c1.copy(as_default=True) + assert c2.int == 43 + assert not c2.s1.a + c2.s1.a = True + assert c2.s1.a + c2.int = 44 # does not crash + From arigo at codespeak.net Wed Nov 1 13:30:28 2006 From: arigo at codespeak.net (arigo at codespeak.net) Date: Wed, 1 Nov 2006 13:30:28 +0100 (CET) Subject: [pypy-svn] r34011 - pypy/dist/pypy/lang/js/js Message-ID: <20061101123028.BF19410079@code0.codespeak.net> Author: arigo Date: Wed Nov 1 13:30:27 2006 New Revision: 34011 Modified: pypy/dist/pypy/lang/js/js/jsparse.js Log: (fijal, arigo) Hate hate hate JavaScript. Modified: pypy/dist/pypy/lang/js/js/jsparse.js ============================================================================== --- pypy/dist/pypy/lang/js/js/jsparse.js (original) +++ pypy/dist/pypy/lang/js/js/jsparse.js Wed Nov 1 13:30:27 2006 @@ -284,7 +284,7 @@ var s = "{\n" + INDENTATION.repeat(n) + "'type': '" + tokenstr(this.type) + "'"; for (i = 0; i < a.length; i++) { val = a[i].value + ""; - if (val.search("},{") != -1) { + if (val.search("\\},\\{") != -1) { s += ",\n" + INDENTATION.repeat(n) + "'" + a[i].id + "': [" + val + "]"; } else { if (val.search("\n") != -1) { From ericvrp at codespeak.net Wed Nov 1 13:41:40 2006 From: ericvrp at codespeak.net (ericvrp at codespeak.net) Date: Wed, 1 Nov 2006 13:41:40 +0100 (CET) Subject: [pypy-svn] r34012 - in pypy/dist/pypy/jit/codegen/llvm: . lib test Message-ID: <20061101124140.16B2D10079@code0.codespeak.net> Author: ericvrp Date: Wed Nov 1 13:41:39 2006 New Revision: 34012 Added: pypy/dist/pypy/jit/codegen/llvm/lib/libllvmjit.cpp - copied, changed from r34006, pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.cpp pypy/dist/pypy/jit/codegen/llvm/lib/libllvmjit.h - copied unchanged from r34000, pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.h Removed: pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.cpp pypy/dist/pypy/jit/codegen/llvm/lib/llvmjit.h Modified: pypy/dist/pypy/jit/codegen/llvm/llvmjit.py pypy/dist/pypy/jit/codegen/llvm/setup.py pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py Log: (mwh, ericvrp) translation of the c-api lib works Modified: pypy/dist/pypy/jit/codegen/llvm/llvmjit.py ============================================================================== --- pypy/dist/pypy/jit/codegen/llvm/llvmjit.py (original) +++ pypy/dist/pypy/jit/codegen/llvm/llvmjit.py Wed Nov 1 13:41:39 2006 @@ -6,12 +6,20 @@ This file contains the ctypes specification to use the llvmjit library! ''' +from pypy.rpython.rctypes import implementation import ctypes import os -path = os.path.join(os.path.dirname(__file__), 'llvmjit_.so') +path = os.path.join(os.path.dirname(__file__), 'libllvmjit.so') llvmjit = ctypes.cdll.LoadLibrary(os.path.abspath(path)) +class _FuncPtr(ctypes._CFuncPtr): + _flags_ = ctypes._FUNCFLAG_CDECL + # aaarghdistutilsunixaaargh (may need something different for standalone builds...) + libraries = (os.path.join(os.path.dirname(path), 'llvmjit'),) +llvmjit._FuncPtr = _FuncPtr -def testme(n): - return llvmjit.testme(n) +#impls +testme = llvmjit.testme +testme.restype = ctypes.c_int +testme.argtypes = [ctypes.c_int] Modified: pypy/dist/pypy/jit/codegen/llvm/setup.py ============================================================================== --- pypy/dist/pypy/jit/codegen/llvm/setup.py (original) +++ pypy/dist/pypy/jit/codegen/llvm/setup.py Wed Nov 1 13:41:39 2006 @@ -2,12 +2,14 @@ from distutils.extension import Extension from os import popen +#Create llvm c api library by running "python setup.py build_ext -i" here + cxxflags = popen('llvm-config --cxxflags').readline().split() ldflags = popen('llvm-config --ldflags').readline().split() libs = popen('llvm-config --libs all').readline().split() -opts = dict(name='llvmjit_', - sources=['lib/llvmjit.cpp'], +opts = dict(name='libllvmjit', + sources=['lib/libllvmjit.cpp'], libraries=[], include_dirs =["include"] + [f[2:] for f in cxxflags if f.startswith('-I')], library_dirs =[f[2:] for f in ldflags if f.startswith('-L')], Modified: pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py ============================================================================== --- pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py (original) +++ pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py Wed Nov 1 13:41:39 2006 @@ -1,4 +1,5 @@ import py +from pypy.translator.c.test.test_genc import compile try: from pypy.jit.codegen.llvm import llvmjit @@ -7,3 +8,10 @@ def test_testme(): assert llvmjit.testme(10) == 20 + +def test_testme_compile(): + def f(x): + return llvmjit.testme(20+x) + fn = compile(f, [int]) + res = fn(1) + assert res == 42 From rxe at codespeak.net Wed Nov 1 13:42:03 2006 From: rxe at codespeak.net (rxe at codespeak.net) Date: Wed, 1 Nov 2006 13:42:03 +0100 (CET) Subject: [pypy-svn] r34014 - in pypy/dist/pypy/lang/automata: . test Message-ID: <20061101124203.006291007D@code0.codespeak.net> Author: rxe Date: Wed Nov 1 13:42:03 2006 New Revision: 34014 Modified: pypy/dist/pypy/lang/automata/dfa.py pypy/dist/pypy/lang/automata/test/test_dfa.py Log: simplify, cleanup and add final states check on recognizetable() Modified: pypy/dist/pypy/lang/automata/dfa.py ============================================================================== --- pypy/dist/pypy/lang/automata/dfa.py (original) +++ pypy/dist/pypy/lang/automata/dfa.py Wed Nov 1 13:42:03 2006 @@ -1,43 +1,19 @@ -" a very stripped down versio of cfbolz's algorithm/automaton module " +" a very stripped down version of cfbolz's algorithm/automaton module " from pypy.rlib.objectmodel import hint from pypy.rpython.lltypesystem.lltype import GcArray, Signed, malloc -class LexerError(Exception): - def __init__(self, input, state, index): - self.input = input - self.state = state - self.index = index - self.args = (input, state, index) - class DFA(object): - def __init__(self, num_states=0, transitions=None, final_states=None, - names=None): + def __init__(self, num_states=0, transitions=None, final_states=None): self.num_states = 0 - if transitions is None: - transitions = {} - if final_states is None: - final_states = {} - if names is None: - names = [] - self.transitions = transitions - self.final_states = final_states - self.names = names - - def __repr__(self): - from pprint import pformat - return "DFA%s" % (pformat(( - self.num_states, self.transitions, self.final_states, - self.names)), ) + self.transitions = {} + self.final_states = {} - def add_state(self, name=None, final=False): + def add_state(self, final=False): state = self.num_states self.num_states += 1 if final: self.final_states[state] = None - if name is None: - name = str(state) - self.names.append(name) return self.num_states - 1 def add_transition(self, state, input, next_state): @@ -46,22 +22,21 @@ def get_transition(self, state, input): return self.transitions[state, input] - def contains(self, (state, input)): - return (state, input) in self.transitions - - def get_all_chars(self): + def get_language(self): all_chars = {} for state, input in self.transitions: - all_chars.add(input) + all_chars[input] = None return all_chars - def get_runner(self): - return DFARunner(self) + def __repr__(self): + from pprint import pformat + return "DFA%s" % (pformat( + self.num_states, self.transitions, self.final_states)) def getautomaton(): - # simple example of handcrafted dfa + " simple example of handcrafted dfa " a = DFA() - s0 = a.add_state("start") + s0 = a.add_state() s1 = a.add_state() s2 = a.add_state(final=True) a.add_transition(s0, "a", s0) @@ -71,6 +46,7 @@ return a def recognize(automaton, s): + " a simple recognizer " state = 0 try: for char in s: @@ -80,53 +56,20 @@ return state in automaton.final_states -#________________________________________________________________________________ - -# lower level version - more amenable to JIT - -# an earlier version to keep around, based of GcArray - -# A = GcArray(Signed, hints={'immutable': True}) -# def convertdfa(automaton): -# automaton.transitions -# size = automaton.num_states * 256 -# dfatable = malloc(A, size) -# for ii in range(size): -# dfatable[ii] = -1 -# for (s, c), r in automaton.transitions.items(): -# dfatable[s * 256 + ord(c)] = r -# return dfatable - -# def recognizetable(dfatable, s): -# state = 0 -# indx = 0 -# while True: -# hint(None, global_merge_point=True) -# if indx >= len(s): -# break -# c = s[indx] -# c = hint(c, promote=True) -# state = dfatable[state * 256 + ord(c)] -# hint(state, concrete=True) -# if state < 0: -# break -# indx += 1 -# return hint(state, variable=True) - -#________________________________________________________________________________ - -# another lower level version - more amenable to JIT, this time converts -# nice automata class to a table, represented as a big string - def convertdfa(automaton): - automaton.transitions + """ converts the dfa transitions into a table, represented as a big string. + this is just to make the code more amenable to current state of the JIT. Returns + a two tuple of dfa as table, and final states""" + size = automaton.num_states * 256 dfatable = [chr(255)] * size for (s, c), r in automaton.transitions.items(): dfatable[s * 256 + ord(c)] = chr(r) - return "".join(dfatable) + dfatable = "".join(dfatable) + final_states = "".join([chr(fs) for fs in automaton.final_states]) + return dfatable, final_states -def recognizetable(dfatable, s): +def recognizetable(dfatable, s, finalstates): state = 0 indx = 0 while True: @@ -140,4 +83,10 @@ if state == 255: break indx += 1 - return hint(state, variable=True) + state = hint(state, variable=True) + + # more strange code for now - check final state? + for fs in finalstates: + if state == ord(fs): + return 1 + return 0 Modified: pypy/dist/pypy/lang/automata/test/test_dfa.py ============================================================================== --- pypy/dist/pypy/lang/automata/test/test_dfa.py (original) +++ pypy/dist/pypy/lang/automata/test/test_dfa.py Wed Nov 1 13:42:03 2006 @@ -14,11 +14,17 @@ def rundfa(): a = getautomaton() + assert 'a' in a.get_language() + assert 'b' in a.get_language() + assert 'c' in a.get_language() + assert 'd' not in a.get_language() + assert recognize(a, "aaaaaaaaaab") assert recognize(a, "b") + assert recognize(a, "aaaacb") + assert not recognize(a, "a") assert not recognize(a, "xyza") - assert recognize(a, "aaaacb") def test_dfa_simple(): rundfa() @@ -29,65 +35,9 @@ def test_dfa_compiledummy(): def main(gets): a = getautomaton() - dfatable = convertdfa(a) + dfatable, final_states = convertdfa(a) s = ["aaaaaaaaaab", "aaaa"][gets] - return recognizetable(dfatable, s) - - interpret(main, [0]) + return recognizetable(dfatable, s, final_states) + assert interpret(main, [0]) + assert not interpret(main, [1]) -# class TestWithPortal(object): -# from pypy.jit.codegen.llgraph.rgenop import RGenOp - -# def setup_class(cls): -# cls._cache = {} -# cls._cache_order = [] - -# def teardown_class(cls): -# del cls._cache -# del cls._cache_order - -# def timeshift_from_portal(self, main, portal, main_args, -# inline=None, policy=None, -# backendoptimize=False): - -# key = main, portal, inline, policy, backendoptimize -# try: -# maingraph, rtyper = self._cache[key] -# except KeyError: -# if len(self._cache_order) >= 3: -# del self._cache[self._cache_order.pop(0)] - -# hs, ha, rtyper = hannotate(main, main_args, portal=portal, -# policy=policy, inline=inline, -# backendoptimize=backendoptimize) - -# t = rtyper.annotator.translator -# maingraph = graphof(t, main) -# # make the timeshifted graphs -# hrtyper = HintRTyper(ha, rtyper, self.RGenOp) -# origportalgraph = graphof(t, portal) -# hrtyper.specialize(origportalgraph=origportalgraph, -# view = conftest.option.view) - -# for graph in ha.translator.graphs: -# checkgraph(graph) -# t.graphs.append(graph) - -# if conftest.option.view: -# t.view() - -# self._cache[key] = maingraph, rtyper -# self._cache_order.append(key) - -# llinterp = LLInterpreter(rtyper) -# return llinterp.eval_graph(maingraph, main_args) - -# def test_dfa_compile(self): -# def main(gets): -# a = getautomaton() -# dfatable = convertdfa(a) -# s = ["aaaaaaaaaab", "aaaa"][gets] -# return recognizetable(dfatable, s) - -# res = self.timeshift_from_portal(main, recognizetable, [0], policy=P_NOVIRTUAL) -# assert res >= 0 From cfbolz at codespeak.net Wed Nov 1 13:42:07 2006 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Wed, 1 Nov 2006 13:42:07 +0100 (CET) Subject: [pypy-svn] r34013 - pypy/dist/pypy/translator/oosupport/test_template Message-ID: <20061101124207.443051007D@code0.codespeak.net> Author: cfbolz Date: Wed Nov 1 13:42:00 2006 New Revision: 34013 Modified: pypy/dist/pypy/translator/oosupport/test_template/ (props changed) pypy/dist/pypy/translator/oosupport/test_template/snippets.py (props changed) Log: fixeol From cfbolz at codespeak.net Wed Nov 1 13:43:38 2006 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Wed, 1 Nov 2006 13:43:38 +0100 (CET) Subject: [pypy-svn] r34015 - in pypy/dist/pypy/translator: . backendopt backendopt/test c/test llvm Message-ID: <20061101124338.F24AF1007B@code0.codespeak.net> Author: cfbolz Date: Wed Nov 1 13:43:37 2006 New Revision: 34015 Modified: pypy/dist/pypy/translator/backendopt/all.py pypy/dist/pypy/translator/backendopt/test/test_all.py pypy/dist/pypy/translator/backendopt/test/test_merge_if_blocks.py pypy/dist/pypy/translator/backendopt/test/test_removenoops.py pypy/dist/pypy/translator/c/test/test_backendoptimized.py pypy/dist/pypy/translator/driver.py pypy/dist/pypy/translator/llvm/genllvm.py Log: (cfbolz, arigo and pedronis discussing) fix failing backend optimization tests Modified: pypy/dist/pypy/translator/backendopt/all.py ============================================================================== --- pypy/dist/pypy/translator/backendopt/all.py (original) +++ pypy/dist/pypy/translator/backendopt/all.py Wed Nov 1 13:43:37 2006 @@ -11,25 +11,14 @@ from pypy.translator.backendopt.support import log from pypy.objspace.flow.model import checkgraph -def backend_optimizations(translator, graphs=None, - raisingop2direct_call_all=False, - inline_threshold=1, - mallocs=True, - merge_if_blocks_to_switch=True, - constfold=True, - heap2stack=False, - clever_malloc_removal=False): - - config = translator.config.translation.backendopt - # ZZZ the arguments here should disappear - raisingop2direct_call_all = (config.raisingop2direct_call or - raisingop2direct_call_all) - mallocs = config.mallocs or mallocs - merge_if_blocks_to_switch = (config.merge_if_blocks or - merge_if_blocks_to_switch) - constfold = config.constfold or constfold - heap2stack = config.heap2stack or heap2stack - clever_malloc_removal = config.clever_malloc_removal or clever_malloc_removal +def backend_optimizations(translator, graphs=None, **kwds): + # sensible keywords are + # raisingop2direct_call, inline_threshold, mallocs + # merge_if_blocks, constfold, heap2stack + # clever_malloc_removal + + config = translator.config.translation.backendopt.copy() + config.set(**kwds) if graphs is None: graphs = translator.graphs @@ -38,7 +27,7 @@ print "before optimizations:" print_statistics(translator.graphs[0], translator, "per-graph.txt") - if raisingop2direct_call_all: + if config.raisingop2direct_call: raisingop2direct_call(translator, graphs) # remove obvious no-ops @@ -52,11 +41,11 @@ print "after no-op removal:" print_statistics(translator.graphs[0], translator) - if not clever_malloc_removal: + if not config.clever_malloc_removal: # inline functions in each other - if inline_threshold: + if config.inline_threshold: callgraph = inline.inlinable_static_callers(graphs) - inline.auto_inlining(translator, inline_threshold, + inline.auto_inlining(translator, config.inline_threshold, callgraph=callgraph) for graph in graphs: removenoops.remove_superfluous_keep_alive(graph) @@ -67,7 +56,7 @@ print_statistics(translator.graphs[0], translator) # vaporize mallocs - if mallocs: + if config.mallocs: tot = 0 for graph in graphs: count = remove_simple_mallocs(graph) @@ -90,15 +79,15 @@ print "after clever inlining and malloc removal" print_statistics(translator.graphs[0], translator) - if constfold: + if config.constfold: for graph in graphs: constant_fold_graph(graph) - if heap2stack: + if config.heap2stack: assert graphs is translator.graphs # XXX for now malloc_to_stack(translator) - if merge_if_blocks_to_switch: + if config.merge_if_blocks: for graph in graphs: merge_if_blocks(graph) Modified: pypy/dist/pypy/translator/backendopt/test/test_all.py ============================================================================== --- pypy/dist/pypy/translator/backendopt/test/test_all.py (original) +++ pypy/dist/pypy/translator/backendopt/test/test_all.py Wed Nov 1 13:43:37 2006 @@ -139,7 +139,7 @@ c = [i for i in range(n2)] return 33 + big() + g(10) - t = translateopt(idempotent, [int, int], raisingop2direct_call_all=True, + t = translateopt(idempotent, [int, int], raisingop2direct_call=True, constfold=False) digest1 = md5digest(t) @@ -148,7 +148,7 @@ #XXX Inlining and constfold are currently non-idempotent. # Maybe they just renames variables but the graph changes in some way. - backend_optimizations(t, raisingop2direct_call_all=True, + backend_optimizations(t, raisingop2direct_call=True, inline_threshold=0, constfold=False) digest3 = md5digest(t) assert digest1 == digest3 @@ -184,7 +184,7 @@ for i in r: res = res * 51 + i return res - t = translateopt(fn, [int, int, int], merge_if_blocks_to_switch=True) + t = translateopt(fn, [int, int, int], merge_if_blocks=True) interp = LLInterpreter(t.rtyper) for args in [2, 7, 0], [7, 2, 0], [10, 50, 7], [50, -10, -3]: assert interp.eval_graph(graphof(t, fn), args) == intmask(fn(*args)) Modified: pypy/dist/pypy/translator/backendopt/test/test_merge_if_blocks.py ============================================================================== --- pypy/dist/pypy/translator/backendopt/test/test_merge_if_blocks.py (original) +++ pypy/dist/pypy/translator/backendopt/test/test_merge_if_blocks.py Wed Nov 1 13:43:37 2006 @@ -154,7 +154,7 @@ a.build_types(fn, []) rtyper = t.buildrtyper() rtyper.specialize() - backend_optimizations(t, merge_if_blocks_to_switch=True) + backend_optimizations(t, merge_if_blocks=True) graph = tgraphof(t, fn) blocknum = len(list(graph.iterblocks())) merge_if_blocks(graph) @@ -174,7 +174,7 @@ a.build_types(fn, [int]) rtyper = t.buildrtyper() rtyper.specialize() - backend_optimizations(t, merge_if_blocks_to_switch=True) + backend_optimizations(t, merge_if_blocks=True) graph = tgraphof(t, fn) assert len(graph.startblock.exits) == 2 interp = LLInterpreter(rtyper) Modified: pypy/dist/pypy/translator/backendopt/test/test_removenoops.py ============================================================================== --- pypy/dist/pypy/translator/backendopt/test/test_removenoops.py (original) +++ pypy/dist/pypy/translator/backendopt/test/test_removenoops.py Wed Nov 1 13:43:37 2006 @@ -21,7 +21,7 @@ if all_opts: backend_optimizations(t, inline_threshold=inline_threshold, constfold=False, - raisingop2direct_call_all=False) + raisingop2direct_call=False) graph = graphof(t, fn) if conftest.option.view: t.view() Modified: pypy/dist/pypy/translator/c/test/test_backendoptimized.py ============================================================================== --- pypy/dist/pypy/translator/c/test/test_backendoptimized.py (original) +++ pypy/dist/pypy/translator/c/test/test_backendoptimized.py Wed Nov 1 13:43:37 2006 @@ -10,7 +10,7 @@ def process(self, t): _TestTypedTestCase.process(self, t) self.t = t - backend_optimizations(t, merge_if_blocks_to_switch=False) + backend_optimizations(t, merge_if_blocks=False) if conftest.option.view: t.view() @@ -89,7 +89,7 @@ def process(self, t): _TestTypedTestCase.process(self, t) self.t = t - backend_optimizations(t, merge_if_blocks_to_switch=True) + backend_optimizations(t, merge_if_blocks=True) def test_int_switch(self): def f(x): @@ -186,7 +186,7 @@ def process(self, t): _TestTypedTestCase.process(self, t) self.t = t - backend_optimizations(t, raisingop2direct_call_all=True) + backend_optimizations(t, raisingop2direct_call=True) def test_int_floordiv_zer(self): def f(x): Modified: pypy/dist/pypy/translator/driver.py ============================================================================== --- pypy/dist/pypy/translator/driver.py (original) +++ pypy/dist/pypy/translator/driver.py Wed Nov 1 13:43:37 2006 @@ -277,10 +277,10 @@ def task_backendopt_ootype(self): from pypy.translator.backendopt.all import backend_optimizations backend_optimizations(self.translator, - raisingop2direct_call_all=False, + raisingop2direct_call=False, inline_threshold=0, mallocs=False, - merge_if_blocks_to_switch=False, + merge_if_blocks=False, propagate=False, constfold=True, heap2stack=False, Modified: pypy/dist/pypy/translator/llvm/genllvm.py ============================================================================== --- pypy/dist/pypy/translator/llvm/genllvm.py (original) +++ pypy/dist/pypy/translator/llvm/genllvm.py Wed Nov 1 13:43:37 2006 @@ -335,13 +335,13 @@ # use backend optimizations? if optimize: - backend_optimizations(translator, raisingop2direct_call_all=True) + backend_optimizations(translator, raisingop2direct_call=True) else: backend_optimizations(translator, - rais