diff --git a/dotviewer/test/test_translator.py b/dotviewer/test/test_translator.py index 3436789872ec4e58c0061a91292a6aff30c30c35..acffbf915123fef1f4d0327bfe7ee0179aa85c62 100644 --- a/dotviewer/test/test_translator.py +++ b/dotviewer/test/test_translator.py @@ -21,7 +21,7 @@ def is_prime(n): def test_annotated(): - from pypy.translator.interactive import Translation + from rpython.translator.interactive import Translation t = Translation(is_prime) t.annotate([int]) t.viewcg() diff --git a/lib_pypy/ctypes_config_cache/dumpcache.py b/lib_pypy/ctypes_config_cache/dumpcache.py index 32ed7d7758092883bf00d6d6135f5ca0f8f2d370..be0a562f9437f0253223fbf3fd4ceeed52763448 100644 --- a/lib_pypy/ctypes_config_cache/dumpcache.py +++ b/lib_pypy/ctypes_config_cache/dumpcache.py @@ -1,6 +1,6 @@ import os from ctypes_configure import dumpcache -from pypy.jit.backend import detect_cpu +from rpython.jit.backend import detect_cpu def dumpcache2(basename, config): model = detect_cpu.autodetect_main_model_and_size() @@ -14,7 +14,7 @@ def dumpcache2(basename, config): try: from __pypy__ import cpumodel except ImportError: - from pypy.jit.backend import detect_cpu + from rpython.jit.backend import detect_cpu cpumodel = detect_cpu.autodetect_main_model_and_size() # XXX relative import, should be removed together with # XXX the relative imports done e.g. by lib_pypy/pypy_test/test_hashlib diff --git a/lib_pypy/ctypes_config_cache/rebuild.py b/lib_pypy/ctypes_config_cache/rebuild.py index 31209713ae5f29487050f91ef487711ab5c3137e..b7ff9301dbcf491276fddf995e8001de438cd88b 100755 --- a/lib_pypy/ctypes_config_cache/rebuild.py +++ b/lib_pypy/ctypes_config_cache/rebuild.py @@ -15,7 +15,7 @@ import py _dirpath = os.path.dirname(__file__) or os.curdir -from pypy.tool.ansi_print import ansi_log +from rpython.tool.ansi_print import ansi_log log = py.log.Producer("ctypes_config_cache") py.log.setconsumer("ctypes_config_cache", ansi_log) @@ -31,7 +31,7 @@ def rebuild_one(name): sys.path[:] = path def try_rebuild(): - from pypy.jit.backend import detect_cpu + from rpython.jit.backend import detect_cpu model = detect_cpu.autodetect_main_model_and_size() # remove the files '_*_model_.py' left = {} diff --git a/lib_pypy/ctypes_config_cache/test/test_cache.py b/lib_pypy/ctypes_config_cache/test/test_cache.py index baba5590a66226fa2ff4f91b0a9981ebc8ada1af..56b1999804f717dac82093263420c915153303f0 100644 --- a/lib_pypy/ctypes_config_cache/test/test_cache.py +++ b/lib_pypy/ctypes_config_cache/test/test_cache.py @@ -1,6 +1,6 @@ import py import sys, os -from pypy.tool.udir import udir +from rpython.tool.udir import udir dirpath = py.path.local(__file__).dirpath().dirpath() diff --git a/lib_pypy/pypy_test/test_dbm_extra.py b/lib_pypy/pypy_test/test_dbm_extra.py index 9776367b7803029624c51dfb13acb6de7da7d1e7..171a39df95d6dacebc43b6d0537a167153ad469f 100644 --- a/lib_pypy/pypy_test/test_dbm_extra.py +++ b/lib_pypy/pypy_test/test_dbm_extra.py @@ -1,6 +1,6 @@ from __future__ import absolute_import import py -from pypy.tool.udir import udir +from rpython.tool.udir import udir try: from lib_pypy import dbm except ImportError, e: diff --git a/lib_pypy/pypy_test/test_marshal_extra.py b/lib_pypy/pypy_test/test_marshal_extra.py index 1075e9c31dcd91e49aed7a3c3b1bd860e1389475..fb0e0d04475a567cec1ef433ae5bd42e40c63b4b 100644 --- a/lib_pypy/pypy_test/test_marshal_extra.py +++ b/lib_pypy/pypy_test/test_marshal_extra.py @@ -4,7 +4,7 @@ import sys import marshal as cpy_marshal from lib_pypy import _marshal as marshal -from pypy.tool.udir import udir +from rpython.tool.udir import udir hello = "he" hello += "llo" diff --git a/pypy/annotation/__init__.py b/pypy/annotation/__init__.py deleted file mode 100644 index fd433f4fac94107a19028d7554a36bd7532e7930..0000000000000000000000000000000000000000 --- a/pypy/annotation/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# workaround for a circular imports problem -# e.g. if you import pypy.annotation.listdef first - -import pypy.annotation.model diff --git a/pypy/annotation/test/autopath.py b/pypy/annotation/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/annotation/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/bin/autopath.py b/pypy/bin/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/bin/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/bin/checkmodule.py b/pypy/bin/checkmodule.py index f1dbc10adad0d13f6fbe86cd0f443d668ba70fe8..6a2453c3dace09c4f6a1cfa8773a6649dab272a1 100755 --- a/pypy/bin/checkmodule.py +++ b/pypy/bin/checkmodule.py @@ -6,8 +6,8 @@ Check annotation and rtyping of the PyPy extension module from pypy/module//. Useful for testing whether a modules compiles without doing a full translation. """ -import autopath import sys, os +sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..'))) from pypy.objspace.fake.checkmodule import checkmodule diff --git a/pypy/bin/dotviewer.py b/pypy/bin/dotviewer.py index 4ee1c63bee0b2733f2d7bae29f1af9df11833be2..c22c3221a41bbddd8b97598145c40d2195534138 100755 --- a/pypy/bin/dotviewer.py +++ b/pypy/bin/dotviewer.py @@ -4,7 +4,8 @@ Command-line interface for a dot file viewer. Run with no arguments for help. """ -import autopath +import sys +sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..'))) from dotviewer.dotviewer import main if __name__ == '__main__': diff --git a/pypy/bin/py.py b/pypy/bin/py.py index 765ed5bc4e8560f695a67bc9bb720c4f064b6eac..139154df89f45adc4353a4522207ef96421cd714 100755 --- a/pypy/bin/py.py +++ b/pypy/bin/py.py @@ -57,7 +57,7 @@ def pypy_init(import_site): def set_compiler(option, opt, value, parser): - from pypy.translator.platform import set_platform + from rpython.translator.platform import set_platform set_platform('host', value) def main_(argv=None): diff --git a/pypy/bin/reportstaticdata.py b/pypy/bin/reportstaticdata.py index 572219fe97ed2905ce6006f8f71b010819b011b5..56a34305e8a3343f1f194d9c5f2f5e2670f730c9 100755 --- a/pypy/bin/reportstaticdata.py +++ b/pypy/bin/reportstaticdata.py @@ -27,8 +27,10 @@ Options: --help Show this help message """ -import autopath -from pypy.translator.tool.staticsizereport import print_report +import sys +sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..'))) + +from rpython.translator.tool.staticsizereport import print_report def parse_options(argv): kwds = {} diff --git a/pypy/bin/rpython b/pypy/bin/rpython index 881d727c2c0825a6473caf56eeea59a2e2d85edf..6747e98d76c96d2ed0835505ab2bdc4e054ff697 100755 --- a/pypy/bin/rpython +++ b/pypy/bin/rpython @@ -8,7 +8,7 @@ run with --help for more information """ import sys -from pypy.translator.goal.translate import main +from rpython.translator.goal.translate import main # no implicit targets if len(sys.argv) == 1: diff --git a/pypy/bin/translatorshell.py b/pypy/bin/translatorshell.py index ab9014f46183a5ded06169006b0d202f18786940..1f7eb7382f1b8b3ca08980857576487463dbb674 100755 --- a/pypy/bin/translatorshell.py +++ b/pypy/bin/translatorshell.py @@ -23,10 +23,12 @@ Some functions are provided for the benefit of interactive testing. Try dir(snippet) for list of current snippets. """ -import autopath, os, sys -from pypy.translator.interactive import Translation -from pypy.rpython.rtyper import * -from pypy.rlib.rarithmetic import * +import os, sys +sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..'))) + +from rpython.translator.interactive import Translation +from rpython.rtyper.rtyper import * +from rpython.rlib.rarithmetic import * import py @@ -53,8 +55,8 @@ if __name__ == '__main__': setup_readline() except ImportError, err: print "Disabling readline support (%s)" % err - from pypy.translator.test import snippet - from pypy.rpython.rtyper import RPythonTyper + from rpython.translator.test import snippet + from rpython.rtyper.rtyper import RPythonTyper if (os.getcwd() not in sys.path and os.path.curdir not in sys.path): diff --git a/pypy/config/autopath.py b/pypy/config/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/config/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/config/config.py b/pypy/config/config.py index b924a7f3c8e56538d986703afd3593af6f12de5f..d21eb10e43fafcd269994d42a18d62805c9b6c17 100644 --- a/pypy/config/config.py +++ b/pypy/config/config.py @@ -1,6 +1,6 @@ import py import optparse -from pypy.tool.pairtype import extendabletype +from rpython.tool.pairtype import extendabletype SUPPRESS_USAGE = optparse.SUPPRESS_USAGE diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py index 4863ffeefdf104dce9f81ad2988c6d0a46db83ac..b214e4022e66cba582733026628f60c00666f401 100644 --- a/pypy/config/pypyoption.py +++ b/pypy/config/pypyoption.py @@ -93,25 +93,25 @@ module_suggests = { } module_import_dependencies = { - # no _rawffi if importing pypy.rlib.clibffi raises ImportError + # no _rawffi if importing rpython.rlib.clibffi raises ImportError # or CompilationError or py.test.skip.Exception - "_rawffi" : ["pypy.rlib.clibffi"], - "_ffi" : ["pypy.rlib.clibffi"], + "_rawffi" : ["rpython.rlib.clibffi"], + "_ffi" : ["rpython.rlib.clibffi"], - "zlib" : ["pypy.rlib.rzlib"], + "zlib" : ["rpython.rlib.rzlib"], "bz2" : ["pypy.module.bz2.interp_bz2"], "pyexpat" : ["pypy.module.pyexpat.interp_pyexpat"], "_ssl" : ["pypy.module._ssl.interp_ssl"], "_hashlib" : ["pypy.module._ssl.interp_ssl"], "_minimal_curses": ["pypy.module._minimal_curses.fficurses"], - "_continuation": ["pypy.rlib.rstacklet"], + "_continuation": ["rpython.rlib.rstacklet"], } def get_module_validator(modname): if modname in module_import_dependencies: modlist = module_import_dependencies[modname] def validator(config): - from pypy.rpython.tool.rffi_platform import CompilationError + from rpython.rtyper.tool.rffi_platform import CompilationError try: for name in modlist: __import__(name) diff --git a/pypy/config/test/test_config.py b/pypy/config/test/test_config.py index b95deda2a37b37a60a413f04a6d776a9fc5b7529..04cea12cdac110c04eeb53005b0d3c705c8f9fbf 100644 --- a/pypy/config/test/test_config.py +++ b/pypy/config/test/test_config.py @@ -90,7 +90,7 @@ def test_arbitrary_option(): assert c1.a == [1] def test_annotator_folding(): - from pypy.translator.interactive import Translation + from rpython.translator.interactive import Translation gcoption = ChoiceOption('name', 'GC name', ['ref', 'framework'], 'ref') gcgroup = OptionDescription('gc', '', [gcoption]) diff --git a/pypy/config/translationoption.py b/pypy/config/translationoption.py index 1f4cae42f6ca9421ddf4ae6ca5c3c2224439b80b..2f582cbaf5262cb32fdd4de379a9e11888b437da 100644 --- a/pypy/config/translationoption.py +++ b/pypy/config/translationoption.py @@ -1,4 +1,3 @@ -import autopath import py, os, sys from pypy.config.config import OptionDescription, BoolOption, IntOption, ArbitraryOption, FloatOption from pypy.config.config import ChoiceOption, StrOption, to_optparse, Config @@ -198,7 +197,7 @@ translation_optiondescription = OptionDescription( default=DEFL_INLINE_THRESHOLD, cmdline="--inline-threshold"), StrOption("inline_heuristic", "Dotted name of an heuristic function " "for inlining", - default="pypy.translator.backendopt.inline.inlining_heuristic", + default="rpython.translator.backendopt.inline.inlining_heuristic", cmdline="--inline-heuristic"), BoolOption("print_statistics", "Print statistics while optimizing", @@ -226,7 +225,7 @@ translation_optiondescription = OptionDescription( StrOption("profile_based_inline_heuristic", "Dotted name of an heuristic function " "for profile based inlining", - default="pypy.translator.backendopt.inline.inlining_heuristic", + default="rpython.translator.backendopt.inline.inlining_heuristic", ), # cmdline="--prof-based-inline-heuristic" fix me # control clever malloc removal BoolOption("clever_malloc_removal", @@ -241,7 +240,7 @@ translation_optiondescription = OptionDescription( StrOption("clever_malloc_removal_heuristic", "Dotted name of an heuristic function " "for inlining in clever malloc removal", - default="pypy.translator.backendopt.inline.inlining_heuristic", + default="rpython.translator.backendopt.inline.inlining_heuristic", cmdline="--clever-malloc-removal-heuristic"), BoolOption("remove_asserts", @@ -339,7 +338,7 @@ OPT_TABLE = { def final_check_config(config): # XXX: this should be a real config option, but it is hard to refactor it; # instead, we "just" patch it from here - from pypy.rlib import rfloat + from rpython.rlib import rfloat if config.translation.type_system == 'ootype': rfloat.USE_SHORT_FLOAT_REPR = False @@ -393,11 +392,11 @@ def set_opt_level(config, level): # ---------------------------------------------------------------- def set_platform(config): - from pypy.translator.platform import set_platform + from rpython.translator.platform import set_platform set_platform(config.translation.platform, config.translation.cc) def get_platform(config): - from pypy.translator.platform import pick_platform + from rpython.translator.platform import pick_platform opt = config.translation.platform cc = config.translation.cc return pick_platform(opt, cc) diff --git a/pypy/conftest.py b/pypy/conftest.py index aed1164c0e8f27d2e27350879d1d7217c9636a16..534c2519841d865bb639ecd174c153e8976709aa 100644 --- a/pypy/conftest.py +++ b/pypy/conftest.py @@ -10,6 +10,7 @@ rsyncignore = ['_cache'] # option = None +pypydir = os.path.realpath(os.path.join(os.path.dirname(__file__), '..')) def braindead_deindent(self): """monkeypatch that wont end up doing stupid in the python tokenizer""" @@ -36,7 +37,7 @@ def pytest_configure(config): def _set_platform(opt, opt_str, value, parser): from pypy.config.translationoption import PLATFORMS - from pypy.translator.platform import set_platform + from rpython.translator.platform import set_platform if value not in PLATFORMS: raise ValueError("%s not in %s" % (value, PLATFORMS)) set_platform(value, None) diff --git a/pypy/doc/config/autopath.py b/pypy/doc/config/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/doc/config/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/doc/config/generate.py b/pypy/doc/config/generate.py index e53de5f403351c52181b7fc12210bdceb53f8f66..aa3272a8dc4570b9030549c6ffd912cf36639a38 100644 --- a/pypy/doc/config/generate.py +++ b/pypy/doc/config/generate.py @@ -1,4 +1,3 @@ -import autopath import py from pypy.config import pypyoption, translationoption, config, makerestdoc from pypy.doc.config.confrest import all_optiondescrs diff --git a/pypy/doc/config/makemodules.py b/pypy/doc/config/makemodules.py index 893341b49b1b2da11b4f56fd8992356733524131..6cfd8dd72d9f7292770efb39c1d020a734e14cae 100644 --- a/pypy/doc/config/makemodules.py +++ b/pypy/doc/config/makemodules.py @@ -1,4 +1,3 @@ -import autopath import py from pypy.config import pypyoption, translationoption, config diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py index fdd565cd2d5455288b8d1b57b8f504d1e5cc51c1..e8ef3c39a00da314a8d30d9c7b43e59b185ba1c4 100644 --- a/pypy/interpreter/argument.py +++ b/pypy/interpreter/argument.py @@ -3,8 +3,8 @@ Arguments objects. """ from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rlib.debug import make_sure_not_resized -from pypy.rlib import jit +from rpython.rlib.debug import make_sure_not_resized +from rpython.rlib import jit class Signature(object): diff --git a/pypy/interpreter/astcompiler/assemble.py b/pypy/interpreter/astcompiler/assemble.py index 01dec16df8384d32cdca040738ec8b1fdedef434..8deccd959eb44682eaf31d30fc8d8ae7e97747d6 100644 --- a/pypy/interpreter/astcompiler/assemble.py +++ b/pypy/interpreter/astcompiler/assemble.py @@ -4,11 +4,11 @@ Python control flow graph generation and bytecode assembly. from pypy.interpreter.astcompiler import ast, symtable from pypy.interpreter import pycode -from pypy.tool import stdlib_opcode as ops +from rpython.tool import stdlib_opcode as ops from pypy.interpreter.error import OperationError -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib import rfloat +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib import rfloat class Instruction(object): diff --git a/pypy/interpreter/astcompiler/ast.py b/pypy/interpreter/astcompiler/ast.py index 87439efff2f4b336de0b25f4687ab95137763064..79d1859ea39645380120eb4c1ae4c6f9b8d4be99 100644 --- a/pypy/interpreter/astcompiler/ast.py +++ b/pypy/interpreter/astcompiler/ast.py @@ -3,9 +3,9 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter import typedef from pypy.interpreter.gateway import interp2app from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rlib.unroll import unrolling_iterable -from pypy.tool.pairtype import extendabletype -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.unroll import unrolling_iterable +from rpython.tool.pairtype import extendabletype +from rpython.tool.sourcetools import func_with_new_name def check_string(space, w_obj): diff --git a/pypy/interpreter/astcompiler/astbuilder.py b/pypy/interpreter/astcompiler/astbuilder.py index 6fe865eaacebd8a1dee17cc0fd37b7a7ed1e5557..18afb9ac6c29dae5f4b5cfd8da27370f0bae8ce8 100644 --- a/pypy/interpreter/astcompiler/astbuilder.py +++ b/pypy/interpreter/astcompiler/astbuilder.py @@ -4,7 +4,7 @@ from pypy.interpreter import error from pypy.interpreter.pyparser.pygram import syms, tokens from pypy.interpreter.pyparser.error import SyntaxError from pypy.interpreter.pyparser import parsestring -from pypy.rlib.objectmodel import specialize +from rpython.rlib.objectmodel import specialize def ast_from_node(space, node, compile_info): diff --git a/pypy/interpreter/astcompiler/codegen.py b/pypy/interpreter/astcompiler/codegen.py index 2e244d2349fbc3155a02fa1febb07739d354b4d6..3a91f0b2b9e27f15256046b064cf430c748b1375 100644 --- a/pypy/interpreter/astcompiler/codegen.py +++ b/pypy/interpreter/astcompiler/codegen.py @@ -10,7 +10,7 @@ Generate Python bytecode from a Abstract Syntax Tree. from pypy.interpreter.astcompiler import ast, assemble, symtable, consts, misc from pypy.interpreter.astcompiler import optimize # For side effects from pypy.interpreter.pyparser.error import SyntaxError -from pypy.tool import stdlib_opcode as ops +from rpython.tool import stdlib_opcode as ops from pypy.interpreter.error import OperationError diff --git a/pypy/interpreter/astcompiler/misc.py b/pypy/interpreter/astcompiler/misc.py index 9d6f0dfd629a34a33505a8d8079750124a0b7c1c..6c8062a6aefc178227847492660f5ad9b72a64c4 100644 --- a/pypy/interpreter/astcompiler/misc.py +++ b/pypy/interpreter/astcompiler/misc.py @@ -1,7 +1,7 @@ from pypy.interpreter import gateway from pypy.interpreter.astcompiler import ast -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.unroll import unrolling_iterable +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.unroll import unrolling_iterable app = gateway.applevel(""" diff --git a/pypy/interpreter/astcompiler/optimize.py b/pypy/interpreter/astcompiler/optimize.py index fc9dfbe14d2e238a8bd109a971e2d47d7fb3c26f..8c9373c305749caa1df808e1482989a232cc73e8 100644 --- a/pypy/interpreter/astcompiler/optimize.py +++ b/pypy/interpreter/astcompiler/optimize.py @@ -2,10 +2,10 @@ import sys from pypy.interpreter.astcompiler import ast, consts, misc -from pypy.tool import stdlib_opcode as ops +from rpython.tool import stdlib_opcode as ops from pypy.interpreter.error import OperationError -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.runicode import MAXUNICODE +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.runicode import MAXUNICODE def optimize_ast(space, tree, compile_info): diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py b/pypy/interpreter/astcompiler/test/test_compiler.py index bf6b3f3a873670b33828aca19da95c6c302d8276..65a54541dc859a2f721c1f84a7c441635fdde164 100644 --- a/pypy/interpreter/astcompiler/test/test_compiler.py +++ b/pypy/interpreter/astcompiler/test/test_compiler.py @@ -4,7 +4,7 @@ from pypy.interpreter.pyparser import pyparse from pypy.interpreter.pyparser.test import expressions from pypy.interpreter.pycode import PyCode from pypy.interpreter.pyparser.error import SyntaxError, IndentationError -from pypy.tool import stdlib_opcode as ops +from rpython.tool import stdlib_opcode as ops def compile_with_astcompiler(expr, mode, space): p = pyparse.PythonParser(space) diff --git a/pypy/interpreter/astcompiler/tools/asdl_py.py b/pypy/interpreter/astcompiler/tools/asdl_py.py index 48c33400c581c14e34e2913b500631b9ce04a1e5..93e8997a28c322b79a118eb0dfcefb499b40ee0a 100644 --- a/pypy/interpreter/astcompiler/tools/asdl_py.py +++ b/pypy/interpreter/astcompiler/tools/asdl_py.py @@ -542,9 +542,9 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter import typedef from pypy.interpreter.gateway import interp2app from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rlib.unroll import unrolling_iterable -from pypy.tool.pairtype import extendabletype -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.unroll import unrolling_iterable +from rpython.tool.pairtype import extendabletype +from rpython.tool.sourcetools import func_with_new_name def check_string(space, w_obj): diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py index 4105b1e9abec67befa7b70d6bb08e9ca30ab19b6..67d26d8ae7fd10c638fe51a85f8b256b8cae3f9e 100644 --- a/pypy/interpreter/baseobjspace.py +++ b/pypy/interpreter/baseobjspace.py @@ -7,12 +7,12 @@ from pypy.interpreter.error import (OperationError, operationerrfmt, from pypy.interpreter.argument import Arguments from pypy.interpreter.miscutils import ThreadLocals from pypy.tool.cache import Cache -from pypy.tool.uid import HUGEVAL_BYTES -from pypy.rlib import jit -from pypy.rlib.debug import make_sure_not_resized -from pypy.rlib.objectmodel import we_are_translated, newlist_hint,\ +from rpython.tool.uid import HUGEVAL_BYTES +from rpython.rlib import jit +from rpython.rlib.debug import make_sure_not_resized +from rpython.rlib.objectmodel import we_are_translated, newlist_hint,\ compute_unique_id -from pypy.rlib.rarithmetic import r_uint +from rpython.rlib.rarithmetic import r_uint __all__ = ['ObjSpace', 'OperationError', 'Wrappable', 'W_Root'] @@ -1327,7 +1327,7 @@ class ObjSpace(object): def str0_w(self, w_obj): "Like str_w, but rejects strings with NUL bytes." - from pypy.rlib import rstring + from rpython.rlib import rstring result = w_obj.str_w(self) if '\x00' in result: raise OperationError(self.w_TypeError, self.wrap( @@ -1355,7 +1355,7 @@ class ObjSpace(object): def unicode0_w(self, w_obj): "Like unicode_w, but rejects strings with NUL bytes." - from pypy.rlib import rstring + from rpython.rlib import rstring result = w_obj.unicode_w(self) if u'\x00' in result: raise OperationError(self.w_TypeError, self.wrap( @@ -1451,7 +1451,7 @@ class ObjSpace(object): except OperationError, e: if not e.match(self, self.w_OverflowError): raise - from pypy.rlib.rarithmetic import intmask + from rpython.rlib.rarithmetic import intmask return intmask(self.bigint_w(w_obj).uintmask()) def truncatedlonglong_w(self, w_obj): @@ -1462,7 +1462,7 @@ class ObjSpace(object): except OperationError, e: if not e.match(self, self.w_OverflowError): raise - from pypy.rlib.rarithmetic import longlongmask + from rpython.rlib.rarithmetic import longlongmask return longlongmask(self.bigint_w(w_obj).ulonglongmask()) def c_filedescriptor_w(self, w_fd): @@ -1529,7 +1529,7 @@ dummy_lock = DummyLock() ## Table describing the regular part of the interface of object spaces, ## namely all methods which only take w_ arguments and return a w_ result -## (if any). Note: keep in sync with pypy.objspace.flow.operation.Table. +## (if any). Note: keep in sync with rpython.flowspace.operation.Table. ObjSpace.MethodTable = [ # method name # symbol # number of arguments # special method name(s) diff --git a/pypy/interpreter/buffer.py b/pypy/interpreter/buffer.py index 5af2028cd27a7fd91f1748690a083c025952beae..cacdf1d8001e1fad9a732bcbc3f4a81e4524a419 100644 --- a/pypy/interpreter/buffer.py +++ b/pypy/interpreter/buffer.py @@ -19,8 +19,8 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import OperationError -from pypy.rlib.objectmodel import compute_hash -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.objectmodel import compute_hash +from rpython.rlib.rstring import StringBuilder class Buffer(Wrappable): @@ -155,7 +155,7 @@ def descr_buffer__new__(space, w_subtype, w_object, offset=0, size=-1): if space.isinstance_w(w_object, space.w_unicode): # unicode objects support the old buffer interface # but not the new buffer interface (change in python 2.7) - from pypy.rlib.rstruct.unichar import pack_unichar, UNICODE_SIZE + from rpython.rlib.rstruct.unichar import pack_unichar, UNICODE_SIZE unistr = space.unicode_w(w_object) builder = StringBuilder(len(unistr) * UNICODE_SIZE) for unich in unistr: diff --git a/pypy/interpreter/error.py b/pypy/interpreter/error.py index 6eefbe70f3677b919d938e1771ca287b868ba9f5..f7308b26ee37870995f03c79abb88818796df454 100644 --- a/pypy/interpreter/error.py +++ b/pypy/interpreter/error.py @@ -1,6 +1,6 @@ import os, sys -from pypy.rlib import jit -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib import jit +from rpython.rlib.objectmodel import we_are_translated from errno import EINTR AUTO_DEBUG = os.getenv('PYPY_DEBUG') @@ -324,7 +324,7 @@ def get_operrcls2(valuefmt): try: OpErrFmt = _fmtcache2[formats] except KeyError: - from pypy.rlib.unroll import unrolling_iterable + from rpython.rlib.unroll import unrolling_iterable attrs = ['x%d' % i for i in range(len(formats))] entries = unrolling_iterable(enumerate(attrs)) # @@ -368,7 +368,7 @@ operationerrfmt._annspecialcase_ = 'specialize:arg(1)' # ____________________________________________________________ # Utilities -from pypy.tool.ansi_print import ansi_print +from rpython.tool.ansi_print import ansi_print def debug_print(text, file=None, newline=True): # 31: ANSI color code "red" @@ -382,7 +382,7 @@ else: _WINDOWS = True def wrap_windowserror(space, e, w_filename=None): - from pypy.rlib import rwin32 + from rpython.rlib import rwin32 winerror = e.winerror try: @@ -440,7 +440,7 @@ def wrap_oserror(space, e, filename=None, exception_name='w_OSError', wrap_oserror._annspecialcase_ = 'specialize:arg(3)' def exception_from_errno(space, w_type): - from pypy.rlib.rposix import get_errno + from rpython.rlib.rposix import get_errno errno = get_errno() msg = os.strerror(errno) diff --git a/pypy/interpreter/executioncontext.py b/pypy/interpreter/executioncontext.py index 674b2d46232526999985bc3323d08ccb2f1802f0..47be983742e8a9cb1d8ea3db572620397b949413 100644 --- a/pypy/interpreter/executioncontext.py +++ b/pypy/interpreter/executioncontext.py @@ -1,8 +1,8 @@ import sys from pypy.interpreter.error import OperationError -from pypy.rlib.rarithmetic import LONG_BIT -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib import jit +from rpython.rlib.rarithmetic import LONG_BIT +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib import jit TICK_COUNTER_STEP = 100 diff --git a/pypy/interpreter/function.py b/pypy/interpreter/function.py index 0e023449d40b5496fe63bcfc93566acf48f81fe7..ce0d7dee2d26932e0510c254a3277bbdfcac8e83 100644 --- a/pypy/interpreter/function.py +++ b/pypy/interpreter/function.py @@ -6,13 +6,13 @@ objects; the difference lies in the code object found in their func_code attribute. """ -from pypy.rlib.unroll import unrolling_iterable +from rpython.rlib.unroll import unrolling_iterable from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.eval import Code from pypy.interpreter.argument import Arguments -from pypy.rlib import jit -from pypy.rlib.debug import make_sure_not_resized +from rpython.rlib import jit +from rpython.rlib.debug import make_sure_not_resized funccallunrolling = unrolling_iterable(range(4)) diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py index a68b1494dc60a5f0d6179b30c168e1c042454547..285ff73ac8efc6cdd31139377dded87e798287d3 100644 --- a/pypy/interpreter/gateway.py +++ b/pypy/interpreter/gateway.py @@ -19,10 +19,10 @@ from pypy.interpreter.baseobjspace import (W_Root, ObjSpace, Wrappable, SpaceCache, DescrMismatch) from pypy.interpreter.error import OperationError from pypy.interpreter.function import ClassMethod, FunctionWithFixedCode -from pypy.rlib import rstackovf -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.rarithmetic import r_longlong, r_int, r_ulonglong, r_uint -from pypy.tool.sourcetools import func_with_new_name, compile2 +from rpython.rlib import rstackovf +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.rarithmetic import r_longlong, r_int, r_ulonglong, r_uint +from rpython.tool.sourcetools import func_with_new_name, compile2 # internal non-translatable parts: diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py index e08da792ea7e8b8cbff15524076837a1c9e9642f..298e0165c8f0c7d9bcf344b6dd4aee95e5159b39 100644 --- a/pypy/interpreter/generator.py +++ b/pypy/interpreter/generator.py @@ -1,7 +1,7 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.error import OperationError from pypy.interpreter.pyopcode import LoopBlock -from pypy.rlib import jit +from rpython.rlib import jit class GeneratorIterator(Wrappable): diff --git a/pypy/interpreter/module.py b/pypy/interpreter/module.py index d13d6b409639cdc7dbe5d73b8a061b075f184705..31932c9dcd8e8a8c17661ac53f26cdcc36acffc2 100644 --- a/pypy/interpreter/module.py +++ b/pypy/interpreter/module.py @@ -4,7 +4,7 @@ Module objects. from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.error import OperationError -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.objectmodel import we_are_translated class Module(Wrappable): """A module.""" diff --git a/pypy/interpreter/nestedscope.py b/pypy/interpreter/nestedscope.py index a017d6ea27996792f2fdeecfba567cf37d6b696f..ee5f0789cb28ce7c3adbf4fc61d82f9d5033372f 100644 --- a/pypy/interpreter/nestedscope.py +++ b/pypy/interpreter/nestedscope.py @@ -3,8 +3,8 @@ from pypy.interpreter import function, pycode, pyframe from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.mixedmodule import MixedModule from pypy.interpreter.astcompiler import consts -from pypy.rlib import jit -from pypy.tool.uid import uid +from rpython.rlib import jit +from rpython.tool.uid import uid class Cell(Wrappable): "A simple container for a wrapped value." diff --git a/pypy/interpreter/pycode.py b/pypy/interpreter/pycode.py index 89aa790c22b5710135699f0d07041f47fb03cb67..f53b8c553b37c2e8d62361f0688aeb606337956a 100644 --- a/pypy/interpreter/pycode.py +++ b/pypy/interpreter/pycode.py @@ -13,11 +13,11 @@ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.astcompiler.consts import ( CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS, CO_VARKEYWORDS, CO_NESTED, CO_GENERATOR, CO_CONTAINSGLOBALS) -from pypy.rlib.rarithmetic import intmask -from pypy.rlib.debug import make_sure_not_resized -from pypy.rlib import jit -from pypy.rlib.objectmodel import compute_hash -from pypy.tool.stdlib_opcode import opcodedesc, HAVE_ARGUMENT +from rpython.rlib.rarithmetic import intmask +from rpython.rlib.debug import make_sure_not_resized +from rpython.rlib import jit +from rpython.rlib.objectmodel import compute_hash +from rpython.tool.stdlib_opcode import opcodedesc, HAVE_ARGUMENT class BytecodeCorruption(Exception): diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py index 8e1c1b0593cc5c7dcbda3308e087782f4d234e8a..5218e1b66a096316a605d867f8281ddc352383b4 100644 --- a/pypy/interpreter/pyframe.py +++ b/pypy/interpreter/pyframe.py @@ -1,19 +1,19 @@ """ PyFrame class implementation with the interpreter main loop. """ -from pypy.tool.pairtype import extendabletype +from rpython.tool.pairtype import extendabletype from pypy.interpreter import eval, baseobjspace, pycode from pypy.interpreter.argument import Arguments from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.executioncontext import ExecutionContext from pypy.interpreter import pytraceback -from pypy.rlib.objectmodel import we_are_translated, instantiate -from pypy.rlib.jit import hint -from pypy.rlib.debug import make_sure_not_resized, check_nonneg -from pypy.rlib.rarithmetic import intmask, r_uint -from pypy.rlib import jit -from pypy.tool import stdlib_opcode -from pypy.tool.stdlib_opcode import host_bytecode_spec +from rpython.rlib.objectmodel import we_are_translated, instantiate +from rpython.rlib.jit import hint +from rpython.rlib.debug import make_sure_not_resized, check_nonneg +from rpython.rlib.rarithmetic import intmask, r_uint +from rpython.rlib import jit +from rpython.tool import stdlib_opcode +from rpython.tool.stdlib_opcode import host_bytecode_spec # Define some opcodes used g = globals() diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py index 7f205be9ba0162284e9da2045a17131aa7160b82..c15074dddc9755d46ca1d95658c818a165862cc2 100644 --- a/pypy/interpreter/pyopcode.py +++ b/pypy/interpreter/pyopcode.py @@ -9,13 +9,13 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter import gateway, function, eval, pyframe, pytraceback from pypy.interpreter.pycode import PyCode, BytecodeCorruption -from pypy.tool.sourcetools import func_with_new_name -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib import jit, rstackovf -from pypy.rlib.rarithmetic import r_uint, intmask -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.debug import check_nonneg -from pypy.tool.stdlib_opcode import (bytecode_spec, +from rpython.tool.sourcetools import func_with_new_name +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib import jit, rstackovf +from rpython.rlib.rarithmetic import r_uint, intmask +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.debug import check_nonneg +from rpython.tool.stdlib_opcode import (bytecode_spec, unrolling_all_opcode_descs) def unaryoperation(operationname): diff --git a/pypy/interpreter/pyparser/autopath.py b/pypy/interpreter/pyparser/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/interpreter/pyparser/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/interpreter/pyparser/genpytokenize.py b/pypy/interpreter/pyparser/genpytokenize.py old mode 100644 new mode 100755 index aba6bc82b183317bbec5b2fbb17aa2dc833536f9..3ce37c36cf3338e45d842cd5383b6927221c760e --- a/pypy/interpreter/pyparser/genpytokenize.py +++ b/pypy/interpreter/pyparser/genpytokenize.py @@ -10,7 +10,6 @@ When run from the command line, this should pretty print the DFA machinery. $Id: genPytokenize.py,v 1.1 2003/10/02 17:37:17 jriehl Exp $ """ -import autopath from pypy.interpreter.pyparser.pylexer import * from pypy.interpreter.pyparser.automata import NonGreedyDFA, DFA, DEFAULT diff --git a/pypy/interpreter/pyparser/parsestring.py b/pypy/interpreter/pyparser/parsestring.py index 23006239806f3b48b231e9ca690caa52029d688c..2a828df41c33d75b5d5c1d2f87fe414e92d08a4f 100644 --- a/pypy/interpreter/pyparser/parsestring.py +++ b/pypy/interpreter/pyparser/parsestring.py @@ -1,6 +1,6 @@ from pypy.interpreter.error import OperationError from pypy.interpreter import unicodehelper -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.rstring import StringBuilder def parsestr(space, encoding, s, unicode_literal=False): """Parses a string or unicode literal, and return a wrapped value. diff --git a/pypy/interpreter/streamutil.py b/pypy/interpreter/streamutil.py index 788d74476e081c71e3e1b0962eefeaeb5d7bd1aa..062fa57c04459a8ac1b54a8cd2e01f154e618f55 100644 --- a/pypy/interpreter/streamutil.py +++ b/pypy/interpreter/streamutil.py @@ -1,4 +1,4 @@ -from pypy.rlib.streamio import StreamError +from rpython.rlib.streamio import StreamError from pypy.interpreter.error import OperationError, wrap_oserror2 def wrap_streamerror(space, e, w_filename=None): diff --git a/pypy/interpreter/test/test_buffer.py b/pypy/interpreter/test/test_buffer.py index 549e653de9001cbddd7e8b3921d41145e940c0f1..08f96ae9608865d41270a1b477dec3574d431bbe 100644 --- a/pypy/interpreter/test/test_buffer.py +++ b/pypy/interpreter/test/test_buffer.py @@ -1,6 +1,6 @@ import py from pypy.interpreter.buffer import Buffer -from pypy.tool.udir import udir +from rpython.tool.udir import udir testdir = udir.ensure('test_buffer', dir=1) diff --git a/pypy/interpreter/test/test_compiler.py b/pypy/interpreter/test/test_compiler.py index cdfe5cebbf83f438a0b826ef73fea4d07b4cbcbb..10da846ec12f71f49f7c376d199ed81c32114c77 100644 --- a/pypy/interpreter/test/test_compiler.py +++ b/pypy/interpreter/test/test_compiler.py @@ -622,7 +622,7 @@ def test(): assert space.float_w(w_result) == 0 def test_dont_inherit_across_import(self): - from pypy.tool.udir import udir + from rpython.tool.udir import udir udir.join('test_dont_inherit_across_import.py').write('x = 1/2\n') space = self.space s1 = str(py.code.Source(""" diff --git a/pypy/interpreter/test/test_exec.py b/pypy/interpreter/test/test_exec.py index ba3f992363dace8ef67a0e71d0c2617243afdbdf..fd257d02c7af5921244366dfe8539b3955335e6c 100644 --- a/pypy/interpreter/test/test_exec.py +++ b/pypy/interpreter/test/test_exec.py @@ -2,7 +2,7 @@ New for PyPy - Could be incorporated into CPython regression tests. """ -from pypy.tool.udir import udir +from rpython.tool.udir import udir def test_file(space): diff --git a/pypy/interpreter/test/test_executioncontext.py b/pypy/interpreter/test/test_executioncontext.py index 7d7b81ffe38936915f5bbec2875e42a459118a61..5922484177ff82aba09abc560dd9a4bd999b3ff1 100644 --- a/pypy/interpreter/test/test_executioncontext.py +++ b/pypy/interpreter/test/test_executioncontext.py @@ -262,7 +262,7 @@ class AppTestDelNotBlocked: def setup_method(self, meth): if not self.runappdirect: py.test.skip("test is meant for running with py.test -A") - from pypy.tool.udir import udir + from rpython.tool.udir import udir tmpfile = udir.join('test_execution_context') tmpfile.write(""" import gc diff --git a/pypy/interpreter/test/test_extmodules.py b/pypy/interpreter/test/test_extmodules.py index 35b4168a37539a892ac3e70604b4be33f379afcc..bc1e8d2fa639c42f1820c29bfa06bf8ff36c1fca 100644 --- a/pypy/interpreter/test/test_extmodules.py +++ b/pypy/interpreter/test/test_extmodules.py @@ -3,7 +3,7 @@ import pytest from pypy.config.pypyoption import get_pypy_config from pypy.objspace.std import StdObjSpace -from pypy.tool.udir import udir +from rpython.tool.udir import udir mod_init = """ from pypy.interpreter.mixedmodule import MixedModule diff --git a/pypy/interpreter/test/test_gateway.py b/pypy/interpreter/test/test_gateway.py index 5428579bd19dc23b43694703c7b7d7f4426db936..c70c9ee851a9667e85825b2e263c04385a099571 100644 --- a/pypy/interpreter/test/test_gateway.py +++ b/pypy/interpreter/test/test_gateway.py @@ -197,7 +197,7 @@ class TestGateway: space.call_function, w_app_g, space.wrap(-1)) def test_interp2app_unwrap_spec_c_int(self): - from pypy.rlib.rarithmetic import r_longlong + from rpython.rlib.rarithmetic import r_longlong space = self.space w = space.wrap def g(space, x): diff --git a/pypy/interpreter/test/test_main.py b/pypy/interpreter/test/test_main.py index 5932665abbece4513c842a6f54036079731e5921..dc7e5367e263787fcc3d071189f4b0c5e6d7e8c1 100644 --- a/pypy/interpreter/test/test_main.py +++ b/pypy/interpreter/test/test_main.py @@ -1,7 +1,7 @@ from cStringIO import StringIO import py -from pypy.tool.udir import udir +from rpython.tool.udir import udir from pypy.interpreter.baseobjspace import OperationError from pypy.interpreter import main diff --git a/pypy/interpreter/test/test_objspace.py b/pypy/interpreter/test/test_objspace.py index 078db9b0caa92a46340c8e3fcfb89a48f80467f8..3e7da7e884baa011f7aa6e2d1a368ed5bc4822a2 100644 --- a/pypy/interpreter/test/test_objspace.py +++ b/pypy/interpreter/test/test_objspace.py @@ -2,7 +2,7 @@ from py.test import raises from pypy.interpreter.error import OperationError from pypy.interpreter.function import Function from pypy.interpreter.pycode import PyCode -from pypy.rlib.rarithmetic import r_longlong, r_ulonglong +from rpython.rlib.rarithmetic import r_longlong, r_ulonglong import sys # this test isn't so much to test that the objspace interface *works* diff --git a/pypy/interpreter/test/test_pyframe.py b/pypy/interpreter/test/test_pyframe.py index eb45e2857785be4666a2c8bdd5db610279fb0be7..4282bb19b4bb21981613e9e245ab3d955b8d501e 100644 --- a/pypy/interpreter/test/test_pyframe.py +++ b/pypy/interpreter/test/test_pyframe.py @@ -1,4 +1,4 @@ -from pypy.tool import udir +from rpython.tool import udir from pypy.conftest import option diff --git a/pypy/interpreter/test/test_typedef.py b/pypy/interpreter/test/test_typedef.py index 4a5cf302cd1dd36096f7fc8d9ef105fcf2d2d86d..a6b6cc483bd2ca1e5fab9ba5616fd57fedc294e6 100644 --- a/pypy/interpreter/test/test_typedef.py +++ b/pypy/interpreter/test/test_typedef.py @@ -1,6 +1,6 @@ import gc from pypy.interpreter import typedef -from pypy.tool.udir import udir +from rpython.tool.udir import udir from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.gateway import ObjSpace, interp2app diff --git a/pypy/interpreter/test/test_zpy.py b/pypy/interpreter/test/test_zpy.py index da836c0c1932206984bbe997f3505edaa1750ddf..c8346866a255f824b9e3ca31955ccf556c8f50d3 100644 --- a/pypy/interpreter/test/test_zpy.py +++ b/pypy/interpreter/test/test_zpy.py @@ -1,5 +1,5 @@ -from pypy.tool.udir import udir +from rpython.tool.udir import udir import py import sys import pypy diff --git a/pypy/interpreter/test/test_zzpickle_and_slow.py b/pypy/interpreter/test/test_zzpickle_and_slow.py index 0389c89d21db9e5a3528ab8b672fd47e99055e57..bd2f57b40bc138ffa7e1cbb9c0a02a22f8cf7bb2 100644 --- a/pypy/interpreter/test/test_zzpickle_and_slow.py +++ b/pypy/interpreter/test/test_zzpickle_and_slow.py @@ -1,7 +1,7 @@ import py from pypy import conftest from pypy.interpreter import gateway -from pypy.rlib.jit import non_virtual_ref, vref_None +from rpython.rlib.jit import non_virtual_ref, vref_None class AppTestSlow: spaceconfig = dict(usemodules=['itertools']) diff --git a/pypy/interpreter/typedef.py b/pypy/interpreter/typedef.py index 6ff31218a367a2bf86651103966f2d8728e38a8f..33ea16b5cc19eb9c976b175396aad80bd4ff6062 100644 --- a/pypy/interpreter/typedef.py +++ b/pypy/interpreter/typedef.py @@ -8,9 +8,9 @@ from pypy.interpreter.gateway import interp2app, BuiltinCode, unwrap_spec,\ from pypy.interpreter.argument import Arguments from pypy.interpreter.baseobjspace import Wrappable, DescrMismatch from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.tool.sourcetools import compile2, func_with_new_name -from pypy.rlib.objectmodel import instantiate, compute_identity_hash, specialize -from pypy.rlib.jit import promote +from rpython.tool.sourcetools import compile2, func_with_new_name +from rpython.rlib.objectmodel import instantiate, compute_identity_hash, specialize +from rpython.rlib.jit import promote class TypeDef: def __init__(self, __name, __base=None, __total_ordering__=None, **rawdict): diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py index e445f841bd6822e94957512da41ec527f9dbcc65..efe535cbdb80a53414c038754b1666d51ef9ce05 100644 --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -1,6 +1,6 @@ from pypy.interpreter.error import OperationError -from pypy.rlib.objectmodel import specialize -from pypy.rlib import runicode +from rpython.rlib.objectmodel import specialize +from rpython.rlib import runicode from pypy.module._codecs import interp_codecs @specialize.memo() diff --git a/pypy/jit/backend/arm/test/test_zll_random.py b/pypy/jit/backend/arm/test/test_zll_random.py deleted file mode 100644 index b3795d22e913dc3339d4dcbd82b1f98809917b78..0000000000000000000000000000000000000000 --- a/pypy/jit/backend/arm/test/test_zll_random.py +++ /dev/null @@ -1,15 +0,0 @@ -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.test import test_ll_random -from pypy.jit.backend.test import test_random -from pypy.jit.backend.test.test_ll_random import LLtypeOperationBuilder -from pypy.jit.backend.test.test_random import check_random_function, Random -from pypy.jit.metainterp.resoperation import rop - -CPU = getcpuclass() - -def test_stress(): - cpu = CPU(None, None) - cpu.setup_once() - for i in range(100): - r = Random() - check_random_function(cpu, LLtypeOperationBuilder, r, i, 1000) diff --git a/pypy/jit/backend/autopath.py b/pypy/jit/backend/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/jit/backend/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/jit/backend/x86/autopath.py b/pypy/jit/backend/x86/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/jit/backend/x86/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/jit/backend/x86/test/test_calling_convention.py b/pypy/jit/backend/x86/test/test_calling_convention.py deleted file mode 100644 index 252882d8d65311dbba10ffa0909aea6813ffc231..0000000000000000000000000000000000000000 --- a/pypy/jit/backend/x86/test/test_calling_convention.py +++ /dev/null @@ -1 +0,0 @@ -from pypy.jit.backend.test.calling_convention_test import TestCallingConv diff --git a/pypy/jit/backend/x86/tool/autopath.py b/pypy/jit/backend/x86/tool/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/jit/backend/x86/tool/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/jit/metainterp/jitdriver.py b/pypy/jit/metainterp/jitdriver.py deleted file mode 100644 index bc4dccae9d1df82be34de447a1c54bf87f925ee0..0000000000000000000000000000000000000000 --- a/pypy/jit/metainterp/jitdriver.py +++ /dev/null @@ -1,34 +0,0 @@ - - -class JitDriverStaticData(object): - """There is one instance of this class per JitDriver used in the program. - """ - # This is just a container with the following attributes (... set by): - # self.jitdriver ... pypy.jit.metainterp.warmspot - # self.portal_graph ... pypy.jit.metainterp.warmspot - # self.portal_runner_ptr ... pypy.jit.metainterp.warmspot - # self.portal_runner_adr ... pypy.jit.metainterp.warmspot - # self.portal_calldescr ... pypy.jit.metainterp.warmspot - # self.num_green_args ... pypy.jit.metainterp.warmspot - # self.num_red_args ... pypy.jit.metainterp.warmspot - # self.red_args_types ... pypy.jit.metainterp.warmspot - # self.result_type ... pypy.jit.metainterp.warmspot - # self.virtualizable_info... pypy.jit.metainterp.warmspot - # self.greenfield_info ... pypy.jit.metainterp.warmspot - # self.warmstate ... pypy.jit.metainterp.warmspot - # self.handle_jitexc_from_bh pypy.jit.metainterp.warmspot - # self.no_loop_header ... pypy.jit.metainterp.warmspot - # self.portal_finishtoken... pypy.jit.metainterp.pyjitpl - # self.index ... pypy.jit.codewriter.call - # self.mainjitcode ... pypy.jit.codewriter.call - - # These attributes are read by the backend in CALL_ASSEMBLER: - # self.assembler_helper_adr - # self.index_of_virtualizable - # self.vable_token_descr - # self.portal_calldescr - - # warmspot sets extra attributes starting with '_' for its own use. - - def _freeze_(self): - return True diff --git a/pypy/jit/tl/autopath.py b/pypy/jit/tl/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/jit/tl/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/jit/tl/spli/autopath.py b/pypy/jit/tl/spli/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/jit/tl/spli/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/jit/tool/autopath.py b/pypy/jit/tool/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/jit/tool/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/module/__builtin__/abstractinst.py b/pypy/module/__builtin__/abstractinst.py index 011340f57a0b4d4651c869c842a7ad1ab4b24541..75130861de6b5db1d7871576265105fab0b80651 100644 --- a/pypy/module/__builtin__/abstractinst.py +++ b/pypy/module/__builtin__/abstractinst.py @@ -7,7 +7,7 @@ issubclass() follow and trust these attributes is they are present, in addition to checking for instances and subtypes in the normal way. """ -from pypy.rlib import jit +from rpython.rlib import jit from pypy.interpreter.error import OperationError from pypy.module.__builtin__.interp_classobj import W_ClassObject from pypy.module.__builtin__.interp_classobj import W_InstanceObject diff --git a/pypy/module/__builtin__/functional.py b/pypy/module/__builtin__/functional.py index 0a35ef7f6deabf28fb0c4ebd53d77a8dfc7afc79..b0c567ed4369409354d47c7176ed7e9c30ec4d15 100644 --- a/pypy/module/__builtin__/functional.py +++ b/pypy/module/__builtin__/functional.py @@ -7,10 +7,10 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter.typedef import TypeDef -from pypy.rlib import jit -from pypy.rlib.objectmodel import specialize -from pypy.rlib.rarithmetic import r_uint, intmask -from pypy.rlib.rbigint import rbigint +from rpython.rlib import jit +from rpython.rlib.objectmodel import specialize +from rpython.rlib.rarithmetic import r_uint, intmask +from rpython.rlib.rbigint import rbigint def get_len_of_range(space, lo, hi, step): diff --git a/pypy/module/__builtin__/interp_classobj.py b/pypy/module/__builtin__/interp_classobj.py index 2b7cbe5e0073d9794149944f515a5226bb492608..43d3c72ba319e40a131889822852c57091671ae6 100644 --- a/pypy/module/__builtin__/interp_classobj.py +++ b/pypy/module/__builtin__/interp_classobj.py @@ -4,9 +4,9 @@ from pypy.interpreter.gateway import interp2app from pypy.interpreter.typedef import TypeDef, make_weakref_descr from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import GetSetProperty, descr_get_dict, descr_set_dict -from pypy.rlib.objectmodel import compute_identity_hash -from pypy.rlib.debug import make_sure_not_resized -from pypy.rlib import jit +from rpython.rlib.objectmodel import compute_identity_hash +from rpython.rlib.debug import make_sure_not_resized +from rpython.rlib import jit def raise_type_err(space, argument, expected, w_obj): diff --git a/pypy/module/__builtin__/operation.py b/pypy/module/__builtin__/operation.py index 332df280fec28fbc540106095d27333394f7af61..812ca6c9aa19d7e13b3673a9502e5351f185e571 100644 --- a/pypy/module/__builtin__/operation.py +++ b/pypy/module/__builtin__/operation.py @@ -5,9 +5,9 @@ Interp-level implementation of the basic space operations. from pypy.interpreter import gateway from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import unwrap_spec, WrappedDefault -from pypy.rlib.runicode import UNICHR -from pypy.rlib.rfloat import isnan, isinf, round_double -from pypy.rlib import rfloat +from rpython.rlib.runicode import UNICHR +from rpython.rlib.rfloat import isnan, isinf, round_double +from rpython.rlib import rfloat import __builtin__ def abs(space, w_val): diff --git a/pypy/module/__builtin__/test/autopath.py b/pypy/module/__builtin__/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/module/__builtin__/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/module/__builtin__/test/test_apply.py b/pypy/module/__builtin__/test/test_apply.py index 4a0d5f3b988f77fa896e3347b81f85863cbaff86..3ea9c31084cf0d0bed451c280641009abf171af0 100644 --- a/pypy/module/__builtin__/test/test_apply.py +++ b/pypy/module/__builtin__/test/test_apply.py @@ -1,6 +1,3 @@ -import autopath - - # This is a very trivial series of tests. If apply is subtlely broken, # we will have to find out some other way. diff --git a/pypy/module/__builtin__/test/test_buffer.py b/pypy/module/__builtin__/test/test_buffer.py index 94e2af782660900c37c988071f2295f78812becb..9e4e83eb96419c4d62305455b8222c091da2182e 100644 --- a/pypy/module/__builtin__/test/test_buffer.py +++ b/pypy/module/__builtin__/test/test_buffer.py @@ -1,6 +1,5 @@ """Tests some behaviour of the buffer type that is not tested in lib-python/2.5.2/test/test_types.py where the stdlib buffer tests live.""" -import autopath class AppTestBuffer: spaceconfig = dict(usemodules=['array']) diff --git a/pypy/module/__builtin__/test/test_builtin.py b/pypy/module/__builtin__/test/test_builtin.py index de4cab3912a879de07413f974c15b7f3031faa63..e3e2766793515b999e60c4f730c35dd44c7f20f5 100644 --- a/pypy/module/__builtin__/test/test_builtin.py +++ b/pypy/module/__builtin__/test/test_builtin.py @@ -1,4 +1,3 @@ -import autopath import sys class AppTestBuiltinApp: @@ -670,7 +669,7 @@ class AppTestGetattrWithGetAttributeShortcut(AppTestGetattr): class TestInternal: def test_execfile(self, space): - from pypy.tool.udir import udir + from rpython.tool.udir import udir fn = str(udir.join('test_execfile')) f = open(fn, 'w') print >>f, "i=42" @@ -684,7 +683,7 @@ class TestInternal: assert space.eq_w(w_value, space.wrap(42)) def test_execfile_different_lineendings(self, space): - from pypy.tool.udir import udir + from rpython.tool.udir import udir d = udir.ensure('lineending', dir=1) dos = d.join('dos.py') f = dos.open('wb') diff --git a/pypy/module/__builtin__/test/test_descriptor.py b/pypy/module/__builtin__/test/test_descriptor.py index aaee08c2c632e571780cd7c3bfe7a483eb49f579..4066f13be2ae3f906e3020f3a59945bbc40901e5 100644 --- a/pypy/module/__builtin__/test/test_descriptor.py +++ b/pypy/module/__builtin__/test/test_descriptor.py @@ -1,6 +1,3 @@ -import autopath - - class AppTestBuiltinApp: def test_staticmethod(self): class C(object): diff --git a/pypy/module/__builtin__/test/test_filter.py b/pypy/module/__builtin__/test/test_filter.py index 0e0cb25f40abc533b2d9ce94063d12fba7645e19..a254d393115119dd917af1cdb35586fdf25a37ab 100644 --- a/pypy/module/__builtin__/test/test_filter.py +++ b/pypy/module/__builtin__/test/test_filter.py @@ -1,5 +1,3 @@ -import autopath - # trivial functions for testing class AppTestFilter: diff --git a/pypy/module/__builtin__/test/test_functional.py b/pypy/module/__builtin__/test/test_functional.py index 550618b22ac3c20746f1cf980312216a0fc5a20b..fd41e5534b2fc0d61598ca95817446482baaa44a 100644 --- a/pypy/module/__builtin__/test/test_functional.py +++ b/pypy/module/__builtin__/test/test_functional.py @@ -1,6 +1,3 @@ -import autopath - - class AppTestMap: def test_trivial_map_one_seq(self): diff --git a/pypy/module/__builtin__/test/test_minmax.py b/pypy/module/__builtin__/test/test_minmax.py index 20f8427bc1dc69e38be70d31d7f86c0c346fa9ca..915021f44bd182680cab1eb5540425fb9b14221e 100644 --- a/pypy/module/__builtin__/test/test_minmax.py +++ b/pypy/module/__builtin__/test/test_minmax.py @@ -1,5 +1,3 @@ -import autopath - class AppTestMin: def test_min_notseq(self): diff --git a/pypy/module/__builtin__/test/test_range.py b/pypy/module/__builtin__/test/test_range.py index cef86b4d9d4b2cac1ea20bd861a45bfde208aaea..2a8024040a6dbd766a478b3e93963482ca9e359c 100644 --- a/pypy/module/__builtin__/test/test_range.py +++ b/pypy/module/__builtin__/test/test_range.py @@ -1,5 +1,3 @@ -import autopath - class AppTestRange: def test_range_toofew(self): diff --git a/pypy/module/__builtin__/test/test_rawinput.py b/pypy/module/__builtin__/test/test_rawinput.py index 56ddabcbb9a5d18003009f8dd362d6e1ba0d9bc6..c7fd9481de8f490cb5f33c94d5f7b5b0c21f124f 100644 --- a/pypy/module/__builtin__/test/test_rawinput.py +++ b/pypy/module/__builtin__/test/test_rawinput.py @@ -1,6 +1,3 @@ -import autopath - - class AppTestRawInput(): def test_input_and_raw_input(self): diff --git a/pypy/module/__builtin__/test/test_reduce.py b/pypy/module/__builtin__/test/test_reduce.py index 023c9b8fa0523a8ed37576815325bedd2e0bf100..5dbb0c0a13252f87aa2c51862ba91eb60b400f38 100644 --- a/pypy/module/__builtin__/test/test_reduce.py +++ b/pypy/module/__builtin__/test/test_reduce.py @@ -1,6 +1,3 @@ -import autopath - - class AppTestReduce: def test_None(self): raises(TypeError, reduce, lambda x, y: x+y, [1,2,3], None) diff --git a/pypy/module/__builtin__/test/test_vars.py b/pypy/module/__builtin__/test/test_vars.py index bfd3d2d27131141f4c68d0276cf60825cb498896..5ef58e6bbf471108444b37045b7b05820febfbab 100644 --- a/pypy/module/__builtin__/test/test_vars.py +++ b/pypy/module/__builtin__/test/test_vars.py @@ -1,5 +1,3 @@ -import autopath - class AppTestVars: def test_vars_no_arguments(self): diff --git a/pypy/module/__builtin__/test/test_zip.py b/pypy/module/__builtin__/test/test_zip.py index 5dbe56c2a3870150640dbe658bc0fb8d0463a9af..78ba6c124a23508218421cf85f61a102da0033e4 100644 --- a/pypy/module/__builtin__/test/test_zip.py +++ b/pypy/module/__builtin__/test/test_zip.py @@ -1,5 +1,3 @@ -import autopath - class AppTestZip: def test_zip_no_arguments(self): diff --git a/pypy/module/__pypy__/__init__.py b/pypy/module/__pypy__/__init__.py index f68f2fc5db848a6945018c9a839854629ac75612..7edbd8c5d17caa051c51e39a73b8fa6e510742fe 100644 --- a/pypy/module/__pypy__/__init__.py +++ b/pypy/module/__pypy__/__init__.py @@ -71,6 +71,6 @@ class Module(MixedModule): PYC_MAGIC = get_pyc_magic(self.space) self.extra_interpdef('PYC_MAGIC', 'space.wrap(%d)' % PYC_MAGIC) # - from pypy.jit.backend import detect_cpu + from rpython.jit.backend import detect_cpu model = detect_cpu.autodetect_main_model_and_size() self.extra_interpdef('cpumodel', 'space.wrap(%r)' % model) diff --git a/pypy/module/__pypy__/interp_builders.py b/pypy/module/__pypy__/interp_builders.py index 4813f3519e9007a002b5114ae553cdba0ebf6e5c..49504dd0d95c463928cb51c0b4ee9bc98530d1ad 100644 --- a/pypy/module/__pypy__/interp_builders.py +++ b/pypy/module/__pypy__/interp_builders.py @@ -2,8 +2,8 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef -from pypy.rlib.rstring import UnicodeBuilder, StringBuilder -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.rstring import UnicodeBuilder, StringBuilder +from rpython.tool.sourcetools import func_with_new_name def create_builder(name, strtype, builder_cls): diff --git a/pypy/module/__pypy__/interp_debug.py b/pypy/module/__pypy__/interp_debug.py index 1d77175ea9d92c2c852a592aaf5ff99c50a3917f..80c6a05dad814efaa669ba44e6648a4cae34e7d7 100644 --- a/pypy/module/__pypy__/interp_debug.py +++ b/pypy/module/__pypy__/interp_debug.py @@ -1,5 +1,5 @@ from pypy.interpreter.gateway import unwrap_spec -from pypy.rlib import debug, jit +from rpython.rlib import debug, jit @jit.dont_look_inside diff --git a/pypy/module/__pypy__/interp_magic.py b/pypy/module/__pypy__/interp_magic.py index 023164eb20074cb92bf78489f58b360d0d690279..405200fae5fa4f0ae901839821eec87a4eaaa0a5 100644 --- a/pypy/module/__pypy__/interp_magic.py +++ b/pypy/module/__pypy__/interp_magic.py @@ -1,11 +1,11 @@ from pypy.interpreter.baseobjspace import ObjSpace, W_Root from pypy.interpreter.error import OperationError, wrap_oserror from pypy.interpreter.gateway import unwrap_spec -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.objectmodel import we_are_translated from pypy.objspace.std.listobject import W_ListObject from pypy.objspace.std.typeobject import MethodCache from pypy.objspace.std.mapdict import IndexCache -from pypy.rlib import rposix +from rpython.rlib import rposix def internal_repr(space, w_object): @@ -85,7 +85,7 @@ def validate_fd(space, fd): raise wrap_oserror(space, e) def get_console_cp(space): - from pypy.rlib import rwin32 # Windows only + from rpython.rlib import rwin32 # Windows only return space.newtuple([ space.wrap('cp%d' % rwin32.GetConsoleCP()), space.wrap('cp%d' % rwin32.GetConsoleOutputCP()), diff --git a/pypy/module/__pypy__/interp_time.py b/pypy/module/__pypy__/interp_time.py index ee5734f32831a303039752056f1d28a86b7dc096..89af0766948a182bebefe8ad752a6510d3fcb794 100644 --- a/pypy/module/__pypy__/interp_time.py +++ b/pypy/module/__pypy__/interp_time.py @@ -3,9 +3,9 @@ import sys from pypy.interpreter.error import exception_from_errno from pypy.interpreter.gateway import unwrap_spec -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rpython.tool import rffi_platform -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rtyper.tool import rffi_platform +from rpython.translator.tool.cbuild import ExternalCompilationInfo if sys.platform == 'linux2': libraries = ["rt"] diff --git a/pypy/module/__pypy__/test/test_debug.py b/pypy/module/__pypy__/test/test_debug.py index 2f2eddaf60ddb8abe76f14029318fc5c9b04bd05..cdd4384eab9d0c00ccf29d1e7a6b102759de74b1 100644 --- a/pypy/module/__pypy__/test/test_debug.py +++ b/pypy/module/__pypy__/test/test_debug.py @@ -1,7 +1,7 @@ import py from pypy.interpreter.gateway import interp2app -from pypy.rlib import debug +from rpython.rlib import debug class AppTestDebug: diff --git a/pypy/module/_cffi_backend/__init__.py b/pypy/module/_cffi_backend/__init__.py index 8cdaa04c0ca10aad2954177579f41bdee662c05b..1e9ab84dd379f72797cb230fc4baf547106e54d3 100644 --- a/pypy/module/_cffi_backend/__init__.py +++ b/pypy/module/_cffi_backend/__init__.py @@ -1,5 +1,5 @@ from pypy.interpreter.mixedmodule import MixedModule -from pypy.rlib import rdynload +from rpython.rlib import rdynload class Module(MixedModule): diff --git a/pypy/module/_cffi_backend/cbuffer.py b/pypy/module/_cffi_backend/cbuffer.py index 703a24ae78147e1a882378a4dda1776f51ba00e6..bf45668f99d73077773aaa20f3e475746043ccf1 100644 --- a/pypy/module/_cffi_backend/cbuffer.py +++ b/pypy/module/_cffi_backend/cbuffer.py @@ -3,7 +3,7 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.buffer import RWBuffer from pypy.interpreter.gateway import unwrap_spec, interp2app from pypy.interpreter.typedef import TypeDef -from pypy.rpython.lltypesystem import rffi +from rpython.rtyper.lltypesystem import rffi from pypy.module._cffi_backend import cdataobj, ctypeptr, ctypearray diff --git a/pypy/module/_cffi_backend/ccallback.py b/pypy/module/_cffi_backend/ccallback.py index 99e9ab455e170a334cf0a890ca2df91b316ecf28..7b5b1c33758bc18042af824603bdf6d8f3e9a173 100644 --- a/pypy/module/_cffi_backend/ccallback.py +++ b/pypy/module/_cffi_backend/ccallback.py @@ -3,10 +3,10 @@ Callbacks. """ import os from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rlib.objectmodel import compute_unique_id, keepalive_until_here -from pypy.rlib import clibffi, rweakref, rgc -from pypy.rlib.rarithmetic import r_ulonglong +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rlib.objectmodel import compute_unique_id, keepalive_until_here +from rpython.rlib import clibffi, rweakref, rgc +from rpython.rlib.rarithmetic import r_ulonglong from pypy.module._cffi_backend.cdataobj import W_CData from pypy.module._cffi_backend.ctypefunc import SIZE_OF_FFI_ARG, BIG_ENDIAN diff --git a/pypy/module/_cffi_backend/cdataobj.py b/pypy/module/_cffi_backend/cdataobj.py index 61e76f5e38c557074a701ef85c92a3cab24fe03b..c175e5b1cc102a5273babbeafb15f9a3fd3e5a0b 100644 --- a/pypy/module/_cffi_backend/cdataobj.py +++ b/pypy/module/_cffi_backend/cdataobj.py @@ -3,10 +3,10 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef, make_weakref_descr -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.objectmodel import keepalive_until_here, specialize -from pypy.rlib import objectmodel, rgc -from pypy.tool.sourcetools import func_with_new_name +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.objectmodel import keepalive_until_here, specialize +from rpython.rlib import objectmodel, rgc +from rpython.tool.sourcetools import func_with_new_name from pypy.module._cffi_backend import misc diff --git a/pypy/module/_cffi_backend/cerrno.py b/pypy/module/_cffi_backend/cerrno.py index 81c58e9f20e2da8c6c59de13e7da2a7280653289..1892562b4c701fc49c2d349fd1c9919f8c00770e 100644 --- a/pypy/module/_cffi_backend/cerrno.py +++ b/pypy/module/_cffi_backend/cerrno.py @@ -1,11 +1,11 @@ import sys -from pypy.rlib import rposix +from rpython.rlib import rposix from pypy.interpreter.executioncontext import ExecutionContext from pypy.interpreter.gateway import unwrap_spec WIN32 = sys.platform == 'win32' if WIN32: - from pypy.rlib import rwin32 + from rpython.rlib import rwin32 ExecutionContext._cffi_saved_errno = 0 diff --git a/pypy/module/_cffi_backend/ctypearray.py b/pypy/module/_cffi_backend/ctypearray.py index 4fc5bce75e6199531cdf77aecc5d7734c769360f..7fb3b3393560ee3cdbd43c63d274c3dfe873548a 100644 --- a/pypy/module/_cffi_backend/ctypearray.py +++ b/pypy/module/_cffi_backend/ctypearray.py @@ -6,9 +6,9 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.gateway import interp2app from pypy.interpreter.typedef import TypeDef -from pypy.rpython.lltypesystem import rffi -from pypy.rlib.objectmodel import keepalive_until_here -from pypy.rlib.rarithmetic import ovfcheck +from rpython.rtyper.lltypesystem import rffi +from rpython.rlib.objectmodel import keepalive_until_here +from rpython.rlib.rarithmetic import ovfcheck from pypy.module._cffi_backend.ctypeprim import W_CTypePrimitiveChar from pypy.module._cffi_backend.ctypeprim import W_CTypePrimitiveUniChar diff --git a/pypy/module/_cffi_backend/ctypeenum.py b/pypy/module/_cffi_backend/ctypeenum.py index 40b5ad9a7bbb340d520f6ac85f73a413437ad6f5..d9113c3deb5f037424da3583c734bf7440b7a133 100644 --- a/pypy/module/_cffi_backend/ctypeenum.py +++ b/pypy/module/_cffi_backend/ctypeenum.py @@ -3,9 +3,9 @@ Enums. """ from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rpython.lltypesystem import rffi -from pypy.rlib.rarithmetic import intmask, r_ulonglong -from pypy.rlib.objectmodel import keepalive_until_here +from rpython.rtyper.lltypesystem import rffi +from rpython.rlib.rarithmetic import intmask, r_ulonglong +from rpython.rlib.objectmodel import keepalive_until_here from pypy.module._cffi_backend.ctypeprim import W_CTypePrimitiveSigned from pypy.module._cffi_backend import misc diff --git a/pypy/module/_cffi_backend/ctypefunc.py b/pypy/module/_cffi_backend/ctypefunc.py index 47449203fb6a43bc763b640f42d47b8edfc9acbc..3a6b18ae6b95c95c175984871a1775bd71950a25 100644 --- a/pypy/module/_cffi_backend/ctypefunc.py +++ b/pypy/module/_cffi_backend/ctypefunc.py @@ -4,13 +4,13 @@ Function pointers. import sys from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rlib import jit, clibffi, jit_libffi -from pypy.rlib.jit_libffi import CIF_DESCRIPTION, CIF_DESCRIPTION_P -from pypy.rlib.jit_libffi import FFI_TYPE, FFI_TYPE_P, FFI_TYPE_PP -from pypy.rlib.jit_libffi import SIZE_OF_FFI_ARG -from pypy.rlib.objectmodel import we_are_translated, instantiate -from pypy.rlib.objectmodel import keepalive_until_here +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rlib import jit, clibffi, jit_libffi +from rpython.rlib.jit_libffi import CIF_DESCRIPTION, CIF_DESCRIPTION_P +from rpython.rlib.jit_libffi import FFI_TYPE, FFI_TYPE_P, FFI_TYPE_PP +from rpython.rlib.jit_libffi import SIZE_OF_FFI_ARG +from rpython.rlib.objectmodel import we_are_translated, instantiate +from rpython.rlib.objectmodel import keepalive_until_here from pypy.module._cffi_backend.ctypeobj import W_CType from pypy.module._cffi_backend.ctypeptr import W_CTypePtrBase, W_CTypePointer diff --git a/pypy/module/_cffi_backend/ctypeobj.py b/pypy/module/_cffi_backend/ctypeobj.py index 9962f904356f6172ad042663b44595ec09eb459a..17a31ed3b116fad07611d6fd30e3c78339e5c901 100644 --- a/pypy/module/_cffi_backend/ctypeobj.py +++ b/pypy/module/_cffi_backend/ctypeobj.py @@ -4,8 +4,8 @@ from pypy.interpreter.gateway import interp2app from pypy.interpreter.typedef import TypeDef from pypy.interpreter.typedef import make_weakref_descr from pypy.interpreter.typedef import GetSetProperty, interp_attrproperty -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rlib.objectmodel import we_are_translated +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rlib.objectmodel import we_are_translated from pypy.module._cffi_backend import cdataobj diff --git a/pypy/module/_cffi_backend/ctypeprim.py b/pypy/module/_cffi_backend/ctypeprim.py index bfcf82bb83f7241d744f28d3bf00e70fab3f7b85..547bb5522c9fc97f4889dc522b5bfd457ae9af6a 100644 --- a/pypy/module/_cffi_backend/ctypeprim.py +++ b/pypy/module/_cffi_backend/ctypeprim.py @@ -3,10 +3,10 @@ Primitives. """ from pypy.interpreter.error import operationerrfmt -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.rarithmetic import r_uint, r_ulonglong, intmask -from pypy.rlib.objectmodel import keepalive_until_here -from pypy.rlib import jit +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.rarithmetic import r_uint, r_ulonglong, intmask +from rpython.rlib.objectmodel import keepalive_until_here +from rpython.rlib import jit from pypy.module._cffi_backend.ctypeobj import W_CType from pypy.module._cffi_backend import cdataobj, misc diff --git a/pypy/module/_cffi_backend/ctypeptr.py b/pypy/module/_cffi_backend/ctypeptr.py index c62559bcaa84ca0a05a30916bfd2d956de335d2b..f8ba7678d7268594e4834e87577dd519b7854d03 100644 --- a/pypy/module/_cffi_backend/ctypeptr.py +++ b/pypy/module/_cffi_backend/ctypeptr.py @@ -4,10 +4,10 @@ Pointers. from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.error import wrap_oserror -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.objectmodel import keepalive_until_here -from pypy.rlib.rarithmetic import ovfcheck -from pypy.rlib import rposix +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.objectmodel import keepalive_until_here +from rpython.rlib.rarithmetic import ovfcheck +from rpython.rlib import rposix from pypy.module._cffi_backend.ctypeobj import W_CType from pypy.module._cffi_backend import cdataobj, misc, ctypeprim, ctypevoid diff --git a/pypy/module/_cffi_backend/ctypestruct.py b/pypy/module/_cffi_backend/ctypestruct.py index be89e3a9438da4676ff025a7a1ce9a414a3fa9ea..2b4d76692352d29d2f6de4031a1f275863a62d56 100644 --- a/pypy/module/_cffi_backend/ctypestruct.py +++ b/pypy/module/_cffi_backend/ctypestruct.py @@ -3,12 +3,12 @@ Struct and unions. """ from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef, interp_attrproperty -from pypy.rlib.objectmodel import keepalive_until_here -from pypy.rlib.rarithmetic import r_uint, r_ulonglong, r_longlong, intmask -from pypy.rlib import jit +from rpython.rlib.objectmodel import keepalive_until_here +from rpython.rlib.rarithmetic import r_uint, r_ulonglong, r_longlong, intmask +from rpython.rlib import jit from pypy.module._cffi_backend.ctypeobj import W_CType from pypy.module._cffi_backend import cdataobj, ctypeprim, misc diff --git a/pypy/module/_cffi_backend/libraryobj.py b/pypy/module/_cffi_backend/libraryobj.py index 4403402aeadc3b81a11f574bde104d629bead6a2..4f987388f58df2d34fe4151f011db6fab8f15fa9 100644 --- a/pypy/module/_cffi_backend/libraryobj.py +++ b/pypy/module/_cffi_backend/libraryobj.py @@ -3,8 +3,8 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.rdynload import DLLHANDLE, dlopen, dlsym, dlclose, DLOpenError +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.rdynload import DLLHANDLE, dlopen, dlsym, dlclose, DLOpenError from pypy.module._cffi_backend.cdataobj import W_CData from pypy.module._cffi_backend.ctypeobj import W_CType diff --git a/pypy/module/_cffi_backend/misc.py b/pypy/module/_cffi_backend/misc.py index ec8b9ea24bd1b8a4b56cb9c53a3f8abd5ac1917e..b1ab74872bc8824bdb4ef47130cb627d6780d3be 100644 --- a/pypy/module/_cffi_backend/misc.py +++ b/pypy/module/_cffi_backend/misc.py @@ -1,11 +1,11 @@ from __future__ import with_statement from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rlib.rarithmetic import r_uint, r_ulonglong, is_signed_integer_type -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.objectmodel import keepalive_until_here, specialize -from pypy.rlib import jit -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rlib.rarithmetic import r_uint, r_ulonglong, is_signed_integer_type +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.objectmodel import keepalive_until_here, specialize +from rpython.rlib import jit +from rpython.translator.tool.cbuild import ExternalCompilationInfo # ____________________________________________________________ diff --git a/pypy/module/_cffi_backend/newtype.py b/pypy/module/_cffi_backend/newtype.py index ca4d0384af6a517bc80faac4f7f3ac9835904d5a..521436f07466b053bcdbb27da92b3473c8362f42 100644 --- a/pypy/module/_cffi_backend/newtype.py +++ b/pypy/module/_cffi_backend/newtype.py @@ -1,8 +1,8 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.gateway import unwrap_spec -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.rarithmetic import ovfcheck -from pypy.rlib.objectmodel import specialize +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.rarithmetic import ovfcheck +from rpython.rlib.objectmodel import specialize from pypy.module._cffi_backend import ctypeobj, ctypeprim, ctypeptr, ctypearray from pypy.module._cffi_backend import ctypestruct, ctypevoid, ctypeenum diff --git a/pypy/module/_cffi_backend/test/test_c.py b/pypy/module/_cffi_backend/test/test_c.py index 924baf27da05926db7ea3fab0d873f27c26aef12..0618e7c8c27a1a24e84c2d0ef40d1dff061a9ffc 100644 --- a/pypy/module/_cffi_backend/test/test_c.py +++ b/pypy/module/_cffi_backend/test/test_c.py @@ -19,11 +19,11 @@ import py, sys, ctypes if sys.version_info < (2, 6): py.test.skip("requires the b'' literal syntax") -from pypy.tool.udir import udir +from rpython.tool.udir import udir from pypy.interpreter import gateway from pypy.module._cffi_backend import Module -from pypy.translator.platform import host -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.translator.platform import host +from rpython.translator.tool.cbuild import ExternalCompilationInfo class AppTestC(object): diff --git a/pypy/module/_cffi_backend/test/test_ztranslation.py b/pypy/module/_cffi_backend/test/test_ztranslation.py index 69a5c7af1f421897bc99b97b19063a69db26b7fa..739e40addcf01303cf2af43c042b5c1defbe01a8 100644 --- a/pypy/module/_cffi_backend/test/test_ztranslation.py +++ b/pypy/module/_cffi_backend/test/test_ztranslation.py @@ -1,6 +1,6 @@ from pypy.objspace.fake.checkmodule import checkmodule from pypy.module._cffi_backend import ctypeptr -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi # side-effect: FORMAT_LONGDOUBLE must be built before test_checkmodule() from pypy.module._cffi_backend import misc diff --git a/pypy/module/_codecs/__init__.py b/pypy/module/_codecs/__init__.py index b6080ef96da1d873a260542ffed3856d1b80afd6..04965e87b89ab71e1f7f58441d7c4813546225b8 100644 --- a/pypy/module/_codecs/__init__.py +++ b/pypy/module/_codecs/__init__.py @@ -1,5 +1,5 @@ from pypy.interpreter.mixedmodule import MixedModule -from pypy.rlib import runicode +from rpython.rlib import runicode from pypy.module._codecs import interp_codecs class Module(MixedModule): diff --git a/pypy/module/_codecs/interp_codecs.py b/pypy/module/_codecs/interp_codecs.py index 94fbe326c028506bc4ee03a1a5767fdd6fbadf12..0d78271870ec0c9c848a43b3efd7ad25d4f0867a 100644 --- a/pypy/module/_codecs/interp_codecs.py +++ b/pypy/module/_codecs/interp_codecs.py @@ -1,7 +1,7 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault -from pypy.rlib.rstring import UnicodeBuilder -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.rstring import UnicodeBuilder +from rpython.rlib.objectmodel import we_are_translated class CodecState(object): def __init__(self, space): @@ -352,7 +352,7 @@ def register_error(space, errors, w_handler): # ____________________________________________________________ # delegation to runicode -from pypy.rlib import runicode +from rpython.rlib import runicode def make_encoder_wrapper(name): rname = "unicode_encode_%s" % (name.replace("_encode", ""), ) diff --git a/pypy/module/_codecs/test/autopath.py b/pypy/module/_codecs/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/module/_codecs/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/module/_codecs/test/test_codecs.py b/pypy/module/_codecs/test/test_codecs.py index 7b808a76dc1cf6d5cad9309f446a61803b8e4551..e6b3e480c655ff4f13c0547b3ee7258b7abbf117 100644 --- a/pypy/module/_codecs/test/test_codecs.py +++ b/pypy/module/_codecs/test/test_codecs.py @@ -1,6 +1,3 @@ -import autopath - - class AppTestCodecs: spaceconfig = { "usemodules": ['unicodedata', 'struct', 'binascii'], diff --git a/pypy/module/_collections/interp_deque.py b/pypy/module/_collections/interp_deque.py index b32aaaa091b1ba2b2e32e617b3a56bfdf9833bc4..85d459e8f4f09fc16b17932242cf6fd1aa6f9a5a 100644 --- a/pypy/module/_collections/interp_deque.py +++ b/pypy/module/_collections/interp_deque.py @@ -5,7 +5,7 @@ from pypy.interpreter.typedef import TypeDef, make_weakref_descr from pypy.interpreter.typedef import GetSetProperty from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import OperationError -from pypy.rlib.debug import check_nonneg +from rpython.rlib.debug import check_nonneg # A `dequeobject` is composed of a doubly-linked list of `block` nodes. diff --git a/pypy/module/_continuation/interp_continuation.py b/pypy/module/_continuation/interp_continuation.py index ee7b4a3c70ec97efcf16cf9bf996ffdc7832834a..075cb56331e87195e2a5e1828b5d71cb46e7bc81 100644 --- a/pypy/module/_continuation/interp_continuation.py +++ b/pypy/module/_continuation/interp_continuation.py @@ -1,5 +1,5 @@ -from pypy.rlib.rstacklet import StackletThread -from pypy.rlib import jit +from rpython.rlib.rstacklet import StackletThread +from rpython.rlib import jit from pypy.interpreter.error import OperationError from pypy.interpreter.executioncontext import ExecutionContext from pypy.interpreter.baseobjspace import Wrappable @@ -206,7 +206,7 @@ class SThread(StackletThread): self.space = space self.ec = ec # for unpickling - from pypy.rlib.rweakref import RWeakKeyDictionary + from rpython.rlib.rweakref import RWeakKeyDictionary self.frame2continulet = RWeakKeyDictionary(PyFrame, W_Continulet) ExecutionContext.stacklet_thread = None diff --git a/pypy/module/_continuation/interp_pickle.py b/pypy/module/_continuation/interp_pickle.py index 1d66e780b52708241162becb5815de8c8cde2183..bc0ef6ca5a6dee1f09b35b081ddbc4717b56aa3b 100644 --- a/pypy/module/_continuation/interp_pickle.py +++ b/pypy/module/_continuation/interp_pickle.py @@ -1,5 +1,5 @@ -from pypy.tool import stdlib_opcode as pythonopcode -from pypy.rlib import jit +from rpython.tool import stdlib_opcode as pythonopcode +from rpython.rlib import jit from pypy.interpreter.error import OperationError from pypy.interpreter.pyframe import PyFrame from pypy.module._continuation.interp_continuation import State, global_state diff --git a/pypy/module/_continuation/test/support.py b/pypy/module/_continuation/test/support.py index 6c6de9348b8dc7955a8fede30436370061a43f72..166a2f86859570a9df360f129f550af23aaaf709 100644 --- a/pypy/module/_continuation/test/support.py +++ b/pypy/module/_continuation/test/support.py @@ -1,5 +1,5 @@ import py -from pypy.rpython.tool.rffi_platform import CompilationError +from rpython.rtyper.tool.rffi_platform import CompilationError class BaseAppTest: @@ -7,7 +7,7 @@ class BaseAppTest: def setup_class(cls): try: - import pypy.rlib.rstacklet + import rpython.rlib.rstacklet except CompilationError, e: py.test.skip("cannot import rstacklet: %s" % e) diff --git a/pypy/module/_csv/interp_reader.py b/pypy/module/_csv/interp_reader.py index 6bccaea35ab72c9223c6aa86c676a0bcb0ca45f3..a6ae739d99ea49b4ef31585795fcd5871b9f632f 100644 --- a/pypy/module/_csv/interp_reader.py +++ b/pypy/module/_csv/interp_reader.py @@ -1,4 +1,4 @@ -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.rstring import StringBuilder from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import unwrap_spec diff --git a/pypy/module/_csv/interp_writer.py b/pypy/module/_csv/interp_writer.py index 41876812a4b91f5d11550e577969246bb38896c3..00564f3ef210018626756476da15a0271316f1ce 100644 --- a/pypy/module/_csv/interp_writer.py +++ b/pypy/module/_csv/interp_writer.py @@ -1,4 +1,4 @@ -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.rstring import StringBuilder from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.error import OperationError from pypy.interpreter.typedef import TypeDef, interp2app diff --git a/pypy/module/_demo/demo.py b/pypy/module/_demo/demo.py index ef26aa208f118929c69737e170b42775404c22de..9fa5811f9109b3aa1ea516c144024229d4c4c556 100644 --- a/pypy/module/_demo/demo.py +++ b/pypy/module/_demo/demo.py @@ -2,9 +2,9 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef, GetSetProperty -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rpython.tool import rffi_platform -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rtyper.tool import rffi_platform +from rpython.translator.tool.cbuild import ExternalCompilationInfo import sys, math time_t = rffi_platform.getsimpletype('time_t', '#include ', rffi.LONG) diff --git a/pypy/module/_ffi/interp_ffitype.py b/pypy/module/_ffi/interp_ffitype.py index 834320e2f6f9729756f79d94124a6f9279a2237c..d509438e1e28d99d94e3bae8b5c346a1711d8fbc 100644 --- a/pypy/module/_ffi/interp_ffitype.py +++ b/pypy/module/_ffi/interp_ffitype.py @@ -1,6 +1,6 @@ -from pypy.rlib import libffi, clibffi -from pypy.rlib.rarithmetic import intmask -from pypy.rlib import jit +from rpython.rlib import libffi, clibffi +from rpython.rlib.rarithmetic import intmask +from rpython.rlib import jit from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef, interp_attrproperty from pypy.interpreter.gateway import interp2app diff --git a/pypy/module/_ffi/interp_funcptr.py b/pypy/module/_ffi/interp_funcptr.py index 4fd4fe5bb8a856045e11b6faee7c2a7cc6a9095a..b94269656daa6762a4e3f651be9f124140d7e7fb 100644 --- a/pypy/module/_ffi/interp_funcptr.py +++ b/pypy/module/_ffi/interp_funcptr.py @@ -5,14 +5,14 @@ from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef from pypy.module._ffi.interp_ffitype import W_FFIType # -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi # -from pypy.rlib import jit -from pypy.rlib import libffi -from pypy.rlib.clibffi import get_libc_name, StackCheckError, LibFFIError -from pypy.rlib.rdynload import DLOpenError -from pypy.rlib.rarithmetic import intmask, r_uint -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib import jit +from rpython.rlib import libffi +from rpython.rlib.clibffi import get_libc_name, StackCheckError, LibFFIError +from rpython.rlib.rdynload import DLOpenError +from rpython.rlib.rarithmetic import intmask, r_uint +from rpython.rlib.objectmodel import we_are_translated from pypy.module._ffi.type_converter import FromAppLevelConverter, ToAppLevelConverter from pypy.module._rawffi.interp_rawffi import got_libffi_error diff --git a/pypy/module/_ffi/interp_struct.py b/pypy/module/_ffi/interp_struct.py index ad33e81d85a3da79cca6560ab1aed71d24669134..1195bd4f5de77fab18f6c52ab8b7f40bcd88c430 100644 --- a/pypy/module/_ffi/interp_struct.py +++ b/pypy/module/_ffi/interp_struct.py @@ -1,9 +1,9 @@ -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib import clibffi -from pypy.rlib import libffi -from pypy.rlib import jit -from pypy.rlib.rgc import must_be_light_finalizer -from pypy.rlib.rarithmetic import r_uint, r_ulonglong, r_singlefloat, intmask +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib import clibffi +from rpython.rlib import libffi +from rpython.rlib import jit +from rpython.rlib.rgc import must_be_light_finalizer +from rpython.rlib.rarithmetic import r_uint, r_ulonglong, r_singlefloat, intmask from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef, interp_attrproperty from pypy.interpreter.gateway import interp2app, unwrap_spec diff --git a/pypy/module/_ffi/test/test_funcptr.py b/pypy/module/_ffi/test/test_funcptr.py index 479e6e117410bf6084ef30f7ffeb0930606da576..e23671defcbe48fdb1fa56011335370f6f50442a 100644 --- a/pypy/module/_ffi/test/test_funcptr.py +++ b/pypy/module/_ffi/test/test_funcptr.py @@ -1,8 +1,8 @@ -from pypy.rpython.lltypesystem import rffi -from pypy.rlib.clibffi import get_libc_name -from pypy.rlib.libffi import types -from pypy.rlib.libffi import CDLL -from pypy.rlib.test.test_clibffi import get_libm_name +from rpython.rtyper.lltypesystem import rffi +from rpython.rlib.clibffi import get_libc_name +from rpython.rlib.libffi import types +from rpython.rlib.libffi import CDLL +from rpython.rlib.test.test_clibffi import get_libm_name import sys, py @@ -11,9 +11,9 @@ class BaseAppTestFFI(object): @classmethod def prepare_c_example(cls): - from pypy.tool.udir import udir - from pypy.translator.tool.cbuild import ExternalCompilationInfo - from pypy.translator.platform import platform + from rpython.tool.udir import udir + from rpython.translator.tool.cbuild import ExternalCompilationInfo + from rpython.translator.platform import platform c_file = udir.ensure("test__ffi", dir=1).join("foolib.c") # automatically collect the C source from the docstrings of the tests diff --git a/pypy/module/_ffi/test/test_struct.py b/pypy/module/_ffi/test/test_struct.py index 7dc77c926ca4cd2fe6d33df33085733b47463c5a..68a9eb1dc72adbf8432c1e2d8cfe70e6c6f6b478 100644 --- a/pypy/module/_ffi/test/test_struct.py +++ b/pypy/module/_ffi/test/test_struct.py @@ -58,9 +58,9 @@ class AppTestStruct(BaseAppTestFFI): else: cls.w_read_raw_mem = cls.space.wrap(interp2app(read_raw_mem)) # - from pypy.rlib import clibffi - from pypy.rlib.rarithmetic import r_uint - from pypy.rpython.lltypesystem import lltype, rffi + from rpython.rlib import clibffi + from rpython.rlib.rarithmetic import r_uint + from rpython.rtyper.lltypesystem import lltype, rffi dummy_type = lltype.malloc(clibffi.FFI_TYPE_P.TO, flavor='raw') dummy_type.c_size = r_uint(123) dummy_type.c_alignment = rffi.cast(rffi.USHORT, 0) diff --git a/pypy/module/_ffi/test/test_type_converter.py b/pypy/module/_ffi/test/test_type_converter.py index 018d0d206a8100b2f682d2301a6ba6dfec03d905..1fd6a44de11060f25e179ee8619e91517afc7418 100644 --- a/pypy/module/_ffi/test/test_type_converter.py +++ b/pypy/module/_ffi/test/test_type_converter.py @@ -1,6 +1,6 @@ import sys -from pypy.rlib.rarithmetic import r_uint, r_singlefloat, r_longlong, r_ulonglong -from pypy.rlib.libffi import IS_32_BIT +from rpython.rlib.rarithmetic import r_uint, r_singlefloat, r_longlong, r_ulonglong +from rpython.rlib.libffi import IS_32_BIT from pypy.module._ffi.interp_ffitype import app_types, descr_new_pointer from pypy.module._ffi.type_converter import FromAppLevelConverter, ToAppLevelConverter diff --git a/pypy/module/_ffi/type_converter.py b/pypy/module/_ffi/type_converter.py index 36c38e8f4fee46e00b883a663cdecf39484fcc45..a7a36a4d665709dad61b87ad9d243874d0406e8e 100644 --- a/pypy/module/_ffi/type_converter.py +++ b/pypy/module/_ffi/type_converter.py @@ -1,7 +1,7 @@ -from pypy.rlib import libffi -from pypy.rlib import jit -from pypy.rlib.rarithmetic import intmask, r_uint -from pypy.rpython.lltypesystem import rffi +from rpython.rlib import libffi +from rpython.rlib import jit +from rpython.rlib.rarithmetic import intmask, r_uint +from rpython.rtyper.lltypesystem import rffi from pypy.interpreter.error import operationerrfmt, OperationError from pypy.module._rawffi.structure import W_StructureInstance, W_Structure from pypy.module._ffi.interp_ffitype import app_types @@ -73,7 +73,7 @@ class FromAppLevelConverter(object): def _singlefloat(self, w_ffitype, w_obj): # a separate function, which can be seen by the jit or not, # depending on whether singlefloats are supported - from pypy.rlib.rarithmetic import r_singlefloat + from rpython.rlib.rarithmetic import r_singlefloat floatval = self.space.float_w(w_obj) singlefloatval = r_singlefloat(floatval) self.handle_singlefloat(w_ffitype, w_obj, singlefloatval) diff --git a/pypy/module/_file/interp_file.py b/pypy/module/_file/interp_file.py index 2660002c0b676325e2e46d426785bc34c0adf9fb..6bf5c2c44d16bb6cc7dd0152f05f57db68972a01 100644 --- a/pypy/module/_file/interp_file.py +++ b/pypy/module/_file/interp_file.py @@ -2,9 +2,9 @@ import py import os import stat import errno -from pypy.rlib import streamio -from pypy.rlib.rarithmetic import r_longlong -from pypy.rlib.rstring import StringBuilder +from rpython.rlib import streamio +from rpython.rlib.rarithmetic import r_longlong +from rpython.rlib.rstring import StringBuilder from pypy.module._file.interp_stream import W_AbstractStream, StreamErrors from pypy.module.posix.interp_posix import dispatch_filename from pypy.interpreter.error import OperationError, operationerrfmt diff --git a/pypy/module/_file/interp_stream.py b/pypy/module/_file/interp_stream.py index 7b7712a8925801060de9bcdc8779bb1a9f6bd6f8..9cd6fc73cb53b9c6238d83fa86846146c1066f20 100644 --- a/pypy/module/_file/interp_stream.py +++ b/pypy/module/_file/interp_stream.py @@ -1,6 +1,6 @@ import py -from pypy.rlib import streamio -from pypy.rlib.streamio import StreamErrors +from rpython.rlib import streamio +from rpython.rlib.streamio import StreamErrors from pypy.interpreter.error import OperationError from pypy.interpreter.baseobjspace import ObjSpace, Wrappable diff --git a/pypy/module/_file/test/test_file.py b/pypy/module/_file/test/test_file.py index 201705fc669247d2975274f9d8c9f3481049cd54..85c60dd2b15c301b26e0a9cf393dbce173f2fbaa 100644 --- a/pypy/module/_file/test/test_file.py +++ b/pypy/module/_file/test/test_file.py @@ -444,7 +444,7 @@ class AppTestFile25: def test_flush_at_exit(): from pypy import conftest from pypy.tool.option import make_config, make_objspace - from pypy.tool.udir import udir + from rpython.tool.udir import udir tmpfile = udir.join('test_flush_at_exit') config = make_config(conftest.option) diff --git a/pypy/module/_file/test/test_file_extra.py b/pypy/module/_file/test/test_file_extra.py index 7b495e95067ca0bcda2234f31994964c2c2a78b9..65129a5e63200bde867b0e2825e4552c3884c537 100644 --- a/pypy/module/_file/test/test_file_extra.py +++ b/pypy/module/_file/test/test_file_extra.py @@ -1,8 +1,8 @@ import os, random, sys -import pypy.tool.udir +import rpython.tool.udir import py -udir = pypy.tool.udir.udir.ensure('test_file_extra', dir=1) +udir = rpython.tool.udir.udir.ensure('test_file_extra', dir=1) # XXX this file is a random test. It may only fail occasionally diff --git a/pypy/module/_hashlib/__init__.py b/pypy/module/_hashlib/__init__.py index 3fb4dba46706e94c0db342825308dd9b949c6fab..d331ba8d04abee8a9280728ec54165c5b83b072a 100644 --- a/pypy/module/_hashlib/__init__.py +++ b/pypy/module/_hashlib/__init__.py @@ -14,5 +14,5 @@ class Module(MixedModule): interpleveldefs['openssl_' + name] = 'interp_hashlib.new_' + name def startup(self, space): - from pypy.rlib.ropenssl import init_digests + from rpython.rlib.ropenssl import init_digests init_digests() diff --git a/pypy/module/_hashlib/interp_hashlib.py b/pypy/module/_hashlib/interp_hashlib.py index 6e434c22481ca9193c1fbb9f34246910cd38a9b3..bff6702794f4c5cc49d14d7c04c29ad739f85541 100644 --- a/pypy/module/_hashlib/interp_hashlib.py +++ b/pypy/module/_hashlib/interp_hashlib.py @@ -2,12 +2,12 @@ from __future__ import with_statement from pypy.interpreter.gateway import unwrap_spec, interp2app from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.error import OperationError -from pypy.tool.sourcetools import func_renamer +from rpython.tool.sourcetools import func_renamer from pypy.interpreter.baseobjspace import Wrappable -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rlib import rgc, ropenssl -from pypy.rlib.objectmodel import keepalive_until_here -from pypy.rlib.rstring import StringBuilder +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rlib import rgc, ropenssl +from rpython.rlib.objectmodel import keepalive_until_here +from rpython.rlib.rstring import StringBuilder from pypy.module.thread.os_lock import Lock algorithms = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512') diff --git a/pypy/module/_io/interp_bufferedio.py b/pypy/module/_io/interp_bufferedio.py index abb786e990f300f98fb2d9c62c0263b28753464a..c7800b3caad33cab6b05bcb14f977d33db8d4e5a 100644 --- a/pypy/module/_io/interp_bufferedio.py +++ b/pypy/module/_io/interp_bufferedio.py @@ -4,10 +4,10 @@ from pypy.interpreter.typedef import ( from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.buffer import RWBuffer -from pypy.rlib.rstring import StringBuilder -from pypy.rlib.rarithmetic import r_longlong, intmask -from pypy.rlib import rposix -from pypy.tool.sourcetools import func_renamer +from rpython.rlib.rstring import StringBuilder +from rpython.rlib.rarithmetic import r_longlong, intmask +from rpython.rlib import rposix +from rpython.tool.sourcetools import func_renamer from pypy.module._io.interp_iobase import ( W_IOBase, DEFAULT_BUFFER_SIZE, convert_size, check_readable_w, check_writable_w, check_seekable_w) diff --git a/pypy/module/_io/interp_bytesio.py b/pypy/module/_io/interp_bytesio.py index 8be80471a40d7c0064b43433fdb15e421fd77d50..0519ea76662f931bcdeb86b250609e50e9b23ec7 100644 --- a/pypy/module/_io/interp_bytesio.py +++ b/pypy/module/_io/interp_bytesio.py @@ -2,13 +2,13 @@ from pypy.interpreter.typedef import ( TypeDef, generic_new_descr, GetSetProperty) from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rlib.rarithmetic import r_longlong +from rpython.rlib.rarithmetic import r_longlong from pypy.module._io.interp_bufferedio import W_BufferedIOBase from pypy.module._io.interp_iobase import convert_size import sys def buffer2string(buffer, start, end): - from pypy.rlib.rstring import StringBuilder + from rpython.rlib.rstring import StringBuilder builder = StringBuilder(end - start) for i in range(start, end): builder.append(buffer[i]) diff --git a/pypy/module/_io/interp_fileio.py b/pypy/module/_io/interp_fileio.py index 8784535be1e94d82d870a663f42f46fcc07f7720..7b502eae6a05c330db388631195bd4b4ad32c825 100644 --- a/pypy/module/_io/interp_fileio.py +++ b/pypy/module/_io/interp_fileio.py @@ -1,8 +1,8 @@ from pypy.interpreter.typedef import TypeDef, interp_attrproperty, GetSetProperty from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import OperationError, wrap_oserror, wrap_oserror2 -from pypy.rlib.rarithmetic import r_longlong -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.rarithmetic import r_longlong +from rpython.rlib.rstring import StringBuilder from os import O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_TRUNC import sys, os, stat, errno from pypy.module._io.interp_iobase import W_RawIOBase, convert_size @@ -401,7 +401,7 @@ class W_FileIO(W_RawIOBase): if sys.platform == "win32": def _truncate(self, size): - from pypy.rlib.streamio import ftruncate_win32 + from rpython.rlib.streamio import ftruncate_win32 ftruncate_win32(self.fd, size) else: def _truncate(self, size): diff --git a/pypy/module/_io/interp_io.py b/pypy/module/_io/interp_io.py index cb6165d0931bdfb10381968c3ffb95e20179ccb3..81ec63947e8dacb50278fbae65e9356bef121821 100644 --- a/pypy/module/_io/interp_io.py +++ b/pypy/module/_io/interp_io.py @@ -7,7 +7,7 @@ from pypy.interpreter.typedef import ( from pypy.module.exceptions.interp_exceptions import W_IOError from pypy.module._io.interp_fileio import W_FileIO from pypy.module._io.interp_textio import W_TextIOWrapper -from pypy.rpython.module.ll_os_stat import STAT_FIELD_TYPES +from rpython.rtyper.module.ll_os_stat import STAT_FIELD_TYPES class W_BlockingIOError(W_IOError): diff --git a/pypy/module/_io/interp_iobase.py b/pypy/module/_io/interp_iobase.py index dc3ad565ea9b66c1e25595c8d7129a1a2719f4b7..f1775b403c4c0e341db7396ee596b63614a57416 100644 --- a/pypy/module/_io/interp_iobase.py +++ b/pypy/module/_io/interp_iobase.py @@ -4,8 +4,8 @@ from pypy.interpreter.typedef import ( make_weakref_descr) from pypy.interpreter.gateway import interp2app from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rlib.rstring import StringBuilder -from pypy.rlib import rweakref +from rpython.rlib.rstring import StringBuilder +from rpython.rlib import rweakref DEFAULT_BUFFER_SIZE = 8192 diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py index 8cd623658921129139a07456cc3e73ba8578917d..e2d1664b23593e6347c816c84fc1132afe885222 100644 --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -5,9 +5,9 @@ from pypy.interpreter.typedef import ( from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.error import OperationError -from pypy.rlib.rarithmetic import intmask, r_ulonglong, r_uint -from pypy.rlib.rbigint import rbigint -from pypy.rlib.rstring import UnicodeBuilder +from rpython.rlib.rarithmetic import intmask, r_ulonglong, r_uint +from rpython.rlib.rbigint import rbigint +from rpython.rlib.rstring import UnicodeBuilder from pypy.module._codecs import interp_codecs from pypy.module._io.interp_iobase import convert_size import sys diff --git a/pypy/module/_io/test/test_bufferedio.py b/pypy/module/_io/test/test_bufferedio.py index 70499c76c96e8864b60432c1d6a7d02f5f455c10..1df51ef1866777a9ea9b18035ec3ff715b52ba83 100644 --- a/pypy/module/_io/test/test_bufferedio.py +++ b/pypy/module/_io/test/test_bufferedio.py @@ -1,6 +1,6 @@ from __future__ import with_statement from pypy.interpreter.gateway import interp2app -from pypy.tool.udir import udir +from rpython.tool.udir import udir from pypy.module._io import interp_bufferedio from pypy.interpreter.error import OperationError import py.test diff --git a/pypy/module/_io/test/test_fileio.py b/pypy/module/_io/test/test_fileio.py index 8b78be294a8b158e0ba4e3b8dfb1937e3679006a..3c9defff1eaff71d2515d66b3d19c8cee06ef053 100644 --- a/pypy/module/_io/test/test_fileio.py +++ b/pypy/module/_io/test/test_fileio.py @@ -1,4 +1,4 @@ -from pypy.tool.udir import udir +from rpython.tool.udir import udir import os class AppTestFileIO: @@ -163,7 +163,7 @@ class AppTestFileIO: def test_flush_at_exit(): from pypy import conftest from pypy.tool.option import make_config, make_objspace - from pypy.tool.udir import udir + from rpython.tool.udir import udir tmpfile = udir.join('test_flush_at_exit') config = make_config(conftest.option) diff --git a/pypy/module/_io/test/test_io.py b/pypy/module/_io/test/test_io.py index 1307b80edb7ab52807167d2d6db75cac758ec12a..a9a10e310f77613934a04697fc0dbaec7fdcb24d 100644 --- a/pypy/module/_io/test/test_io.py +++ b/pypy/module/_io/test/test_io.py @@ -1,6 +1,6 @@ from __future__ import with_statement -from pypy.tool.udir import udir +from rpython.tool.udir import udir class AppTestIoModule: diff --git a/pypy/module/_locale/__init__.py b/pypy/module/_locale/__init__.py index 4c975487e3ffe064efe72642e92840ecf2a3f9eb..6d91bf37184a43d86afbff17db0efcfa6afcf8e2 100644 --- a/pypy/module/_locale/__init__.py +++ b/pypy/module/_locale/__init__.py @@ -1,5 +1,5 @@ from pypy.interpreter.mixedmodule import MixedModule -from pypy.rlib import rlocale +from rpython.rlib import rlocale import sys class Module(MixedModule): diff --git a/pypy/module/_locale/interp_locale.py b/pypy/module/_locale/interp_locale.py index bf2bbbec335dc9f097d2a77f7bc5d704082862e6..e531f509870a3db61919180f1f9db118ff8baf91 100644 --- a/pypy/module/_locale/interp_locale.py +++ b/pypy/module/_locale/interp_locale.py @@ -1,12 +1,12 @@ -from pypy.rlib import rposix -from pypy.rlib.rarithmetic import intmask +from rpython.rlib import rposix +from rpython.rlib.rarithmetic import intmask from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import unwrap_spec -from pypy.rlib import rlocale +from rpython.rlib import rlocale from pypy.module.exceptions.interp_exceptions import _new_exception, W_Exception -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi W_Error = _new_exception('Error', W_Exception, 'locale error') diff --git a/pypy/module/_lsprof/interp_lsprof.py b/pypy/module/_lsprof/interp_lsprof.py index c024064335211adad492dc7cce11bc3214b02e62..7f3e5bc7732599dbe27af6ac1d34ff7c8ef5a700 100644 --- a/pypy/module/_lsprof/interp_lsprof.py +++ b/pypy/module/_lsprof/interp_lsprof.py @@ -6,13 +6,13 @@ from pypy.interpreter.function import Method, Function from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import (TypeDef, GetSetProperty, interp_attrproperty) -from pypy.rlib import jit -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.rtimer import read_timestamp, _is_64_bit -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.tool.autopath import pypydir -from pypy.rlib.rarithmetic import r_longlong +from rpython.rlib import jit +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.rtimer import read_timestamp, _is_64_bit +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from pypy.conftest import pypydir +from rpython.rlib.rarithmetic import r_longlong import time, sys diff --git a/pypy/module/_md5/interp_md5.py b/pypy/module/_md5/interp_md5.py index 99c1a7adaf4dd9b0ae564467aba231757e301e46..2eef24403a9440c10b9406e2161c2061d4dee23e 100644 --- a/pypy/module/_md5/interp_md5.py +++ b/pypy/module/_md5/interp_md5.py @@ -1,4 +1,4 @@ -from pypy.rlib import rmd5 +from rpython.rlib import rmd5 from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef from pypy.interpreter.gateway import interp2app, unwrap_spec diff --git a/pypy/module/_minimal_curses/__init__.py b/pypy/module/_minimal_curses/__init__.py index b91a19a32d2f78fbf664e4d7460648a740e546f0..1d7fd338bf8e1bf422d398fce629df3ab035c8c1 100644 --- a/pypy/module/_minimal_curses/__init__.py +++ b/pypy/module/_minimal_curses/__init__.py @@ -10,7 +10,7 @@ except ImportError: from pypy.interpreter.mixedmodule import MixedModule from pypy.module._minimal_curses import fficurses from pypy.module._minimal_curses import interp_curses -from pypy.rlib.nonconst import NonConstant +from rpython.rlib.nonconst import NonConstant class Module(MixedModule): diff --git a/pypy/module/_minimal_curses/fficurses.py b/pypy/module/_minimal_curses/fficurses.py index 348ab140fe5f0d23c48d5042bfda5841cf16cb88..ec8b401c46fff9bfae665a6a29ca69c768301221 100644 --- a/pypy/module/_minimal_curses/fficurses.py +++ b/pypy/module/_minimal_curses/fficurses.py @@ -2,12 +2,12 @@ """ The ffi for rpython, need to be imported for side effects """ -from pypy.rpython.lltypesystem import rffi -from pypy.rpython.lltypesystem import lltype -from pypy.rpython.tool import rffi_platform -from pypy.rpython.extfunc import register_external +from rpython.rtyper.lltypesystem import rffi +from rpython.rtyper.lltypesystem import lltype +from rpython.rtyper.tool import rffi_platform +from rpython.rtyper.extfunc import register_external from pypy.module._minimal_curses import interp_curses -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.translator.tool.cbuild import ExternalCompilationInfo from sys import platform import os.path diff --git a/pypy/module/_minimal_curses/interp_curses.py b/pypy/module/_minimal_curses/interp_curses.py index 47070db1b3645cb682544df02787ee5205acd0aa..253197bdd1c2787ba2d01ae9466dd0d85aa666df 100644 --- a/pypy/module/_minimal_curses/interp_curses.py +++ b/pypy/module/_minimal_curses/interp_curses.py @@ -13,8 +13,8 @@ class curses_error(Exception): def __init__(self, msg): self.msg = msg -from pypy.annotation.classdef import FORCE_ATTRIBUTES_INTO_CLASSES -from pypy.annotation.model import SomeString +from rpython.annotator.classdef import FORCE_ATTRIBUTES_INTO_CLASSES +from rpython.annotator.model import SomeString # this is necessary due to annmixlevel FORCE_ATTRIBUTES_INTO_CLASSES[curses_error] = {'msg': SomeString()} diff --git a/pypy/module/_minimal_curses/test/test_curses.py b/pypy/module/_minimal_curses/test/test_curses.py index eb86692aee2c4147904cd3eaf03fc0fd5c50a8c0..96a829828d61cd0618f676bebf4d7122ecfb56a6 100644 --- a/pypy/module/_minimal_curses/test/test_curses.py +++ b/pypy/module/_minimal_curses/test/test_curses.py @@ -1,5 +1,5 @@ -from pypy.tool.autopath import pypydir -from pypy.tool.udir import udir +from pypy.conftest import pypydir +from rpython.tool.udir import udir import py import sys # tests here are run as snippets through a pexpected python subprocess @@ -75,7 +75,7 @@ class ExpectTestCCurses(object): """ Test compiled version """ def test_csetupterm(self): - from pypy.translator.c.test.test_genc import compile + from rpython.translator.c.test.test_genc import compile from pypy.module._minimal_curses import interp_curses def runs_setupterm(): interp_curses._curses_setupterm_null(1) @@ -84,7 +84,7 @@ class ExpectTestCCurses(object): fn() def test_ctgetstr(self): - from pypy.translator.c.test.test_genc import compile + from rpython.translator.c.test.test_genc import compile from pypy.module._minimal_curses import interp_curses def runs_ctgetstr(): interp_curses._curses_setupterm("xterm", 1) @@ -95,7 +95,7 @@ class ExpectTestCCurses(object): assert res == '\x1b[%i%p1%d;%p2%dH' def test_ctparm(self): - from pypy.translator.c.test.test_genc import compile + from rpython.translator.c.test.test_genc import compile from pypy.module._minimal_curses import interp_curses def runs_tparm(): interp_curses._curses_setupterm("xterm", 1) diff --git a/pypy/module/_multibytecodec/c_codecs.py b/pypy/module/_multibytecodec/c_codecs.py index 8fe76defcdb6b015ad24a0ecbe4dd31a742caa12..0bb986b2f46830d44f2b72a91ad4d5ed380cd10c 100644 --- a/pypy/module/_multibytecodec/c_codecs.py +++ b/pypy/module/_multibytecodec/c_codecs.py @@ -1,7 +1,7 @@ import py -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.tool.autopath import pypydir +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from pypy.conftest import pypydir UNICODE_REPLACEMENT_CHARACTER = u'\uFFFD' diff --git a/pypy/module/_multibytecodec/interp_incremental.py b/pypy/module/_multibytecodec/interp_incremental.py index d83e4bf660d84e6106e2a13de1f2935258df6efc..42b586576410dcc53ffca04ca4c7634ad82d3f35 100644 --- a/pypy/module/_multibytecodec/interp_incremental.py +++ b/pypy/module/_multibytecodec/interp_incremental.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import lltype +from rpython.rtyper.lltypesystem import lltype from pypy.module._multibytecodec import c_codecs from pypy.module._multibytecodec.interp_multibytecodec import ( MultibyteCodec, wrap_unicodedecodeerror, wrap_runtimeerror, diff --git a/pypy/module/_multibytecodec/test/test_translation.py b/pypy/module/_multibytecodec/test/test_translation.py index 651c287de83a5094383758168e13d196dc7b9729..c38c5ab0a1618e641b9d7c4da7da087d92d45df9 100644 --- a/pypy/module/_multibytecodec/test/test_translation.py +++ b/pypy/module/_multibytecodec/test/test_translation.py @@ -1,5 +1,5 @@ from pypy.module._multibytecodec import c_codecs -from pypy.translator.c.test import test_standalone +from rpython.translator.c.test import test_standalone class TestTranslation(test_standalone.StandaloneTests): diff --git a/pypy/module/_multiprocessing/interp_connection.py b/pypy/module/_multiprocessing/interp_connection.py index 86f3505177235c732e43def5f4030e6517e498fd..e52750ebaea589849423d7dfef3add120d254e54 100644 --- a/pypy/module/_multiprocessing/interp_connection.py +++ b/pypy/module/_multiprocessing/interp_connection.py @@ -4,9 +4,9 @@ from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter.error import ( OperationError, wrap_oserror, operationerrfmt) -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rlib.rarithmetic import intmask -from pypy.rlib import rpoll, rsocket +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rlib.rarithmetic import intmask +from rpython.rlib import rpoll, rsocket import sys READABLE = 1 @@ -194,20 +194,20 @@ class W_FileConnection(W_BaseConnection): if sys.platform == 'win32': def WRITE(self, data): - from pypy.rlib._rsocket_rffi import send, geterrno + from rpython.rlib._rsocket_rffi import send, geterrno length = send(self.fd, data, len(data), 0) if length < 0: raise WindowsError(geterrno(), "send") return length def READ(self, size): - from pypy.rlib._rsocket_rffi import socketrecv, geterrno + from rpython.rlib._rsocket_rffi import socketrecv, geterrno with rffi.scoped_alloc_buffer(size) as buf: length = socketrecv(self.fd, buf.raw, buf.size, 0) if length < 0: raise WindowsError(geterrno(), "recv") return buf.str(length) def CLOSE(self): - from pypy.rlib._rsocket_rffi import socketclose + from rpython.rlib._rsocket_rffi import socketclose socketclose(self.fd) else: def WRITE(self, data): @@ -343,7 +343,7 @@ W_FileConnection.typedef = TypeDef( class W_PipeConnection(W_BaseConnection): if sys.platform == 'win32': - from pypy.rlib.rwin32 import INVALID_HANDLE_VALUE + from rpython.rlib.rwin32 import INVALID_HANDLE_VALUE def __init__(self, handle, flags): W_BaseConnection.__init__(self, flags) @@ -372,7 +372,7 @@ class W_PipeConnection(W_BaseConnection): return w_handle(space, self.handle) def do_close(self): - from pypy.rlib.rwin32 import CloseHandle + from rpython.rlib.rwin32 import CloseHandle if self.is_valid(): CloseHandle(self.handle) self.handle = self.INVALID_HANDLE_VALUE @@ -380,7 +380,7 @@ class W_PipeConnection(W_BaseConnection): def do_send_string(self, space, buffer, offset, size): from pypy.module._multiprocessing.interp_win32 import ( _WriteFile, ERROR_NO_SYSTEM_RESOURCES) - from pypy.rlib import rwin32 + from rpython.rlib import rwin32 charp = rffi.str2charp(buffer) written_ptr = lltype.malloc(rffi.CArrayPtr(rwin32.DWORD).TO, 1, @@ -402,7 +402,7 @@ class W_PipeConnection(W_BaseConnection): def do_recv_string(self, space, buflength, maxlength): from pypy.module._multiprocessing.interp_win32 import ( _ReadFile, _PeekNamedPipe, ERROR_BROKEN_PIPE, ERROR_MORE_DATA) - from pypy.rlib import rwin32 + from rpython.rlib import rwin32 from pypy.interpreter.error import wrap_windowserror read_ptr = lltype.malloc(rffi.CArrayPtr(rwin32.DWORD).TO, 1, @@ -457,7 +457,7 @@ class W_PipeConnection(W_BaseConnection): def do_poll(self, space, timeout): from pypy.module._multiprocessing.interp_win32 import ( _PeekNamedPipe, _GetTickCount, _Sleep) - from pypy.rlib import rwin32 + from rpython.rlib import rwin32 from pypy.interpreter.error import wrap_windowserror bytes_ptr = lltype.malloc(rffi.CArrayPtr(rwin32.DWORD).TO, 1, flavor='raw') diff --git a/pypy/module/_multiprocessing/interp_memory.py b/pypy/module/_multiprocessing/interp_memory.py index 2084c3123ea1e7e3514e02028582aeaff7fbf902..bc2c5f615b518338c7bf1facf33cc9ed595cc579 100644 --- a/pypy/module/_multiprocessing/interp_memory.py +++ b/pypy/module/_multiprocessing/interp_memory.py @@ -1,5 +1,5 @@ from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi +from rpython.rtyper.lltypesystem import rffi from pypy.module.mmap.interp_mmap import W_MMap def address_of_buffer(space, w_obj): diff --git a/pypy/module/_multiprocessing/interp_semaphore.py b/pypy/module/_multiprocessing/interp_semaphore.py index 478d1396fa74b5f241ca6d2cc0a6e53fbd405f09..5fbc14484ae758eb361c478eeae7fc959f19901d 100644 --- a/pypy/module/_multiprocessing/interp_semaphore.py +++ b/pypy/module/_multiprocessing/interp_semaphore.py @@ -3,11 +3,11 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import wrap_oserror, OperationError -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rlib import rgc -from pypy.rlib.rarithmetic import r_uint -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.rpython.tool import rffi_platform as platform +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rlib import rgc +from rpython.rlib.rarithmetic import r_uint +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.tool import rffi_platform as platform from pypy.module.thread import ll_thread from pypy.module._multiprocessing.interp_connection import w_handle import sys, os, time, errno @@ -15,7 +15,7 @@ import sys, os, time, errno RECURSIVE_MUTEX, SEMAPHORE = range(2) if sys.platform == 'win32': - from pypy.rlib import rwin32 + from rpython.rlib import rwin32 from pypy.module._multiprocessing.interp_win32 import ( handle_w, _GetTickCount) @@ -31,7 +31,7 @@ if sys.platform == 'win32': rwin32.BOOL) else: - from pypy.rlib import rposix + from rpython.rlib import rposix if sys.platform == 'darwin': libraries = [] diff --git a/pypy/module/_multiprocessing/interp_win32.py b/pypy/module/_multiprocessing/interp_win32.py index edfa5036744bcb35d791e1ad0a95aa6bc734738b..d8421dff691aea9122e6513155a7cab7cc8badd0 100644 --- a/pypy/module/_multiprocessing/interp_win32.py +++ b/pypy/module/_multiprocessing/interp_win32.py @@ -1,11 +1,11 @@ from pypy.interpreter.gateway import unwrap_spec, interp2app from pypy.interpreter.function import StaticMethod from pypy.interpreter.error import wrap_windowserror, OperationError -from pypy.rlib import rwin32 -from pypy.rlib.rarithmetic import r_uint -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.rpython.tool import rffi_platform +from rpython.rlib import rwin32 +from rpython.rlib.rarithmetic import r_uint +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.tool import rffi_platform from pypy.module._multiprocessing.interp_connection import w_handle CONSTANTS = """ diff --git a/pypy/module/_pickle_support/maker.py b/pypy/module/_pickle_support/maker.py index f5f1e70586258a583f0ae0f46df4a5bde0cf94d5..81ae5fdab240eb5f61406da752375c8fff7344ba 100644 --- a/pypy/module/_pickle_support/maker.py +++ b/pypy/module/_pickle_support/maker.py @@ -6,7 +6,7 @@ from pypy.interpreter.module import Module from pypy.interpreter.pyframe import PyFrame from pypy.interpreter.pytraceback import PyTraceback from pypy.interpreter.generator import GeneratorIterator -from pypy.rlib.objectmodel import instantiate +from rpython.rlib.objectmodel import instantiate from pypy.interpreter.gateway import unwrap_spec from pypy.objspace.std.iterobject import W_SeqIterObject, W_ReverseSeqIterObject diff --git a/pypy/module/_random/interp_random.py b/pypy/module/_random/interp_random.py index 21560d04488ecac1657b502e06ffe4364fbf5c43..b1ac3da16c68e300abfcb9e7b9b8df33196e9c86 100644 --- a/pypy/module/_random/interp_random.py +++ b/pypy/module/_random/interp_random.py @@ -2,8 +2,8 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.typedef import TypeDef from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.baseobjspace import Wrappable -from pypy.rlib.rarithmetic import r_uint, intmask -from pypy.rlib import rbigint, rrandom, rstring +from rpython.rlib.rarithmetic import r_uint, intmask +from rpython.rlib import rbigint, rrandom, rstring import time diff --git a/pypy/module/_rawffi/__init__.py b/pypy/module/_rawffi/__init__.py index e973f1df7f6884423d8300934f538035746dbc16..e32fee507300ad1405aa82d6a9f8eeae8e232f6c 100644 --- a/pypy/module/_rawffi/__init__.py +++ b/pypy/module/_rawffi/__init__.py @@ -4,7 +4,7 @@ from pypy.interpreter.mixedmodule import MixedModule from pypy.module._rawffi.interp_rawffi import W_CDLL -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.module._rawffi.tracker import Tracker import sys @@ -46,7 +46,7 @@ class Module(MixedModule): if hasattr(interp_rawffi, 'check_HRESULT'): Module.interpleveldefs['check_HRESULT'] = 'interp_rawffi.check_HRESULT' - from pypy.rlib import clibffi + from rpython.rlib import clibffi for name in ['FUNCFLAG_STDCALL', 'FUNCFLAG_CDECL', 'FUNCFLAG_PYTHONAPI', 'FUNCFLAG_USE_ERRNO', 'FUNCFLAG_USE_LASTERROR', ]: diff --git a/pypy/module/_rawffi/array.py b/pypy/module/_rawffi/array.py index d5261268e985a40c62f85c200a921a1454395694..c7dad2cc24884c696593bfc1240507cca432a801 100644 --- a/pypy/module/_rawffi/array.py +++ b/pypy/module/_rawffi/array.py @@ -5,7 +5,7 @@ to app-level with apropriate interface from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef, GetSetProperty, interp_attrproperty -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.interpreter.error import OperationError from pypy.module._rawffi.interp_rawffi import segfault_exception from pypy.module._rawffi.interp_rawffi import W_DataShape, W_DataInstance @@ -13,7 +13,7 @@ from pypy.module._rawffi.interp_rawffi import unwrap_value, wrap_value from pypy.module._rawffi.interp_rawffi import TYPEMAP from pypy.module._rawffi.interp_rawffi import size_alignment from pypy.module._rawffi.interp_rawffi import unpack_shape_with_length -from pypy.rlib.rarithmetic import r_uint +from rpython.rlib.rarithmetic import r_uint def push_elem(ll_array, pos, value): TP = lltype.typeOf(value) diff --git a/pypy/module/_rawffi/callback.py b/pypy/module/_rawffi/callback.py index 9aaa33573fb4f07cb5696d9f23ffe444a901c8da..0b0d643895b2b59ec2e538dc068462c889635a8e 100644 --- a/pypy/module/_rawffi/callback.py +++ b/pypy/module/_rawffi/callback.py @@ -1,14 +1,14 @@ from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef, GetSetProperty -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.module._rawffi.array import push_elem from pypy.module._rawffi.structure import W_Structure from pypy.module._rawffi.interp_rawffi import (W_DataInstance, letter2tp, unwrap_value, unpack_argshapes, got_libffi_error) -from pypy.rlib.clibffi import USERDATA_P, CallbackFuncPtr, FUNCFLAG_CDECL -from pypy.rlib.clibffi import ffi_type_void, LibFFIError -from pypy.rlib import rweakref +from rpython.rlib.clibffi import USERDATA_P, CallbackFuncPtr, FUNCFLAG_CDECL +from rpython.rlib.clibffi import ffi_type_void, LibFFIError +from rpython.rlib import rweakref from pypy.module._rawffi.tracker import tracker from pypy.interpreter.error import OperationError from pypy.interpreter import gateway diff --git a/pypy/module/_rawffi/interp_rawffi.py b/pypy/module/_rawffi/interp_rawffi.py index 327a5e635822e1968b822748fd55a6669e1f8439..631e363545b58cfb19fd10a85a18a31be787d4a0 100644 --- a/pypy/module/_rawffi/interp_rawffi.py +++ b/pypy/module/_rawffi/interp_rawffi.py @@ -3,18 +3,18 @@ from pypy.interpreter.error import OperationError, wrap_oserror, operationerrfmt from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef, GetSetProperty -from pypy.rlib.clibffi import * -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.unroll import unrolling_iterable -import pypy.rlib.rposix as rposix +from rpython.rlib.clibffi import * +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.unroll import unrolling_iterable +import rpython.rlib.rposix as rposix _MS_WINDOWS = os.name == "nt" if _MS_WINDOWS: - from pypy.rlib import rwin32 + from rpython.rlib import rwin32 -from pypy.tool.sourcetools import func_with_new_name -from pypy.rlib.rarithmetic import intmask, r_uint +from rpython.tool.sourcetools import func_with_new_name +from rpython.rlib.rarithmetic import intmask, r_uint from pypy.module._rawffi.tracker import tracker TYPEMAP = { @@ -553,11 +553,11 @@ def set_errno(space, w_errno): if sys.platform == 'win32': def get_last_error(space): - from pypy.rlib.rwin32 import GetLastError + from rpython.rlib.rwin32 import GetLastError return space.wrap(GetLastError()) @unwrap_spec(error=int) def set_last_error(space, error): - from pypy.rlib.rwin32 import SetLastError + from rpython.rlib.rwin32 import SetLastError SetLastError(error) else: # always have at least a dummy version of these functions diff --git a/pypy/module/_rawffi/structure.py b/pypy/module/_rawffi/structure.py index 831139c0be74372ff94d6a9dba1a4e8938a9fdc1..e85ddbf35a7d0c44cdb220573022b419ed76e87b 100644 --- a/pypy/module/_rawffi/structure.py +++ b/pypy/module/_rawffi/structure.py @@ -6,7 +6,7 @@ to app-level with apropriate interface from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import interp_attrproperty from pypy.interpreter.typedef import TypeDef, GetSetProperty -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.interpreter.error import OperationError, operationerrfmt from pypy.module._rawffi.interp_rawffi import segfault_exception, _MS_WINDOWS from pypy.module._rawffi.interp_rawffi import W_DataShape, W_DataInstance @@ -14,8 +14,8 @@ from pypy.module._rawffi.interp_rawffi import wrap_value, unwrap_value from pypy.module._rawffi.interp_rawffi import unpack_shape_with_length from pypy.module._rawffi.interp_rawffi import size_alignment, LL_TYPEMAP from pypy.module._rawffi.interp_rawffi import unroll_letters_for_numbers -from pypy.rlib import clibffi -from pypy.rlib.rarithmetic import intmask, r_uint, signedtype, widen +from rpython.rlib import clibffi +from rpython.rlib.rarithmetic import intmask, r_uint, signedtype, widen def unpack_fields(space, w_fields): fields_w = space.unpackiterable(w_fields) diff --git a/pypy/module/_rawffi/test/test__rawffi.py b/pypy/module/_rawffi/test/test__rawffi.py index b71dd1219455d24a5b185835f59160d161f2f039..0c8731f694c3c275ebff46f4e30867541374a10c 100644 --- a/pypy/module/_rawffi/test/test__rawffi.py +++ b/pypy/module/_rawffi/test/test__rawffi.py @@ -1,5 +1,5 @@ -from pypy.translator.platform import platform -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.translator.platform import platform +from rpython.translator.tool.cbuild import ExternalCompilationInfo from pypy.module._rawffi.interp_rawffi import TYPEMAP from pypy.module._rawffi.tracker import Tracker @@ -9,7 +9,7 @@ class AppTestFfi: spaceconfig = dict(usemodules=['_rawffi', 'struct']) def prepare_c_example(): - from pypy.tool.udir import udir + from rpython.tool.udir import udir c_file = udir.ensure("test__rawffi", dir=1).join("xlib.c") c_file.write(py.code.Source(''' #include @@ -197,7 +197,7 @@ class AppTestFfi: def setup_class(cls): space = cls.space - from pypy.rlib.clibffi import get_libc_name + from rpython.rlib.clibffi import get_libc_name cls.w_lib_name = space.wrap(cls.prepare_c_example()) cls.w_libc_name = space.wrap(get_libc_name()) if sys.platform == 'win32': diff --git a/pypy/module/_sha/interp_sha.py b/pypy/module/_sha/interp_sha.py index d1538cc36f13664da5a09e544aefdc737d07131d..b5f882695dcdec5212daa207257112778730d683 100644 --- a/pypy/module/_sha/interp_sha.py +++ b/pypy/module/_sha/interp_sha.py @@ -1,4 +1,4 @@ -from pypy.rlib import rsha +from rpython.rlib import rsha from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef from pypy.interpreter.gateway import interp2app, unwrap_spec diff --git a/pypy/module/_socket/__init__.py b/pypy/module/_socket/__init__.py index b7b6ea7f0dc855af51a806eb13ae767681495692..a87474ea2afa5e28ca3a71d2f376d5b7b74c3b14 100644 --- a/pypy/module/_socket/__init__.py +++ b/pypy/module/_socket/__init__.py @@ -17,11 +17,11 @@ class Module(MixedModule): } def startup(self, space): - from pypy.rlib.rsocket import rsocket_startup + from rpython.rlib.rsocket import rsocket_startup rsocket_startup() def buildloaders(cls): - from pypy.rlib import rsocket + from rpython.rlib import rsocket for name in """ gethostbyname gethostbyname_ex gethostbyaddr gethostname getservbyname getservbyport getprotobyname diff --git a/pypy/module/_socket/interp_func.py b/pypy/module/_socket/interp_func.py index ef943a9abdc36ce7d270ef6d15b58f32f21a02ed..f790b369beb516d9b4ffa77dae97003567a941e5 100644 --- a/pypy/module/_socket/interp_func.py +++ b/pypy/module/_socket/interp_func.py @@ -1,7 +1,7 @@ from pypy.interpreter.gateway import unwrap_spec, WrappedDefault from pypy.module._socket.interp_socket import converted_error, W_RSocket -from pypy.rlib import rsocket -from pypy.rlib.rsocket import SocketError, INVALID_SOCKET +from rpython.rlib import rsocket +from rpython.rlib.rsocket import SocketError, INVALID_SOCKET from pypy.interpreter.error import OperationError def gethostname(space): diff --git a/pypy/module/_socket/interp_socket.py b/pypy/module/_socket/interp_socket.py index 63f6498ea0b3c52ee1114f146e8a3215fb7b34d6..6207716228d01bd14b19b29d8b062a7da4695cca 100644 --- a/pypy/module/_socket/interp_socket.py +++ b/pypy/module/_socket/interp_socket.py @@ -2,10 +2,10 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef, make_weakref_descr,\ interp_attrproperty from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault -from pypy.rlib.rarithmetic import intmask -from pypy.rlib import rsocket -from pypy.rlib.rsocket import RSocket, AF_INET, SOCK_STREAM -from pypy.rlib.rsocket import SocketError, SocketErrorWithErrno +from rpython.rlib.rarithmetic import intmask +from rpython.rlib import rsocket +from rpython.rlib.rsocket import RSocket, AF_INET, SOCK_STREAM +from rpython.rlib.rsocket import SocketError, SocketErrorWithErrno from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter import gateway @@ -328,9 +328,9 @@ class W_RSocket(Wrappable, RSocket): @unwrap_spec(cmd=int) def ioctl_w(self, space, cmd, w_option): - from pypy.rpython.lltypesystem import rffi, lltype - from pypy.rlib import rwin32 - from pypy.rlib.rsocket import _c + from rpython.rtyper.lltypesystem import rffi, lltype + from rpython.rlib import rwin32 + from rpython.rlib.rsocket import _c recv_ptr = lltype.malloc(rwin32.LPDWORD.TO, 1, flavor='raw') try: diff --git a/pypy/module/_socket/test/test_sock_app.py b/pypy/module/_socket/test/test_sock_app.py index 75e4ab98296b6a26795326bdc6ed6724cd3e3dd4..6ac472c259d47900840623a66eff1812fe80d966 100644 --- a/pypy/module/_socket/test/test_sock_app.py +++ b/pypy/module/_socket/test/test_sock_app.py @@ -1,9 +1,9 @@ import sys import py from pypy.tool.pytest.objspace import gettestobjspace -from pypy.tool.udir import udir -from pypy.rlib import rsocket -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.tool.udir import udir +from rpython.rlib import rsocket +from rpython.rtyper.lltypesystem import lltype, rffi def setup_module(mod): mod.space = gettestobjspace(usemodules=['_socket', 'array', 'struct']) diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py index f2dc1ac24f91c752def30a2d37475027ffb08760..aae5b22e925562c0974c1fa877f3bda3fd311b89 100644 --- a/pypy/module/_sre/interp_sre.py +++ b/pypy/module/_sre/interp_sre.py @@ -5,15 +5,15 @@ from pypy.interpreter.typedef import interp_attrproperty, interp_attrproperty_w from pypy.interpreter.typedef import make_weakref_descr from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter.error import OperationError -from pypy.rlib.rarithmetic import intmask -from pypy.rlib import jit +from rpython.rlib.rarithmetic import intmask +from rpython.rlib import jit # ____________________________________________________________ # # Constants and exposed functions -from pypy.rlib.rsre import rsre_core -from pypy.rlib.rsre.rsre_char import MAGIC, CODESIZE, getlower, set_unicode_db +from rpython.rlib.rsre import rsre_core +from rpython.rlib.rsre.rsre_char import MAGIC, CODESIZE, getlower, set_unicode_db @unwrap_spec(char_ord=int, flags=int) diff --git a/pypy/module/_sre/test/autopath.py b/pypy/module/_sre/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/module/_sre/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/module/_sre/test/test_app_sre.py b/pypy/module/_sre/test/test_app_sre.py index d5521e4534e3869cdeda7ecc2a19556d4ec2447f..2d720637151516e77fb5c5c156c4ddeba34e6d48 100644 --- a/pypy/module/_sre/test/test_app_sre.py +++ b/pypy/module/_sre/test/test_app_sre.py @@ -1,11 +1,10 @@ """Regular expression tests specific to _sre.py and accumulated during TDD.""" -import autopath import py from py.test import raises, skip from pypy.interpreter.gateway import app2interp_temp def init_app_test(cls, space): - cls.w_s = space.appexec([space.wrap(autopath.this_dir)], + cls.w_s = space.appexec([space.wrap(os.path.realpath(os.path.dirname(__file__)))], """(this_dir): import sys # Uh-oh, ugly hack diff --git a/pypy/module/_ssl/__init__.py b/pypy/module/_ssl/__init__.py index 768671ef8384ef1798a41a1bca10968ebb202871..d2c6a30a76875144f95946b83c1768d807570586 100644 --- a/pypy/module/_ssl/__init__.py +++ b/pypy/module/_ssl/__init__.py @@ -29,7 +29,7 @@ class Module(MixedModule): super(Module, cls).buildloaders() def startup(self, space): - from pypy.rlib.ropenssl import init_ssl + from rpython.rlib.ropenssl import init_ssl init_ssl() if space.config.objspace.usemodules.thread: from pypy.module._ssl.thread_lock import setup_ssl_threads diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py index ad702864bcd161c66abe847dbb436741d9ddd8de..3997127ca5f563350aff15b0487641322a477a30 100644 --- a/pypy/module/_ssl/interp_ssl.py +++ b/pypy/module/_ssl/interp_ssl.py @@ -1,13 +1,13 @@ from __future__ import with_statement -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.error import OperationError from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef from pypy.interpreter.gateway import interp2app, unwrap_spec -from pypy.rlib.rarithmetic import intmask -from pypy.rlib import rpoll, rsocket -from pypy.rlib.ropenssl import * +from rpython.rlib.rarithmetic import intmask +from rpython.rlib import rpoll, rsocket +from rpython.rlib.ropenssl import * from pypy.module._socket import interp_socket diff --git a/pypy/module/_ssl/thread_lock.py b/pypy/module/_ssl/thread_lock.py index b62d31d89b508bbe8db3c9acc8f5a91f24657afd..db68df5d454405fe7efb3c073af6550e18111b94 100644 --- a/pypy/module/_ssl/thread_lock.py +++ b/pypy/module/_ssl/thread_lock.py @@ -1,6 +1,6 @@ -from pypy.rlib.ropenssl import * -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rlib.ropenssl import * +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.translator.tool.cbuild import ExternalCompilationInfo # CRYPTO_set_locking_callback: # diff --git a/pypy/module/_weakref/interp__weakref.py b/pypy/module/_weakref/interp__weakref.py index 98ed657a59df81c9f540af1f9384ca01b47c69fa..a82d43bbfdcc4320b23ba7024d1cf2a50f8f9ea5 100644 --- a/pypy/module/_weakref/interp__weakref.py +++ b/pypy/module/_weakref/interp__weakref.py @@ -3,9 +3,9 @@ from pypy.interpreter.baseobjspace import Wrappable, W_Root from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import interp2app, ObjSpace from pypy.interpreter.typedef import TypeDef -from pypy.rlib import jit -from pypy.rlib.rshrinklist import AbstractShrinkList -from pypy.rlib.objectmodel import specialize +from rpython.rlib import jit +from rpython.rlib.rshrinklist import AbstractShrinkList +from rpython.rlib.objectmodel import specialize import weakref diff --git a/pypy/module/_winreg/__init__.py b/pypy/module/_winreg/__init__.py index 96b9855896866b6d04507c86aff9dd6fc528ac81..24d634a57b36c0793a1010175ca463fbab0a3d14 100644 --- a/pypy/module/_winreg/__init__.py +++ b/pypy/module/_winreg/__init__.py @@ -1,6 +1,6 @@ from pypy.interpreter.mixedmodule import MixedModule from pypy.module._winreg import interp_winreg -from pypy.rlib.rwinreg import constants +from rpython.rlib.rwinreg import constants class Module(MixedModule): """This module provides access to the Windows registry API. diff --git a/pypy/module/_winreg/interp_winreg.py b/pypy/module/_winreg/interp_winreg.py index 5cdf9e2ebd71fc5130de53736b2d199b19c4dbb2..49b0bc01efcb9f222dc614b4beb6705974a6cbb6 100644 --- a/pypy/module/_winreg/interp_winreg.py +++ b/pypy/module/_winreg/interp_winreg.py @@ -3,9 +3,9 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.error import OperationError, wrap_windowserror -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rlib import rwinreg, rwin32 -from pypy.rlib.rarithmetic import r_uint, intmask +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rlib import rwinreg, rwin32 +from rpython.rlib.rarithmetic import r_uint, intmask def raiseWindowsError(space, errcode, context): message = rwin32.FormatError(errcode) diff --git a/pypy/module/_winreg/test/test_winreg.py b/pypy/module/_winreg/test/test_winreg.py index f2d0a565b1fe46373054dced72dbbf47e923f1cd..1a63513bbebc25798ccd8969e0117856433ea3cc 100644 --- a/pypy/module/_winreg/test/test_winreg.py +++ b/pypy/module/_winreg/test/test_winreg.py @@ -1,4 +1,4 @@ -from pypy.tool.udir import udir +from rpython.tool.udir import udir import os, sys, py diff --git a/pypy/module/array/interp_array.py b/pypy/module/array/interp_array.py index a4a39f61eecf25ca16ea40197f4aac9304749671..c689fd257be83c802b5d5e4319bf08cd339a00a8 100644 --- a/pypy/module/array/interp_array.py +++ b/pypy/module/array/interp_array.py @@ -9,11 +9,11 @@ from pypy.objspace.std.model import W_Object from pypy.objspace.std.multimethod import FailedToImplement from pypy.objspace.std.stdtypedef import SMM, StdTypeDef from pypy.objspace.std.register_all import register_all -from pypy.rlib import jit -from pypy.rlib.rarithmetic import ovfcheck, widen -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.objectmodel import specialize, keepalive_until_here -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rlib import jit +from rpython.rlib.rarithmetic import ovfcheck, widen +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.objectmodel import specialize, keepalive_until_here +from rpython.rtyper.lltypesystem import lltype, rffi @unwrap_spec(typecode=str) diff --git a/pypy/module/binascii/interp_base64.py b/pypy/module/binascii/interp_base64.py index 32a9ec7f839dec77b97798be46cf7710215e7c50..8e775a27fb9f1536bf3f71a9abc7cceb42288fd3 100644 --- a/pypy/module/binascii/interp_base64.py +++ b/pypy/module/binascii/interp_base64.py @@ -1,8 +1,8 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import unwrap_spec -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.rstring import StringBuilder from pypy.module.binascii.interp_binascii import raise_Error -from pypy.rlib.rarithmetic import ovfcheck +from rpython.rlib.rarithmetic import ovfcheck # ____________________________________________________________ diff --git a/pypy/module/binascii/interp_crc32.py b/pypy/module/binascii/interp_crc32.py index 90eb69c6b43537c80536e94f2a98655123806cb0..4ea4e010d7297f1af7a253cef6cb2f44643057b3 100644 --- a/pypy/module/binascii/interp_crc32.py +++ b/pypy/module/binascii/interp_crc32.py @@ -1,6 +1,6 @@ from pypy.interpreter.gateway import unwrap_spec -from pypy.rlib.rarithmetic import r_uint, intmask -from pypy.rpython.lltypesystem import rffi +from rpython.rlib.rarithmetic import r_uint, intmask +from rpython.rtyper.lltypesystem import rffi # ____________________________________________________________ diff --git a/pypy/module/binascii/interp_hexlify.py b/pypy/module/binascii/interp_hexlify.py index 6739d4c7d893c3cc4e5a92caa9beb655fc7e86ac..62d631b05e932404acd0438f6f35daec08f34151 100644 --- a/pypy/module/binascii/interp_hexlify.py +++ b/pypy/module/binascii/interp_hexlify.py @@ -1,7 +1,7 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import unwrap_spec -from pypy.rlib.rstring import StringBuilder -from pypy.rlib.rarithmetic import ovfcheck +from rpython.rlib.rstring import StringBuilder +from rpython.rlib.rarithmetic import ovfcheck # ____________________________________________________________ diff --git a/pypy/module/binascii/interp_hqx.py b/pypy/module/binascii/interp_hqx.py index 9b7111a3c99b16921049c4c7a2e7b39cb68f6872..2dd3807fcb22648198d76c94cb6614d27579ea90 100644 --- a/pypy/module/binascii/interp_hqx.py +++ b/pypy/module/binascii/interp_hqx.py @@ -1,8 +1,8 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import unwrap_spec -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.rstring import StringBuilder from pypy.module.binascii.interp_binascii import raise_Error, raise_Incomplete -from pypy.rlib.rarithmetic import ovfcheck +from rpython.rlib.rarithmetic import ovfcheck # ____________________________________________________________ diff --git a/pypy/module/binascii/interp_qp.py b/pypy/module/binascii/interp_qp.py index faf7545e05eb3884403b97b8b997de7c7a85d0dd..fe6e71728c6ddf82694aaf22111509a90ef170d1 100644 --- a/pypy/module/binascii/interp_qp.py +++ b/pypy/module/binascii/interp_qp.py @@ -1,5 +1,5 @@ from pypy.interpreter.gateway import unwrap_spec -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.rstring import StringBuilder MAXLINESIZE = 76 diff --git a/pypy/module/binascii/interp_uu.py b/pypy/module/binascii/interp_uu.py index fcb92694038c5d7988938e2ffe61e2c8ee4e60c8..92fce2cc4f0da3b10ac6b7095919a1d5ee7df02c 100644 --- a/pypy/module/binascii/interp_uu.py +++ b/pypy/module/binascii/interp_uu.py @@ -1,5 +1,5 @@ from pypy.interpreter.gateway import unwrap_spec -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.rstring import StringBuilder from pypy.module.binascii.interp_binascii import raise_Error # ____________________________________________________________ diff --git a/pypy/module/bz2/interp_bz2.py b/pypy/module/bz2/interp_bz2.py index c96360aaf30f11ca418c2a7307191dc202c7569f..f0fae7deccfc405f0531269e02649ce2757db1a4 100644 --- a/pypy/module/bz2/interp_bz2.py +++ b/pypy/module/bz2/interp_bz2.py @@ -1,15 +1,15 @@ from __future__ import with_statement -from pypy.rpython.tool import rffi_platform as platform -from pypy.rpython.lltypesystem import rffi -from pypy.rpython.lltypesystem import lltype +from rpython.rtyper.tool import rffi_platform as platform +from rpython.rtyper.lltypesystem import rffi +from rpython.rtyper.lltypesystem import lltype from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef, interp_attrproperty from pypy.interpreter.gateway import interp2app, unwrap_spec -from pypy.rlib.streamio import Stream -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.translator.platform import platform as compiler -from pypy.rlib.rarithmetic import intmask, r_longlong +from rpython.rlib.streamio import Stream +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.translator.platform import platform as compiler +from rpython.rlib.rarithmetic import intmask, r_longlong import sys @@ -319,8 +319,8 @@ newlines are available only when reading.""", def open_bz2file_as_stream(space, w_path, mode="r", buffering=-1, compresslevel=9): - from pypy.rlib.streamio import decode_mode, open_path_helper - from pypy.rlib.streamio import construct_stream_tower + from rpython.rlib.streamio import decode_mode, open_path_helper + from rpython.rlib.streamio import construct_stream_tower os_flags, universal, reading, writing, basemode, binary = decode_mode(mode) if reading and writing: raise OperationError(space.w_ValueError, diff --git a/pypy/module/bz2/test/support.py b/pypy/module/bz2/test/support.py index 634e2886e4a3a50559c0bb8df93fd8fa9702d854..d4e171e90dbeb479a2f9e47350a3d35d025fa389 100644 --- a/pypy/module/bz2/test/support.py +++ b/pypy/module/bz2/test/support.py @@ -1,6 +1,6 @@ class CheckAllocation: def teardown_method(self, fun): - from pypy.rpython.lltypesystem import ll2ctypes + from rpython.rtyper.lltypesystem import ll2ctypes import gc tries = 20 while tries and ll2ctypes.ALLOCATED: diff --git a/pypy/module/cStringIO/interp_stringio.py b/pypy/module/cStringIO/interp_stringio.py index 32369fd3f942a22caef911bc2fa7706f5f0e8a9e..9daf14c10284c1ed078f3b063fb3c5f564b073f6 100644 --- a/pypy/module/cStringIO/interp_stringio.py +++ b/pypy/module/cStringIO/interp_stringio.py @@ -2,7 +2,7 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.gateway import interp2app, unwrap_spec -from pypy.rlib.rStringIO import RStringIO +from rpython.rlib.rStringIO import RStringIO class W_InputOutputType(Wrappable): diff --git a/pypy/module/clr/boxing_rules.py b/pypy/module/clr/boxing_rules.py index d19cc7f835dc2083f2c8b5adef2ec93f120f5c84..f8999a5d137971cedd3b55189161a37d0698a7d4 100644 --- a/pypy/module/clr/boxing_rules.py +++ b/pypy/module/clr/boxing_rules.py @@ -1,11 +1,11 @@ -from pypy.tool.pairtype import extendabletype +from rpython.tool.pairtype import extendabletype from pypy.interpreter.baseobjspace import W_Root from pypy.objspace.std.intobject import W_IntObject from pypy.objspace.std.floatobject import W_FloatObject from pypy.objspace.std.boolobject import W_BoolObject from pypy.objspace.std.noneobject import W_NoneObject from pypy.objspace.std.stringobject import W_StringObject -from pypy.translator.cli.dotnet import box +from rpython.translator.cli.dotnet import box class __extend__(W_Root): __metaclass__ = extendabletype @@ -44,7 +44,7 @@ class __extend__(W_StringObject): return box(self._value) ##from pypy.objspace.fake.objspace import W_Object as W_Object_Fake -##from pypy.rlib.nonconst import NonConstant +##from rpython.rlib.nonconst import NonConstant ##class __extend__(W_Object_Fake): ## __metaclass__ = extendabletype diff --git a/pypy/module/clr/interp_clr.py b/pypy/module/clr/interp_clr.py index 93a00dcb5be8b6b9c3e70788af6719102a9abd8a..df6b0d16faccad714414d10a98346ae511e7866f 100644 --- a/pypy/module/clr/interp_clr.py +++ b/pypy/module/clr/interp_clr.py @@ -4,8 +4,8 @@ from pypy.interpreter.baseobjspace import W_Root, Wrappable from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.gateway import interp2app, unwrap_spec, ApplevelClass from pypy.interpreter.typedef import TypeDef -from pypy.rpython.ootypesystem import ootype -from pypy.translator.cli.dotnet import CLR, box, unbox, NativeException, native_exc,\ +from rpython.rtyper.ootypesystem import ootype +from rpython.translator.cli.dotnet import CLR, box, unbox, NativeException, native_exc,\ new_array, init_array, typeof System = CLR.System diff --git a/pypy/module/cmath/interp_cmath.py b/pypy/module/cmath/interp_cmath.py index e61b742fadcda81385a03043f52065c018535fce..1cb23188d04afcfd9482bf534c0a6b3b9e7d9d6e 100644 --- a/pypy/module/cmath/interp_cmath.py +++ b/pypy/module/cmath/interp_cmath.py @@ -1,9 +1,9 @@ import math -from pypy.rlib.objectmodel import specialize -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.objectmodel import specialize +from rpython.tool.sourcetools import func_with_new_name from pypy.interpreter.error import OperationError from pypy.module.cmath import names_and_docstrings -from pypy.rlib import rcomplex +from rpython.rlib import rcomplex pi = math.pi e = math.e diff --git a/pypy/module/cmath/test/test_cmath.py b/pypy/module/cmath/test/test_cmath.py index 0608051e7483e4d14a20aa0d8957a6a3ef310e56..aa39a662433fd3983a1c59f4968a0c4d3e695dbc 100644 --- a/pypy/module/cmath/test/test_cmath.py +++ b/pypy/module/cmath/test/test_cmath.py @@ -1,11 +1,11 @@ from __future__ import with_statement -from pypy.rlib.rfloat import copysign, isnan, isinf +from rpython.rlib.rfloat import copysign, isnan, isinf from pypy.module.cmath import interp_cmath import os, sys, math def test_special_values(): - from pypy.rlib.special_value import sqrt_special_values + from rpython.rlib.special_value import sqrt_special_values assert len(sqrt_special_values) == 7 assert len(sqrt_special_values[4]) == 7 assert isinstance(sqrt_special_values[5][1], tuple) diff --git a/pypy/module/cppyy/capi/__init__.py b/pypy/module/cppyy/capi/__init__.py index bc6da0691961e77dc082b8e2e8496e63b1f0aa00..6c40de8726bc0106b8655294daa742165910308d 100644 --- a/pypy/module/cppyy/capi/__init__.py +++ b/pypy/module/cppyy/capi/__init__.py @@ -1,5 +1,5 @@ -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rlib import jit +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rlib import jit import reflex_capi as backend #import cint_capi as backend diff --git a/pypy/module/cppyy/capi/cint_capi.py b/pypy/module/cppyy/capi/cint_capi.py index 7fbb610f5e518919a918360319dd261d66d5dc69..4ef471417b7cfe887800ad4daa0d1236e7d8b1f1 100644 --- a/pypy/module/cppyy/capi/cint_capi.py +++ b/pypy/module/cppyy/capi/cint_capi.py @@ -5,9 +5,9 @@ from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef from pypy.interpreter.baseobjspace import Wrappable -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.rpython.lltypesystem import rffi -from pypy.rlib import libffi, rdynload +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.lltypesystem import rffi +from rpython.rlib import libffi, rdynload from pypy.module.itertools import interp_itertools diff --git a/pypy/module/cppyy/capi/reflex_capi.py b/pypy/module/cppyy/capi/reflex_capi.py index 5e26b0ba6c6b3e6256425d331c09a8b5b61900bb..6233c89d074d9a04731d6623ab6635fc4ce45477 100644 --- a/pypy/module/cppyy/capi/reflex_capi.py +++ b/pypy/module/cppyy/capi/reflex_capi.py @@ -1,7 +1,7 @@ import py, os -from pypy.rlib import libffi -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rlib import libffi +from rpython.translator.tool.cbuild import ExternalCompilationInfo __all__ = ['identify', 'eci', 'c_load_dictionary'] diff --git a/pypy/module/cppyy/converter.py b/pypy/module/cppyy/converter.py index 02fdb85bcb5a4552384da936f31c8cc2cc2ce379..da021886cf3c04426f844d67dfa75e5d9828bf46 100644 --- a/pypy/module/cppyy/converter.py +++ b/pypy/module/cppyy/converter.py @@ -2,9 +2,9 @@ import sys from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rlib.rarithmetic import r_singlefloat -from pypy.rlib import jit_libffi, rfloat +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rlib.rarithmetic import r_singlefloat +from rpython.rlib import jit_libffi, rfloat from pypy.module._rawffi.interp_rawffi import unpack_simple_shape from pypy.module._rawffi.array import W_Array diff --git a/pypy/module/cppyy/executor.py b/pypy/module/cppyy/executor.py index 16324b57bbd35550a90214d9e02c884328cf43e2..7f6907ecebcda9c68ba71de4664aef174c3f56e5 100644 --- a/pypy/module/cppyy/executor.py +++ b/pypy/module/cppyy/executor.py @@ -2,8 +2,8 @@ import sys from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rlib import jit_libffi +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rlib import jit_libffi from pypy.module._rawffi.interp_rawffi import unpack_simple_shape from pypy.module._rawffi.array import W_Array, W_ArrayInstance diff --git a/pypy/module/cppyy/ffitypes.py b/pypy/module/cppyy/ffitypes.py index 289f1da3790949f663beb1159fbed64981580b14..e6789a718f0606ce3e4cc1bd9a5414042a8218d4 100644 --- a/pypy/module/cppyy/ffitypes.py +++ b/pypy/module/cppyy/ffitypes.py @@ -1,8 +1,8 @@ from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi -from pypy.rlib.rarithmetic import r_singlefloat -from pypy.rlib import jit_libffi, rfloat +from rpython.rtyper.lltypesystem import rffi +from rpython.rlib.rarithmetic import r_singlefloat +from rpython.rlib import jit_libffi, rfloat # Mixins to share between converter and executor classes (in converter.py and # executor.py, respectively). Basically these mixins allow grouping of the diff --git a/pypy/module/cppyy/helper.py b/pypy/module/cppyy/helper.py index 8773d510a3639d5ac64501f5bbbb15c52319e8a6..b430e5662cac701f44d77a4bdf77d2e27b68789c 100644 --- a/pypy/module/cppyy/helper.py +++ b/pypy/module/cppyy/helper.py @@ -1,4 +1,4 @@ -from pypy.rlib import rstring +from rpython.rlib import rstring #- type name manipulations -------------------------------------------------- diff --git a/pypy/module/cppyy/interp_cppyy.py b/pypy/module/cppyy/interp_cppyy.py index 26a84c54cc42dd9640718cec2e922aea0dfa120c..183a32d3d2de64afe377ad0c664ab95dd2809660 100644 --- a/pypy/module/cppyy/interp_cppyy.py +++ b/pypy/module/cppyy/interp_cppyy.py @@ -5,11 +5,11 @@ from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef, GetSetProperty, interp_attrproperty from pypy.interpreter.baseobjspace import Wrappable, W_Root -from pypy.rpython.lltypesystem import rffi, lltype, llmemory +from rpython.rtyper.lltypesystem import rffi, lltype, llmemory -from pypy.rlib import jit, rdynload, rweakref -from pypy.rlib import jit_libffi, clibffi -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib import jit, rdynload, rweakref +from rpython.rlib import jit_libffi, clibffi +from rpython.rlib.objectmodel import we_are_translated from pypy.module.cppyy import converter, executor, helper @@ -423,7 +423,7 @@ class W_CPPOverload(Wrappable): def __init__(self, space, containing_scope, functions): self.space = space self.scope = containing_scope - from pypy.rlib import debug + from rpython.rlib import debug self.functions = debug.make_sure_not_resized(functions) @jit.elidable_promote() diff --git a/pypy/module/cppyy/test/test_zjit.py b/pypy/module/cppyy/test/test_zjit.py index 7951d147f5d277d4c9ad8ab4f02eb796ed0fb616..acc4a76ca4a10ea4bdfa7fb515540812ac6b4e56 100644 --- a/pypy/module/cppyy/test/test_zjit.py +++ b/pypy/module/cppyy/test/test_zjit.py @@ -1,8 +1,8 @@ import py, os, sys -from pypy.jit.metainterp.test.support import LLJitMixin -from pypy.rlib.objectmodel import specialize, instantiate -from pypy.rlib import rarithmetic, jit -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.jit.metainterp.test.support import LLJitMixin +from rpython.rlib.objectmodel import specialize, instantiate +from rpython.rlib import rarithmetic, jit +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.baseobjspace import InternalSpaceCache, W_Root from pypy.module.cppyy import interp_cppyy, capi diff --git a/pypy/module/cpyext/__init__.py b/pypy/module/cpyext/__init__.py index 4d2af7e3193f819cace3c7ea8cb251a41885ca22..8d54a8fe94ff5af93325598947c9dc33fc4a1871 100644 --- a/pypy/module/cpyext/__init__.py +++ b/pypy/module/cpyext/__init__.py @@ -1,8 +1,8 @@ from pypy.interpreter.mixedmodule import MixedModule -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.objectmodel import we_are_translated from pypy.module.cpyext.state import State from pypy.module.cpyext import api -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype class Module(MixedModule): interpleveldefs = { diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py index 9ca29a503c1a5e1143019a129defa959724aa18a..4a71a0a8bae2d2513ec974f097585d1b5cc347fd 100644 --- a/pypy/module/cpyext/api.py +++ b/pypy/module/cpyext/api.py @@ -4,16 +4,16 @@ import atexit import py -from pypy.translator.goal import autopath -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rpython.tool import rffi_platform -from pypy.rpython.lltypesystem import ll2ctypes -from pypy.rpython.annlowlevel import llhelper -from pypy.rlib.objectmodel import we_are_translated -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.translator.gensupp import NameManager -from pypy.tool.udir import udir -from pypy.translator import platform +from pypy.conftest import pypydir +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rtyper.tool import rffi_platform +from rpython.rtyper.lltypesystem import ll2ctypes +from rpython.rtyper.annlowlevel import llhelper +from rpython.rlib.objectmodel import we_are_translated +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.translator.gensupp import NameManager +from rpython.tool.udir import udir +from rpython.translator import platform from pypy.module.cpyext.state import State from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.baseobjspace import W_Root @@ -25,17 +25,17 @@ from pypy.objspace.std.sliceobject import W_SliceObject from pypy.module.__builtin__.descriptor import W_Property from pypy.module.__builtin__.interp_classobj import W_ClassObject from pypy.module.__builtin__.interp_memoryview import W_MemoryView -from pypy.rlib.entrypoint import entrypoint -from pypy.rlib.rposix import is_valid_fd, validate_fd -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.objectmodel import specialize -from pypy.rlib.exports import export_struct +from rpython.rlib.entrypoint import entrypoint +from rpython.rlib.rposix import is_valid_fd, validate_fd +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.objectmodel import specialize +from rpython.rlib.exports import export_struct from pypy.module import exceptions from pypy.module.exceptions import interp_exceptions # CPython 2.4 compatibility from py.builtin import BaseException -from pypy.tool.sourcetools import func_with_new_name -from pypy.rpython.lltypesystem.lloperation import llop +from rpython.tool.sourcetools import func_with_new_name +from rpython.rtyper.lltypesystem.lloperation import llop DEBUG_WRAPPER = True @@ -45,7 +45,7 @@ Py_ssize_tP = rffi.CArrayPtr(Py_ssize_t) size_t = rffi.ULONG ADDR = lltype.Signed -pypydir = py.path.local(autopath.pypydir) +pypydir = py.path.local(pypydir) include_dir = pypydir / 'module' / 'cpyext' / 'include' source_dir = pypydir / 'module' / 'cpyext' / 'src' translator_c_dir = pypydir / 'translator' / 'c' @@ -696,7 +696,7 @@ def build_bridge(space): from pypy.module.cpyext.pyobject import make_ref export_symbols = list(FUNCTIONS) + SYMBOLS_C + list(GLOBALS) - from pypy.translator.c.database import LowLevelDatabase + from rpython.translator.c.database import LowLevelDatabase db = LowLevelDatabase() generate_macros(export_symbols, rename=True, do_deref=True) @@ -989,7 +989,7 @@ def setup_library(space): from pypy.module.cpyext.pyobject import make_ref export_symbols = list(FUNCTIONS) + SYMBOLS_C + list(GLOBALS) - from pypy.translator.c.database import LowLevelDatabase + from rpython.translator.c.database import LowLevelDatabase db = LowLevelDatabase() generate_macros(export_symbols, rename=False, do_deref=False) @@ -1040,7 +1040,7 @@ def load_extension_module(space, path, name): old_context = state.package_context state.package_context = name, path try: - from pypy.rlib import rdynload + from rpython.rlib import rdynload try: ll_libname = rffi.str2charp(path) try: diff --git a/pypy/module/cpyext/boolobject.py b/pypy/module/cpyext/boolobject.py index 5a420a8af209e144af36758c2d8f0d5f483cd420..d5da0936e86562b964fbe94bde3571271d999d12 100644 --- a/pypy/module/cpyext/boolobject.py +++ b/pypy/module/cpyext/boolobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import (cpython_api, PyObject, CANNOT_FAIL, build_type_checkers) diff --git a/pypy/module/cpyext/buffer.py b/pypy/module/cpyext/buffer.py index 90cea998d8f67ab4c4b4894397884d604319b0cb..3a9fb9a1802a02d4a3f9cefaf48245a47ac25d82 100644 --- a/pypy/module/cpyext/buffer.py +++ b/pypy/module/cpyext/buffer.py @@ -1,5 +1,5 @@ from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, CANNOT_FAIL, Py_buffer) from pypy.module.cpyext.pyobject import PyObject diff --git a/pypy/module/cpyext/bufferobject.py b/pypy/module/cpyext/bufferobject.py index 19d7da544e3209a758fdb3e0af6b4957c5564dc3..65cc0d61bed8aeea4a0f2d0fd5e36e35e2efe5eb 100644 --- a/pypy/module/cpyext/bufferobject.py +++ b/pypy/module/cpyext/bufferobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, Py_ssize_t, cpython_struct, bootstrap_function, PyObjectFields, PyObject) diff --git a/pypy/module/cpyext/cdatetime.py b/pypy/module/cpyext/cdatetime.py index 225efb9602238b09e4d30d833a104e86c8125596..38af22f14a45fa578008da1a48709df74b1579b4 100644 --- a/pypy/module/cpyext/cdatetime.py +++ b/pypy/module/cpyext/cdatetime.py @@ -1,11 +1,11 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.pyobject import PyObject, make_ref from pypy.module.cpyext.api import (cpython_api, CANNOT_FAIL, cpython_struct, PyObjectFields) from pypy.module.cpyext.import_ import PyImport_Import from pypy.module.cpyext.typeobject import PyTypeObjectPtr from pypy.interpreter.error import OperationError -from pypy.tool.sourcetools import func_renamer +from rpython.tool.sourcetools import func_renamer # API import function diff --git a/pypy/module/cpyext/classobject.py b/pypy/module/cpyext/classobject.py index 77c4be511718d29e5ac20e1bcbc80606a51c44d2..cacce57a9fc81c6bc31dbfc22a4fa237970b3dc3 100644 --- a/pypy/module/cpyext/classobject.py +++ b/pypy/module/cpyext/classobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( PyObjectFields, CANNOT_FAIL, cpython_api, bootstrap_function, cpython_struct, build_type_checkers) diff --git a/pypy/module/cpyext/codecs.py b/pypy/module/cpyext/codecs.py index 6a7389d436fab2b1624e3bc15f762ab6f86d4689..7115bea7d1b3d89b951c93263fa02d845fa4bd37 100644 --- a/pypy/module/cpyext/codecs.py +++ b/pypy/module/cpyext/codecs.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi +from rpython.rtyper.lltypesystem import rffi from pypy.module.cpyext.api import cpython_api, PyObject, CONST_STRING from pypy.module._codecs import interp_codecs diff --git a/pypy/module/cpyext/complexobject.py b/pypy/module/cpyext/complexobject.py index 4666ed5d3c4d94a9fe1a38c972e7ab090dec45df..d8beb463ba23167caedc58492cb1d9a5c94a4ec7 100644 --- a/pypy/module/cpyext/complexobject.py +++ b/pypy/module/cpyext/complexobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.module.cpyext.api import ( cpython_api, cpython_struct, PyObject, build_type_checkers) from pypy.module.cpyext.floatobject import PyFloat_AsDouble diff --git a/pypy/module/cpyext/dictobject.py b/pypy/module/cpyext/dictobject.py index 73a2af28436a86bd292797814b4fb8922d6a011f..7a6f674074b4ff6dcee9fcce7d2f9f5e5d67175f 100644 --- a/pypy/module/cpyext/dictobject.py +++ b/pypy/module/cpyext/dictobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, CANNOT_FAIL, build_type_checkers, Py_ssize_t, Py_ssize_tP, CONST_STRING) @@ -6,7 +6,7 @@ from pypy.module.cpyext.pyobject import PyObject, PyObjectP, borrow_from from pypy.module.cpyext.pyobject import RefcountState from pypy.module.cpyext.pyerrors import PyErr_BadInternalCall from pypy.interpreter.error import OperationError -from pypy.rlib.objectmodel import specialize +from rpython.rlib.objectmodel import specialize @cpython_api([], PyObject) def PyDict_New(space): diff --git a/pypy/module/cpyext/eval.py b/pypy/module/cpyext/eval.py index b0c377cf45edef608d562c04bf685497697b1741..63e6e7e6807385881f59f124ad84025c11705b6a 100644 --- a/pypy/module/cpyext/eval.py +++ b/pypy/module/cpyext/eval.py @@ -1,6 +1,6 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.astcompiler import consts -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, CANNOT_FAIL, CONST_STRING, FILEP, fread, feof, Py_ssize_tP, cpython_struct) diff --git a/pypy/module/cpyext/floatobject.py b/pypy/module/cpyext/floatobject.py index 9ccc5c314cbe65c8b0075a176f713d8c5ea0ad18..63e106fab9a50f144288b470af0ae11c938ebc04 100644 --- a/pypy/module/cpyext/floatobject.py +++ b/pypy/module/cpyext/floatobject.py @@ -1,8 +1,8 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( CANNOT_FAIL, cpython_api, PyObject, build_type_checkers, CONST_STRING) from pypy.interpreter.error import OperationError -from pypy.rlib.rstruct import runpack +from rpython.rlib.rstruct import runpack PyFloat_Check, PyFloat_CheckExact = build_type_checkers("Float") diff --git a/pypy/module/cpyext/frameobject.py b/pypy/module/cpyext/frameobject.py index afbb759cb72b4bce8915b009b4d33d905457b244..30fff415cb59a05fbd2df6235d8073e5f31a36fa 100644 --- a/pypy/module/cpyext/frameobject.py +++ b/pypy/module/cpyext/frameobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, bootstrap_function, PyObjectFields, cpython_struct, CANNOT_FAIL) diff --git a/pypy/module/cpyext/funcobject.py b/pypy/module/cpyext/funcobject.py index 355d56df0a70cf78eb5c73230a3a377e3b931f63..d7650c0a4eaeaca45806439b7947d9e796c074dd 100644 --- a/pypy/module/cpyext/funcobject.py +++ b/pypy/module/cpyext/funcobject.py @@ -1,10 +1,10 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( PyObjectFields, generic_cpy_call, CONST_STRING, CANNOT_FAIL, Py_ssize_t, cpython_api, bootstrap_function, cpython_struct, build_type_checkers) from pypy.module.cpyext.pyobject import ( PyObject, make_ref, from_ref, Py_DecRef, make_typedescr, borrow_from) -from pypy.rlib.unroll import unrolling_iterable +from rpython.rlib.unroll import unrolling_iterable from pypy.interpreter.error import OperationError from pypy.interpreter.function import Function, Method from pypy.interpreter.pycode import PyCode diff --git a/pypy/module/cpyext/import_.py b/pypy/module/cpyext/import_.py index 5700cec5494567d8754059d0a68a27af9fa23ad6..bc0824598537f2a4f9afe5b154663a0885cfc41b 100644 --- a/pypy/module/cpyext/import_.py +++ b/pypy/module/cpyext/import_.py @@ -2,7 +2,7 @@ from pypy.interpreter import module from pypy.module.cpyext.api import ( generic_cpy_call, cpython_api, PyObject, CONST_STRING) from pypy.module.cpyext.pyobject import borrow_from -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.interpreter.error import OperationError from pypy.interpreter.module import Module from pypy.interpreter.pycode import PyCode diff --git a/pypy/module/cpyext/intobject.py b/pypy/module/cpyext/intobject.py index 186a9b688b987f9360a3b738eb4e8c80ba5981d6..160341cd4d3db6218b685e6844ec8b884949acca 100644 --- a/pypy/module/cpyext/intobject.py +++ b/pypy/module/cpyext/intobject.py @@ -1,12 +1,12 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.error import OperationError from pypy.module.cpyext.api import ( cpython_api, cpython_struct, build_type_checkers, bootstrap_function, PyObject, PyObjectFields, CONST_STRING, CANNOT_FAIL, Py_ssize_t) from pypy.module.cpyext.pyobject import ( make_typedescr, track_reference, RefcountState, from_ref) -from pypy.rlib.rarithmetic import r_uint, intmask, LONG_TEST, r_ulonglong +from rpython.rlib.rarithmetic import r_uint, intmask, LONG_TEST, r_ulonglong from pypy.objspace.std.intobject import W_IntObject import sys diff --git a/pypy/module/cpyext/iterator.py b/pypy/module/cpyext/iterator.py index 927f480c3653a3052fa99e9bbd1bc66b1ea82611..42b8de414905ec57f06193991abab608f0f042a4 100644 --- a/pypy/module/cpyext/iterator.py +++ b/pypy/module/cpyext/iterator.py @@ -2,7 +2,7 @@ from pypy.interpreter.error import OperationError from pypy.module.cpyext.api import (generic_cpy_call, cpython_api, PyObject, CANNOT_FAIL) import pypy.module.__builtin__.operation as operation -from pypy.rpython.lltypesystem import rffi +from rpython.rtyper.lltypesystem import rffi @cpython_api([PyObject, PyObject], PyObject) diff --git a/pypy/module/cpyext/listobject.py b/pypy/module/cpyext/listobject.py index c39312c3fa869ef5f144701195af08b717a5157e..7ea61589377e16ed7f6b74b286e0fd6665456e72 100644 --- a/pypy/module/cpyext/listobject.py +++ b/pypy/module/cpyext/listobject.py @@ -1,5 +1,5 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import (cpython_api, CANNOT_FAIL, Py_ssize_t, build_type_checkers) from pypy.module.cpyext.pyerrors import PyErr_BadInternalCall diff --git a/pypy/module/cpyext/longobject.py b/pypy/module/cpyext/longobject.py index 7afc8eb99973adf5fc016ae40b29ac4d38844aef..a57db872f2e534ec2b12eb937310ff77e9555cfb 100644 --- a/pypy/module/cpyext/longobject.py +++ b/pypy/module/cpyext/longobject.py @@ -1,12 +1,12 @@ -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.module.cpyext.api import ( cpython_api, PyObject, build_type_checkers, Py_ssize_t, CONST_STRING, ADDR, CANNOT_FAIL) from pypy.objspace.std.longobject import W_LongObject from pypy.interpreter.error import OperationError from pypy.module.cpyext.intobject import PyInt_AsUnsignedLongMask -from pypy.rlib.rbigint import rbigint -from pypy.rlib.rarithmetic import intmask +from rpython.rlib.rbigint import rbigint +from rpython.rlib.rarithmetic import intmask PyLong_Check, PyLong_CheckExact = build_type_checkers("Long") diff --git a/pypy/module/cpyext/mapping.py b/pypy/module/cpyext/mapping.py index bad02bea565a4181d41c9581d2ec23dc04ae7744..66e9997990b63ddaa5a49a2e36f04c8a460b5d77 100644 --- a/pypy/module/cpyext/mapping.py +++ b/pypy/module/cpyext/mapping.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.module.cpyext.api import ( cpython_api, CANNOT_FAIL, CONST_STRING, Py_ssize_t) from pypy.module.cpyext.pyobject import PyObject diff --git a/pypy/module/cpyext/methodobject.py b/pypy/module/cpyext/methodobject.py index 69722f77fd57f01cfca1c873b7750342709a4521..5fb1cf77c0a4d848040ed4b28dc0d396bccd5050 100644 --- a/pypy/module/cpyext/methodobject.py +++ b/pypy/module/cpyext/methodobject.py @@ -6,7 +6,7 @@ from pypy.interpreter.gateway import interp2app from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.function import ( BuiltinFunction, Method, StaticMethod, ClassMethod) -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.pyobject import (PyObject, from_ref, make_ref, make_typedescr, Py_DecRef) from pypy.module.cpyext.api import ( @@ -14,7 +14,7 @@ from pypy.module.cpyext.api import ( METH_O, CONST_STRING, METH_CLASS, METH_STATIC, METH_COEXIST, METH_NOARGS, METH_VARARGS, build_type_checkers, PyObjectFields, bootstrap_function) from pypy.module.cpyext.pyerrors import PyErr_Occurred -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.objectmodel import we_are_translated PyCFunction_typedef = rffi.COpaquePtr(typedef='PyCFunction') PyCFunction = lltype.Ptr(lltype.FuncType([PyObject, PyObject], PyObject)) diff --git a/pypy/module/cpyext/modsupport.py b/pypy/module/cpyext/modsupport.py index d15774337203c494d18220c49d7016a4cef994f1..ff4a9a62ec17333c844fa42c569477df8580fb03 100644 --- a/pypy/module/cpyext/modsupport.py +++ b/pypy/module/cpyext/modsupport.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import cpython_api, cpython_struct, \ METH_STATIC, METH_CLASS, METH_COEXIST, CANNOT_FAIL, CONST_STRING from pypy.module.cpyext.pyobject import PyObject, borrow_from diff --git a/pypy/module/cpyext/number.py b/pypy/module/cpyext/number.py index 8794fcf54e9718b0e53ba2aae98dd12a89b14bad..d3e31b6c8ff602cc27df5ea8ab1d6f1099eb36f2 100644 --- a/pypy/module/cpyext/number.py +++ b/pypy/module/cpyext/number.py @@ -1,8 +1,8 @@ from pypy.interpreter.error import OperationError from pypy.module.cpyext.api import cpython_api, CANNOT_FAIL, Py_ssize_t from pypy.module.cpyext.pyobject import PyObject -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.tool.sourcetools import func_with_new_name +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.tool.sourcetools import func_with_new_name @cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL) def PyIndex_Check(space, w_obj): diff --git a/pypy/module/cpyext/object.py b/pypy/module/cpyext/object.py index 8c782d71f9c8e3a085be9d42da7aa0bf9f3cd346..f794fbb0a7a1a4ee177239bd273d127869c4d4fa 100644 --- a/pypy/module/cpyext/object.py +++ b/pypy/module/cpyext/object.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, generic_cpy_call, CANNOT_FAIL, Py_ssize_t, Py_ssize_tP, PyVarObject, Py_buffer, diff --git a/pypy/module/cpyext/presetup.py b/pypy/module/cpyext/presetup.py index a97e75b6a2249d2e3cc730c2e52ee3c5e2baf242..5c3f44f7e2990e43c60e6de232fdc1547c156d9e 100644 --- a/pypy/module/cpyext/presetup.py +++ b/pypy/module/cpyext/presetup.py @@ -11,7 +11,7 @@ import sys, os dn = os.path.dirname rootdir = dn(dn(dn(dn(__file__)))) sys.path.insert(0, rootdir) -from pypy.tool.udir import udir +from rpython.tool.udir import udir pypydir = os.path.join(rootdir, 'pypy') f = open(os.path.join(str(udir), 'pyconfig.h'), "w") f.write("\n") diff --git a/pypy/module/cpyext/pyerrors.py b/pypy/module/cpyext/pyerrors.py index e389791e772738a154fffc0a5d10897e9b7aa5ce..9d1e33f2491a6d8e1a107ffad9f468ac88d6c01a 100644 --- a/pypy/module/cpyext/pyerrors.py +++ b/pypy/module/cpyext/pyerrors.py @@ -1,6 +1,6 @@ import os -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.error import OperationError from pypy.interpreter import pytraceback from pypy.module.cpyext.api import cpython_api, CANNOT_FAIL, CONST_STRING @@ -9,7 +9,7 @@ from pypy.module.cpyext.pyobject import ( PyObject, PyObjectP, make_ref, from_ref, Py_DecRef, borrow_from) from pypy.module.cpyext.state import State from pypy.module.cpyext.import_ import PyImport_Import -from pypy.rlib.rposix import get_errno +from rpython.rlib.rposix import get_errno @cpython_api([PyObject, PyObject], lltype.Void) def PyErr_SetObject(space, w_type, w_value): diff --git a/pypy/module/cpyext/pyfile.py b/pypy/module/cpyext/pyfile.py index b196963f027fac7050f1b710a0e8651350e37aa0..628a90a2c779f2b2ad18e74c2027fe065b9c2fe0 100644 --- a/pypy/module/cpyext/pyfile.py +++ b/pypy/module/cpyext/pyfile.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, CANNOT_FAIL, CONST_STRING, FILEP, build_type_checkers) from pypy.module.cpyext.pyobject import PyObject, borrow_from diff --git a/pypy/module/cpyext/pyobject.py b/pypy/module/cpyext/pyobject.py index a208717804869f95a2e3fa88d693d49fa0eb90cd..432ad917f315f6a7c2e64da8c303fe2a5e4c7646 100644 --- a/pypy/module/cpyext/pyobject.py +++ b/pypy/module/cpyext/pyobject.py @@ -1,16 +1,16 @@ import sys from pypy.interpreter.baseobjspace import W_Root, SpaceCache -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, bootstrap_function, PyObject, PyObjectP, ADDR, CANNOT_FAIL, Py_TPFLAGS_HEAPTYPE, PyTypeObjectPtr) from pypy.module.cpyext.state import State from pypy.objspace.std.typeobject import W_TypeObject from pypy.objspace.std.objectobject import W_ObjectObject -from pypy.rlib.objectmodel import specialize, we_are_translated -from pypy.rlib.rweakref import RWeakKeyDictionary -from pypy.rpython.annlowlevel import llhelper +from rpython.rlib.objectmodel import specialize, we_are_translated +from rpython.rlib.rweakref import RWeakKeyDictionary +from rpython.rtyper.annlowlevel import llhelper #________________________________________________________ # type description diff --git a/pypy/module/cpyext/pystate.py b/pypy/module/cpyext/pystate.py index af733392e3b4e284fb29312dfa1dd14c242680b2..b1d2e7958f47d7af4aba64ba0b4ba3d4ba485316 100644 --- a/pypy/module/cpyext/pystate.py +++ b/pypy/module/cpyext/pystate.py @@ -1,7 +1,7 @@ from pypy.module.cpyext.api import ( cpython_api, generic_cpy_call, CANNOT_FAIL, CConfig, cpython_struct) from pypy.module.cpyext.pyobject import PyObject, Py_DecRef, make_ref, from_ref -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.thread import ll_thread, os_thread PyInterpreterStateStruct = lltype.ForwardReference() diff --git a/pypy/module/cpyext/pystrtod.py b/pypy/module/cpyext/pystrtod.py index bb2355a51e0aba45a232059a95681f89dd3aa1ac..b1e56b6d37d5722491f8782748b4b36523c06658 100644 --- a/pypy/module/cpyext/pystrtod.py +++ b/pypy/module/cpyext/pystrtod.py @@ -2,11 +2,11 @@ import errno from pypy.interpreter.error import OperationError from pypy.module.cpyext.api import cpython_api from pypy.module.cpyext.pyobject import PyObject -from pypy.rlib import rdtoa -from pypy.rlib import rfloat -from pypy.rlib import rposix -from pypy.rpython.lltypesystem import lltype -from pypy.rpython.lltypesystem import rffi +from rpython.rlib import rdtoa +from rpython.rlib import rfloat +from rpython.rlib import rposix +from rpython.rtyper.lltypesystem import lltype +from rpython.rtyper.lltypesystem import rffi @cpython_api([rffi.CCHARP, rffi.CCHARPP, PyObject], rffi.DOUBLE, error=-1.0) diff --git a/pypy/module/cpyext/pythonrun.py b/pypy/module/cpyext/pythonrun.py index f1efa718e85ef07ce539ab847961a0d3a45a7135..06ac3010161008516fb4b83245f3edae9308b579 100644 --- a/pypy/module/cpyext/pythonrun.py +++ b/pypy/module/cpyext/pythonrun.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import cpython_api, CANNOT_FAIL from pypy.module.cpyext.state import State diff --git a/pypy/module/cpyext/sequence.py b/pypy/module/cpyext/sequence.py index e2112ca07c51385cae8049d7a46a90c03bc8a7c1..7d1a83a098e453da74f7e59d610ef17dc4ae1d01 100644 --- a/pypy/module/cpyext/sequence.py +++ b/pypy/module/cpyext/sequence.py @@ -3,7 +3,7 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.module.cpyext.api import ( cpython_api, CANNOT_FAIL, CONST_STRING, Py_ssize_t) from pypy.module.cpyext.pyobject import PyObject, borrow_from -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.objspace.std import listobject, tupleobject from pypy.module.cpyext.tupleobject import PyTuple_Check, PyTuple_SetItem diff --git a/pypy/module/cpyext/setobject.py b/pypy/module/cpyext/setobject.py index f90bdf05c6c58791ed29db87f4dc0eaaf48ca12b..d16bcbffa20e08492ac6a88277dd654d202daaed 100644 --- a/pypy/module/cpyext/setobject.py +++ b/pypy/module/cpyext/setobject.py @@ -1,5 +1,5 @@ from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import (cpython_api, Py_ssize_t, CANNOT_FAIL, build_type_checkers) from pypy.module.cpyext.pyobject import (PyObject, PyObjectP, Py_DecRef, diff --git a/pypy/module/cpyext/sliceobject.py b/pypy/module/cpyext/sliceobject.py index b646c3fd9ee9adf9119e0fca0090ac04a949a915..f509a968cf20ea6ccda17409cf01077c889e5c49 100644 --- a/pypy/module/cpyext/sliceobject.py +++ b/pypy/module/cpyext/sliceobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, cpython_struct, bootstrap_function, build_type_checkers, CANNOT_FAIL, Py_ssize_t, Py_ssize_tP, PyObjectFields) diff --git a/pypy/module/cpyext/slotdefs.py b/pypy/module/cpyext/slotdefs.py index f4661d22121ae6e5dbc886add133bcd9cdbda881..f6e06da8c6b43283143262f294d82c3b84895035 100644 --- a/pypy/module/cpyext/slotdefs.py +++ b/pypy/module/cpyext/slotdefs.py @@ -2,7 +2,7 @@ from __future__ import with_statement import re -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, generic_cpy_call, PyObject, Py_ssize_t) from pypy.module.cpyext.typeobjectdefs import ( @@ -17,10 +17,10 @@ from pypy.module.cpyext.state import State from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.buffer import Buffer as W_Buffer from pypy.interpreter.argument import Arguments -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.objectmodel import specialize -from pypy.tool.sourcetools import func_renamer -from pypy.rpython.annlowlevel import llhelper +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.objectmodel import specialize +from rpython.tool.sourcetools import func_renamer +from rpython.rtyper.annlowlevel import llhelper # XXX: Also defined in object.h Py_LT = 0 @@ -320,7 +320,7 @@ def slot_tp_iter(space, w_self): def slot_tp_iternext(space, w_self): return space.next(w_self) -from pypy.rlib.nonconst import NonConstant +from rpython.rlib.nonconst import NonConstant SLOTS = {} diff --git a/pypy/module/cpyext/state.py b/pypy/module/cpyext/state.py index ef156436c87a242bee98fb853b37d622c8f00139..67a4e24d16ae712044622d040c7031a2bcfa6eb0 100644 --- a/pypy/module/cpyext/state.py +++ b/pypy/module/cpyext/state.py @@ -1,8 +1,8 @@ -from pypy.rlib.objectmodel import we_are_translated -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rlib.objectmodel import we_are_translated +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import lltype -from pypy.rlib.rdynload import DLLHANDLE +from rpython.rtyper.lltypesystem import lltype +from rpython.rlib.rdynload import DLLHANDLE import sys class State: diff --git a/pypy/module/cpyext/stringobject.py b/pypy/module/cpyext/stringobject.py index f2a1fd5787817bb1c9add527a9267c9a6809854e..7f2983894ca9f579e94736c8a6f4d98d3a58d437 100644 --- a/pypy/module/cpyext/stringobject.py +++ b/pypy/module/cpyext/stringobject.py @@ -1,5 +1,5 @@ from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( cpython_api, cpython_struct, bootstrap_function, build_type_checkers, PyObjectFields, Py_ssize_t, CONST_STRING, CANNOT_FAIL) diff --git a/pypy/module/cpyext/structmember.py b/pypy/module/cpyext/structmember.py index 065575b373f92a382b2e03bb47c52e595eac7b87..44f2a3507a3cf263e5aad023f56d092134290837 100644 --- a/pypy/module/cpyext/structmember.py +++ b/pypy/module/cpyext/structmember.py @@ -1,6 +1,6 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.typedef import TypeDef, GetSetProperty -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.structmemberdefs import * from pypy.module.cpyext.api import ADDR, PyObjectP, cpython_api from pypy.module.cpyext.intobject import PyInt_AsLong, PyInt_AsUnsignedLong @@ -12,7 +12,7 @@ from pypy.module.cpyext.floatobject import PyFloat_AsDouble from pypy.module.cpyext.longobject import ( PyLong_AsLongLong, PyLong_AsUnsignedLongLong, PyLong_AsSsize_t) from pypy.module.cpyext.typeobjectdefs import PyMemberDef -from pypy.rlib.unroll import unrolling_iterable +from rpython.rlib.unroll import unrolling_iterable integer_converters = unrolling_iterable([ (T_SHORT, rffi.SHORT, PyInt_AsLong), diff --git a/pypy/module/cpyext/stubs.py b/pypy/module/cpyext/stubs.py index 0c54ef23cafe9f672254dd0961ca45d1acb83182..5438690269381df4cb7cd74972f59df23dd7d862 100644 --- a/pypy/module/cpyext/stubs.py +++ b/pypy/module/cpyext/stubs.py @@ -2,7 +2,7 @@ from pypy.module.cpyext.api import ( cpython_api, PyObject, PyObjectP, CANNOT_FAIL ) from pypy.module.cpyext.complexobject import Py_complex_ptr as Py_complex -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype # we don't really care PyTypeObjectPtr = rffi.VOIDP diff --git a/pypy/module/cpyext/stubsactive.py b/pypy/module/cpyext/stubsactive.py index 48dc36e87f0b6c64d01b9d5b5da23335a961f80f..17b4176d419f43f4625d67e417c6c8debe0211e9 100644 --- a/pypy/module/cpyext/stubsactive.py +++ b/pypy/module/cpyext/stubsactive.py @@ -1,7 +1,7 @@ from pypy.module.cpyext.pyobject import PyObject from pypy.module.cpyext.api import cpython_api, Py_ssize_t, CANNOT_FAIL, CConfig from pypy.module.cpyext.object import FILEP -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.pystate import PyThreadState, PyInterpreterState diff --git a/pypy/module/cpyext/sysmodule.py b/pypy/module/cpyext/sysmodule.py index d4a5ab33cd68503c37580e4c5d542e8807aa495c..cc33c9246c17be4c6b6dffaa8d26447194f625c8 100644 --- a/pypy/module/cpyext/sysmodule.py +++ b/pypy/module/cpyext/sysmodule.py @@ -1,5 +1,5 @@ from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import CANNOT_FAIL, cpython_api, CONST_STRING from pypy.module.cpyext.pyobject import PyObject, borrow_from diff --git a/pypy/module/cpyext/test/test_api.py b/pypy/module/cpyext/test/test_api.py index ffc44caa843240cfc1a4eb1d5a48ce82527c67de..65ea8dbbdf2533cb7727c9537f146f4ef4f1335b 100644 --- a/pypy/module/cpyext/test/test_api.py +++ b/pypy/module/cpyext/test/test_api.py @@ -1,5 +1,5 @@ import py -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.baseobjspace import W_Root from pypy.module.cpyext.state import State from pypy.module.cpyext import api @@ -83,7 +83,7 @@ class TestConversion(BaseApiTest): api.PyPy_GetReference(space.w_None) def test_typedef(self, space): - from pypy.translator.c.database import LowLevelDatabase + from rpython.translator.c.database import LowLevelDatabase db = LowLevelDatabase() assert (api.c_function_signature(db, api.FUNCTIONS['PyPy_TypedefTest1']) == ('Py_ssize_t', 'Py_ssize_t arg0')) diff --git a/pypy/module/cpyext/test/test_bufferobject.py b/pypy/module/cpyext/test/test_bufferobject.py index 6f985b56aa8f5305ceac083395d2c45effff77ba..e64a6d9d04dfc15ad6b2bca2d20bfc24f78f5a44 100644 --- a/pypy/module/cpyext/test/test_bufferobject.py +++ b/pypy/module/cpyext/test/test_bufferobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase from pypy.module.cpyext.api import PyObject diff --git a/pypy/module/cpyext/test/test_codecs.py b/pypy/module/cpyext/test/test_codecs.py index 000755c0856762f031d5d117d55515cfa7ccfb35..2ad900a4bb79711069c74d80e42ec08d7aafa9b6 100644 --- a/pypy/module/cpyext/test/test_codecs.py +++ b/pypy/module/cpyext/test/test_codecs.py @@ -1,6 +1,6 @@ # encoding: iso-8859-15 from pypy.module.cpyext.test.test_api import BaseApiTest -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype class TestCodecs(BaseApiTest): def test_incremental(self, space, api): diff --git a/pypy/module/cpyext/test/test_cpyext.py b/pypy/module/cpyext/test/test_cpyext.py index ee14120b8317c0d0f485254f80c5e91d85d563dd..1247cdbde9e10bc3ce69e1b92410a6ba0e203a0c 100644 --- a/pypy/module/cpyext/test/test_cpyext.py +++ b/pypy/module/cpyext/test/test_cpyext.py @@ -4,20 +4,20 @@ import os.path import py +from pypy.conftest import pypydir from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import interp2app, unwrap_spec -from pypy.rpython.lltypesystem import rffi, lltype, ll2ctypes -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.translator import platform -from pypy.translator.gensupp import uniquemodulename -from pypy.tool.udir import udir +from rpython.rtyper.lltypesystem import rffi, lltype, ll2ctypes +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.translator import platform +from rpython.translator.gensupp import uniquemodulename +from rpython.tool.udir import udir from pypy.module.cpyext import api from pypy.module.cpyext.state import State from pypy.module.cpyext.pyobject import RefcountState from pypy.module.cpyext.pyobject import Py_DecRef, InvalidPointerException -from pypy.translator.goal import autopath -from pypy.tool.identity_dict import identity_dict -from pypy.tool import leakfinder +from rpython.tool.identity_dict import identity_dict +from rpython.tool import leakfinder @api.cpython_api([], api.PyObject) def PyPy_Crash1(space): @@ -157,7 +157,7 @@ class LeakCheckingTest(object): class AppTestApi(LeakCheckingTest): def setup_class(cls): - from pypy.rlib.clibffi import get_libc_name + from rpython.rlib.clibffi import get_libc_name cls.w_libc = cls.space.wrap(get_libc_name()) def test_load_error(self): @@ -235,7 +235,7 @@ class AppTestCpythonExtensionBase(LeakCheckingTest): else: if filename is None: filename = name - filename = py.path.local(autopath.pypydir) / 'module' \ + filename = py.path.local(pypydir) / 'module' \ / 'cpyext'/ 'test' / (filename + ".c") kwds = dict(separate_module_files=[filename]) @@ -304,7 +304,7 @@ class AppTestCpythonExtensionBase(LeakCheckingTest): self.w_record_imported_module = self.space.wrap( interp2app(record_imported_module)) self.w_here = self.space.wrap( - str(py.path.local(autopath.pypydir)) + '/module/cpyext/test/') + str(py.path.local(pypydir)) + '/module/cpyext/test/') # create the file lock before we count allocations diff --git a/pypy/module/cpyext/test/test_dictobject.py b/pypy/module/cpyext/test/test_dictobject.py index 0ca0eed9f342da879e0207eb3fc7d77555227043..dbfcae2444ab78bb8bbc3ab71d2a986d0b7a8a3d 100644 --- a/pypy/module/cpyext/test/test_dictobject.py +++ b/pypy/module/cpyext/test/test_dictobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.api import Py_ssize_tP, PyObjectP from pypy.module.cpyext.pyobject import make_ref, from_ref diff --git a/pypy/module/cpyext/test/test_eval.py b/pypy/module/cpyext/test/test_eval.py index 3c3cafe76ce140421f67b1a7c99e0b5b44835f16..6217bdbba5fcdeea9512686142d2b53559920354 100644 --- a/pypy/module/cpyext/test/test_eval.py +++ b/pypy/module/cpyext/test/test_eval.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.eval import ( @@ -6,7 +6,7 @@ from pypy.module.cpyext.eval import ( from pypy.module.cpyext.api import fopen, fclose, fileno, Py_ssize_tP from pypy.interpreter.gateway import interp2app from pypy.interpreter.astcompiler import consts -from pypy.tool.udir import udir +from rpython.tool.udir import udir import sys, os class TestEval(BaseApiTest): diff --git a/pypy/module/cpyext/test/test_floatobject.py b/pypy/module/cpyext/test/test_floatobject.py index fcf5d0e566ebcf5bea22fe20c80f8de20d9be05e..df55205320c18ed4a92c8834bca99ee5c07a3a6a 100644 --- a/pypy/module/cpyext/test/test_floatobject.py +++ b/pypy/module/cpyext/test/test_floatobject.py @@ -1,6 +1,6 @@ from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase -from pypy.rpython.lltypesystem import rffi +from rpython.rtyper.lltypesystem import rffi class TestFloatObject(BaseApiTest): def test_floatobject(self, space, api): diff --git a/pypy/module/cpyext/test/test_funcobject.py b/pypy/module/cpyext/test/test_funcobject.py index da7b822cc9146cfa667a77b65b1d3241ce041673..82fa95a149562c4bb3804ace14058b09bcdbc6eb 100644 --- a/pypy/module/cpyext/test/test_funcobject.py +++ b/pypy/module/cpyext/test/test_funcobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.pyobject import PyObject, make_ref, from_ref diff --git a/pypy/module/cpyext/test/test_import.py b/pypy/module/cpyext/test/test_import.py index 146ef32bd59e9356b80e6670fea9601083df919c..aebcac662e56306bb6b72400dafce89e0cb02495 100644 --- a/pypy/module/cpyext/test/test_import.py +++ b/pypy/module/cpyext/test/test_import.py @@ -1,6 +1,6 @@ from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype class TestImport(BaseApiTest): def test_import(self, space, api): diff --git a/pypy/module/cpyext/test/test_longobject.py b/pypy/module/cpyext/test/test_longobject.py index 8176bf597f4ba04f7806bd3ce2c37211a3d122e2..12c74b827267aac2dada8897e54aa0047fd8976f 100644 --- a/pypy/module/cpyext/test/test_longobject.py +++ b/pypy/module/cpyext/test/test_longobject.py @@ -1,5 +1,5 @@ import sys, py -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.objspace.std.intobject import W_IntObject from pypy.objspace.std.longobject import W_LongObject from pypy.module.cpyext.test.test_api import BaseApiTest diff --git a/pypy/module/cpyext/test/test_mapping.py b/pypy/module/cpyext/test/test_mapping.py index e22340c93f026159e045e5122950a7d6b98fc17f..6470a2968abe720ce9383ed9f978d3bb6d849c1b 100644 --- a/pypy/module/cpyext/test/test_mapping.py +++ b/pypy/module/cpyext/test/test_mapping.py @@ -1,5 +1,5 @@ from pypy.module.cpyext.test.test_api import BaseApiTest -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi class TestMapping(BaseApiTest): def test_check(self, space, api): diff --git a/pypy/module/cpyext/test/test_methodobject.py b/pypy/module/cpyext/test/test_methodobject.py index 46382cd737cd224a1e442809756c67e5cc2eae12..9ac60bcf3df73e7239b1424bc622fdee324bb0b4 100644 --- a/pypy/module/cpyext/test/test_methodobject.py +++ b/pypy/module/cpyext/test/test_methodobject.py @@ -5,7 +5,7 @@ from pypy.module.cpyext.api import ApiFunction from pypy.module.cpyext.pyobject import PyObject, make_ref, Py_DecRef from pypy.module.cpyext.methodobject import ( PyDescr_NewMethod, PyCFunction_typedef) -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype class AppTestMethodObject(AppTestCpythonExtensionBase): def test_call_METH(self): diff --git a/pypy/module/cpyext/test/test_number.py b/pypy/module/cpyext/test/test_number.py index d8552aaaaeae3ba2f2fb72e22ac4ee6a0a984e69..d120e4f16746b6922fbee4ca20348b59e162a2b1 100644 --- a/pypy/module/cpyext/test/test_number.py +++ b/pypy/module/cpyext/test/test_number.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.error import OperationError from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext import sequence diff --git a/pypy/module/cpyext/test/test_object.py b/pypy/module/cpyext/test/test_object.py index 46a2f5c568441a052abe70a102f0cb33903bc4dc..dc53668137c7b093b97137b258069aab17cb42c6 100644 --- a/pypy/module/cpyext/test/test_object.py +++ b/pypy/module/cpyext/test/test_object.py @@ -2,7 +2,7 @@ import py from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import ( Py_LT, Py_LE, Py_NE, Py_EQ, Py_GE, Py_GT) diff --git a/pypy/module/cpyext/test/test_pyerrors.py b/pypy/module/cpyext/test/test_pyerrors.py index c38c853ef9965840366c7d19a9d7388d891ac795..38631346a97a1566d425d720a432978c1b49e210 100644 --- a/pypy/module/cpyext/test/test_pyerrors.py +++ b/pypy/module/cpyext/test/test_pyerrors.py @@ -4,7 +4,7 @@ import StringIO from pypy.module.cpyext.state import State from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase -from pypy.rpython.lltypesystem import rffi, ll2ctypes +from rpython.rtyper.lltypesystem import rffi, ll2ctypes from pypy.interpreter.gateway import interp2app diff --git a/pypy/module/cpyext/test/test_pyfile.py b/pypy/module/cpyext/test/test_pyfile.py index 2a911c99b3fda231e7ef1481611155cafbe848e1..33d798f2077943b9524c99effda9943ed127e28f 100644 --- a/pypy/module/cpyext/test/test_pyfile.py +++ b/pypy/module/cpyext/test/test_pyfile.py @@ -1,8 +1,8 @@ from pypy.module.cpyext.api import fopen, fclose, fwrite from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.object import Py_PRINT_RAW -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.tool.udir import udir +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.tool.udir import udir import pytest class TestFile(BaseApiTest): diff --git a/pypy/module/cpyext/test/test_pystate.py b/pypy/module/cpyext/test/test_pystate.py index e446bc0f460719712d648f1233b163d3a166701c..98e6d5049898d3600e8f9b4cacc684e5a1e37be6 100644 --- a/pypy/module/cpyext/test/test_pystate.py +++ b/pypy/module/cpyext/test/test_pystate.py @@ -1,12 +1,12 @@ from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase from pypy.module.cpyext.test.test_api import BaseApiTest -from pypy.rpython.lltypesystem.lltype import nullptr +from rpython.rtyper.lltypesystem.lltype import nullptr from pypy.module.cpyext.pystate import PyInterpreterState, PyThreadState from pypy.module.cpyext.pyobject import from_ref -from pypy.rpython.lltypesystem import lltype +from rpython.rtyper.lltypesystem import lltype from pypy.module.cpyext.test.test_cpyext import LeakCheckingTest, freeze_refcnts from pypy.module.cpyext.pystate import PyThreadState_Get, PyInterpreterState_Head -from pypy.tool import leakfinder +from rpython.tool import leakfinder class AppTestThreads(AppTestCpythonExtensionBase): def test_allow_threads(self): diff --git a/pypy/module/cpyext/test/test_pystrtod.py b/pypy/module/cpyext/test/test_pystrtod.py index df0818ea70b4e6596794b946c0d2d8d82a1bc71c..1a0fb9ce9e6d0faab78863921eabd262059519ad 100644 --- a/pypy/module/cpyext/test/test_pystrtod.py +++ b/pypy/module/cpyext/test/test_pystrtod.py @@ -1,8 +1,8 @@ import math from pypy.module.cpyext.test.test_api import BaseApiTest -from pypy.rpython.lltypesystem import rffi -from pypy.rpython.lltypesystem import lltype +from rpython.rtyper.lltypesystem import rffi +from rpython.rtyper.lltypesystem import lltype class TestPyOS_string_to_double(BaseApiTest): diff --git a/pypy/module/cpyext/test/test_sequence.py b/pypy/module/cpyext/test/test_sequence.py index cdd4ed5906bf4b00e117c634f9d36823c4c99f64..020a2eaa48daf48cf04b0dca425b69ed588c6b3f 100644 --- a/pypy/module/cpyext/test/test_sequence.py +++ b/pypy/module/cpyext/test/test_sequence.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.error import OperationError from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext import sequence diff --git a/pypy/module/cpyext/test/test_setobject.py b/pypy/module/cpyext/test/test_setobject.py index f46dc4f824e47628ae3dac977d5a73f781b88891..7a2a72a2e3f622ab152e56e56300159178567cc7 100644 --- a/pypy/module/cpyext/test/test_setobject.py +++ b/pypy/module/cpyext/test/test_setobject.py @@ -2,7 +2,7 @@ import py from pypy.module.cpyext.pyobject import PyObject, PyObjectP, make_ref, from_ref from pypy.module.cpyext.test.test_api import BaseApiTest -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype class TestTupleObject(BaseApiTest): diff --git a/pypy/module/cpyext/test/test_sliceobject.py b/pypy/module/cpyext/test/test_sliceobject.py index f7acf34c264513d72e78ecdfcf271f42f292d976..7c11a3ba378277807ce3bb89be87f013ef9b1214 100644 --- a/pypy/module/cpyext/test/test_sliceobject.py +++ b/pypy/module/cpyext/test/test_sliceobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase from pypy.module.cpyext.api import Py_ssize_t, Py_ssize_tP diff --git a/pypy/module/cpyext/test/test_stringobject.py b/pypy/module/cpyext/test/test_stringobject.py index e472300d4cd71927bde5a5e06ac60e9d5ae51f2e..0b74e45df3c1244978b0eb530708b9b3255bcc9c 100644 --- a/pypy/module/cpyext/test/test_stringobject.py +++ b/pypy/module/cpyext/test/test_stringobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase from pypy.module.cpyext.stringobject import new_empty_str, PyStringObject diff --git a/pypy/module/cpyext/test/test_structseq.py b/pypy/module/cpyext/test/test_structseq.py index 5a0bc672c2a416dd124005d80efacd5d777137ab..97f4271d801c6b9695bf52bf27bb4fbeea29c91b 100644 --- a/pypy/module/cpyext/test/test_structseq.py +++ b/pypy/module/cpyext/test/test_structseq.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase from pypy.module.cpyext.api import PyObject diff --git a/pypy/module/cpyext/test/test_sysmodule.py b/pypy/module/cpyext/test/test_sysmodule.py index 61e1710cf6e2041f83c894017250872598242046..081ebc73f7101d343e5134fbd78c1e7265ba6e4d 100644 --- a/pypy/module/cpyext/test/test_sysmodule.py +++ b/pypy/module/cpyext/test/test_sysmodule.py @@ -1,6 +1,6 @@ from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase from pypy.module.cpyext.test.test_api import BaseApiTest -from pypy.rpython.lltypesystem import rffi +from rpython.rtyper.lltypesystem import rffi class AppTestSysModule(AppTestCpythonExtensionBase): def test_sysmodule(self): diff --git a/pypy/module/cpyext/test/test_translate.py b/pypy/module/cpyext/test/test_translate.py index f8cfed2adeb6cb51b00459206c496581716e984f..343c229891a7ff3e6c26a448878247cfcbe42c7d 100644 --- a/pypy/module/cpyext/test/test_translate.py +++ b/pypy/module/cpyext/test/test_translate.py @@ -1,10 +1,10 @@ -from pypy.translator.c.test.test_genc import compile +from rpython.translator.c.test.test_genc import compile import pypy.module.cpyext.api from pypy.module.cpyext.api import cpython_api -from pypy.rpython.annlowlevel import llhelper -from pypy.rpython.lltypesystem import lltype -from pypy.rlib.objectmodel import specialize -from pypy.rlib.nonconst import NonConstant +from rpython.rtyper.annlowlevel import llhelper +from rpython.rtyper.lltypesystem import lltype +from rpython.rlib.objectmodel import specialize +from rpython.rlib.nonconst import NonConstant def test_llhelper(monkeypatch): """Show how to get function pointers used in type slots""" diff --git a/pypy/module/cpyext/test/test_tupleobject.py b/pypy/module/cpyext/test/test_tupleobject.py index a5d25773e40304b049ccee4d40642d5101b676d1..3c36edd39bf54edcecde8b89513e5075ab6acf5b 100644 --- a/pypy/module/cpyext/test/test_tupleobject.py +++ b/pypy/module/cpyext/test/test_tupleobject.py @@ -2,7 +2,7 @@ import py from pypy.module.cpyext.pyobject import PyObject, PyObjectP, make_ref, from_ref from pypy.module.cpyext.test.test_api import BaseApiTest -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype class TestTupleObject(BaseApiTest): diff --git a/pypy/module/cpyext/test/test_typeobject.py b/pypy/module/cpyext/test/test_typeobject.py index c64f273b9b62194d0c28532db882538f33679e69..08d0deeed01969c90afa8f174ad9848aee00d636 100644 --- a/pypy/module/cpyext/test/test_typeobject.py +++ b/pypy/module/cpyext/test/test_typeobject.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase from pypy.module.cpyext.test.test_api import BaseApiTest from pypy.module.cpyext.pyobject import PyObject, make_ref, from_ref diff --git a/pypy/module/cpyext/test/test_unicodeobject.py b/pypy/module/cpyext/test/test_unicodeobject.py index d1107981527135c8b8aada3cf5cbc69118383bf5..ce0bcea3f00e9f77505a03503df8ae914b214874 100644 --- a/pypy/module/cpyext/test/test_unicodeobject.py +++ b/pypy/module/cpyext/test/test_unicodeobject.py @@ -5,7 +5,7 @@ from pypy.module.cpyext.unicodeobject import ( Py_UNICODE, PyUnicodeObject, new_empty_unicode) from pypy.module.cpyext.api import PyObjectP, PyObject from pypy.module.cpyext.pyobject import Py_DecRef, from_ref -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype import sys, py class AppTestUnicodeObject(AppTestCpythonExtensionBase): diff --git a/pypy/module/cpyext/tupleobject.py b/pypy/module/cpyext/tupleobject.py index c3517b6489d51dba36af0ac2353362535642d961..ef23ba9803974e9a481baa245fd6895090d5a0a0 100644 --- a/pypy/module/cpyext/tupleobject.py +++ b/pypy/module/cpyext/tupleobject.py @@ -1,5 +1,5 @@ from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.cpyext.api import (cpython_api, Py_ssize_t, CANNOT_FAIL, build_type_checkers) from pypy.module.cpyext.pyobject import (PyObject, PyObjectP, Py_DecRef, diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py index cff12b3a72a1bfd94e13d3eb54eeedd7729fc436..f8980f6313cf4dac16000d31e10a8f222b884682 100644 --- a/pypy/module/cpyext/typeobject.py +++ b/pypy/module/cpyext/typeobject.py @@ -1,8 +1,8 @@ import os import sys -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rpython.annlowlevel import llhelper +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rtyper.annlowlevel import llhelper from pypy.interpreter.baseobjspace import W_Root, DescrMismatch from pypy.objspace.std.typeobject import W_TypeObject from pypy.interpreter.typedef import GetSetProperty @@ -30,11 +30,11 @@ from pypy.module.cpyext.slotdefs import ( slotdefs_for_tp_slots, slotdefs_for_wrappers, get_slot_tp_function) from pypy.interpreter.buffer import Buffer from pypy.interpreter.error import OperationError -from pypy.rlib.rstring import rsplit -from pypy.rlib.objectmodel import specialize +from rpython.rlib.rstring import rsplit +from rpython.rlib.objectmodel import specialize from pypy.module.__builtin__.abstractinst import abstract_issubclass_w from pypy.module.__builtin__.interp_classobj import W_ClassObject -from pypy.rlib import jit +from rpython.rlib import jit WARN_ABOUT_MISSING_SLOT_FUNCTIONS = False diff --git a/pypy/module/cpyext/typeobjectdefs.py b/pypy/module/cpyext/typeobjectdefs.py index 80db565e93e8ec6a3e32ef24bd87723013e86005..c2730c206ba512860a0f1e908481ed9fe3647d59 100644 --- a/pypy/module/cpyext/typeobjectdefs.py +++ b/pypy/module/cpyext/typeobjectdefs.py @@ -1,5 +1,5 @@ -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rpython.lltypesystem.lltype import Ptr, FuncType, Void +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem.lltype import Ptr, FuncType, Void from pypy.module.cpyext.api import (cpython_struct, Py_ssize_t, Py_ssize_tP, PyVarObjectFields, PyTypeObject, PyTypeObjectPtr, FILEP, Py_TPFLAGS_READYING, Py_TPFLAGS_READY, Py_TPFLAGS_HEAPTYPE) diff --git a/pypy/module/cpyext/unicodeobject.py b/pypy/module/cpyext/unicodeobject.py index b12b35761700393ee361b7e59ceaf7a80a656b66..69f7a8f97096764ed9cf1bc3702a52d38251a80d 100644 --- a/pypy/module/cpyext/unicodeobject.py +++ b/pypy/module/cpyext/unicodeobject.py @@ -1,6 +1,6 @@ from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rpython.lltypesystem import llmemory +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import llmemory from pypy.module.unicodedata import unicodedb from pypy.module.cpyext.api import ( CANNOT_FAIL, Py_ssize_t, build_type_checkers, cpython_api, @@ -14,8 +14,8 @@ from pypy.module.cpyext.stringobject import PyString_Check from pypy.module.sys.interp_encoding import setdefaultencoding from pypy.module._codecs.interp_codecs import CodecState from pypy.objspace.std import unicodeobject, unicodetype, stringtype -from pypy.rlib import runicode -from pypy.tool.sourcetools import func_renamer +from rpython.rlib import runicode +from rpython.tool.sourcetools import func_renamer import sys ## See comment in stringobject.py. diff --git a/pypy/module/crypt/interp_crypt.py b/pypy/module/crypt/interp_crypt.py index b38ffa18fcc3b46de7813d8441526f4c138ac2ea..a99236909f7c2d58d913fff264616e44278a3821 100644 --- a/pypy/module/crypt/interp_crypt.py +++ b/pypy/module/crypt/interp_crypt.py @@ -1,6 +1,6 @@ from pypy.interpreter.gateway import unwrap_spec -from pypy.rpython.lltypesystem import rffi -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.lltypesystem import rffi +from rpython.translator.tool.cbuild import ExternalCompilationInfo import sys if sys.platform.startswith('darwin'): diff --git a/pypy/module/exceptions/interp_exceptions.py b/pypy/module/exceptions/interp_exceptions.py index 5a10ea85e0dcef529bb4fb4feb852f400eb51cec..0f6e004231a1a8b34838347874d424c8e75b60b4 100644 --- a/pypy/module/exceptions/interp_exceptions.py +++ b/pypy/module/exceptions/interp_exceptions.py @@ -77,7 +77,7 @@ from pypy.interpreter.typedef import (TypeDef, GetSetProperty, descr_get_dict, descr_set_dict, descr_del_dict) from pypy.interpreter.gateway import interp2app from pypy.interpreter.error import OperationError -from pypy.rlib import rwin32 +from rpython.rlib import rwin32 def readwrite_attrproperty_w(name, cls): def fget(space, obj): diff --git a/pypy/module/fcntl/__init__.py b/pypy/module/fcntl/__init__.py index dbc1098cc6a191e863dc1f636dc45652d70fc23b..1917d9eb18e7f936ff74e284c7f1cb9db08e6017 100644 --- a/pypy/module/fcntl/__init__.py +++ b/pypy/module/fcntl/__init__.py @@ -1,5 +1,5 @@ from pypy.interpreter.mixedmodule import MixedModule -from pypy.rlib.rarithmetic import intmask +from rpython.rlib.rarithmetic import intmask class Module(MixedModule): interpleveldefs = { diff --git a/pypy/module/fcntl/interp_fcntl.py b/pypy/module/fcntl/interp_fcntl.py index b0794ed5df5c412c0e0ba95ee1f1db56c3dc6b66..5e35d481fc73f864245d571550243d04fd82d427 100644 --- a/pypy/module/fcntl/interp_fcntl.py +++ b/pypy/module/fcntl/interp_fcntl.py @@ -1,9 +1,9 @@ -from pypy.rpython.tool import rffi_platform as platform -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.tool import rffi_platform as platform +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.error import OperationError, wrap_oserror from pypy.interpreter.gateway import unwrap_spec, WrappedDefault -from pypy.rlib import rposix -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rlib import rposix +from rpython.translator.tool.cbuild import ExternalCompilationInfo import sys class CConfig: diff --git a/pypy/module/fcntl/test/test_fcntl.py b/pypy/module/fcntl/test/test_fcntl.py index b26c06ce39077ba75651ca4a54a786885317db27..cb26346e47ff41f3337d217eba142385201d665d 100644 --- a/pypy/module/fcntl/test/test_fcntl.py +++ b/pypy/module/fcntl/test/test_fcntl.py @@ -1,5 +1,5 @@ import os -from pypy.tool.udir import udir +from rpython.tool.udir import udir if os.name == "nt": from py.test import skip diff --git a/pypy/module/gc/interp_gc.py b/pypy/module/gc/interp_gc.py index e73cfac05834d16d7e41748b761ddfad9cf4435b..565cf8e387b9d149a7112057028442e70efff6eb 100644 --- a/pypy/module/gc/interp_gc.py +++ b/pypy/module/gc/interp_gc.py @@ -1,7 +1,7 @@ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import OperationError -from pypy.rlib import rgc -from pypy.rlib.streamio import open_file_as_stream +from rpython.rlib import rgc +from rpython.rlib.streamio import open_file_as_stream def collect(space): "Run a full collection." diff --git a/pypy/module/gc/referents.py b/pypy/module/gc/referents.py index d4fba7c4d6b9c796b0751fc546b4516576a0ddca..33e05b235ce3f3ae012656d77c3050b0b4c96523 100644 --- a/pypy/module/gc/referents.py +++ b/pypy/module/gc/referents.py @@ -1,9 +1,9 @@ -from pypy.rlib import rgc +from rpython.rlib import rgc from pypy.interpreter.baseobjspace import W_Root, Wrappable from pypy.interpreter.typedef import TypeDef from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import wrap_oserror, OperationError -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.objectmodel import we_are_translated class W_GcRef(Wrappable): diff --git a/pypy/module/gc/test/test_app_referents.py b/pypy/module/gc/test/test_app_referents.py index c7b9902141b029921c360920987946609d6c826e..4f2b3b6d106a1b6275d6ccc58daf8e3c845598f0 100644 --- a/pypy/module/gc/test/test_app_referents.py +++ b/pypy/module/gc/test/test_app_referents.py @@ -1,5 +1,5 @@ import py, os -from pypy.tool.udir import udir +from rpython.tool.udir import udir def test_interface_to_dump_rpy_heap_str(space): diff --git a/pypy/module/gc/test/test_gc.py b/pypy/module/gc/test/test_gc.py index 32f103eb97a18db648abeae287ad2775e44aa4b0..70606cbaabbc67b2e104db46b535d191eb47afa8 100644 --- a/pypy/module/gc/test/test_gc.py +++ b/pypy/module/gc/test/test_gc.py @@ -73,8 +73,8 @@ class AppTestGcDumpHeap(object): def setup_class(cls): import py - from pypy.tool.udir import udir - from pypy.rlib import rgc + from rpython.tool.udir import udir + from rpython.rlib import rgc class X(object): def __init__(self, count, size, links): self.count = count @@ -92,7 +92,7 @@ class AppTestGcDumpHeap(object): def teardown_class(cls): import py - from pypy.rlib import rgc + from rpython.rlib import rgc rgc._heap_stats = cls._heap_stats assert py.path.local(cls._fname).read() == '1 12 0,0\n2 10 10,0\n' diff --git a/pypy/module/gc/test/test_referents.py b/pypy/module/gc/test/test_referents.py index cb699bd830e37557e22145ede30060084e662494..b6882877d6ae0010e296df48d4137d7671c3633a 100644 --- a/pypy/module/gc/test/test_referents.py +++ b/pypy/module/gc/test/test_referents.py @@ -4,7 +4,7 @@ from pypy.conftest import option class AppTestReferents(object): def setup_class(cls): - from pypy.rlib import rgc + from rpython.rlib import rgc cls._backup = [rgc.get_rpy_roots] w = cls.space.wrap space = cls.space @@ -21,7 +21,7 @@ class AppTestReferents(object): cls.w_runappdirect = cls.space.wrap(option.runappdirect) def teardown_class(cls): - from pypy.rlib import rgc + from rpython.rlib import rgc rgc.get_rpy_roots = cls._backup[0] def test_get_objects(self): diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py index c8c9ce29441968e23f35bf0fb997b957acf05f02..e97043562f36d322974c612ba92e91cc28ddece0 100644 --- a/pypy/module/imp/importing.py +++ b/pypy/module/imp/importing.py @@ -11,9 +11,9 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.eval import Code from pypy.interpreter.pycode import PyCode -from pypy.rlib import streamio, jit -from pypy.rlib.streamio import StreamErrors -from pypy.rlib.objectmodel import we_are_translated, specialize +from rpython.rlib import streamio, jit +from rpython.rlib.streamio import StreamErrors +from rpython.rlib.objectmodel import we_are_translated, specialize from pypy.module.sys.version import PYPY_VERSION SEARCH_ERROR = 0 diff --git a/pypy/module/imp/interp_imp.py b/pypy/module/imp/interp_imp.py index 54f9cb2e84316e73c7b459b8cf4436a48e3a4d29..e6a8762bed6ef8a8c7c119806a8583dc265b759f 100644 --- a/pypy/module/imp/interp_imp.py +++ b/pypy/module/imp/interp_imp.py @@ -1,7 +1,7 @@ from pypy.module.imp import importing from pypy.module._file.interp_file import W_File -from pypy.rlib import streamio -from pypy.rlib.streamio import StreamErrors +from rpython.rlib import streamio +from rpython.rlib.streamio import StreamErrors from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.module import Module from pypy.interpreter.gateway import unwrap_spec diff --git a/pypy/module/imp/test/test_import.py b/pypy/module/imp/test/test_import.py index db299bc962cc9be4f094ab0efee6bb0f46b9f451..22e4f31623430733486e269875865c6fbbd08051 100644 --- a/pypy/module/imp/test/test_import.py +++ b/pypy/module/imp/test/test_import.py @@ -3,8 +3,8 @@ from pypy.interpreter.module import Module from pypy.interpreter import gateway from pypy.interpreter.error import OperationError import pypy.interpreter.pycode -from pypy.tool.udir import udir -from pypy.rlib import streamio +from rpython.tool.udir import udir +from rpython.rlib import streamio from pypy.tool.option import make_config from pypy.tool.pytest.objspace import maketestobjspace import pytest diff --git a/pypy/module/marshal/interp_marshal.py b/pypy/module/marshal/interp_marshal.py index 4b4b4793c8da5efaf1db4b103d6adbd77b570e31..cc1246fc65548e8c26dca5dd3a55f1202736378b 100644 --- a/pypy/module/marshal/interp_marshal.py +++ b/pypy/module/marshal/interp_marshal.py @@ -1,7 +1,7 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import WrappedDefault, unwrap_spec -from pypy.rlib.rarithmetic import intmask -from pypy.rlib import rstackovf +from rpython.rlib.rarithmetic import intmask +from rpython.rlib import rstackovf from pypy.module._file.interp_file import W_File diff --git a/pypy/module/marshal/test/test_marshal.py b/pypy/module/marshal/test/test_marshal.py index 056596408089ced0d47e3414da4630e324c57ae5..b918f08cccc90cb23d575ad4e9f1a6802c04809d 100644 --- a/pypy/module/marshal/test/test_marshal.py +++ b/pypy/module/marshal/test/test_marshal.py @@ -1,4 +1,4 @@ -from pypy.tool.udir import udir +from rpython.tool.udir import udir class AppTestMarshal: diff --git a/pypy/module/math/interp_math.py b/pypy/module/math/interp_math.py index f20727c2fba2636566465ccad370bec98d4fedf8..921179ab4f9aa942cc2545a5fe87d04dac7eedf1 100644 --- a/pypy/module/math/interp_math.py +++ b/pypy/module/math/interp_math.py @@ -1,7 +1,7 @@ import math import sys -from pypy.rlib import rfloat, unroll +from rpython.rlib import rfloat, unroll from pypy.interpreter.error import OperationError class State: diff --git a/pypy/module/math/test/test_direct.py b/pypy/module/math/test/test_direct.py index a3786b03ac84da0db7f1b36b302960595309b590..014e6dbdcc1ab783dc880549b872923c23265067 100644 --- a/pypy/module/math/test/test_direct.py +++ b/pypy/module/math/test/test_direct.py @@ -2,8 +2,8 @@ """ import py, sys, math -from pypy.rlib import rfloat -from pypy.rlib.rfloat import isinf, isnan, INFINITY, NAN +from rpython.rlib import rfloat +from rpython.rlib.rfloat import isinf, isnan, INFINITY, NAN consistent_host = True if '__pypy__' not in sys.builtin_module_names: diff --git a/pypy/module/math/test/test_translated.py b/pypy/module/math/test/test_translated.py index 08444a345a06f292b9794ffeb66c1ced33784ef3..fc32ea40850c33e31f5a45a6b6851f1f23281242 100644 --- a/pypy/module/math/test/test_translated.py +++ b/pypy/module/math/test/test_translated.py @@ -1,4 +1,4 @@ -from pypy.translator.c.test.test_genc import compile +from rpython.translator.c.test.test_genc import compile from pypy.module.math.interp_math import _gamma diff --git a/pypy/module/micronumpy/appbridge.py b/pypy/module/micronumpy/appbridge.py index 2a5f717149b8473cf4f21c7c6db77ac437d24fd3..9929cd098591ec6bad0bb26e9e151aabe9db498b 100644 --- a/pypy/module/micronumpy/appbridge.py +++ b/pypy/module/micronumpy/appbridge.py @@ -1,5 +1,5 @@ -from pypy.rlib.objectmodel import specialize +from rpython.rlib.objectmodel import specialize class AppBridgeCache(object): w__var = None diff --git a/pypy/module/micronumpy/arrayimpl/concrete.py b/pypy/module/micronumpy/arrayimpl/concrete.py index f0d6c840c77ecdc5a7b45462f8ef40838e421e57..83238a9d0f3b1dc6e34202742d15f39026ba25da 100644 --- a/pypy/module/micronumpy/arrayimpl/concrete.py +++ b/pypy/module/micronumpy/arrayimpl/concrete.py @@ -7,10 +7,10 @@ from pypy.module.micronumpy.strides import calc_new_strides, shape_agreement,\ calculate_broadcast_strides, calculate_dot_strides from pypy.module.micronumpy.iter import Chunk, Chunks, NewAxisChunk, RecordChunk from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rlib import jit -from pypy.rlib.rawstorage import free_raw_storage -from pypy.rlib.debug import make_sure_not_resized +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rlib import jit +from rpython.rlib.rawstorage import free_raw_storage +from rpython.rlib.debug import make_sure_not_resized class ConcreteArrayIterator(base.BaseArrayIterator): def __init__(self, array): diff --git a/pypy/module/micronumpy/arrayimpl/voidbox.py b/pypy/module/micronumpy/arrayimpl/voidbox.py index 32c43349b02ddb947d170c7fbd2d08a939d5a650..ecff6547fd5974d4f3c2e3a6b24d0c771cf97d4a 100644 --- a/pypy/module/micronumpy/arrayimpl/voidbox.py +++ b/pypy/module/micronumpy/arrayimpl/voidbox.py @@ -1,6 +1,6 @@ from pypy.module.micronumpy.arrayimpl.base import BaseArrayImplementation -from pypy.rlib.rawstorage import free_raw_storage, alloc_raw_storage +from rpython.rlib.rawstorage import free_raw_storage, alloc_raw_storage class VoidBoxStorage(BaseArrayImplementation): def __init__(self, size, dtype): diff --git a/pypy/module/micronumpy/base.py b/pypy/module/micronumpy/base.py index 71800a29728f78f54f93dc7d04cc64349d1bab34..26dadfed7a1d28260a4fca1057b73e3ec49548c3 100644 --- a/pypy/module/micronumpy/base.py +++ b/pypy/module/micronumpy/base.py @@ -1,6 +1,6 @@ from pypy.interpreter.baseobjspace import Wrappable -from pypy.tool.pairtype import extendabletype +from rpython.tool.pairtype import extendabletype from pypy.module.micronumpy.support import calc_strides def issequence_w(space, w_obj): diff --git a/pypy/module/micronumpy/compile.py b/pypy/module/micronumpy/compile.py index 7ddf9ce7d6d0ee6eae351b63158af2d3b542899c..4ba1761f415530cc985ebcb1e8ce31023f5c8f37 100644 --- a/pypy/module/micronumpy/compile.py +++ b/pypy/module/micronumpy/compile.py @@ -13,7 +13,7 @@ from pypy.module.micronumpy.base import W_NDimArray from pypy.module.micronumpy.interp_numarray import array from pypy.module.micronumpy.interp_arrayops import where from pypy.module.micronumpy import interp_ufuncs -from pypy.rlib.objectmodel import specialize, instantiate +from rpython.rlib.objectmodel import specialize, instantiate class BogusBytecode(Exception): diff --git a/pypy/module/micronumpy/interp_boxes.py b/pypy/module/micronumpy/interp_boxes.py index ae3cbeaec7176390c6921ff8d2a90ec12b535005..a9a07e22dc64391f902be6fb0c95203192d66d2c 100644 --- a/pypy/module/micronumpy/interp_boxes.py +++ b/pypy/module/micronumpy/interp_boxes.py @@ -7,9 +7,9 @@ from pypy.objspace.std.stringtype import str_typedef from pypy.objspace.std.unicodetype import unicode_typedef, unicode_from_object from pypy.objspace.std.inttype import int_typedef from pypy.objspace.std.complextype import complex_typedef -from pypy.rlib.rarithmetic import LONG_BIT -from pypy.rpython.lltypesystem import rffi -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.rarithmetic import LONG_BIT +from rpython.rtyper.lltypesystem import rffi +from rpython.tool.sourcetools import func_with_new_name from pypy.module.micronumpy.arrayimpl.voidbox import VoidBoxStorage MIXIN_32 = (int_typedef,) if LONG_BIT == 32 else () diff --git a/pypy/module/micronumpy/interp_dtype.py b/pypy/module/micronumpy/interp_dtype.py index 36b1c017585b88f6836d727f7476a980cda8b7ab..89f8646ad84f7af6262dd036cea352bb5791ffa8 100644 --- a/pypy/module/micronumpy/interp_dtype.py +++ b/pypy/module/micronumpy/interp_dtype.py @@ -6,9 +6,9 @@ from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import (TypeDef, GetSetProperty, interp_attrproperty, interp_attrproperty_w) from pypy.module.micronumpy import types, interp_boxes -from pypy.rlib.objectmodel import specialize -from pypy.rlib.rarithmetic import LONG_BIT, r_longlong, r_ulonglong -from pypy.rpython.lltypesystem import rffi +from rpython.rlib.objectmodel import specialize +from rpython.rlib.rarithmetic import LONG_BIT, r_longlong, r_ulonglong +from rpython.rtyper.lltypesystem import rffi UNSIGNEDLTR = "u" diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py index 419f7fde8d3252e356865c8bb392c958522f7f73..7562bda071c7f34d61767a52d50a3c2c7665aa04 100644 --- a/pypy/module/micronumpy/interp_numarray.py +++ b/pypy/module/micronumpy/interp_numarray.py @@ -13,9 +13,9 @@ from pypy.module.micronumpy.appbridge import get_appbridge_cache from pypy.module.micronumpy import loop from pypy.module.micronumpy.dot import match_dot_shapes from pypy.module.micronumpy.interp_arrayops import repeat -from pypy.tool.sourcetools import func_with_new_name -from pypy.rlib import jit -from pypy.rlib.rstring import StringBuilder +from rpython.tool.sourcetools import func_with_new_name +from rpython.rlib import jit +from rpython.rlib.rstring import StringBuilder def _find_shape(space, w_size): if space.is_none(w_size): diff --git a/pypy/module/micronumpy/interp_support.py b/pypy/module/micronumpy/interp_support.py index 5e05375397a982a606a62b6779eb5a453b50fab2..8d1c32241c83f203cdfa6acd781b2a8c6c971140 100644 --- a/pypy/module/micronumpy/interp_support.py +++ b/pypy/module/micronumpy/interp_support.py @@ -1,9 +1,9 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.gateway import unwrap_spec, WrappedDefault -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.module.micronumpy import interp_dtype, loop from pypy.objspace.std.strutil import strip_spaces -from pypy.rlib.rarithmetic import maxint +from rpython.rlib.rarithmetic import maxint from pypy.module.micronumpy.base import W_NDimArray FLOAT_SIZE = rffi.sizeof(lltype.Float) diff --git a/pypy/module/micronumpy/interp_ufuncs.py b/pypy/module/micronumpy/interp_ufuncs.py index e62cebe8a57726c518a08e25359f0bbee410cd34..04424070ba74d0ca9580a722e7d45130fad9e844 100644 --- a/pypy/module/micronumpy/interp_ufuncs.py +++ b/pypy/module/micronumpy/interp_ufuncs.py @@ -3,9 +3,9 @@ from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef, GetSetProperty, interp_attrproperty from pypy.module.micronumpy import interp_boxes, interp_dtype, loop -from pypy.rlib import jit -from pypy.rlib.rarithmetic import LONG_BIT -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib import jit +from rpython.rlib.rarithmetic import LONG_BIT +from rpython.tool.sourcetools import func_with_new_name from pypy.module.micronumpy.interp_support import unwrap_axis_arg from pypy.module.micronumpy.strides import shape_agreement from pypy.module.micronumpy.base import convert_to_array, W_NDimArray diff --git a/pypy/module/micronumpy/iter.py b/pypy/module/micronumpy/iter.py index 8b822de5c320b24cf52fccd8e341c789be00596e..c8927b69cfbae078d5a4266a9130fdf23ec9d437 100644 --- a/pypy/module/micronumpy/iter.py +++ b/pypy/module/micronumpy/iter.py @@ -45,7 +45,7 @@ dimension, perhaps we could overflow times in one big step. from pypy.module.micronumpy.strides import enumerate_chunks,\ calculate_slice_strides from pypy.module.micronumpy.base import W_NDimArray -from pypy.rlib import jit +from rpython.rlib import jit # structures to describe slicing diff --git a/pypy/module/micronumpy/loop.py b/pypy/module/micronumpy/loop.py index 8b4587a3aa79ab6b23a93c1c2c83e2a2dce34606..6b07c8b16fa945fcaa6ec4c4b02d08dc12a35876 100644 --- a/pypy/module/micronumpy/loop.py +++ b/pypy/module/micronumpy/loop.py @@ -4,9 +4,9 @@ operations. This is the place to look for all the computations that iterate over all the array elements. """ -from pypy.rlib.rstring import StringBuilder -from pypy.rlib import jit -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rlib.rstring import StringBuilder +from rpython.rlib import jit +from rpython.rtyper.lltypesystem import lltype, rffi from pypy.module.micronumpy.base import W_NDimArray call2_driver = jit.JitDriver(name='numpy_call2', diff --git a/pypy/module/micronumpy/strides.py b/pypy/module/micronumpy/strides.py index d2d208fa759eae21bb205e36d0f7fddc670f60a9..94c93dcbbf6c1062b3d1406e4cb7d9a0b2da8cd1 100644 --- a/pypy/module/micronumpy/strides.py +++ b/pypy/module/micronumpy/strides.py @@ -1,4 +1,4 @@ -from pypy.rlib import jit +from rpython.rlib import jit from pypy.interpreter.error import OperationError from pypy.module.micronumpy.base import W_NDimArray diff --git a/pypy/module/micronumpy/support.py b/pypy/module/micronumpy/support.py index 952d9922bcc43b2ea0dd4bab35ea72633313a654..9ae90b5ff80daaa9de326418bfd876963512512d 100644 --- a/pypy/module/micronumpy/support.py +++ b/pypy/module/micronumpy/support.py @@ -1,4 +1,4 @@ -from pypy.rlib import jit +from rpython.rlib import jit @jit.unroll_safe diff --git a/pypy/module/micronumpy/test/test_complex.py b/pypy/module/micronumpy/test/test_complex.py index 6f948eab91b7339946e5d503d7757b99bb1f231a..1568bb0c59b2551f159d233b0f8dc99b91a5deaf 100644 --- a/pypy/module/micronumpy/test/test_complex.py +++ b/pypy/module/micronumpy/test/test_complex.py @@ -6,8 +6,8 @@ from pypy.conftest import option from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import interp2app from pypy.module.micronumpy.test.test_base import BaseNumpyAppTest -from pypy.rlib.rfloat import isnan, isinf, copysign -from pypy.rlib.rcomplex import c_pow +from rpython.rlib.rfloat import isnan, isinf, copysign +from rpython.rlib.rcomplex import c_pow def rAlmostEqual(a, b, rel_err=2e-15, abs_err=5e-323, msg='', isnumpy=False): diff --git a/pypy/module/micronumpy/test/test_dtypes.py b/pypy/module/micronumpy/test/test_dtypes.py index 26445face9d28d74c119f48ec9c55dfba044b04b..46c36da94c3c67fb1117ef3383c07ce6da5fa541 100644 --- a/pypy/module/micronumpy/test/test_dtypes.py +++ b/pypy/module/micronumpy/test/test_dtypes.py @@ -249,7 +249,7 @@ class AppTestTypes(BaseNumpyAppTest): bits, linkage = platform.architecture() ptr_size = int(bits[:-3]) // 8 else: - from pypy.rpython.lltypesystem import rffi + from rpython.rtyper.lltypesystem import rffi ptr_size = rffi.sizeof(rffi.CCHARP) cls.w_ptr_size = cls.space.wrap(ptr_size) diff --git a/pypy/module/micronumpy/test/test_ufuncs.py b/pypy/module/micronumpy/test/test_ufuncs.py index 73ac7b5d3a8d53c2840ce7ae46e0172af43d4f5e..6abb47b40d4f7e8471e5b58ca5d9290ee67977cb 100644 --- a/pypy/module/micronumpy/test/test_ufuncs.py +++ b/pypy/module/micronumpy/test/test_ufuncs.py @@ -1,7 +1,7 @@ from pypy.conftest import option from pypy.interpreter.gateway import interp2app from pypy.module.micronumpy.test.test_base import BaseNumpyAppTest -from pypy.rlib.rcomplex import c_pow +from rpython.rlib.rcomplex import c_pow class AppTestUfuncs(BaseNumpyAppTest): diff --git a/pypy/module/micronumpy/test/test_zjit.py b/pypy/module/micronumpy/test/test_zjit.py index db2cda3874319cd31b5ed6ef34fdae8b50a99973..c5fb99fc1fc529c09c3e0ece9a952840276f81db 100644 --- a/pypy/module/micronumpy/test/test_zjit.py +++ b/pypy/module/micronumpy/test/test_zjit.py @@ -4,9 +4,9 @@ good assembler """ import py -from pypy.jit.metainterp import pyjitpl -from pypy.jit.metainterp.test.support import LLJitMixin -from pypy.jit.metainterp.warmspot import reset_stats +from rpython.jit.metainterp import pyjitpl +from rpython.jit.metainterp.test.support import LLJitMixin +from rpython.jit.metainterp.warmspot import reset_stats from pypy.module.micronumpy import interp_boxes from pypy.module.micronumpy.compile import FakeSpace, Parser, InterpreterState from pypy.module.micronumpy.base import W_NDimArray diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py index 4ed0ecc8849d675dc72b64553509808c6641c484..61edefe84b12515d0674f38587b2e9405f5ffafe 100644 --- a/pypy/module/micronumpy/types.py +++ b/pypy/module/micronumpy/types.py @@ -6,19 +6,19 @@ from pypy.module.micronumpy import interp_boxes from pypy.module.micronumpy.arrayimpl.voidbox import VoidBoxStorage from pypy.objspace.std.floatobject import float2string from pypy.objspace.std.complexobject import str_format -from pypy.rlib import rfloat, clibffi, rcomplex -from pypy.rlib.rawstorage import (alloc_raw_storage, raw_storage_setitem, +from rpython.rlib import rfloat, clibffi, rcomplex +from rpython.rlib.rawstorage import (alloc_raw_storage, raw_storage_setitem, raw_storage_getitem) -from pypy.rlib.objectmodel import specialize -from pypy.rlib.rarithmetic import widen, byteswap, r_ulonglong -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.rstruct.runpack import runpack -from pypy.rlib.rstruct.nativefmttable import native_is_bigendian -from pypy.rlib.rstruct.ieee import (float_pack, float_unpack, +from rpython.rlib.objectmodel import specialize +from rpython.rlib.rarithmetic import widen, byteswap, r_ulonglong +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.rstruct.runpack import runpack +from rpython.rlib.rstruct.nativefmttable import native_is_bigendian +from rpython.rlib.rstruct.ieee import (float_pack, float_unpack, unpack_float, unpack_float128) -from pypy.tool.sourcetools import func_with_new_name -from pypy.rlib import jit -from pypy.rlib.rstring import StringBuilder +from rpython.tool.sourcetools import func_with_new_name +from rpython.rlib import jit +from rpython.rlib.rstring import StringBuilder degToRad = math.pi / 180.0 log2 = math.log(2) diff --git a/pypy/module/mmap/__init__.py b/pypy/module/mmap/__init__.py index 57706764136ab35755a1244f11074b2d3733d24b..a3628d72409223373d5b6763c6fc53105641f022 100644 --- a/pypy/module/mmap/__init__.py +++ b/pypy/module/mmap/__init__.py @@ -1,5 +1,5 @@ from pypy.interpreter.mixedmodule import MixedModule -from pypy.rlib import rmmap +from rpython.rlib import rmmap class Module(MixedModule): interpleveldefs = { diff --git a/pypy/module/mmap/interp_mmap.py b/pypy/module/mmap/interp_mmap.py index 487efa4ccb9935f052e9dfb7a6eb7e06dbe2ff2c..592cd7e9231ed8a534d4f5d2d4a58c3f9cd62ee1 100644 --- a/pypy/module/mmap/interp_mmap.py +++ b/pypy/module/mmap/interp_mmap.py @@ -2,8 +2,8 @@ from pypy.interpreter.error import OperationError, wrap_oserror from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef from pypy.interpreter.gateway import interp2app, unwrap_spec -from pypy.rlib import rmmap, rarithmetic -from pypy.rlib.rmmap import RValueError, RTypeError +from rpython.rlib import rmmap, rarithmetic +from rpython.rlib.rmmap import RValueError, RTypeError if rmmap.HAVE_LARGEFILE_SUPPORT: OFF_T = rarithmetic.r_longlong diff --git a/pypy/module/mmap/test/test_mmap.py b/pypy/module/mmap/test/test_mmap.py index 9a83061ab01752b116449bff03c4b0c96b38cf1f..ce3ae7209bd49682a951a9bf32a338dce884f810 100644 --- a/pypy/module/mmap/test/test_mmap.py +++ b/pypy/module/mmap/test/test_mmap.py @@ -1,5 +1,5 @@ from __future__ import with_statement -from pypy.tool.udir import udir +from rpython.tool.udir import udir import os class AppTestMMap: diff --git a/pypy/module/oracle/config.py b/pypy/module/oracle/config.py index ba56fdaff926351b0a5fec0ad1fad888de9fb5e4..a3ee1c1aae29ddece3342ebb7150f992c15c840f 100644 --- a/pypy/module/oracle/config.py +++ b/pypy/module/oracle/config.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.oracle import roci WITH_UNICODE = False diff --git a/pypy/module/oracle/conftest.py b/pypy/module/oracle/conftest.py index 5a92002a23715fe1655d94dcec7f9c0d698ef2ae..90d1aa05cdbe1702db9cba0014da07fc79a16085 100644 --- a/pypy/module/oracle/conftest.py +++ b/pypy/module/oracle/conftest.py @@ -1,4 +1,4 @@ -from pypy.rpython.tool.rffi_platform import CompilationError +from rpython.rtyper.tool.rffi_platform import CompilationError import py import os diff --git a/pypy/module/oracle/interp_connect.py b/pypy/module/oracle/interp_connect.py index 0a3c7650d6054d7d9c0e638a104d783681dab40d..d1cbd1e49b542d32bc2f081965a10604a22ebe8f 100644 --- a/pypy/module/oracle/interp_connect.py +++ b/pypy/module/oracle/interp_connect.py @@ -4,7 +4,7 @@ from pypy.interpreter.typedef import (TypeDef, interp_attrproperty_w, GetSetProperty) from pypy.interpreter.gateway import interp2app from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.oracle import roci, interp_error from pypy.module.oracle.config import string_w, StringBuffer, MAX_STRING_CHARS diff --git a/pypy/module/oracle/interp_cursor.py b/pypy/module/oracle/interp_cursor.py index cd324c0f569e083f6a8c1a0b6c01ee17dd557e26..55c3095b71089435c422c5dcd5e65fc0ef0d6171 100644 --- a/pypy/module/oracle/interp_cursor.py +++ b/pypy/module/oracle/interp_cursor.py @@ -3,7 +3,7 @@ from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.typedef import interp_attrproperty, interp_attrproperty_w from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.oracle import roci, interp_error from pypy.module.oracle.config import w_string, string_w, StringBuffer diff --git a/pypy/module/oracle/interp_environ.py b/pypy/module/oracle/interp_environ.py index 876bd23a115a558603a0437dcc941a9e76b806df..aa65590ddfc3bd10a125df402bd7cc0493913b36 100644 --- a/pypy/module/oracle/interp_environ.py +++ b/pypy/module/oracle/interp_environ.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.oracle import roci, config from pypy.interpreter.error import OperationError diff --git a/pypy/module/oracle/interp_error.py b/pypy/module/oracle/interp_error.py index e15394b8581429ab2eceefd93e27f443759f501d..219e50d08e90f66fb4bd8cbebd2020a377b4c186 100644 --- a/pypy/module/oracle/interp_error.py +++ b/pypy/module/oracle/interp_error.py @@ -1,12 +1,12 @@ from pypy.interpreter.baseobjspace import Wrappable -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.typedef import TypeDef from pypy.interpreter.typedef import interp_attrproperty, interp_attrproperty_w from pypy.interpreter.gateway import interp2app from pypy.interpreter.error import OperationError from pypy.module.oracle import roci, config -from pypy.rlib.unroll import unrolling_iterable +from rpython.rlib.unroll import unrolling_iterable exported_names = unrolling_iterable(""" DatabaseError OperationalError InterfaceError ProgrammingError diff --git a/pypy/module/oracle/interp_object.py b/pypy/module/oracle/interp_object.py index c98eff266b400bfc28957969a4c64a934b3a6ca1..43fbe0d72e600e7881612c24968b083bd062f1b8 100644 --- a/pypy/module/oracle/interp_object.py +++ b/pypy/module/oracle/interp_object.py @@ -3,7 +3,7 @@ from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.typedef import interp_attrproperty from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.oracle import roci, config, transform from pypy.module.oracle.interp_error import get diff --git a/pypy/module/oracle/interp_pool.py b/pypy/module/oracle/interp_pool.py index 78b88402a87a6d9b98d32b18e294eacd4d36992a..0265e99ec8ca54f71eb3bd75012d2340c0aa51ff 100644 --- a/pypy/module/oracle/interp_pool.py +++ b/pypy/module/oracle/interp_pool.py @@ -4,7 +4,7 @@ from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.typedef import interp_attrproperty, interp_attrproperty_w from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.oracle import roci, config from pypy.module.oracle import interp_error, interp_environ diff --git a/pypy/module/oracle/interp_variable.py b/pypy/module/oracle/interp_variable.py index 5c516f8a62682746003b16e91262a3365aaffcc2..4ad0ff6d7eea9d08dcddb86fb87409d2d7cb0bc6 100644 --- a/pypy/module/oracle/interp_variable.py +++ b/pypy/module/oracle/interp_variable.py @@ -3,8 +3,8 @@ from pypy.interpreter.typedef import TypeDef from pypy.interpreter.typedef import interp_attrproperty from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rlib.rarithmetic import ovfcheck +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rlib.rarithmetic import ovfcheck import sys from pypy.module.oracle import roci, config, transform diff --git a/pypy/module/oracle/roci.py b/pypy/module/oracle/roci.py index 04a07bea939640ea4f182a888465c8a44b05432b..37d93509b1b8cf96c99b819c14e578c40e5ce5a4 100644 --- a/pypy/module/oracle/roci.py +++ b/pypy/module/oracle/roci.py @@ -1,6 +1,6 @@ -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.rpython.tool import rffi_platform as platform -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.tool import rffi_platform as platform +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.conftest import option import sys, os import py diff --git a/pypy/module/oracle/test/test_connect.py b/pypy/module/oracle/test/test_connect.py index c67b1a184bd35bb29c11c69a113439c6f6a78895..30f450feaf1f3c541c5de33ff4a9901d033fd0ec 100644 --- a/pypy/module/oracle/test/test_connect.py +++ b/pypy/module/oracle/test/test_connect.py @@ -1,5 +1,5 @@ from pypy.conftest import option -from pypy.rpython.tool.rffi_platform import CompilationError +from rpython.rtyper.tool.rffi_platform import CompilationError import py class OracleNotConnectedTestBase(object): diff --git a/pypy/module/oracle/transform.py b/pypy/module/oracle/transform.py index 1d92334587d6ef8ce11b49632d25733a61d20581..4f5c884c8b5f7f5568b49cddd210ebc7c75a6086 100644 --- a/pypy/module/oracle/transform.py +++ b/pypy/module/oracle/transform.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.module.oracle import roci, config def OracleNumberToPythonFloat(environment, valueptr): diff --git a/pypy/module/parser/pyparser.py b/pypy/module/parser/pyparser.py index 06d9f0626fb11dd0c3f101cce35a29188274d431..5f017c7fd07ef99d8428c74a50a7b8d8de5a195f 100644 --- a/pypy/module/parser/pyparser.py +++ b/pypy/module/parser/pyparser.py @@ -5,7 +5,7 @@ from pypy.interpreter.error import OperationError from pypy.interpreter.pyparser import pyparse, pygram, error from pypy.interpreter.astcompiler.astbuilder import ast_from_node from pypy.interpreter.astcompiler.codegen import compile_ast -from pypy.rlib.objectmodel import specialize +from rpython.rlib.objectmodel import specialize class STType(Wrappable): diff --git a/pypy/module/posix/__init__.py b/pypy/module/posix/__init__.py index 050f9d42a8d153e1f7cb129002af9c6390b05678..c53ee5150305996e37b305b968ed1b18021ea754 100644 --- a/pypy/module/posix/__init__.py +++ b/pypy/module/posix/__init__.py @@ -1,6 +1,6 @@ # Package initialisation from pypy.interpreter.mixedmodule import MixedModule -from pypy.rpython.module.ll_os import RegisterOs +from rpython.rtyper.module.ll_os import RegisterOs import os, sys exec 'import %s as posix' % os.name diff --git a/pypy/module/posix/interp_posix.py b/pypy/module/posix/interp_posix.py index 6ab7fea51667655460a9db9c8b0e52202a0c76ca..994d4a369f67e58d093b6e47136be8ec6a1afd75 100644 --- a/pypy/module/posix/interp_posix.py +++ b/pypy/module/posix/interp_posix.py @@ -1,22 +1,22 @@ from pypy.interpreter.gateway import unwrap_spec -from pypy.rlib import rposix, objectmodel, rurandom -from pypy.rlib.objectmodel import specialize -from pypy.rlib.rarithmetic import r_longlong -from pypy.rlib.unroll import unrolling_iterable +from rpython.rlib import rposix, objectmodel, rurandom +from rpython.rlib.objectmodel import specialize +from rpython.rlib.rarithmetic import r_longlong +from rpython.rlib.unroll import unrolling_iterable from pypy.interpreter.error import OperationError, wrap_oserror, wrap_oserror2 from pypy.interpreter.error import operationerrfmt -from pypy.rpython.module.ll_os import RegisterOs -from pypy.rpython.module import ll_os_stat -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rpython.tool import rffi_platform -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.module.ll_os import RegisterOs +from rpython.rtyper.module import ll_os_stat +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rtyper.tool import rffi_platform +from rpython.translator.tool.cbuild import ExternalCompilationInfo from pypy.module.sys.interp_encoding import getfilesystemencoding import os, sys _WIN32 = sys.platform == 'win32' if _WIN32: - from pypy.rlib.rwin32 import _MAX_ENV + from rpython.rlib.rwin32 import _MAX_ENV c_int = "c_int" diff --git a/pypy/module/posix/test/test_posix2.py b/pypy/module/posix/test/test_posix2.py index 8eb814641256d349145efcd3872e93910f74d82e..b3c3712c5b94a4e54b957e10be454b7ebec82e58 100644 --- a/pypy/module/posix/test/test_posix2.py +++ b/pypy/module/posix/test/test_posix2.py @@ -3,10 +3,10 @@ from __future__ import with_statement from pypy.objspace.std import StdObjSpace -from pypy.tool.udir import udir +from rpython.tool.udir import udir from pypy.tool.pytest.objspace import gettestobjspace -from pypy.tool.autopath import pypydir -from pypy.rpython.module.ll_os import RegisterOs +from pypy.conftest import pypydir +from rpython.rtyper.module.ll_os import RegisterOs import os import py import sys diff --git a/pypy/module/posix/test/test_posix_libfile.py b/pypy/module/posix/test/test_posix_libfile.py index 7885262ccd9fe101bf4a246a3a3ccdc1be26e971..4441ecc5477a54f73221af5d6fec5b24accb9c80 100644 --- a/pypy/module/posix/test/test_posix_libfile.py +++ b/pypy/module/posix/test/test_posix_libfile.py @@ -1,6 +1,6 @@ import os -from pypy.tool.udir import udir +from rpython.tool.udir import udir def setup_module(mod): diff --git a/pypy/module/pwd/interp_pwd.py b/pypy/module/pwd/interp_pwd.py index 2f2e588c7644b91f4778e6aa28253d19382deb9b..3ab0c6952ccd061447aa4f5b045432cb6af142db 100644 --- a/pypy/module/pwd/interp_pwd.py +++ b/pypy/module/pwd/interp_pwd.py @@ -1,9 +1,9 @@ -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.rpython.tool import rffi_platform -from pypy.rpython.lltypesystem import rffi, lltype +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.tool import rffi_platform +from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rlib.rarithmetic import intmask +from rpython.rlib.rarithmetic import intmask eci = ExternalCompilationInfo( includes=['pwd.h'] diff --git a/pypy/module/pyexpat/interp_pyexpat.py b/pypy/module/pyexpat/interp_pyexpat.py index 80470b23d3208681d495cfce6b7e57853b71e3cd..a5ba419b7362a0b9e8f7090b557428566954c909 100644 --- a/pypy/module/pyexpat/interp_pyexpat.py +++ b/pypy/module/pyexpat/interp_pyexpat.py @@ -2,11 +2,11 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter.error import OperationError -from pypy.rlib import rgc -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rpython.tool import rffi_platform -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.translator.platform import platform +from rpython.rlib import rgc +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rtyper.tool import rffi_platform +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.translator.platform import platform import sys import weakref diff --git a/pypy/module/pyexpat/test/test_build.py b/pypy/module/pyexpat/test/test_build.py index 384862d57c761fc4d96a93f726936a1974419f30..6593dd0c1b613851eef86f28c86c46f950bc810a 100644 --- a/pypy/module/pyexpat/test/test_build.py +++ b/pypy/module/pyexpat/test/test_build.py @@ -1,8 +1,8 @@ -from pypy.translator.translator import TranslationContext -from pypy.translator.c.genc import CStandaloneBuilder -from pypy.annotation.listdef import s_list_of_strings -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rpython.tool.rffi_platform import CompilationError +from rpython.translator.translator import TranslationContext +from rpython.translator.c.genc import CStandaloneBuilder +from rpython.annotator.listdef import s_list_of_strings +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rtyper.tool.rffi_platform import CompilationError import os import py diff --git a/pypy/module/pypyjit/__init__.py b/pypy/module/pypyjit/__init__.py index 629a2be2c26f0e627648ea03ffd7f8bebe7a608a..615ffdef3523657b80671f93fd34739844735292 100644 --- a/pypy/module/pypyjit/__init__.py +++ b/pypy/module/pypyjit/__init__.py @@ -17,7 +17,7 @@ class Module(MixedModule): 'DebugMergePoint': 'interp_resop.DebugMergePoint', 'JitLoopInfo': 'interp_resop.W_JitLoopInfo', 'Box': 'interp_resop.WrappedBox', - 'PARAMETER_DOCS': 'space.wrap(pypy.rlib.jit.PARAMETER_DOCS)', + 'PARAMETER_DOCS': 'space.wrap(rpython.rlib.jit.PARAMETER_DOCS)', } def setup_after_space_initialization(self): @@ -25,7 +25,7 @@ class Module(MixedModule): from pypy.module.pypyjit.interp_jit import pypyjitdriver from pypy.module.pypyjit.policy import pypy_hooks # add the 'defaults' attribute - from pypy.rlib.jit import PARAMETERS + from rpython.rlib.jit import PARAMETERS space = self.space pypyjitdriver.space = space w_obj = space.wrap(PARAMETERS) diff --git a/pypy/module/pypyjit/interp_jit.py b/pypy/module/pypyjit/interp_jit.py index dec50425a81594af4f5a83033be603149d4857c5..dd79b766b383c10b88be6d991d2fb3af95f2e3fa 100644 --- a/pypy/module/pypyjit/interp_jit.py +++ b/pypy/module/pypyjit/interp_jit.py @@ -3,11 +3,11 @@ This is transformed to become a JIT by code elsewhere: pypy/jit/* """ -from pypy.tool.pairtype import extendabletype -from pypy.rlib.rarithmetic import r_uint, intmask -from pypy.rlib.jit import JitDriver, hint, we_are_jitted, dont_look_inside -from pypy.rlib import jit -from pypy.rlib.jit import current_trace_length, unroll_parameters +from rpython.tool.pairtype import extendabletype +from rpython.rlib.rarithmetic import r_uint, intmask +from rpython.rlib.jit import JitDriver, hint, we_are_jitted, dont_look_inside +from rpython.rlib import jit +from rpython.rlib.jit import current_trace_length, unroll_parameters import pypy.interpreter.pyopcode # for side-effects from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.pycode import PyCode, CO_GENERATOR @@ -27,7 +27,7 @@ PyFrame._virtualizable2_ = ['last_instr', 'pycode', JUMP_ABSOLUTE = opmap['JUMP_ABSOLUTE'] def get_printable_location(next_instr, is_being_profiled, bytecode): - from pypy.tool.stdlib_opcode import opcode_method_names + from rpython.tool.stdlib_opcode import opcode_method_names name = opcode_method_names[ord(bytecode.co_code[next_instr])] return '%s #%d %s' % (bytecode.get_repr(), next_instr, name) diff --git a/pypy/module/pypyjit/interp_resop.py b/pypy/module/pypyjit/interp_resop.py index 517d4b5be2ca2a788ea9913e62d2202497a30bda..b096779eac5087e068c01c33e97b1c75d84dc667 100644 --- a/pypy/module/pypyjit/interp_resop.py +++ b/pypy/module/pypyjit/interp_resop.py @@ -5,14 +5,14 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.gateway import unwrap_spec, interp2app from pypy.interpreter.pycode import PyCode from pypy.interpreter.error import OperationError -from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.rpython.annlowlevel import cast_base_ptr_to_instance, hlstr -from pypy.rpython.lltypesystem.rclass import OBJECT -from pypy.jit.metainterp.resoperation import rop, AbstractResOp -from pypy.rlib.nonconst import NonConstant -from pypy.rlib import jit_hooks -from pypy.rlib.jit import Counters -from pypy.rlib.rarithmetic import r_uint +from rpython.rtyper.lltypesystem import lltype, llmemory +from rpython.rtyper.annlowlevel import cast_base_ptr_to_instance, hlstr +from rpython.rtyper.lltypesystem.rclass import OBJECT +from rpython.jit.metainterp.resoperation import rop, AbstractResOp +from rpython.rlib.nonconst import NonConstant +from rpython.rlib import jit_hooks +from rpython.rlib.jit import Counters +from rpython.rlib.rarithmetic import r_uint from pypy.module.pypyjit.interp_jit import pypyjitdriver class Cache(object): diff --git a/pypy/module/pypyjit/policy.py b/pypy/module/pypyjit/policy.py index 4d1fd40c32fd6681069c221de143a040294c8658..7ec352dbb060830ee5bc4d6dcc1286200f972abe 100644 --- a/pypy/module/pypyjit/policy.py +++ b/pypy/module/pypyjit/policy.py @@ -1,6 +1,6 @@ -from pypy.jit.codewriter.policy import JitPolicy -from pypy.rlib.jit import JitHookInterface, Counters -from pypy.rlib import jit_hooks +from rpython.jit.codewriter.policy import JitPolicy +from rpython.rlib.jit import JitHookInterface, Counters +from rpython.rlib import jit_hooks from pypy.interpreter.error import OperationError from pypy.module.pypyjit.interp_resop import Cache, wrap_greenkey,\ WrappedOp, W_JitLoopInfo @@ -115,7 +115,7 @@ class PyPyJitPolicy(JitPolicy): def look_inside_function(self, func): mod = func.__module__ or '?' - if mod == 'pypy.rlib.rbigint' or mod == 'pypy.rlib.rlocale' or mod == 'pypy.rlib.rsocket': + if mod == 'rpython.rlib.rbigint' or mod == 'rpython.rlib.rlocale' or mod == 'rpython.rlib.rsocket': return False if mod.startswith('pypy.interpreter.astcompiler.'): return False diff --git a/pypy/module/pypyjit/test/test_jit_hook.py b/pypy/module/pypyjit/test/test_jit_hook.py index 5fb67e46fede9c13f9eb431e9e27c2b4da282f8e..4136a83a116d4d67656cdc6aa3c03ff900dbfdbb 100644 --- a/pypy/module/pypyjit/test/test_jit_hook.py +++ b/pypy/module/pypyjit/test/test_jit_hook.py @@ -2,18 +2,18 @@ import py from pypy.interpreter.gateway import interp2app from pypy.interpreter.pycode import PyCode -from pypy.jit.metainterp.history import JitCellToken, ConstInt, ConstPtr -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.metainterp.logger import Logger -from pypy.rpython.annlowlevel import (cast_instance_to_base_ptr, +from rpython.jit.metainterp.history import JitCellToken, ConstInt, ConstPtr +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.metainterp.logger import Logger +from rpython.rtyper.annlowlevel import (cast_instance_to_base_ptr, cast_base_ptr_to_instance) -from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.rpython.lltypesystem.rclass import OBJECT +from rpython.rtyper.lltypesystem import lltype, llmemory +from rpython.rtyper.lltypesystem.rclass import OBJECT from pypy.module.pypyjit.interp_jit import pypyjitdriver from pypy.module.pypyjit.policy import pypy_hooks -from pypy.jit.tool.oparser import parse -from pypy.jit.metainterp.typesystem import llhelper -from pypy.rlib.jit import JitDebugInfo, AsmInfo, Counters +from rpython.jit.tool.oparser import parse +from rpython.jit.metainterp.typesystem import llhelper +from rpython.rlib.jit import JitDebugInfo, AsmInfo, Counters class MockJitDriverSD(object): class warmstate(object): diff --git a/pypy/module/pypyjit/test/test_policy.py b/pypy/module/pypyjit/test/test_policy.py index a28e2bade8c1fecabcc652b1ca12b20bcb70138d..940ea0cd11dcbc62ba3993c00e636a6435512bdc 100644 --- a/pypy/module/pypyjit/test/test_policy.py +++ b/pypy/module/pypyjit/test/test_policy.py @@ -7,11 +7,11 @@ def test_id_any(): assert pypypolicy.look_inside_function(add__Int_Int) def test_bigint(): - from pypy.rlib.rbigint import rbigint + from rpython.rlib.rbigint import rbigint assert not pypypolicy.look_inside_function(rbigint.lt.im_func) def test_rlocale(): - from pypy.rlib.rlocale import setlocale + from rpython.rlib.rlocale import setlocale assert not pypypolicy.look_inside_function(setlocale) def test_astcompiler(): diff --git a/pypy/module/pypyjit/test_pypy_c/test_00_model.py b/pypy/module/pypyjit/test_pypy_c/test_00_model.py index 45f8e109453181a0d4ca79320db2a0e383d86fd1..f5a75f1cd0bbd77f58677a3e0ddc570e8f538e7c 100644 --- a/pypy/module/pypyjit/test_pypy_c/test_00_model.py +++ b/pypy/module/pypyjit/test_pypy_c/test_00_model.py @@ -4,9 +4,9 @@ import types import subprocess import py from lib_pypy import disassembler -from pypy.tool.udir import udir -from pypy.tool import logparser -from pypy.jit.tool.jitoutput import parse_prof +from rpython.tool.udir import udir +from rpython.tool import logparser +from rpython.jit.tool.jitoutput import parse_prof from pypy.module.pypyjit.test_pypy_c.model import (Log, find_ids_range, find_ids, OpMatcher, InvalidMatch) diff --git a/pypy/module/pypyjit/test_pypy_c/test__ffi.py b/pypy/module/pypyjit/test_pypy_c/test__ffi.py index 7719f5274e8f5fb0514d2cd2fb7432a0196c0152..6a8d2a2584e2a2b99ed1d2fadc847d8e994e0fd2 100644 --- a/pypy/module/pypyjit/test_pypy_c/test__ffi.py +++ b/pypy/module/pypyjit/test_pypy_c/test__ffi.py @@ -4,7 +4,7 @@ from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC class Test__ffi(BaseTestPyPyC): def test__ffi_call(self): - from pypy.rlib.test.test_clibffi import get_libm_name + from rpython.rlib.test.test_clibffi import get_libm_name def main(libm_name): try: from _ffi import CDLL, types @@ -42,7 +42,7 @@ class Test__ffi(BaseTestPyPyC): def test__ffi_call_frame_does_not_escape(self): - from pypy.rlib.test.test_clibffi import get_libm_name + from rpython.rlib.test.test_clibffi import get_libm_name def main(libm_name): try: from _ffi import CDLL, types @@ -75,7 +75,7 @@ class Test__ffi(BaseTestPyPyC): assert opnames.count('new_with_vtable') == 1 def test__ffi_call_releases_gil(self): - from pypy.rlib.clibffi import get_libc_name + from rpython.rlib.clibffi import get_libc_name def main(libc_name, n): import time import os @@ -112,7 +112,7 @@ class Test__ffi(BaseTestPyPyC): def test_ctypes_call(self): - from pypy.rlib.test.test_clibffi import get_libm_name + from rpython.rlib.test.test_clibffi import get_libm_name def main(libm_name): import ctypes libm = ctypes.CDLL(libm_name) @@ -172,7 +172,7 @@ class Test__ffi(BaseTestPyPyC): def test__cffi_call(self): - from pypy.rlib.test.test_clibffi import get_libm_name + from rpython.rlib.test.test_clibffi import get_libm_name def main(libm_name): try: import _cffi_backend diff --git a/pypy/module/rctime/interp_time.py b/pypy/module/rctime/interp_time.py index 17e6257009a714df363274a225481cbf028c87c6..aa216b1c0774e3166f9a74d48b12e290aa05b4fe 100644 --- a/pypy/module/rctime/interp_time.py +++ b/pypy/module/rctime/interp_time.py @@ -1,11 +1,11 @@ -from pypy.rpython.tool import rffi_platform as platform -from pypy.rpython.lltypesystem import rffi +from rpython.rtyper.tool import rffi_platform as platform +from rpython.rtyper.lltypesystem import rffi from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter.gateway import unwrap_spec -from pypy.rpython.lltypesystem import lltype -from pypy.rlib.rarithmetic import ovfcheck_float_to_int, intmask -from pypy.rlib import rposix -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.lltypesystem import lltype +from rpython.rlib.rarithmetic import ovfcheck_float_to_int, intmask +from rpython.rlib import rposix +from rpython.translator.tool.cbuild import ExternalCompilationInfo import os import sys import time as pytime @@ -28,7 +28,7 @@ if _WIN: # time.sleep() will actually call WaitForSingleObject with the desired # timeout. On Ctrl-C, the signal handler is called, the event is set, # and the wait function exits. - from pypy.rlib import rwin32 + from rpython.rlib import rwin32 from pypy.interpreter.error import wrap_windowserror, wrap_oserror from pypy.module.thread import ll_thread as thread @@ -311,7 +311,7 @@ if sys.platform != 'win32': space.wrap("Invalid argument: negative time in sleep")) pytime.sleep(secs) else: - from pypy.rlib import rwin32 + from rpython.rlib import rwin32 from errno import EINTR def _simple_sleep(space, secs, interruptible): if secs == 0.0 or not interruptible: diff --git a/pypy/module/select/__init__.py b/pypy/module/select/__init__.py index 33a0b160d99da58c001efe2b71989888f538b868..82bfe781ee73d17610becbdefc3ea826f7be94ca 100644 --- a/pypy/module/select/__init__.py +++ b/pypy/module/select/__init__.py @@ -32,7 +32,7 @@ class Module(MixedModule): interpleveldefs[symbol] = "space.wrap(interp_kqueue.%s)" % symbol def buildloaders(cls): - from pypy.rlib import rpoll + from rpython.rlib import rpoll for name in rpoll.eventnames: value = getattr(rpoll, name) Module.interpleveldefs[name] = "space.wrap(%r)" % value diff --git a/pypy/module/select/interp_epoll.py b/pypy/module/select/interp_epoll.py index 840cb7d8f6e75965ee1a33ea80fa13d5826c3fdc..0b7c0f1e598a0a4883903b86cb831c04ee2b0777 100644 --- a/pypy/module/select/interp_epoll.py +++ b/pypy/module/select/interp_epoll.py @@ -6,12 +6,12 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import OperationError, operationerrfmt, exception_from_errno from pypy.interpreter.typedef import TypeDef, GetSetProperty -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rpython.tool import rffi_platform -from pypy.rlib._rsocket_rffi import socketclose, FD_SETSIZE -from pypy.rlib.rposix import get_errno -from pypy.rlib.rarithmetic import intmask -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rtyper.tool import rffi_platform +from rpython.rlib._rsocket_rffi import socketclose, FD_SETSIZE +from rpython.rlib.rposix import get_errno +from rpython.rlib.rarithmetic import intmask +from rpython.translator.tool.cbuild import ExternalCompilationInfo eci = ExternalCompilationInfo( diff --git a/pypy/module/select/interp_kqueue.py b/pypy/module/select/interp_kqueue.py index b2dc4b1f66d5cb8e5f3f85a8bcfa0a1a77bae8dc..280a6b9d2912647530e895e39c0f3370f0d9fcc1 100644 --- a/pypy/module/select/interp_kqueue.py +++ b/pypy/module/select/interp_kqueue.py @@ -2,11 +2,11 @@ from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.error import OperationError, operationerrfmt, exception_from_errno from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter.typedef import TypeDef, generic_new_descr, GetSetProperty -from pypy.rlib._rsocket_rffi import socketclose -from pypy.rlib.rarithmetic import r_uint -from pypy.rpython.lltypesystem import rffi, lltype -from pypy.rpython.tool import rffi_platform -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rlib._rsocket_rffi import socketclose +from rpython.rlib.rarithmetic import r_uint +from rpython.rtyper.lltypesystem import rffi, lltype +from rpython.rtyper.tool import rffi_platform +from rpython.translator.tool.cbuild import ExternalCompilationInfo import sys diff --git a/pypy/module/select/interp_select.py b/pypy/module/select/interp_select.py index f5fbfed92ab466cfaf93cf6c0f61b2b15b8d4b47..9cf84c4a7af20260d27d5660d811fd953dbd4ee2 100644 --- a/pypy/module/select/interp_select.py +++ b/pypy/module/select/interp_select.py @@ -2,7 +2,7 @@ from pypy.interpreter.typedef import TypeDef from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter.error import OperationError, wrap_oserror -from pypy.rlib import rpoll +from rpython.rlib import rpoll import errno defaultevents = rpoll.POLLIN | rpoll.POLLOUT | rpoll.POLLPRI @@ -78,8 +78,8 @@ Poll.typedef = TypeDef('select.poll', **pollmethods) # ____________________________________________________________ -from pypy.rlib import _rsocket_rffi as _c -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.rlib import _rsocket_rffi as _c +from rpython.rtyper.lltypesystem import lltype, rffi def _build_fd_set(space, list_w, ll_list, nfds): diff --git a/pypy/module/signal/interp_signal.py b/pypy/module/signal/interp_signal.py index ca0821d7365d179e39a1b3d099ab8f2f46bf6e3d..46e5763580bda53148bb2594ea66a807e1f46652 100644 --- a/pypy/module/signal/interp_signal.py +++ b/pypy/module/signal/interp_signal.py @@ -4,14 +4,14 @@ from pypy.interpreter.executioncontext import AsyncAction, AbstractActionFlag from pypy.interpreter.executioncontext import PeriodicAsyncAction from pypy.interpreter.gateway import unwrap_spec import signal as cpy_signal -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rpython.tool import rffi_platform -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rtyper.tool import rffi_platform +from rpython.translator.tool.cbuild import ExternalCompilationInfo import py import sys -from pypy.tool import autopath -from pypy.rlib import jit, rposix -from pypy.rlib.rarithmetic import intmask, is_valid_int +from pypy.conftest import pypydir +from rpython.rlib import jit, rposix +from rpython.rlib.rarithmetic import intmask, is_valid_int def setup(): for key, value in cpy_signal.__dict__.items(): @@ -41,7 +41,7 @@ includes = ['stdlib.h', 'src/signals.h'] if sys.platform != 'win32': includes.append('sys/time.h') -cdir = py.path.local(autopath.pypydir).join('translator', 'c') +cdir = py.path.local(pypydir).join('translator', 'c') eci = ExternalCompilationInfo( includes = includes, diff --git a/pypy/module/signal/test/test_interp_signal.py b/pypy/module/signal/test/test_interp_signal.py index 7afc15b2cbdb6368a6426f1cbc6c4da146c5f049..6dc687f2f7daf5ec1ea9f396154180757763b9e1 100644 --- a/pypy/module/signal/test/test_interp_signal.py +++ b/pypy/module/signal/test/test_interp_signal.py @@ -1,5 +1,5 @@ import os, py -from pypy.translator.c.test.test_genc import compile +from rpython.translator.c.test.test_genc import compile from pypy.module.signal import interp_signal def setup_module(mod): diff --git a/pypy/module/struct/formatiterator.py b/pypy/module/struct/formatiterator.py index b06ae9dcb755ba5a9e181325e6240a187aff9153..b962b6c2407fd8120ae2e262f87e83102190e3fb 100644 --- a/pypy/module/struct/formatiterator.py +++ b/pypy/module/struct/formatiterator.py @@ -1,9 +1,9 @@ -from pypy.rlib import jit -from pypy.rlib.objectmodel import specialize -from pypy.rlib.rstring import StringBuilder -from pypy.rlib.rstruct.error import StructError -from pypy.rlib.rstruct.formatiterator import FormatIterator -from pypy.rlib.rstruct.standardfmttable import PACK_ACCEPTS_BROKEN_INPUT +from rpython.rlib import jit +from rpython.rlib.objectmodel import specialize +from rpython.rlib.rstring import StringBuilder +from rpython.rlib.rstruct.error import StructError +from rpython.rlib.rstruct.formatiterator import FormatIterator +from rpython.rlib.rstruct.standardfmttable import PACK_ACCEPTS_BROKEN_INPUT from pypy.interpreter.error import OperationError diff --git a/pypy/module/struct/interp_struct.py b/pypy/module/struct/interp_struct.py index 1179b3fdbb7e6ce70fba38b52795e9a497df156c..ade643ff54ceb1edc76eb82611452a30a4a4043d 100644 --- a/pypy/module/struct/interp_struct.py +++ b/pypy/module/struct/interp_struct.py @@ -1,8 +1,8 @@ from pypy.interpreter.gateway import unwrap_spec from pypy.module.struct.formatiterator import PackFormatIterator, UnpackFormatIterator -from pypy.rlib import jit -from pypy.rlib.rstruct.error import StructError -from pypy.rlib.rstruct.formatiterator import CalcSizeFormatIterator +from rpython.rlib import jit +from rpython.rlib.rstruct.error import StructError +from rpython.rlib.rstruct.formatiterator import CalcSizeFormatIterator @unwrap_spec(format=str) diff --git a/pypy/module/struct/test/test_struct.py b/pypy/module/struct/test/test_struct.py index 000191321c7ca313980166541f5b7cd5b488abb5..80a873c57769b98616d955a7f4bf5feae820f031 100644 --- a/pypy/module/struct/test/test_struct.py +++ b/pypy/module/struct/test/test_struct.py @@ -3,7 +3,7 @@ Tests for the struct module implemented at interp-level in pypy/module/struct. """ import py -from pypy.rlib.rstruct.nativefmttable import native_is_bigendian +from rpython.rlib.rstruct.nativefmttable import native_is_bigendian class AppTestStruct(object): diff --git a/pypy/module/sys/__init__.py b/pypy/module/sys/__init__.py index a5c2f92f54e0222fa98b14324e36e3b985974630..b8cdfbf220ad5533b33445eb6e012cf7411c9561 100644 --- a/pypy/module/sys/__init__.py +++ b/pypy/module/sys/__init__.py @@ -1,6 +1,6 @@ from pypy.interpreter.mixedmodule import MixedModule from pypy.interpreter.error import OperationError -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.objectmodel import we_are_translated import sys _WIN = sys.platform == 'win32' diff --git a/pypy/module/sys/initpath.py b/pypy/module/sys/initpath.py index 235b6735e187b7ed40df065e7aa729f140bb46a0..6613e30b23f37e7c764369c2c083d0795883102f 100644 --- a/pypy/module/sys/initpath.py +++ b/pypy/module/sys/initpath.py @@ -6,8 +6,8 @@ import sys import os import stat import errno -from pypy.rlib import rpath -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib import rpath +from rpython.rlib.objectmodel import we_are_translated from pypy.interpreter.gateway import unwrap_spec from pypy.module.sys.state import get as get_state diff --git a/pypy/module/sys/interp_encoding.py b/pypy/module/sys/interp_encoding.py index 38461ea93fcd74e26b22c81d1f6867b67a95e147..f7b1634a1477712b2844eb54d6c02ba4039fd203 100644 --- a/pypy/module/sys/interp_encoding.py +++ b/pypy/module/sys/interp_encoding.py @@ -1,6 +1,6 @@ import sys -from pypy.rlib import rlocale -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib import rlocale +from rpython.rlib.objectmodel import we_are_translated def getdefaultencoding(space): """Return the current default string encoding used by the Unicode diff --git a/pypy/module/sys/state.py b/pypy/module/sys/state.py index 550b3a9420ada2889828ef38c9eebf9f0203a2d4..dbd5fccd75c8fd36edc6f0f3b68df4686fe95b2e 100644 --- a/pypy/module/sys/state.py +++ b/pypy/module/sys/state.py @@ -57,6 +57,6 @@ def getio(space): def pypy_getudir(space): """NOT_RPYTHON (should be removed from interpleveldefs before translation)""" - from pypy.tool.udir import udir + from rpython.tool.udir import udir return space.wrap(str(udir)) diff --git a/pypy/module/sys/system.py b/pypy/module/sys/system.py index f6d67ebfa7aecc3964b658ceb9255cf2dea47290..4dbceb798a05fe33458149fb4a94d3730ef5490d 100644 --- a/pypy/module/sys/system.py +++ b/pypy/module/sys/system.py @@ -1,7 +1,7 @@ """Information about the current system.""" from pypy.interpreter import gateway -from pypy.rlib import rfloat, rbigint -from pypy.rpython.lltypesystem import rffi +from rpython.rlib import rfloat, rbigint +from rpython.rtyper.lltypesystem import rffi app = gateway.applevel(""" diff --git a/pypy/module/sys/test/autopath.py b/pypy/module/sys/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/module/sys/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/module/sys/test/test_encoding.py b/pypy/module/sys/test/test_encoding.py index 5f821c475ebc738d3348945f1d3bc6e1843a05b9..c1053ac2e0a9bd3e5efcbca399c5522cf9edc5c3 100644 --- a/pypy/module/sys/test/test_encoding.py +++ b/pypy/module/sys/test/test_encoding.py @@ -1,5 +1,5 @@ import os, py -from pypy.rlib import rlocale +from rpython.rlib import rlocale from pypy.module.sys.interp_encoding import _getfilesystemencoding from pypy.module.sys.interp_encoding import base_encoding diff --git a/pypy/module/sys/test/test_sysmodule.py b/pypy/module/sys/test/test_sysmodule.py index 6cb7790d268011ebf10eb9e4cb9e7bd64d7196f5..feb38f8c0057b5590c017b6b193149062b39311b 100644 --- a/pypy/module/sys/test/test_sysmodule.py +++ b/pypy/module/sys/test/test_sysmodule.py @@ -613,14 +613,14 @@ class AppTestSysExcInfoDirect: vm.exc_info_with_tb = exc_info_with_tb vm.exc_info_without_tb = exc_info_without_tb # - from pypy.rlib import jit + from rpython.rlib import jit self.old2 = [jit.we_are_jitted] jit.we_are_jitted = lambda: True def teardown_method(self, meth): if self.checking: from pypy.module.sys import vm - from pypy.rlib import jit + from rpython.rlib import jit vm.exc_info_with_tb = self.old[0] vm.exc_info_without_tb = self.old[1] jit.we_are_jitted = self.old2[0] diff --git a/pypy/module/sys/version.py b/pypy/module/sys/version.py index 4c97797f8ae68afd8413c7fe80ac31d4c8c0d8f6..ff147548c3c1bc13cae6d3316ee0a6aa5f53f2e7 100644 --- a/pypy/module/sys/version.py +++ b/pypy/module/sys/version.py @@ -3,7 +3,7 @@ Version numbers exposed by PyPy through the 'sys' module. """ import os import re -from pypy.translator.platform import platform +from rpython.translator.platform import platform from pypy.interpreter import gateway #XXX # the release serial 42 is not in range(16) diff --git a/pypy/module/sys/vm.py b/pypy/module/sys/vm.py index 08dd59770f5a79eaed142735ad2a85cecebecc90..486235ec522ccfaad146888acfadd5d2dd8d51ba 100644 --- a/pypy/module/sys/vm.py +++ b/pypy/module/sys/vm.py @@ -6,8 +6,8 @@ import sys from pypy.interpreter import gateway from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import unwrap_spec, WrappedDefault -from pypy.rlib import jit -from pypy.rlib.runicode import MAXUNICODE +from rpython.rlib import jit +from rpython.rlib.runicode import MAXUNICODE # ____________________________________________________________ @@ -55,7 +55,7 @@ reserves 768KB of stack space, which should suffice (on Linux, depending on the compiler settings) for ~1400 calls. Setting the value to N reserves N/1000 times 768KB of stack space. """ - from pypy.rlib.rstack import _stack_set_length_fraction + from rpython.rlib.rstack import _stack_set_length_fraction if new_limit <= 0: raise OperationError(space.w_ValueError, space.wrap("recursion limit must be positive")) @@ -106,7 +106,7 @@ def exc_info_without_tb(space, frame): space.w_None]) def exc_info_direct(space, frame): - from pypy.tool import stdlib_opcode + from rpython.tool import stdlib_opcode # In order to make the JIT happy, we try to return (exc, val, None) # instead of (exc, val, tb). We can do that only if we recognize # the following pattern in the bytecode: @@ -218,7 +218,7 @@ class windows_version_info: def getwindowsversion(space): - from pypy.rlib import rwin32 + from rpython.rlib import rwin32 info = rwin32.GetVersionEx() w_windows_version_info = app.wget(space, "windows_version_info") raw_version = space.newtuple([ diff --git a/pypy/module/termios/__init__.py b/pypy/module/termios/__init__.py index a7b3098ad6ff05ae668ceff6cb7b613fba88d4ee..31a5c046e2d8f98acf7acd4ce91a3934432e22c7 100644 --- a/pypy/module/termios/__init__.py +++ b/pypy/module/termios/__init__.py @@ -1,7 +1,7 @@ from pypy.interpreter.mixedmodule import MixedModule import termios -from pypy.rlib.nonconst import NonConstant +from rpython.rlib.nonconst import NonConstant class Module(MixedModule): "This module provides an interface to the Posix calls for tty I/O control.\n\ diff --git a/pypy/module/termios/interp_termios.py b/pypy/module/termios/interp_termios.py index e13cf9fd6f98411eb2c9e7f27e5ad59a932ade36..4735cb1b597063799a4d7bb557fffa91ff939333 100644 --- a/pypy/module/termios/interp_termios.py +++ b/pypy/module/termios/interp_termios.py @@ -5,10 +5,10 @@ little use of termios module on RPython level by itself from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import OperationError, wrap_oserror -from pypy.rpython.module import ll_termios -from pypy.rlib.objectmodel import we_are_translated +from rpython.rtyper.module import ll_termios +from rpython.rlib.objectmodel import we_are_translated import os -from pypy.rlib import rtermios +from rpython.rlib import rtermios import termios class Cache: diff --git a/pypy/module/termios/test/test_termios.py b/pypy/module/termios/test/test_termios.py index 5ab80c3eb64fdbfdea3a9c71fc4ccefaa4c29f80..dee6b8fbb9d24fcb6fc716c4c78150abee05f79a 100644 --- a/pypy/module/termios/test/test_termios.py +++ b/pypy/module/termios/test/test_termios.py @@ -1,8 +1,8 @@ import py import sys -from pypy.tool.autopath import pypydir -from pypy.tool.udir import udir +from pypy.conftest import pypydir +from rpython.tool.udir import udir class TestTermios(object): def setup_class(cls): diff --git a/pypy/module/test_lib_pypy/ctypes_tests/conftest.py b/pypy/module/test_lib_pypy/ctypes_tests/conftest.py index 3f0a2d71e281683421da689c84e890444ea8d711..599a8e301cbddcf90b0ce073a61b37a6b1ee491a 100644 --- a/pypy/module/test_lib_pypy/ctypes_tests/conftest.py +++ b/pypy/module/test_lib_pypy/ctypes_tests/conftest.py @@ -6,8 +6,8 @@ def pytest_ignore_collect(path): return True def compile_so_file(): - from pypy.translator.platform import platform - from pypy.translator.tool.cbuild import ExternalCompilationInfo + from rpython.translator.platform import platform + from rpython.translator.tool.cbuild import ExternalCompilationInfo udir = pytest.ensuretemp('_ctypes_test') cfile = py.path.local(__file__).dirpath().join("_ctypes_test.c") diff --git a/pypy/module/test_lib_pypy/test_msvcrt.py b/pypy/module/test_lib_pypy/test_msvcrt.py index 7f58ae204403d31b05bd172feb7062c305fd3f89..ef4645a54ace1d5195a7ec1b69d4c71433bbc7ff 100644 --- a/pypy/module/test_lib_pypy/test_msvcrt.py +++ b/pypy/module/test_lib_pypy/test_msvcrt.py @@ -1,4 +1,4 @@ -from pypy.tool.udir import udir +from rpython.tool.udir import udir import py import sys diff --git a/pypy/module/thread/gil.py b/pypy/module/thread/gil.py index cfa75dfaaa1adf365d69790783152367bd7c8c75..b7f5570d251c98d5ae30b26c5fd5dd68350cce2e 100644 --- a/pypy/module/thread/gil.py +++ b/pypy/module/thread/gil.py @@ -11,8 +11,8 @@ from pypy.module.thread import ll_thread as thread from pypy.module.thread.error import wrap_thread_error from pypy.interpreter.executioncontext import PeriodicAsyncAction from pypy.module.thread.threadlocals import OSThreadLocals -from pypy.rlib.objectmodel import invoke_around_extcall -from pypy.rlib.rposix import get_errno, set_errno +from rpython.rlib.objectmodel import invoke_around_extcall +from rpython.rlib.rposix import get_errno, set_errno class GILThreadLocals(OSThreadLocals): """A version of OSThreadLocals that enforces a GIL.""" diff --git a/pypy/module/thread/ll_thread.py b/pypy/module/thread/ll_thread.py index 8a0e39c4b32413b51be64f538db6efa9feb0e305..efc563e9d3e12dea31e0377bd4e88827342acc5a 100644 --- a/pypy/module/thread/ll_thread.py +++ b/pypy/module/thread/ll_thread.py @@ -1,18 +1,18 @@ -from pypy.rpython.lltypesystem import rffi, lltype, llmemory -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.lltypesystem import rffi, lltype, llmemory +from rpython.translator.tool.cbuild import ExternalCompilationInfo import py -from pypy.rlib import jit, rgc -from pypy.rlib.debug import ll_assert -from pypy.rlib.objectmodel import we_are_translated, specialize -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.rpython.tool import rffi_platform -from pypy.tool import autopath +from rpython.rlib import jit, rgc +from rpython.rlib.debug import ll_assert +from rpython.rlib.objectmodel import we_are_translated, specialize +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.rtyper.tool import rffi_platform +from pypy.conftest import pypydir class error(Exception): pass -pypydir = py.path.local(autopath.pypydir) +pypydir = py.path.local(pypydir) translator_c_dir = pypydir / 'translator' / 'c' eci = ExternalCompilationInfo( diff --git a/pypy/module/thread/os_local.py b/pypy/module/thread/os_local.py index 216bbfdf2157b96c772b2950720d90f7f93f1410..eb06439638abb3b8994f32d6cb6bc6d168d8f5ee 100644 --- a/pypy/module/thread/os_local.py +++ b/pypy/module/thread/os_local.py @@ -1,10 +1,10 @@ import weakref -from pypy.rlib import jit +from rpython.rlib import jit from pypy.interpreter.baseobjspace import Wrappable, W_Root from pypy.interpreter.executioncontext import ExecutionContext from pypy.interpreter.typedef import (TypeDef, interp2app, GetSetProperty, descr_get_dict) -from pypy.rlib.rshrinklist import AbstractShrinkList +from rpython.rlib.rshrinklist import AbstractShrinkList class WRefShrinkList(AbstractShrinkList): def must_keep(self, wref): diff --git a/pypy/module/thread/test/test_gil.py b/pypy/module/thread/test/test_gil.py index e869a2a9e30bdf3c29056e65317098defa7ddc38..5cc44a0ab37f5cc3a3a9cd246ee71ff7d58dac9c 100644 --- a/pypy/module/thread/test/test_gil.py +++ b/pypy/module/thread/test/test_gil.py @@ -2,7 +2,7 @@ import time from pypy.module.thread import gil from pypy.module.thread.test import test_ll_thread from pypy.module.thread import ll_thread as thread -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.objectmodel import we_are_translated class FakeEC(object): pass @@ -31,7 +31,7 @@ class GILTests(test_ll_thread.AbstractGCTestClass): bigtest = False def test_one_thread(self, skew=+1): - from pypy.rlib.debug import debug_print + from rpython.rlib.debug import debug_print if self.bigtest: N = 100000 skew *= 25000 diff --git a/pypy/module/thread/test/test_import_lock.py b/pypy/module/thread/test/test_import_lock.py index 57483e3009b55fefdddc535e21887c5082c737a0..7877adb4f00ed9cd0696aa4f4c00338dea7b90b0 100644 --- a/pypy/module/thread/test/test_import_lock.py +++ b/pypy/module/thread/test/test_import_lock.py @@ -1,4 +1,4 @@ -from pypy.tool.udir import udir +from rpython.tool.udir import udir from pypy.module.thread.test.support import GenericTestThread diff --git a/pypy/module/thread/test/test_ll_thread.py b/pypy/module/thread/test/test_ll_thread.py index b9fb9aa7f267b78a51f9d36761b62f56edfebd87..667633c7e7a976acfca9c2be426dc31188a1c94c 100644 --- a/pypy/module/thread/test/test_ll_thread.py +++ b/pypy/module/thread/test/test_ll_thread.py @@ -1,7 +1,7 @@ import gc from pypy.module.thread.ll_thread import * -from pypy.translator.c.test.test_boehm import AbstractGCTestClass -from pypy.rpython.lltypesystem import lltype, rffi +from rpython.translator.c.test.test_boehm import AbstractGCTestClass +from rpython.rtyper.lltypesystem import lltype, rffi import py def setup_module(mod): @@ -65,8 +65,8 @@ class AbstractThreadTests(AbstractGCTestClass): def test_gc_locking(self): import time - from pypy.rlib.objectmodel import invoke_around_extcall - from pypy.rlib.debug import ll_assert + from rpython.rlib.objectmodel import invoke_around_extcall + from rpython.rlib.debug import ll_assert class State: pass diff --git a/pypy/module/thread/test/test_lock.py b/pypy/module/thread/test/test_lock.py index 1cef5a553f9a5ef32ff2d461a5d3d0ec32786517..911dc96d38a9ff77a4e9865fcaa9ecdd25ffd687 100644 --- a/pypy/module/thread/test/test_lock.py +++ b/pypy/module/thread/test/test_lock.py @@ -1,6 +1,6 @@ from __future__ import with_statement from pypy.module.thread.test.support import GenericTestThread -from pypy.translator.c.test.test_genc import compile +from rpython.translator.c.test.test_genc import compile class AppTestLock(GenericTestThread): @@ -47,7 +47,7 @@ class AppTestLock(GenericTestThread): assert lock.locked() is False def test_compile_lock(): - from pypy.rlib import rgc + from rpython.rlib import rgc from pypy.module.thread.ll_thread import allocate_lock def g(): l = allocate_lock() diff --git a/pypy/module/unicodedata/generate_unicodedb.py b/pypy/module/unicodedata/generate_unicodedb.py index cd64d221a038fa5d9cd8fd935d91fea536271728..6f9832c2ff754aaf0e7bb76e93668e0ada8b747d 100755 --- a/pypy/module/unicodedata/generate_unicodedb.py +++ b/pypy/module/unicodedata/generate_unicodedb.py @@ -694,7 +694,7 @@ def main(): print >> outfile, '# This file was generated with the command:' print >> outfile, '# ', ' '.join(sys.argv) print >> outfile - print >> outfile, 'from pypy.rlib.rarithmetic import r_longlong' + print >> outfile, 'from rpython.rlib.rarithmetic import r_longlong' print >> outfile print >> outfile writeUnicodedata(options.unidata_version, table, outfile, options.base) diff --git a/pypy/module/unicodedata/interp_ucd.py b/pypy/module/unicodedata/interp_ucd.py index 5f39f3d8024487a8e54248a7f17bdcd103cea145..17d9f7deab2296f28f91ea1e0f2c9b50ec305eda 100644 --- a/pypy/module/unicodedata/interp_ucd.py +++ b/pypy/module/unicodedata/interp_ucd.py @@ -5,9 +5,9 @@ from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.error import OperationError from pypy.interpreter.typedef import TypeDef, interp_attrproperty -from pypy.rlib.rarithmetic import r_longlong -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.runicode import MAXUNICODE +from rpython.rlib.rarithmetic import r_longlong +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.runicode import MAXUNICODE import sys from pypy.module.unicodedata import unicodedb_5_2_0, unicodedb_3_2_0 diff --git a/pypy/module/unicodedata/test/test_unicodedata.py b/pypy/module/unicodedata/test/test_unicodedata.py index 6c14c779cbc1e510aee009d222a157bc9cf06f23..7cc820c476935f9921b989ef0a4ef835c308be77 100644 --- a/pypy/module/unicodedata/test/test_unicodedata.py +++ b/pypy/module/unicodedata/test/test_unicodedata.py @@ -1,4 +1,4 @@ -from pypy.rpython.test.tool import BaseRtypingTest, LLRtypeMixin +from rpython.rtyper.test.tool import BaseRtypingTest, LLRtypeMixin from pypy.module.unicodedata import unicodedb_3_2_0, unicodedb_5_2_0 class AppTestUnicodeData: diff --git a/pypy/module/unicodedata/unicodedb_3_2_0.py b/pypy/module/unicodedata/unicodedb_3_2_0.py index 5f51cb25d2fc3ffc6c09bac241112fc423a8d14c..ad23ff3c2d76ddc1eeb295e5d543b409f27f70ee 100644 --- a/pypy/module/unicodedata/unicodedb_3_2_0.py +++ b/pypy/module/unicodedata/unicodedb_3_2_0.py @@ -2,7 +2,7 @@ # This file was generated with the command: # ./generate_unicodedb.py --unidata_version=3.2.0 --output=unicodedb_3_2_0 --base=unicodedb_5_2_0 -from pypy.rlib.rarithmetic import r_longlong +from rpython.rlib.rarithmetic import r_longlong import unicodedb_5_2_0 as base_mod diff --git a/pypy/module/unicodedata/unicodedb_5_2_0.py b/pypy/module/unicodedata/unicodedb_5_2_0.py index 5369070ec4f4f42398c67784d6f8548522dcb169..5d1377fd6e9013c633726380be5dc3cd9ec812b5 100644 --- a/pypy/module/unicodedata/unicodedb_5_2_0.py +++ b/pypy/module/unicodedata/unicodedb_5_2_0.py @@ -2,7 +2,7 @@ # This file was generated with the command: # ./generate_unicodedb.py --unidata_version=5.2.0 --output=unicodedb_5_2_0 -from pypy.rlib.rarithmetic import r_longlong +from rpython.rlib.rarithmetic import r_longlong base_mod = None diff --git a/pypy/module/zipimport/interp_zipimport.py b/pypy/module/zipimport/interp_zipimport.py index 7a65615dfd6aaaa387080ef99320a7b8f5e13f39..c8f20ee1688130b17978edfff69bfdfca89d4beb 100644 --- a/pypy/module/zipimport/interp_zipimport.py +++ b/pypy/module/zipimport/interp_zipimport.py @@ -5,8 +5,8 @@ from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.module import Module from pypy.module.imp import importing -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.rzipfile import RZipFile, BadZipfile +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.rzipfile import RZipFile, BadZipfile import os import stat diff --git a/pypy/module/zipimport/test/test_zipimport.py b/pypy/module/zipimport/test/test_zipimport.py index 399547ac74f29aa63cef9db97ffe9245f0a55ea4..5ed5f1f51c61108c285f56540cd007520c46e931 100644 --- a/pypy/module/zipimport/test/test_zipimport.py +++ b/pypy/module/zipimport/test/test_zipimport.py @@ -6,7 +6,7 @@ import struct from pypy.module.imp.importing import get_pyc_magic, _w_long from StringIO import StringIO -from pypy.tool.udir import udir +from rpython.tool.udir import udir from zipfile import ZIP_STORED, ZIP_DEFLATED @@ -362,7 +362,7 @@ class AppTestZipimportDeflated(AppTestZipimport): def setup_class(cls): try: - import pypy.rlib.rzlib + import rpython.rlib.rzlib except ImportError: py.test.skip("zlib not available, cannot test compressed zipfiles") cls.make_class() diff --git a/pypy/module/zlib/__init__.py b/pypy/module/zlib/__init__.py index b1211942c59fd172a7eb3b582cce0288594873fb..055badcdad1c1351df29ba5070617536747c011c 100644 --- a/pypy/module/zlib/__init__.py +++ b/pypy/module/zlib/__init__.py @@ -4,7 +4,7 @@ Mixed-module definition for the zlib module. """ from pypy.interpreter.mixedmodule import MixedModule -from pypy.rlib import rzlib +from rpython.rlib import rzlib class Module(MixedModule): diff --git a/pypy/module/zlib/interp_zlib.py b/pypy/module/zlib/interp_zlib.py index ec6537b24efee89027b80f882365ee6301eb68f3..a9c25f8b568ce7e454c99181c797acb423190b38 100644 --- a/pypy/module/zlib/interp_zlib.py +++ b/pypy/module/zlib/interp_zlib.py @@ -3,10 +3,10 @@ from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef, interp_attrproperty from pypy.interpreter.error import OperationError -from pypy.rlib.rarithmetic import intmask, r_uint -from pypy.rlib.objectmodel import keepalive_until_here +from rpython.rlib.rarithmetic import intmask, r_uint +from rpython.rlib.objectmodel import keepalive_until_here -from pypy.rlib import rzlib +from rpython.rlib import rzlib if intmask(2**31) == -2**31: diff --git a/pypy/objspace/descroperation.py b/pypy/objspace/descroperation.py index bfb34a6344228aae14eeb755a69040de6a338ab3..d09a36191ee19077973ae2a61c4596f07ff153eb 100644 --- a/pypy/objspace/descroperation.py +++ b/pypy/objspace/descroperation.py @@ -4,9 +4,9 @@ from pypy.interpreter.baseobjspace import ObjSpace from pypy.interpreter.function import Function, Method, FunctionWithFixedCode from pypy.interpreter.argument import Arguments from pypy.interpreter.typedef import default_identity_hash -from pypy.tool.sourcetools import compile2, func_with_new_name +from rpython.tool.sourcetools import compile2, func_with_new_name from pypy.module.__builtin__.interp_classobj import W_InstanceObject -from pypy.rlib.objectmodel import specialize +from rpython.rlib.objectmodel import specialize def object_getattribute(space): "Utility that returns the app-level descriptor object.__getattribute__." diff --git a/pypy/objspace/fake/objspace.py b/pypy/objspace/fake/objspace.py index 0642404397f9a008b33945e87b78fa701185ad80..c140476c7a2580aac86adbe5ab034856d81fafe1 100644 --- a/pypy/objspace/fake/objspace.py +++ b/pypy/objspace/fake/objspace.py @@ -1,15 +1,15 @@ -from pypy.annotation.model import SomeInstance, s_None +from rpython.annotator.model import SomeInstance, s_None from pypy.interpreter import argument, gateway from pypy.interpreter.baseobjspace import W_Root, ObjSpace, Wrappable, SpaceCache from pypy.interpreter.typedef import TypeDef, GetSetProperty -from pypy.rlib.objectmodel import instantiate, we_are_translated -from pypy.rlib.nonconst import NonConstant -from pypy.rlib.rarithmetic import r_uint, r_singlefloat -from pypy.rpython.extregistry import ExtRegistryEntry -from pypy.rpython.lltypesystem import lltype +from rpython.rlib.objectmodel import instantiate, we_are_translated +from rpython.rlib.nonconst import NonConstant +from rpython.rlib.rarithmetic import r_uint, r_singlefloat +from rpython.rtyper.extregistry import ExtRegistryEntry +from rpython.rtyper.lltypesystem import lltype from pypy.tool.option import make_config -from pypy.tool.sourcetools import compile2, func_with_new_name -from pypy.translator.translator import TranslationContext +from rpython.tool.sourcetools import compile2, func_with_new_name +from rpython.translator.translator import TranslationContext class W_MyObject(Wrappable): @@ -50,7 +50,7 @@ class W_MyObject(Wrappable): return r_uint(NonConstant(42)) def bigint_w(self, space): - from pypy.rlib.rbigint import rbigint + from rpython.rlib.rbigint import rbigint return rbigint.fromint(NonConstant(42)) class W_MyType(W_MyObject): diff --git a/pypy/objspace/fake/test/test_checkmodule.py b/pypy/objspace/fake/test/test_checkmodule.py index 7e4e0ed0e87ea6626c0dc2db6e479fa8e72f9956..a65841a3b59a7ab69b0affad7566eb0992fb0703 100644 --- a/pypy/objspace/fake/test/test_checkmodule.py +++ b/pypy/objspace/fake/test/test_checkmodule.py @@ -3,7 +3,7 @@ from pypy.objspace.fake.objspace import FakeObjSpace, is_root from pypy.interpreter.baseobjspace import Wrappable from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.gateway import interp2app, W_Root, ObjSpace -from pypy.rpython.test.test_llinterp import interpret +from rpython.rtyper.test.test_llinterp import interpret def make_checker(): check = [] diff --git a/pypy/objspace/fake/test/test_objspace.py b/pypy/objspace/fake/test/test_objspace.py index 3f2888a202eb737687341bd797609968bdd5f05f..4b249f12f6449139a8b12b6690dacbb01c47bd0b 100644 --- a/pypy/objspace/fake/test/test_objspace.py +++ b/pypy/objspace/fake/test/test_objspace.py @@ -3,7 +3,7 @@ from pypy.objspace.fake.objspace import FakeObjSpace, W_Root from pypy.interpreter.argument import Arguments from pypy.interpreter.typedef import TypeDef from pypy.interpreter.baseobjspace import Wrappable -from pypy.rlib.unroll import unrolling_iterable +from rpython.rlib.unroll import unrolling_iterable def test_create(): FakeObjSpace() diff --git a/pypy/objspace/std/boolobject.py b/pypy/objspace/std/boolobject.py index b28e563ff7fba680cf8dd331a8343ecd8df9b30d..e0ad896770fe7be6b478e2ed72fca4b3c1b64954 100644 --- a/pypy/objspace/std/boolobject.py +++ b/pypy/objspace/std/boolobject.py @@ -1,5 +1,5 @@ -from pypy.rlib.rbigint import rbigint -from pypy.rlib.rarithmetic import r_uint +from rpython.rlib.rbigint import rbigint +from rpython.rlib.rarithmetic import r_uint from pypy.interpreter.error import OperationError from pypy.objspace.std import newformat from pypy.objspace.std.model import registerimplementation, W_Object diff --git a/pypy/objspace/std/builtinshortcut.py b/pypy/objspace/std/builtinshortcut.py index f305270745bcadfe51bf220258182a19e64b950c..c30426f7c397144d29d5e78688c59f26e01336e8 100644 --- a/pypy/objspace/std/builtinshortcut.py +++ b/pypy/objspace/std/builtinshortcut.py @@ -3,7 +3,7 @@ from pypy.interpreter.error import OperationError from pypy.objspace.descroperation import DescrOperation from pypy.objspace.std.multimethod import FailedToImplement from pypy.objspace.std.boolobject import W_BoolObject -from pypy.tool.sourcetools import func_with_new_name +from rpython.tool.sourcetools import func_with_new_name # ____________________________________________________________ # diff --git a/pypy/objspace/std/bytearrayobject.py b/pypy/objspace/std/bytearrayobject.py index 533f09f666c5bd2ed8ca1a709146e82ad25eadd9..f3ca8708b797ca134010f62174db4a29e59e528a 100644 --- a/pypy/objspace/std/bytearrayobject.py +++ b/pypy/objspace/std/bytearrayobject.py @@ -4,9 +4,9 @@ from pypy.objspace.std.register_all import register_all from pypy.objspace.std.inttype import wrapint from pypy.objspace.std.multimethod import FailedToImplement from pypy.objspace.std.noneobject import W_NoneObject -from pypy.rlib.rarithmetic import intmask -from pypy.rlib.rstring import StringBuilder -from pypy.rlib.debug import check_annotation +from rpython.rlib.rarithmetic import intmask +from rpython.rlib.rstring import StringBuilder +from rpython.rlib.debug import check_annotation from pypy.objspace.std import stringobject from pypy.objspace.std.intobject import W_IntObject from pypy.objspace.std.listobject import get_positive_index @@ -25,7 +25,7 @@ from pypy.objspace.std.bytearraytype import ( makebytearraydata_w, getbytevalue, new_bytearray ) -from pypy.tool.sourcetools import func_with_new_name +from rpython.tool.sourcetools import func_with_new_name class W_BytearrayObject(W_Object): diff --git a/pypy/objspace/std/callmethod.py b/pypy/objspace/std/callmethod.py index d9d6455562de80b7dfdebad5ff72fe6dc016da47..7b02d018dde5e06c335f90417a2608dc0800d88d 100644 --- a/pypy/objspace/std/callmethod.py +++ b/pypy/objspace/std/callmethod.py @@ -12,7 +12,7 @@ like: (on the left, without the new bytecodes; on the right, with them) from pypy.interpreter import function from pypy.objspace.descroperation import object_getattribute -from pypy.rlib import jit +from rpython.rlib import jit from pypy.objspace.std.mapdict import LOOKUP_METHOD_mapdict, \ LOOKUP_METHOD_mapdict_fill_cache_method diff --git a/pypy/objspace/std/celldict.py b/pypy/objspace/std/celldict.py index 62c545ba7dd2a0724a17b3ca7cfdaf9e408255bf..5f671b792e16bd10c285ab510b5e5fdbdc354767 100644 --- a/pypy/objspace/std/celldict.py +++ b/pypy/objspace/std/celldict.py @@ -7,7 +7,7 @@ from pypy.interpreter.baseobjspace import W_Root from pypy.objspace.std.dictmultiobject import create_iterator_classes from pypy.objspace.std.dictmultiobject import DictStrategy, _never_equal_to_string from pypy.objspace.std.dictmultiobject import ObjectDictStrategy -from pypy.rlib import jit, rerased +from rpython.rlib import jit, rerased class VersionTag(object): pass diff --git a/pypy/objspace/std/complexobject.py b/pypy/objspace/std/complexobject.py index 380651af0bfbf4ae82e3df7d7d6ee4287c99a68b..3e0e6cb5d4f736802f620b446c88f2a12c2ae940 100644 --- a/pypy/objspace/std/complexobject.py +++ b/pypy/objspace/std/complexobject.py @@ -5,11 +5,11 @@ from pypy.objspace.std.model import registerimplementation, W_Object from pypy.objspace.std.register_all import register_all from pypy.objspace.std.floatobject import W_FloatObject, _hash_float from pypy.objspace.std.longobject import W_LongObject -from pypy.rlib.rbigint import rbigint -from pypy.rlib.rfloat import ( +from rpython.rlib.rbigint import rbigint +from rpython.rlib.rfloat import ( formatd, DTSF_STR_PRECISION, isinf, isnan, copysign) -from pypy.rlib import jit, rcomplex -from pypy.rlib.rarithmetic import intmask +from rpython.rlib import jit, rcomplex +from rpython.rlib.rarithmetic import intmask import math @@ -18,7 +18,7 @@ class W_AbstractComplexObject(W_Object): __slots__ = () def is_w(self, space, w_other): - from pypy.rlib.longlong2float import float2longlong + from rpython.rlib.longlong2float import float2longlong if not isinstance(w_other, W_AbstractComplexObject): return False if self.user_overridden_class or w_other.user_overridden_class: @@ -36,7 +36,7 @@ class W_AbstractComplexObject(W_Object): def immutable_unique_id(self, space): if self.user_overridden_class: return None - from pypy.rlib.longlong2float import float2longlong + from rpython.rlib.longlong2float import float2longlong from pypy.objspace.std.model import IDTAG_COMPLEX as tag real = space.float_w(space.getattr(self, space.wrap("real"))) imag = space.float_w(space.getattr(self, space.wrap("imag"))) diff --git a/pypy/objspace/std/dictmultiobject.py b/pypy/objspace/std/dictmultiobject.py index 4a07cc5c3acf44c0e5fc6c4e4f599790f542db1f..1c635c79b5029de5f53a267b570dbaf2840b00e9 100644 --- a/pypy/objspace/std/dictmultiobject.py +++ b/pypy/objspace/std/dictmultiobject.py @@ -7,13 +7,13 @@ from pypy.interpreter import gateway from pypy.interpreter.argument import Signature from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rlib.objectmodel import r_dict, we_are_translated, specialize,\ +from rpython.rlib.objectmodel import r_dict, we_are_translated, specialize,\ newlist_hint -from pypy.rlib.debug import mark_dict_non_null -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.debug import mark_dict_non_null +from rpython.tool.sourcetools import func_with_new_name -from pypy.rlib import rerased -from pypy.rlib import jit +from rpython.rlib import rerased +from rpython.rlib import jit def _is_str(space, w_key): return space.is_w(space.type(w_key), space.w_str) diff --git a/pypy/objspace/std/dictproxyobject.py b/pypy/objspace/std/dictproxyobject.py index 957176fbb00102d5d8393c0947210ef0c8f3f13e..f6ce242d599a2bdafe6c56408d6a0a072fcca066 100644 --- a/pypy/objspace/std/dictproxyobject.py +++ b/pypy/objspace/std/dictproxyobject.py @@ -5,7 +5,7 @@ from pypy.objspace.std.dictmultiobject import DictStrategy from pypy.objspace.std.typeobject import unwrap_cell from pypy.interpreter.error import OperationError, operationerrfmt -from pypy.rlib import rerased +from rpython.rlib import rerased class DictProxyStrategy(DictStrategy): diff --git a/pypy/objspace/std/floatobject.py b/pypy/objspace/std/floatobject.py index 00d7b133ca29b2a0aede47e4f6822736eb84f111..1a683a3c745903dd3f3a4a2abb008c570e83432a 100644 --- a/pypy/objspace/std/floatobject.py +++ b/pypy/objspace/std/floatobject.py @@ -7,13 +7,13 @@ from pypy.objspace.std.model import registerimplementation, W_Object from pypy.objspace.std.register_all import register_all from pypy.objspace.std.noneobject import W_NoneObject from pypy.objspace.std.longobject import W_LongObject -from pypy.rlib.rarithmetic import ovfcheck_float_to_int, intmask, LONG_BIT -from pypy.rlib.rfloat import ( +from rpython.rlib.rarithmetic import ovfcheck_float_to_int, intmask, LONG_BIT +from rpython.rlib.rfloat import ( isinf, isnan, isfinite, INFINITY, NAN, copysign, formatd, DTSF_ADD_DOT_0, DTSF_STR_PRECISION) -from pypy.rlib.rbigint import rbigint -from pypy.rlib import rfloat -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.rbigint import rbigint +from rpython.rlib import rfloat +from rpython.tool.sourcetools import func_with_new_name import math @@ -23,7 +23,7 @@ class W_AbstractFloatObject(W_Object): __slots__ = () def is_w(self, space, w_other): - from pypy.rlib.longlong2float import float2longlong + from rpython.rlib.longlong2float import float2longlong if not isinstance(w_other, W_AbstractFloatObject): return False if self.user_overridden_class or w_other.user_overridden_class: @@ -35,7 +35,7 @@ class W_AbstractFloatObject(W_Object): def immutable_unique_id(self, space): if self.user_overridden_class: return None - from pypy.rlib.longlong2float import float2longlong + from rpython.rlib.longlong2float import float2longlong from pypy.objspace.std.model import IDTAG_FLOAT as tag val = float2longlong(space.float_w(self)) b = rbigint.fromrarith_int(val) diff --git a/pypy/objspace/std/floattype.py b/pypy/objspace/std/floattype.py index 55df7824d722abf4382799977c84d84c44dcfaaa..e37346bc5c871102bfa9683d4233ff68a921cae1 100644 --- a/pypy/objspace/std/floattype.py +++ b/pypy/objspace/std/floattype.py @@ -1,7 +1,7 @@ import math import sys -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib import rfloat, rarithmetic +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib import rfloat, rarithmetic from pypy.interpreter import typedef from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter.baseobjspace import ObjSpace, W_Root @@ -59,7 +59,7 @@ def descr__new__(space, w_floattype, w_x): def detect_floatformat(): - from pypy.rpython.lltypesystem import rffi, lltype + from rpython.rtyper.lltypesystem import rffi, lltype buf = lltype.malloc(rffi.CCHARP.TO, 8, flavor='raw') rffi.cast(rffi.DOUBLEP, buf)[0] = 9006104071832581.0 packed = rffi.charpsize2str(buf, 8) diff --git a/pypy/objspace/std/formatting.py b/pypy/objspace/std/formatting.py index 26ce3af2bdcaa8d8c9fb4d0fb0a33ce89a9bdbf1..8ba19560ce670fc4d5ee74b77cdd633512bc8e43 100644 --- a/pypy/objspace/std/formatting.py +++ b/pypy/objspace/std/formatting.py @@ -3,12 +3,12 @@ String formatting routines. """ from pypy.interpreter.error import OperationError from pypy.objspace.std.unicodetype import unicode_from_object -from pypy.rlib import jit -from pypy.rlib.rarithmetic import ovfcheck -from pypy.rlib.rfloat import formatd, DTSF_ALT, isnan, isinf -from pypy.rlib.rstring import StringBuilder, UnicodeBuilder -from pypy.rlib.unroll import unrolling_iterable -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib import jit +from rpython.rlib.rarithmetic import ovfcheck +from rpython.rlib.rfloat import formatd, DTSF_ALT, isnan, isinf +from rpython.rlib.rstring import StringBuilder, UnicodeBuilder +from rpython.rlib.unroll import unrolling_iterable +from rpython.tool.sourcetools import func_with_new_name class BaseStringFormatter(object): diff --git a/pypy/objspace/std/frame.py b/pypy/objspace/std/frame.py index 16844c7fd38884ff9b2790d626be10db9d8f374e..4cc80775b25778a57b74ac98f8a20265acb3cb03 100644 --- a/pypy/objspace/std/frame.py +++ b/pypy/objspace/std/frame.py @@ -2,7 +2,7 @@ import operator -from pypy.rlib.unroll import unrolling_iterable +from rpython.rlib.unroll import unrolling_iterable from pypy.interpreter import pyopcode from pypy.interpreter.pyframe import PyFrame from pypy.interpreter.error import OperationError diff --git a/pypy/objspace/std/identitydict.py b/pypy/objspace/std/identitydict.py index 1a9cf63a1486d1adacddf87c106930e44d1a0ec4..7a53a76c1b7a7070a04a4ca9131926da38176c8a 100644 --- a/pypy/objspace/std/identitydict.py +++ b/pypy/objspace/std/identitydict.py @@ -1,8 +1,8 @@ ## ---------------------------------------------------------------------------- ## dict strategy (see dictmultiobject.py) -from pypy.rlib import rerased -from pypy.rlib.debug import mark_dict_non_null +from rpython.rlib import rerased +from rpython.rlib.debug import mark_dict_non_null from pypy.objspace.std.dictmultiobject import (AbstractTypedStrategy, DictStrategy, create_iterator_classes) diff --git a/pypy/objspace/std/intobject.py b/pypy/objspace/std/intobject.py index ef05c73e15dc33b28de118201d1652ba615c36bb..fc7c584a1911f6b50e15f67fcc53b545384a3011 100644 --- a/pypy/objspace/std/intobject.py +++ b/pypy/objspace/std/intobject.py @@ -5,9 +5,9 @@ from pypy.objspace.std.model import registerimplementation, W_Object from pypy.objspace.std.multimethod import FailedToImplementArgs from pypy.objspace.std.noneobject import W_NoneObject from pypy.objspace.std.register_all import register_all -from pypy.rlib import jit -from pypy.rlib.rarithmetic import ovfcheck, LONG_BIT, r_uint, is_valid_int -from pypy.rlib.rbigint import rbigint +from rpython.rlib import jit +from rpython.rlib.rarithmetic import ovfcheck, LONG_BIT, r_uint, is_valid_int +from rpython.rlib.rbigint import rbigint """ In order to have the same behavior running @@ -84,7 +84,7 @@ def format__Int_ANY(space, w_int, w_format_spec): def declare_new_int_comparison(opname): import operator - from pypy.tool.sourcetools import func_with_new_name + from rpython.tool.sourcetools import func_with_new_name op = getattr(operator, opname) def f(space, w_int1, w_int2): i = w_int1.intval diff --git a/pypy/objspace/std/inttype.py b/pypy/objspace/std/inttype.py index 48e86bf4d86bfc51f474bc8f30c00d768a66451d..488101a547ffaf8dd8898bb736893b3d9576021f 100644 --- a/pypy/objspace/std/inttype.py +++ b/pypy/objspace/std/inttype.py @@ -7,8 +7,8 @@ from pypy.objspace.std.stdtypedef import StdTypeDef, SMM from pypy.objspace.std.strutil import (string_to_int, string_to_bigint, ParseStringError, ParseStringOverflowError) -from pypy.rlib.rarithmetic import r_uint -from pypy.rlib.objectmodel import instantiate +from rpython.rlib.rarithmetic import r_uint +from rpython.rlib.objectmodel import instantiate # ____________________________________________________________ diff --git a/pypy/objspace/std/kwargsdict.py b/pypy/objspace/std/kwargsdict.py index c5a3bba140aa6174b3c2afce0d34a8b4270f439f..18eca8f4a3d84302e87ff85e838283157b32c23a 100644 --- a/pypy/objspace/std/kwargsdict.py +++ b/pypy/objspace/std/kwargsdict.py @@ -1,7 +1,7 @@ ## ---------------------------------------------------------------------------- ## dict strategy (see dictmultiobject.py) -from pypy.rlib import rerased, jit +from rpython.rlib import rerased, jit from pypy.objspace.std.dictmultiobject import (DictStrategy, create_iterator_classes, EmptyDictStrategy, diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py index 58f4fe60d56f45cf4e0f1101bde5d1a48e5ec6fd..09e65a78cdc08f37799e592c8d3cf31e3e0d3947 100644 --- a/pypy/objspace/std/listobject.py +++ b/pypy/objspace/std/listobject.py @@ -8,12 +8,12 @@ from pypy.objspace.std.listtype import get_list_index from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice from pypy.objspace.std import slicetype from pypy.interpreter import gateway, baseobjspace -from pypy.rlib.objectmodel import (instantiate, newlist_hint, specialize, +from rpython.rlib.objectmodel import (instantiate, newlist_hint, specialize, resizelist_hint) -from pypy.rlib.listsort import make_timsort_class -from pypy.rlib import rerased, jit, debug +from rpython.rlib.listsort import make_timsort_class +from rpython.rlib import rerased, jit, debug from pypy.interpreter.argument import Signature -from pypy.tool.sourcetools import func_with_new_name +from rpython.tool.sourcetools import func_with_new_name UNROLL_CUTOFF = 5 diff --git a/pypy/objspace/std/longobject.py b/pypy/objspace/std/longobject.py index f294b024f77dcd0ce9453df7323c0c38aad337eb..a921fdcb7d0530bd05a998e4860845bf9082cf7f 100644 --- a/pypy/objspace/std/longobject.py +++ b/pypy/objspace/std/longobject.py @@ -6,7 +6,7 @@ from pypy.objspace.std.register_all import register_all from pypy.objspace.std.multimethod import FailedToImplementArgs from pypy.objspace.std.intobject import W_IntObject from pypy.objspace.std.noneobject import W_NoneObject -from pypy.rlib.rbigint import rbigint, SHIFT +from rpython.rlib.rbigint import rbigint, SHIFT class W_AbstractLongObject(W_Object): __slots__ = () diff --git a/pypy/objspace/std/longtype.py b/pypy/objspace/std/longtype.py index f8f0b658dd7d03a58cd295269482c9b8f0763ad3..e8cec42cb6035574b515a715d815206ba100030a 100644 --- a/pypy/objspace/std/longtype.py +++ b/pypy/objspace/std/longtype.py @@ -12,7 +12,7 @@ def descr_conjugate(space, w_int): @unwrap_spec(w_x = WrappedDefault(0)) def descr__new__(space, w_longtype, w_x, w_base=None): from pypy.objspace.std.longobject import W_LongObject - from pypy.rlib.rbigint import rbigint + from rpython.rlib.rbigint import rbigint if space.config.objspace.std.withsmalllong: from pypy.objspace.std.smalllongobject import W_SmallLongObject else: diff --git a/pypy/objspace/std/mapdict.py b/pypy/objspace/std/mapdict.py index e1bbc29b2e3aa416560e9e353e9c4ced34e386b9..e66871d3d7153a9eab6102e54d9a644c9040b0ea 100644 --- a/pypy/objspace/std/mapdict.py +++ b/pypy/objspace/std/mapdict.py @@ -1,7 +1,7 @@ import weakref -from pypy.rlib import jit, objectmodel, debug -from pypy.rlib.rarithmetic import intmask, r_uint -from pypy.rlib import rerased +from rpython.rlib import jit, objectmodel, debug +from rpython.rlib.rarithmetic import intmask, r_uint +from rpython.rlib import rerased from pypy.interpreter.baseobjspace import W_Root from pypy.objspace.std.dictmultiobject import W_DictMultiObject, DictStrategy, ObjectDictStrategy @@ -456,7 +456,7 @@ class BaseMapdictObject: class ObjectMixin(object): _mixin_ = True def _init_empty(self, map): - from pypy.rlib.debug import make_sure_not_resized + from rpython.rlib.debug import make_sure_not_resized self.map = map self.storage = make_sure_not_resized([None] * map.size_estimate()) @@ -513,13 +513,13 @@ erase_item, unerase_item = rerased.new_erasing_pair("mapdict storage item") erase_list, unerase_list = rerased.new_erasing_pair("mapdict storage list") def _make_subclass_size_n(supercls, n): - from pypy.rlib import unroll + from rpython.rlib import unroll rangen = unroll.unrolling_iterable(range(n)) nmin1 = n - 1 rangenmin1 = unroll.unrolling_iterable(range(nmin1)) class subcls(BaseMapdictObject, supercls): def _init_empty(self, map): - from pypy.rlib.debug import make_sure_not_resized + from rpython.rlib.debug import make_sure_not_resized for i in rangen: setattr(self, "_value%s" % i, erase_item(None)) self.map = map diff --git a/pypy/objspace/std/marshal_impl.py b/pypy/objspace/std/marshal_impl.py index eba7eb5db21dcdc22e032cd2a357c46ff0f46f2b..e643ec535e126a8e4e4c9efbda0a9b35d9d495e5 100644 --- a/pypy/objspace/std/marshal_impl.py +++ b/pypy/objspace/std/marshal_impl.py @@ -10,13 +10,13 @@ a callback and a state variable. from pypy.interpreter.error import OperationError from pypy.objspace.std.register_all import register_all -from pypy.rlib.rarithmetic import LONG_BIT, r_longlong, r_uint, intmask +from rpython.rlib.rarithmetic import LONG_BIT, r_longlong, r_uint, intmask from pypy.objspace.std import model from pypy.interpreter.special import Ellipsis from pypy.interpreter.pycode import PyCode from pypy.interpreter import gateway, unicodehelper -from pypy.rlib.rstruct import ieee -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.rstruct import ieee +from rpython.rlib.rstring import StringBuilder from pypy.objspace.std.boolobject import W_BoolObject from pypy.objspace.std.complexobject import W_ComplexObject @@ -206,7 +206,7 @@ def unmarshal_Complex_bin(space, u, tc): register(TYPE_BINARY_COMPLEX, unmarshal_Complex_bin) def marshal_w__Long(space, w_long, m): - from pypy.rlib.rbigint import rbigint + from rpython.rlib.rbigint import rbigint m.start(TYPE_LONG) SHIFT = 15 MASK = (1 << SHIFT) - 1 @@ -223,7 +223,7 @@ def marshal_w__Long(space, w_long, m): m.put_short(i) def unmarshal_Long(space, u, tc): - from pypy.rlib.rbigint import rbigint + from rpython.rlib.rbigint import rbigint lng = u.get_int() if lng < 0: negative = True diff --git a/pypy/objspace/std/multimethod.py b/pypy/objspace/std/multimethod.py index 88daa5561ab6e0796d6df90fb70abebbc7dd2935..54035d824bc1ec192f45794cd279aed49f9a328b 100644 --- a/pypy/objspace/std/multimethod.py +++ b/pypy/objspace/std/multimethod.py @@ -1,5 +1,5 @@ -from pypy.tool.sourcetools import compile2 +from rpython.tool.sourcetools import compile2 # This provide two compatible implementations of "multimethods". A # multimethod is a callable object which chooses and calls a real diff --git a/pypy/objspace/std/newformat.py b/pypy/objspace/std/newformat.py index 57295c6cf8667e8dd20fbeb3019e2b0c61db4b46..0059ee055b0d2a0baf4d58daf151419664a080d8 100644 --- a/pypy/objspace/std/newformat.py +++ b/pypy/objspace/std/newformat.py @@ -3,10 +3,10 @@ import string from pypy.interpreter.error import OperationError -from pypy.rlib import rstring, runicode, rlocale, rarithmetic, rfloat, jit -from pypy.rlib.objectmodel import specialize -from pypy.rlib.rfloat import copysign, formatd -from pypy.tool import sourcetools +from rpython.rlib import rstring, runicode, rlocale, rarithmetic, rfloat, jit +from rpython.rlib.objectmodel import specialize +from rpython.rlib.rfloat import copysign, formatd +from rpython.tool import sourcetools @specialize.argtype(1) diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py index a6abcecc024770c861af867d3c85ce64bf7b8e19..504f11da5c5cb1e5209c10659448f170f7189c64 100644 --- a/pypy/objspace/std/objspace.py +++ b/pypy/objspace/std/objspace.py @@ -7,11 +7,11 @@ from pypy.interpreter.typedef import get_unique_interplevel_subclass from pypy.objspace.std import (builtinshortcut, stdtypedef, frame, model, transparent, callmethod, proxyobject) from pypy.objspace.descroperation import DescrOperation, raiseattrerror -from pypy.rlib.objectmodel import instantiate, r_dict, specialize, is_annotation_constant -from pypy.rlib.debug import make_sure_not_resized -from pypy.rlib.rarithmetic import base_int, widen, maxint, is_valid_int -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib import jit +from rpython.rlib.objectmodel import instantiate, r_dict, specialize, is_annotation_constant +from rpython.rlib.debug import make_sure_not_resized +from rpython.rlib.rarithmetic import base_int, widen, maxint, is_valid_int +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib import jit # Object imports from pypy.objspace.std.boolobject import W_BoolObject @@ -169,8 +169,8 @@ class StdObjSpace(ObjSpace, DescrOperation): if isinstance(x, base_int): if self.config.objspace.std.withsmalllong: from pypy.objspace.std.smalllongobject import W_SmallLongObject - from pypy.rlib.rarithmetic import r_longlong, r_ulonglong - from pypy.rlib.rarithmetic import longlongmax + from rpython.rlib.rarithmetic import r_longlong, r_ulonglong + from rpython.rlib.rarithmetic import longlongmax if (not isinstance(x, r_ulonglong) or x <= r_ulonglong(longlongmax)): return W_SmallLongObject(r_longlong(x)) @@ -243,7 +243,7 @@ class StdObjSpace(ObjSpace, DescrOperation): def wraplong(self, x): "NOT_RPYTHON" if self.config.objspace.std.withsmalllong: - from pypy.rlib.rarithmetic import r_longlong + from rpython.rlib.rarithmetic import r_longlong try: rx = r_longlong(x) except OverflowError: diff --git a/pypy/objspace/std/proxy_helpers.py b/pypy/objspace/std/proxy_helpers.py index 8931d75f3f73e20673c94bc9cf5f100c71348858..d20df98554ec5fe1298562a8f395d6645f4159a7 100644 --- a/pypy/objspace/std/proxy_helpers.py +++ b/pypy/objspace/std/proxy_helpers.py @@ -6,7 +6,7 @@ of cyclic imports from pypy.objspace.std.model import W_ANY, W_Object from pypy.interpreter import baseobjspace from pypy.interpreter.argument import Arguments -from pypy.tool.sourcetools import func_with_new_name +from rpython.tool.sourcetools import func_with_new_name def create_mm_names(classname, mm, is_local): s = "" diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py index 35ddcbefb1e5de41417acbc81f3f03f8248cc224..960367670f9a8b94149600f69715aa1c48419098 100644 --- a/pypy/objspace/std/setobject.py +++ b/pypy/objspace/std/setobject.py @@ -1,14 +1,14 @@ from pypy.objspace.std.model import registerimplementation, W_Object from pypy.objspace.std.register_all import register_all -from pypy.rlib.objectmodel import r_dict -from pypy.rlib.rarithmetic import intmask, r_uint +from rpython.rlib.objectmodel import r_dict +from rpython.rlib.rarithmetic import intmask, r_uint from pypy.interpreter.error import OperationError from pypy.interpreter import gateway from pypy.interpreter.argument import Signature from pypy.objspace.std.settype import set_typedef as settypedef from pypy.objspace.std.frozensettype import frozenset_typedef as frozensettypedef -from pypy.rlib import rerased -from pypy.rlib.objectmodel import instantiate +from rpython.rlib import rerased +from rpython.rlib.objectmodel import instantiate from pypy.interpreter.generator import GeneratorIterator from pypy.objspace.std.listobject import W_ListObject from pypy.objspace.std.intobject import W_IntObject diff --git a/pypy/objspace/std/slicetype.py b/pypy/objspace/std/slicetype.py index 20e6912c85aba5139c44c4f98ad536a60f01f755..d1947b2a7c94aeb648465478c461542ddc520874 100644 --- a/pypy/objspace/std/slicetype.py +++ b/pypy/objspace/std/slicetype.py @@ -3,7 +3,7 @@ from pypy.interpreter.typedef import GetSetProperty from pypy.objspace.std.stdtypedef import StdTypeDef, SMM from pypy.objspace.std.register_all import register_all from pypy.interpreter.error import OperationError -from pypy.rlib.objectmodel import specialize +from rpython.rlib.objectmodel import specialize # indices multimehtod slice_indices = SMM('indices', 2, diff --git a/pypy/objspace/std/smallintobject.py b/pypy/objspace/std/smallintobject.py index 22b285371077789305e3c5147ce0f7d958182412..6d11b0bd78d624f637947d22eefe71fed03119f5 100644 --- a/pypy/objspace/std/smallintobject.py +++ b/pypy/objspace/std/smallintobject.py @@ -8,10 +8,10 @@ from pypy.objspace.std.register_all import register_all from pypy.objspace.std.noneobject import W_NoneObject from pypy.objspace.std.intobject import W_AbstractIntObject, W_IntObject from pypy.interpreter.error import OperationError -from pypy.rlib.objectmodel import UnboxedValue -from pypy.rlib.rbigint import rbigint -from pypy.rlib.rarithmetic import r_uint -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.objectmodel import UnboxedValue +from rpython.rlib.rbigint import rbigint +from rpython.rlib.rarithmetic import r_uint +from rpython.tool.sourcetools import func_with_new_name from pypy.objspace.std.inttype import wrapint class W_SmallIntObject(W_AbstractIntObject, UnboxedValue): diff --git a/pypy/objspace/std/smalllongobject.py b/pypy/objspace/std/smalllongobject.py index 04bce624250e0ab0328d1f4638a6b943598d9222..0098a31f7c24c793c1020b6970058b77876863a5 100644 --- a/pypy/objspace/std/smalllongobject.py +++ b/pypy/objspace/std/smalllongobject.py @@ -6,9 +6,9 @@ fits in an 'int'. from pypy.objspace.std.model import registerimplementation, W_Object from pypy.objspace.std.register_all import register_all from pypy.objspace.std.multimethod import FailedToImplementArgs -from pypy.rlib.rarithmetic import r_longlong, r_int, r_uint -from pypy.rlib.rarithmetic import intmask, LONGLONG_BIT -from pypy.rlib.rbigint import rbigint +from rpython.rlib.rarithmetic import r_longlong, r_int, r_uint +from rpython.rlib.rarithmetic import intmask, LONGLONG_BIT +from rpython.rlib.rbigint import rbigint from pypy.objspace.std.longobject import W_AbstractLongObject, W_LongObject from pypy.objspace.std.intobject import W_IntObject from pypy.objspace.std.noneobject import W_NoneObject diff --git a/pypy/objspace/std/smalltupleobject.py b/pypy/objspace/std/smalltupleobject.py index 51fda6e51bbdce7e55b4820f913d020a079e732e..150e4c4442b2c2c54328d4142506746e3017aa46 100644 --- a/pypy/objspace/std/smalltupleobject.py +++ b/pypy/objspace/std/smalltupleobject.py @@ -3,13 +3,13 @@ from pypy.objspace.std.model import registerimplementation, W_Object from pypy.objspace.std.register_all import register_all from pypy.objspace.std.inttype import wrapint from pypy.objspace.std.multimethod import FailedToImplement -from pypy.rlib.rarithmetic import intmask +from rpython.rlib.rarithmetic import intmask from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice from pypy.objspace.std import slicetype from pypy.interpreter import gateway -from pypy.rlib.debug import make_sure_not_resized -from pypy.rlib.unroll import unrolling_iterable -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.debug import make_sure_not_resized +from rpython.rlib.unroll import unrolling_iterable +from rpython.tool.sourcetools import func_with_new_name from pypy.objspace.std.tupleobject import W_AbstractTupleObject, W_TupleObject class W_SmallTupleObject(W_AbstractTupleObject): diff --git a/pypy/objspace/std/specialisedtupleobject.py b/pypy/objspace/std/specialisedtupleobject.py index 64ba3d89fd43b172a431e46681ae98b9689033ef..461d40d3e60677e976ff576ac89bc8a95fe657c9 100644 --- a/pypy/objspace/std/specialisedtupleobject.py +++ b/pypy/objspace/std/specialisedtupleobject.py @@ -5,10 +5,10 @@ from pypy.objspace.std.multimethod import FailedToImplement from pypy.objspace.std.tupleobject import W_AbstractTupleObject from pypy.objspace.std.tupleobject import W_TupleObject from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice -from pypy.rlib.rarithmetic import intmask -from pypy.rlib.objectmodel import compute_hash -from pypy.rlib.unroll import unrolling_iterable -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.rarithmetic import intmask +from rpython.rlib.objectmodel import compute_hash +from rpython.rlib.unroll import unrolling_iterable +from rpython.tool.sourcetools import func_with_new_name class NotSpecialised(Exception): pass diff --git a/pypy/objspace/std/stdtypedef.py b/pypy/objspace/std/stdtypedef.py index e2dd8e2a13be075697f20a8b24aff157c4cbbefa..11a1e0267d9c142e974773a97ef7753db6303db4 100644 --- a/pypy/objspace/std/stdtypedef.py +++ b/pypy/objspace/std/stdtypedef.py @@ -7,8 +7,8 @@ from pypy.interpreter.baseobjspace import SpaceCache from pypy.objspace.std import model from pypy.objspace.std.model import StdObjSpaceMultiMethod from pypy.objspace.std.multimethod import FailedToImplement -from pypy.rlib import jit -from pypy.tool.sourcetools import compile2 +from rpython.rlib import jit +from rpython.tool.sourcetools import compile2 __all__ = ['StdTypeDef', 'SMM'] diff --git a/pypy/objspace/std/strbufobject.py b/pypy/objspace/std/strbufobject.py index 1e23c46bed2c06874681834c54e0909dbc3d7302..a40fd0adf306e7bc80e08ca3e020a724f3609fe0 100644 --- a/pypy/objspace/std/strbufobject.py +++ b/pypy/objspace/std/strbufobject.py @@ -3,7 +3,7 @@ from pypy.objspace.std.register_all import register_all from pypy.objspace.std.stringobject import W_AbstractStringObject from pypy.objspace.std.stringobject import W_StringObject from pypy.objspace.std.unicodeobject import delegate_String2Unicode -from pypy.rlib.rstring import StringBuilder +from rpython.rlib.rstring import StringBuilder from pypy.interpreter.buffer import Buffer class W_StringBufferObject(W_AbstractStringObject): diff --git a/pypy/objspace/std/stringobject.py b/pypy/objspace/std/stringobject.py index cf046fc04ab1cbbfb9927ef36637ffb6d3fa64d6..8467c9cf53882f62cec5bf5f2c4864f2cd13e322 100644 --- a/pypy/objspace/std/stringobject.py +++ b/pypy/objspace/std/stringobject.py @@ -3,18 +3,18 @@ from pypy.objspace.std.register_all import register_all from pypy.objspace.std.multimethod import FailedToImplement from pypy.interpreter.error import OperationError, operationerrfmt from pypy.interpreter import gateway -from pypy.rlib.rarithmetic import ovfcheck -from pypy.rlib.objectmodel import we_are_translated, compute_hash, specialize -from pypy.rlib.objectmodel import compute_unique_id +from rpython.rlib.rarithmetic import ovfcheck +from rpython.rlib.objectmodel import we_are_translated, compute_hash, specialize +from rpython.rlib.objectmodel import compute_unique_id from pypy.objspace.std.inttype import wrapint from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice from pypy.objspace.std import slicetype, newformat from pypy.objspace.std.listobject import W_ListObject from pypy.objspace.std.noneobject import W_NoneObject from pypy.objspace.std.tupleobject import W_TupleObject -from pypy.rlib.rstring import StringBuilder, split +from rpython.rlib.rstring import StringBuilder, split from pypy.interpreter.buffer import StringBuffer -from pypy.rlib import jit +from rpython.rlib import jit from pypy.objspace.std.stringtype import sliced, wrapstr, wrapchar, \ stringendswith, stringstartswith, joined2 @@ -349,7 +349,7 @@ def str_rsplit__String_None_ANY(space, w_self, w_none, w_maxsplit=-1): return space.newlist(res_w) def make_rsplit_with_delim(funcname, sliced): - from pypy.tool.sourcetools import func_with_new_name + from rpython.tool.sourcetools import func_with_new_name def fn(space, w_self, w_by, w_maxsplit=-1): maxsplit = space.int_w(w_maxsplit) diff --git a/pypy/objspace/std/stringtype.py b/pypy/objspace/std/stringtype.py index 7dad2c575657d6c4e439aad367a10e17f73b6a24..bbaaae439e5c676a4978ed803b32a11e5a983cd1 100644 --- a/pypy/objspace/std/stringtype.py +++ b/pypy/objspace/std/stringtype.py @@ -5,8 +5,8 @@ from pypy.objspace.std.register_all import register_all from sys import maxint -from pypy.rlib.objectmodel import specialize -from pypy.rlib.jit import we_are_jitted +from rpython.rlib.objectmodel import specialize +from rpython.rlib.jit import we_are_jitted def wrapstr(space, s): from pypy.objspace.std.stringobject import W_StringObject diff --git a/pypy/objspace/std/strutil.py b/pypy/objspace/std/strutil.py index 836482d247fe619143aa51fa066e69a1f6dff42e..c7581531e6e4775e87b7f06a71934e3767a73e09 100644 --- a/pypy/objspace/std/strutil.py +++ b/pypy/objspace/std/strutil.py @@ -2,9 +2,9 @@ Pure Python implementation of string utilities. """ -from pypy.rlib.rarithmetic import ovfcheck -from pypy.rlib.rfloat import rstring_to_float, INFINITY, NAN -from pypy.rlib.rbigint import rbigint, parse_digit_string +from rpython.rlib.rarithmetic import ovfcheck +from rpython.rlib.rfloat import rstring_to_float, INFINITY, NAN +from rpython.rlib.rbigint import rbigint, parse_digit_string from pypy.interpreter.error import OperationError import math diff --git a/pypy/objspace/std/test/test_intobject.py b/pypy/objspace/std/test/test_intobject.py index ef717fe7cd0cbf919bf135f75c07f3876b89235a..0188942ae8e501f5385a2b8a0f73e5367a13c2ea 100644 --- a/pypy/objspace/std/test/test_intobject.py +++ b/pypy/objspace/std/test/test_intobject.py @@ -2,8 +2,8 @@ import py import sys from pypy.objspace.std import intobject as iobj from pypy.objspace.std.multimethod import FailedToImplement -from pypy.rlib.rarithmetic import r_uint, is_valid_int -from pypy.rlib.rbigint import rbigint +from rpython.rlib.rarithmetic import r_uint, is_valid_int +from rpython.rlib.rbigint import rbigint class TestW_IntObject: diff --git a/pypy/objspace/std/test/test_listobject.py b/pypy/objspace/std/test/test_listobject.py index 543b150cb1d5d810866b44bac3e16c5569befa43..ceac67309582b091249ff3d215ecb196bbf44593 100644 --- a/pypy/objspace/std/test/test_listobject.py +++ b/pypy/objspace/std/test/test_listobject.py @@ -3,7 +3,7 @@ import random from pypy.objspace.std.listobject import W_ListObject, SizeListStrategy,\ IntegerListStrategy, ObjectListStrategy from pypy.interpreter.error import OperationError -from pypy.rlib.rarithmetic import is_valid_int +from rpython.rlib.rarithmetic import is_valid_int class TestW_ListObject(object): diff --git a/pypy/objspace/std/test/test_longobject.py b/pypy/objspace/std/test/test_longobject.py index 529c6190743fc7805166162e89368723fc33d480..8ca12223b93537768a119c0390dede363509b9c6 100644 --- a/pypy/objspace/std/test/test_longobject.py +++ b/pypy/objspace/std/test/test_longobject.py @@ -1,6 +1,6 @@ import py from pypy.objspace.std import longobject as lobj -from pypy.rlib.rbigint import rbigint +from rpython.rlib.rbigint import rbigint class TestW_LongObject: @@ -17,7 +17,7 @@ class TestW_LongObject: def test_rint_variants(self): py.test.skip("XXX broken!") - from pypy.rpython.tool.rfficache import platform + from rpython.rtyper.tool.rfficache import platform space = self.space for r in platform.numbertype_to_rclass.values(): if r is int: diff --git a/pypy/objspace/std/test/test_smallintobject.py b/pypy/objspace/std/test/test_smallintobject.py index b24b65cc015a2adb0b8771df3d5aae1c4b75542d..74bb060ae47caa852af335372a68eff66b2a6760 100644 --- a/pypy/objspace/std/test/test_smallintobject.py +++ b/pypy/objspace/std/test/test_smallintobject.py @@ -6,7 +6,7 @@ import sys, py from pypy.objspace.std.inttype import wrapint from pypy.objspace.std.multimethod import FailedToImplement -from pypy.rlib.rarithmetic import r_uint +from rpython.rlib.rarithmetic import r_uint from pypy.objspace.std.test.test_intobject import AppTestInt diff --git a/pypy/objspace/std/test/test_smalllongobject.py b/pypy/objspace/std/test/test_smalllongobject.py index 77d875b9fb183f103b6397b35f58e9befe13d35c..714f53b14781ef05ef27ce16b45c49cfdba09a6e 100644 --- a/pypy/objspace/std/test/test_smalllongobject.py +++ b/pypy/objspace/std/test/test_smalllongobject.py @@ -3,7 +3,7 @@ import sys from pypy.objspace.std.smalllongobject import W_SmallLongObject from pypy.objspace.std.test import test_longobject from pypy.tool.pytest.objspace import gettestobjspace -from pypy.rlib.rarithmetic import r_longlong +from rpython.rlib.rarithmetic import r_longlong from pypy.interpreter.error import OperationError diff --git a/pypy/objspace/std/test/test_stdobjspace.py b/pypy/objspace/std/test/test_stdobjspace.py index 0d40b0dbcabb05019ddd800838d0b7c37d031b50..4912b382917e1113e75118dcb916172909b2a6cb 100644 --- a/pypy/objspace/std/test/test_stdobjspace.py +++ b/pypy/objspace/std/test/test_stdobjspace.py @@ -77,7 +77,7 @@ class TestW_StdObjSpace: def test_wrap_various_unsigned_types(self): import sys - from pypy.rpython.lltypesystem import lltype, rffi + from rpython.rtyper.lltypesystem import lltype, rffi space = self.space value = sys.maxint * 2 x = rffi.cast(lltype.Unsigned, value) diff --git a/pypy/objspace/std/transparent.py b/pypy/objspace/std/transparent.py index 77ee63ff5bcb408458e614c8825316baa3f27db7..030a345ca745aa681464dfccd58d0a5c7fc1bb7c 100644 --- a/pypy/objspace/std/transparent.py +++ b/pypy/objspace/std/transparent.py @@ -6,8 +6,8 @@ from pypy.interpreter import gateway from pypy.interpreter.error import OperationError, operationerrfmt from pypy.objspace.std.proxyobject import * from pypy.objspace.std.typeobject import W_TypeObject -from pypy.rlib.objectmodel import r_dict -from pypy.rlib.unroll import unrolling_iterable +from rpython.rlib.objectmodel import r_dict +from rpython.rlib.unroll import unrolling_iterable class TypeCache(object): def __init__(self): diff --git a/pypy/objspace/std/tupleobject.py b/pypy/objspace/std/tupleobject.py index 754eebdf4b1fa628ea4fd79b2821d3344bd1c21e..95973cb4bf95a99736fe11b95de13c1e4754e2c8 100644 --- a/pypy/objspace/std/tupleobject.py +++ b/pypy/objspace/std/tupleobject.py @@ -3,12 +3,12 @@ from pypy.objspace.std.model import registerimplementation, W_Object from pypy.objspace.std.register_all import register_all from pypy.objspace.std.inttype import wrapint from pypy.objspace.std.multimethod import FailedToImplement -from pypy.rlib.rarithmetic import intmask +from rpython.rlib.rarithmetic import intmask from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice from pypy.objspace.std import slicetype -from pypy.rlib.debug import make_sure_not_resized -from pypy.rlib import jit -from pypy.tool.sourcetools import func_with_new_name +from rpython.rlib.debug import make_sure_not_resized +from rpython.rlib import jit +from rpython.tool.sourcetools import func_with_new_name # Tuples of known length up to UNROLL_TUPLE_LIMIT have unrolled certain methods UNROLL_TUPLE_LIMIT = 10 diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py index 123d69554ab6568f1b862dbc31b22f6da683ab3d..84bb237a09a53c33472f677e2551bd72b3142867 100644 --- a/pypy/objspace/std/typeobject.py +++ b/pypy/objspace/std/typeobject.py @@ -8,12 +8,12 @@ from pypy.interpreter.baseobjspace import W_Root from pypy.objspace.std.stdtypedef import std_dict_descr, issubtypedef, Member from pypy.objspace.std.objecttype import object_typedef from pypy.objspace.std import identitydict -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.objectmodel import current_object_addr_as_int, compute_hash -from pypy.rlib.jit import promote, elidable_promote, we_are_jitted,\ +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.objectmodel import current_object_addr_as_int, compute_hash +from rpython.rlib.jit import promote, elidable_promote, we_are_jitted,\ promote_string -from pypy.rlib.jit import elidable, dont_look_inside, unroll_safe -from pypy.rlib.rarithmetic import intmask, r_uint +from rpython.rlib.jit import elidable, dont_look_inside, unroll_safe +from rpython.rlib.rarithmetic import intmask, r_uint class TypeCell(W_Root): def __init__(self, w_value=None): diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py index 1939817bce0598b029560d9ac616eeaf50d423da..61e0db346702cbb37dc00d23b61cfa9756cad4e9 100644 --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -8,14 +8,14 @@ from pypy.objspace.std.noneobject import W_NoneObject from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice from pypy.objspace.std import slicetype, newformat from pypy.objspace.std.tupleobject import W_TupleObject -from pypy.rlib.rarithmetic import intmask, ovfcheck -from pypy.rlib.objectmodel import compute_hash, specialize -from pypy.rlib.objectmodel import compute_unique_id -from pypy.rlib.rstring import UnicodeBuilder -from pypy.rlib.runicode import make_unicode_escape_function +from rpython.rlib.rarithmetic import intmask, ovfcheck +from rpython.rlib.objectmodel import compute_hash, specialize +from rpython.rlib.objectmodel import compute_unique_id +from rpython.rlib.rstring import UnicodeBuilder +from rpython.rlib.runicode import make_unicode_escape_function from pypy.module.unicodedata import unicodedb -from pypy.tool.sourcetools import func_with_new_name -from pypy.rlib import jit +from rpython.tool.sourcetools import func_with_new_name +from rpython.rlib import jit from pypy.objspace.std.formatting import mod_format from pypy.objspace.std.stringtype import stringstartswith, stringendswith diff --git a/pypy/objspace/std/unicodetype.py b/pypy/objspace/std/unicodetype.py index 25e4c847b71589811cbe94264531275c651a7733..48785c0c05b5e882d8fcb4a7a0331c5dd45bbaa2 100644 --- a/pypy/objspace/std/unicodetype.py +++ b/pypy/objspace/std/unicodetype.py @@ -4,7 +4,7 @@ from pypy.interpreter import unicodehelper from pypy.objspace.std.stdtypedef import StdTypeDef, SMM from pypy.objspace.std.register_all import register_all from pypy.objspace.std.basestringtype import basestring_typedef -from pypy.rlib.runicode import str_decode_utf_8, str_decode_ascii,\ +from rpython.rlib.runicode import str_decode_utf_8, str_decode_ascii,\ unicode_encode_utf_8, unicode_encode_ascii from sys import maxint diff --git a/pypy/rlib/parsing/test/autopath.py b/pypy/rlib/parsing/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/rlib/parsing/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/rlib/test/autopath.py b/pypy/rlib/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/rlib/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/rpython/lltypesystem/module/ll_os_path.py b/pypy/rpython/lltypesystem/module/ll_os_path.py deleted file mode 100644 index a1172b4e24ed6fae96099a89bde31ad24c87b7d1..0000000000000000000000000000000000000000 --- a/pypy/rpython/lltypesystem/module/ll_os_path.py +++ /dev/null @@ -1,7 +0,0 @@ -from pypy.rpython.module.support import LLSupport -from pypy.rpython.module.ll_os_path import BaseOsPath - -class Implementation(BaseOsPath, LLSupport): - pass - - diff --git a/pypy/rpython/ootypesystem/module/ll_os.py b/pypy/rpython/ootypesystem/module/ll_os.py deleted file mode 100644 index fd5de737abeec7909074800a939f29dbe11016a4..0000000000000000000000000000000000000000 --- a/pypy/rpython/ootypesystem/module/ll_os.py +++ /dev/null @@ -1,7 +0,0 @@ -# mostly-deprecated module - -from pypy.rpython.ootypesystem import ootype -from pypy.rpython.ootypesystem.rtupletype import TUPLE_TYPE -from pypy.rpython.module.ll_os_stat import PORTABLE_STAT_FIELDS - -STAT_RESULT = TUPLE_TYPE([_TYPE for _name, _TYPE in PORTABLE_STAT_FIELDS]) diff --git a/pypy/rpython/ootypesystem/module/ll_os_path.py b/pypy/rpython/ootypesystem/module/ll_os_path.py deleted file mode 100644 index 297c256424ea9ceec5853a73ba370dbea2b4d348..0000000000000000000000000000000000000000 --- a/pypy/rpython/ootypesystem/module/ll_os_path.py +++ /dev/null @@ -1,5 +0,0 @@ -from pypy.rpython.module.support import OOSupport -from pypy.rpython.module.ll_os_path import BaseOsPath - -class Implementation(BaseOsPath, OOSupport): - pass diff --git a/pypy/test_all.py b/pypy/test_all.py old mode 100644 new mode 100755 index 2d008849abe7e69ff398f572777d3a3586e9c8c6..e6d76cbc78cfa91bec8b62c578f8af33c05a98e2 --- a/pypy/test_all.py +++ b/pypy/test_all.py @@ -24,7 +24,6 @@ if __name__ == '__main__': print >> sys.stderr, __doc__ sys.exit(2) - import tool.autopath import pytest import pytest_cov sys.exit(pytest.main(plugins=[pytest_cov])) diff --git a/pypy/tool/algo/test/autopath.py b/pypy/tool/algo/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/tool/algo/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/tool/autopath.py b/pypy/tool/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/tool/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/tool/frozenlist.py b/pypy/tool/frozenlist.py index c7a6aa1f8f859c7de160d7972b625601f9782e8e..5ce7c88abf4ce897bf112864de267eced1c4cc3a 100644 --- a/pypy/tool/frozenlist.py +++ b/pypy/tool/frozenlist.py @@ -1,4 +1,4 @@ -from pypy.tool.sourcetools import func_with_new_name +from rpython.tool.sourcetools import func_with_new_name def forbid(*args): raise TypeError, "cannot mutate a frozenlist" diff --git a/pypy/tool/gcc_cache.py b/pypy/tool/gcc_cache.py index b77451ac6be35e1db34616b88cd03a4b55088318..3e4ffc2dc4a9e6cedb7ec7609b3a5fc314d68a3d 100644 --- a/pypy/tool/gcc_cache.py +++ b/pypy/tool/gcc_cache.py @@ -1,6 +1,6 @@ -from pypy.tool.autopath import pypydir -from pypy.translator.platform import CompilationError -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from pypy.conftest import pypydir +from rpython.translator.platform import CompilationError +from rpython.translator.tool.cbuild import ExternalCompilationInfo from pypy.tool.compat import md5 import py @@ -9,7 +9,7 @@ cache_dir_root = py.path.local(pypydir).join('_cache').ensure(dir=1) def cache_file_path(c_files, eci, cachename): "Builds a filename to cache compilation data" # Import 'platform' every time, the compiler may have been changed - from pypy.translator.platform import platform + from rpython.translator.platform import platform cache_dir = cache_dir_root.join(cachename).ensure(dir=1) filecontents = [c_file.read() for c_file in c_files] key = repr((filecontents, eci, platform.key())) @@ -19,7 +19,7 @@ def cache_file_path(c_files, eci, cachename): def build_executable_cache(c_files, eci, ignore_errors=False): "Builds and run a program; caches the result" # Import 'platform' every time, the compiler may have been changed - from pypy.translator.platform import platform + from rpython.translator.platform import platform path = cache_file_path(c_files, eci, 'build_executable_cache') try: return path.read() @@ -42,7 +42,7 @@ def build_executable_cache(c_files, eci, ignore_errors=False): def try_compile_cache(c_files, eci): "Try to compile a program; caches the result (starts with 'True' or 'FAIL')" # Import 'platform' every time, the compiler may have been changed - from pypy.translator.platform import platform + from rpython.translator.platform import platform path = cache_file_path(c_files, eci, 'try_compile_cache') try: data = path.read() diff --git a/pypy/tool/genstatistic.py b/pypy/tool/genstatistic.py index 3b30eb6f32ddaab9f14200a023d2fdfbe09f150f..d2603b52cbf26e825184c80154dcd3f7d86d4481 100644 --- a/pypy/tool/genstatistic.py +++ b/pypy/tool/genstatistic.py @@ -1,10 +1,10 @@ -import autopath import py from py._cmdline import pycountloc as countloc from py.xml import raw +from pypy import conftest -pypydir = py.path.local(autopath.pypydir) +pypydir = py.path.local(conftest.pypydir) def isdocfile(p): return (p.ext in ('.txt', '.rst') or @@ -25,7 +25,7 @@ class relchecker: def __init__(self, rel): self.rel = rel def __call__(self, p): - return p.relto(autopath.pypydir).startswith(self.rel) + return p.relto(conftest.pypydir).startswith(self.rel) def isfile(p): return p.check(file=1) and p.ext in ('.py', '.txt', '') @@ -42,7 +42,7 @@ def recpypy(p): def getpypycounter(): filecounter = countloc.FileCounter() - root = py.path.local(autopath.pypydir) + root = py.path.local(conftest.pypydir) filecounter.addrecursive(root, isfile, rec=recpypy) return filecounter @@ -121,7 +121,7 @@ if __name__ == '__main__': print "writing source statistics to", target pypycounter = getpypycounter() model = CounterModel(pypycounter) - rev = py.path.svnwc(autopath.pypydir).info().rev + rev = py.path.svnwc(conftest.pypydir).info().rev html = py.xml.html doc = html.html( html.head( diff --git a/pypy/tool/getdocstrings.py b/pypy/tool/getdocstrings.py index b94a117a2c972c42b23b9c7907d2b98fcac52b36..3db4d3fa04bcf07e61022b82cb270675798cc50c 100644 --- a/pypy/tool/getdocstrings.py +++ b/pypy/tool/getdocstrings.py @@ -1,9 +1,9 @@ -import autopath import re from os import listdir from sys import stdin, stdout, stderr +from pypy.conftest import pypydir -where = autopath.pypydir + '/objspace/std/' +where = pypydir + '/objspace/std/' quote = '(' + "'" + '|' + '"' + ')' triplequotes = '(' + "'''" + '|' + '"""' + ')' # Note: this will produce erroneous result if you nest triple quotes diff --git a/pypy/tool/import_graph.py b/pypy/tool/import_graph.py index 20035403cda21ada5fdcda497b984d307b3fed09..fd26d9fe29b7b362a71fea8c7373991c2bd81ae9 100644 --- a/pypy/tool/import_graph.py +++ b/pypy/tool/import_graph.py @@ -1,11 +1,10 @@ from __future__ import division -import autopath import py import math import random -exclude_files = ["__init__.py", "autopath.py", "conftest.py"] +exclude_files = ["__init__.py", "conftest.py"] def include_file(path): if ("test" in str(path) or "tool" in str(path) or @@ -97,8 +96,8 @@ class ModuleGraph(object): self.topgraph_properties = ["rankdir=LR"] def remove_object_refs(self): - # reduces cases like import pypy.translator.genc.basetype.CType to - # import pypy.translator.genc.basetype + # reduces cases like import rpython.translator.genc.basetype.CType to + # import rpython.translator.genc.basetype for mod, refs in self.imports.iteritems(): i = 0 while i < len(refs): diff --git a/pypy/tool/importfun.py b/pypy/tool/importfun.py index 20a720553755677bd609b65a54c105a557104570..5ce8e50316f365ae2e58a0fd3975463abd06184d 100644 --- a/pypy/tool/importfun.py +++ b/pypy/tool/importfun.py @@ -385,7 +385,7 @@ def report_unused_symbols(system): print ' ', k, v def find_cycles(system): - from pypy.tool.algo import graphlib + from rpython.tool.algo import graphlib vertices = dict.fromkeys(system.modules) edges = {} for m in system.modules: diff --git a/pypy/tool/isolate_slave.py b/pypy/tool/isolate_slave.py index 41899a2c53cdc7c1e47e2977da1f78c801e98f69..967ccf724f853e6eace4b9d18b49eba075405280 100644 --- a/pypy/tool/isolate_slave.py +++ b/pypy/tool/isolate_slave.py @@ -1,4 +1,3 @@ -import autopath import sys, imp from pypy.tool import slaveproc diff --git a/pypy/tool/jitlogparser/parser.py b/pypy/tool/jitlogparser/parser.py index 823043c810af08ded997863423e61ac3ac492157..0ad48814e963edaded368e75f9d4a8f6322960f9 100644 --- a/pypy/tool/jitlogparser/parser.py +++ b/pypy/tool/jitlogparser/parser.py @@ -1,8 +1,8 @@ import re, sys -from pypy.jit.metainterp.resoperation import opname -from pypy.jit.tool.oparser import OpParser -from pypy.tool.logparser import parse_log_file, extract_category +from rpython.jit.metainterp.resoperation import opname +from rpython.jit.tool.oparser import OpParser +from rpython.tool.logparser import parse_log_file, extract_category from copy import copy def parse_code_data(arg): @@ -113,7 +113,7 @@ class SimpleParser(OpParser): return loop def _asm_disassemble(self, d, origin_addr, tp): - from pypy.jit.backend.tool.viewcode import machine_code_dump + from rpython.jit.backend.tool.viewcode import machine_code_dump return list(machine_code_dump(d, tp, origin_addr)) @classmethod diff --git a/pypy/tool/jitlogparser/test/test_parser.py b/pypy/tool/jitlogparser/test/test_parser.py index 5be32f4439e81f1aca2838efeeaa7d6c8d8e8ffe..e850fb2a2de887455da11f790821f1d479bf81bd 100644 --- a/pypy/tool/jitlogparser/test/test_parser.py +++ b/pypy/tool/jitlogparser/test/test_parser.py @@ -4,7 +4,7 @@ from pypy.tool.jitlogparser.parser import (SimpleParser, TraceForOpcode, parse_log_counts) from pypy.tool.jitlogparser.storage import LoopStorage import py, sys -from pypy.jit.backend.detect_cpu import autodetect_main_model +from rpython.jit.backend.detect_cpu import autodetect_main_model def parse(input, **kwds): return SimpleParser.parse_from_input(input, **kwds) @@ -229,7 +229,7 @@ def test_parsing_arm_assembler(): debug_merge_point(0, 're StrMatchIn at 92 [17. 4. 0. 20. 393237. 21. 0. 29. 9. 1. 65535. 15. 4. 9. 3. 0. 1. 21. 1. 29. 9. 1. 65535. 15. 4. 9. 2. 0. 1. 1...') +116: i3 = int_lt(i0, i1) guard_true(i3, descr=) [i1, i0, p2] -+124: p4 = getfield_gc(p2, descr=) ++124: p4 = getfield_gc(p2, descr=) +128: i5 = strgetitem(p4, i0) +136: i7 = int_eq(40, i5) +152: i9 = int_eq(41, i5) diff --git a/pypy/tool/pydis.py b/pypy/tool/pydis.py index 41e41f4c46f95e2e003386cebd155dba78ab4e76..dd4bea0ab97d7f674e44a0323e513a0d1ed6b46e 100644 --- a/pypy/tool/pydis.py +++ b/pypy/tool/pydis.py @@ -5,11 +5,10 @@ XXX this only works for python-2.3 because of the linenumber """ -import autopath import sys -from pypy.tool import stdlib_opcode -from pypy.tool.stdlib_opcode import * +from rpython.tool import stdlib_opcode +from rpython.tool.stdlib_opcode import * __all__ = ["dis","pydisassemble","distb","disco"] + stdlib_opcode.__all__ diff --git a/pypy/tool/pytest/appsupport.py b/pypy/tool/pytest/appsupport.py index 31f42e21f240c283c7aa831c3aafd0d4270260bd..9c4fbfc1e324a57fd1afc2a588ff82af7195813d 100644 --- a/pypy/tool/pytest/appsupport.py +++ b/pypy/tool/pytest/appsupport.py @@ -1,4 +1,3 @@ -import autopath import py from pypy.interpreter import gateway, pycode from pypy.interpreter.error import OperationError diff --git a/pypy/tool/pytest/autopath.py b/pypy/tool/pytest/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/tool/pytest/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/tool/pytest/confpath.py b/pypy/tool/pytest/confpath.py index 911c0e5e78122d9430854b144567a864694c5a02..ec04c7091f43170965b84db922ccce54a3ec5612 100644 --- a/pypy/tool/pytest/confpath.py +++ b/pypy/tool/pytest/confpath.py @@ -1,4 +1,3 @@ -import autopath import py import pypy from pypy.tool import lib_pypy diff --git a/pypy/tool/pytest/expecttest.py b/pypy/tool/pytest/expecttest.py index b5a274090d235c2904ebafa00a758014aeb6ed3d..9b6a53abe90f940ed96919b084bdd96a0bbb7f24 100644 --- a/pypy/tool/pytest/expecttest.py +++ b/pypy/tool/pytest/expecttest.py @@ -8,8 +8,8 @@ import py import os, sys -from pypy.tool.udir import udir -from pypy.tool.autopath import pypydir +from rpython.tool.udir import udir +from pypy.conftest import pypydir class ExpectTestMethod(py.test.collect.Function): diff --git a/pypy/tool/pytest/genreportdata.py b/pypy/tool/pytest/genreportdata.py index 74ada49f484a1e50d403aca4f12efc1dbea6f95b..e24218410be1b6882f41db0a8e1fc89849d8f88c 100755 --- a/pypy/tool/pytest/genreportdata.py +++ b/pypy/tool/pytest/genreportdata.py @@ -1,5 +1,4 @@ #! /usr/bin/env python -import autopath import py import sys diff --git a/pypy/tool/pytest/plugins.py b/pypy/tool/pytest/plugins.py index 41daf75bb746c33847e8ec4d0b44ac3af2d415ac..58f2e15829275e60afa456e6012564787232e189 100644 --- a/pypy/tool/pytest/plugins.py +++ b/pypy/tool/pytest/plugins.py @@ -1,7 +1,7 @@ # pytest hooks, installed by pypy.conftest. import py -from pypy.tool import leakfinder +from rpython.tool import leakfinder class LeakFinder: """Track memory allocations during test execution. diff --git a/pypy/tool/pytest/test/test_pytestsupport.py b/pypy/tool/pytest/test/test_pytestsupport.py index 42a79abfcb8ac4fb4a503c64e0dde2dfa5ab7ff2..316fd700518fe3f4355c4c55ecc28b1404bbb7ec 100644 --- a/pypy/tool/pytest/test/test_pytestsupport.py +++ b/pypy/tool/pytest/test/test_pytestsupport.py @@ -5,7 +5,7 @@ from pypy.interpreter.pycode import PyCode from pypy.tool.pytest.appsupport import (AppFrame, build_pytest_assertion, AppExceptionInfo, interpret) import py -from pypy.tool.udir import udir +from rpython.tool.udir import udir import os import sys import pypy diff --git a/pypy/tool/release/autopath.py b/pypy/tool/release/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/tool/release/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/tool/release/make_release.py b/pypy/tool/release/make_release.py index 58de7ce72fdbdf7b7e6cfd0e35cb725ac7fa01ee..8c385671f60ec0592170f3367c6da5717ba71561 100755 --- a/pypy/tool/release/make_release.py +++ b/pypy/tool/release/make_release.py @@ -8,13 +8,12 @@ Usage: make_release.py e.g.: make_release.py release-1.4.1 1.4.1 """ -import autopath import sys import urllib2 from xml.dom import minidom import re import py -from pypy.tool.udir import udir +from rpython.tool.udir import udir from pypy.tool.release.package import package import tarfile import os diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py index 6828f5d3a6518c5d57df0f6aedd390ac17cab3ff..1a18bd257dccf479166533db9c09aae7a0bdade4 100755 --- a/pypy/tool/release/package.py +++ b/pypy/tool/release/package.py @@ -9,13 +9,12 @@ Usually you would do: package.py ../../.. pypy-VER-PLATFORM The output is found in the directory /tmp/usession-YOURNAME/build/. """ -import autopath import shutil import sys import py import os import fnmatch -from pypy.tool.udir import udir +from rpython.tool.udir import udir if sys.version_info < (2,6): py.test.skip("requires 2.6 so far") diff --git a/pypy/tool/release/test/test_package.py b/pypy/tool/release/test/test_package.py index 0ec9d06dbd1f2f78d8539df7bec9a4caf7f00e71..f33967c033b0f8aa36aab703bf507afedd82a3a0 100644 --- a/pypy/tool/release/test/test_package.py +++ b/pypy/tool/release/test/test_package.py @@ -1,6 +1,6 @@ import py -from pypy.tool.autopath import pypydir +from pypy.conftest import pypydir from pypy.tool.release import package from pypy.module.sys.version import CPYTHON_VERSION import tarfile, zipfile, os, sys diff --git a/pypy/tool/test/autopath.py b/pypy/tool/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/tool/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/tool/test/test_cache.py b/pypy/tool/test/test_cache.py index 0085f94134050c803d8e477d64811dd7f0c4285c..52be3631b8b8288a843535ec02bf7305bd6ebb28 100644 --- a/pypy/tool/test/test_cache.py +++ b/pypy/tool/test/test_cache.py @@ -1,4 +1,3 @@ -import autopath from pypy.tool.cache import Cache class MyCache(Cache): diff --git a/pypy/tool/test/test_error.py b/pypy/tool/test/test_error.py index 908a73225ae557e63ea28f171724424e3f344086..bbb6163ae3818a381f4f555d3fc77aba68e40ac7 100644 --- a/pypy/tool/test/test_error.py +++ b/pypy/tool/test/test_error.py @@ -2,9 +2,9 @@ """ Tests some error handling routines """ -from pypy.translator.translator import TranslationContext -from pypy.tool.error import AnnotatorError -from pypy.annotation.model import UnionError +from rpython.translator.translator import TranslationContext +from rpython.tool.error import AnnotatorError +from rpython.annotator.model import UnionError import py diff --git a/pypy/tool/test/test_gcc_cache.py b/pypy/tool/test/test_gcc_cache.py index 49904c35b4388408d5d196ff51fbfabcea4cd112..c7ad8590f90ebe8c9987385abf0de0d6a72db060 100644 --- a/pypy/tool/test/test_gcc_cache.py +++ b/pypy/tool/test/test_gcc_cache.py @@ -1,8 +1,8 @@ import sys from pypy.tool.gcc_cache import * -from pypy.tool.udir import udir +from rpython.tool.udir import udir import md5, cStringIO -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.translator.tool.cbuild import ExternalCompilationInfo localudir = udir.join('test_gcc_cache').ensure(dir=1) diff --git a/pypy/tool/test/test_getdocstrings.py b/pypy/tool/test/test_getdocstrings.py index f91e153f2ba446d02845312a425c4f9d191658f5..b16e96327740c13fc64e498e334b755885a13c46 100644 --- a/pypy/tool/test/test_getdocstrings.py +++ b/pypy/tool/test/test_getdocstrings.py @@ -1,10 +1,8 @@ -import autopath from os import listdir import glob, os.path, py, re -this_dir = autopath.this_dir -pypy_dir = autopath.pypydir -# Naming weirdness: why not both pypy_dir and this_dir or pypydir and thisdir +this_dir = os.path.realpath(os.path.dirname(__file__)) +pypy_dir = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..')) from pypy.tool.getdocstrings import quote, triplequotes from pypy.tool.getdocstrings import mk_std_filelist diff --git a/pypy/tool/test/test_identitydict.py b/pypy/tool/test/test_identitydict.py index f01e329d53186f284622f80fd79cb80c1d81cf7a..c9a0c7feaea3d819465abccb5a6946c93406b585 100644 --- a/pypy/tool/test/test_identitydict.py +++ b/pypy/tool/test/test_identitydict.py @@ -1,5 +1,5 @@ import py -from pypy.tool.identity_dict import identity_dict, IdentityDictPurePython +from rpython.tool.identity_dict import identity_dict, IdentityDictPurePython class TestIdentityDictNative: identity_dict = identity_dict diff --git a/pypy/tool/test/test_leakfinder.py b/pypy/tool/test/test_leakfinder.py index c0e5d240692318c83a7a284354ea7548c0a535ea..4816e5b98ba35078432a3d85b2a2e4a70ea410b0 100644 --- a/pypy/tool/test/test_leakfinder.py +++ b/pypy/tool/test/test_leakfinder.py @@ -1,5 +1,5 @@ import py -from pypy.tool import leakfinder +from rpython.tool import leakfinder def test_start_stop(): leakfinder.start_tracking_allocations() diff --git a/pypy/tool/test/test_logparser.py b/pypy/tool/test/test_logparser.py index 6a8138cc96a7fbdb7f6b6369018de461354641cf..a7363aeb165744ecfc361b0a79e15fb54d25fc4d 100644 --- a/pypy/tool/test/test_logparser.py +++ b/pypy/tool/test/test_logparser.py @@ -1,5 +1,5 @@ -from pypy.tool.udir import udir -from pypy.tool.logparser import * +from rpython.tool.udir import udir +from rpython.tool.logparser import * globalpath = udir.join('test_logparser.log') diff --git a/pypy/tool/test/test_pairtype.py b/pypy/tool/test/test_pairtype.py index e533acb5b3aaaa63964007b7ee353e1f6d01ef01..a8b2f6b583a3e99c92ca17dc874d14fd7fd984a6 100644 --- a/pypy/tool/test/test_pairtype.py +++ b/pypy/tool/test/test_pairtype.py @@ -1,5 +1,5 @@ -from pypy.tool.pairtype import pairtype, pair, extendabletype +from rpython.tool.pairtype import pairtype, pair, extendabletype def test_binop(): ### Binary operation example diff --git a/pypy/tool/test/test_sourcetools.py b/pypy/tool/test/test_sourcetools.py index 39bdfa8e7feae4d7a2e350a9ed6489b41ef6e27a..dc9a7ff8a759c662dd5437d26760880503e0372e 100644 --- a/pypy/tool/test/test_sourcetools.py +++ b/pypy/tool/test/test_sourcetools.py @@ -1,4 +1,4 @@ -from pypy.tool.sourcetools import func_with_new_name, func_renamer, rpython_wrapper +from rpython.tool.sourcetools import func_with_new_name, func_renamer, rpython_wrapper def test_rename(): def f(x, y=5): diff --git a/pypy/tool/test/test_tab.py b/pypy/tool/test/test_tab.py index 8a26f56cee33118d113a15a18011252ff99b6e67..e0e300a359242cedf1c2cdfd1fbc7203af54f1b2 100644 --- a/pypy/tool/test/test_tab.py +++ b/pypy/tool/test/test_tab.py @@ -2,10 +2,10 @@ Verify that the PyPy source files have no tabs. """ -import autopath import os +from pypy.conftest import pypydir -ROOT = autopath.pypydir +ROOT = pypydir EXCLUDE = {} diff --git a/pypy/tool/test/test_template.py b/pypy/tool/test/test_template.py index a45a775a1710384dc4376bd3d1f8632d064f71b0..d1a214bd12c1db8ba11a9e63758a0666bc0cb776 100644 --- a/pypy/tool/test/test_template.py +++ b/pypy/tool/test/test_template.py @@ -1,5 +1,4 @@ -import autopath -from pypy.tool.sourcetools import compile_template +from rpython.tool.sourcetools import compile_template some_global = 5 diff --git a/pypy/tool/test/test_udir.py b/pypy/tool/test/test_udir.py index 64a980c714a255cc7046dfb935d2f7c16fd163bc..6c73b5284d125c1587989e0ba10eaaeef816a7d6 100644 --- a/pypy/tool/test/test_udir.py +++ b/pypy/tool/test/test_udir.py @@ -1,5 +1,5 @@ -from pypy.tool import udir +from rpython.tool import udir def test_make_udir(): root = str(udir.udir.ensure('make_udir1', dir=1)) diff --git a/pypy/tool/version.py b/pypy/tool/version.py index 3a66a34461f327b2ac233e28c05a9a4ab5b7ba01..064e3c2a06468d02a4bebd22bb0ca48a4c57a335 100644 --- a/pypy/tool/version.py +++ b/pypy/tool/version.py @@ -10,7 +10,7 @@ def maywarn(err, repo_type='Mercurial'): if not err: return - from pypy.tool.ansi_print import ansi_log + from rpython.tool.ansi_print import ansi_log log = py.log.Producer("version") py.log.setconsumer("version", ansi_log) log.WARNING('Errors getting %s information: %s' % (repo_type, err)) diff --git a/pypy/translator/autopath.py b/pypy/translator/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/translator/c/autopath.py b/pypy/translator/c/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/c/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/translator/c/gcc/autopath.py b/pypy/translator/c/gcc/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/c/gcc/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/translator/c/test/autopath.py b/pypy/translator/c/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/c/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/translator/cli/test/autopath.py b/pypy/translator/cli/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/cli/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/translator/cli/test/test_bool.py b/pypy/translator/cli/test/test_bool.py deleted file mode 100644 index 6ef6dc87e85f5e9cf8c0a0c232105c5f80532822..0000000000000000000000000000000000000000 --- a/pypy/translator/cli/test/test_bool.py +++ /dev/null @@ -1,7 +0,0 @@ -import py -from pypy.translator.cli.test.runtest import CliTest -from pypy.rpython.test.test_rbool import BaseTestRbool - -class TestCliBool(CliTest, BaseTestRbool): - pass - diff --git a/pypy/translator/cli/test/test_cast.py b/pypy/translator/cli/test/test_cast.py deleted file mode 100644 index e323eb44013204c42f4ed65ced7a9759770ff613..0000000000000000000000000000000000000000 --- a/pypy/translator/cli/test/test_cast.py +++ /dev/null @@ -1,5 +0,0 @@ -from pypy.translator.cli.test.runtest import CliTest -from pypy.translator.oosupport.test_template.cast import BaseTestCast - -class TestCast(BaseTestCast, CliTest): - pass diff --git a/pypy/translator/cli/test/test_class.py b/pypy/translator/cli/test/test_class.py deleted file mode 100644 index 52fd39a92bc4e51b835dd4f9e1d3d6a90774a229..0000000000000000000000000000000000000000 --- a/pypy/translator/cli/test/test_class.py +++ /dev/null @@ -1,8 +0,0 @@ -import py -from pypy.translator.cli.test.runtest import CliTest -from pypy.translator.oosupport.test_template.class_ import BaseTestClass - -# ====> ../../oosupport/test_template/class_.py - -class TestCliClass(CliTest, BaseTestClass): - pass diff --git a/pypy/translator/cli/test/test_constant.py b/pypy/translator/cli/test/test_constant.py deleted file mode 100644 index 00488f28186b3876a110809ad6ec78f83522c7b6..0000000000000000000000000000000000000000 --- a/pypy/translator/cli/test/test_constant.py +++ /dev/null @@ -1,5 +0,0 @@ -from pypy.translator.oosupport.test_template.constant import BaseTestConstant -from pypy.translator.cli.test.runtest import CliTest - -class TestConstant(BaseTestConstant, CliTest): - pass diff --git a/pypy/translator/cli/test/test_overflow.py b/pypy/translator/cli/test/test_overflow.py deleted file mode 100644 index 1df2db35dd85221937b72c12a8a5c81745262d3f..0000000000000000000000000000000000000000 --- a/pypy/translator/cli/test/test_overflow.py +++ /dev/null @@ -1,5 +0,0 @@ -from pypy.translator.cli.test.runtest import CliTest -from pypy.translator.oosupport.test_template.overflow import BaseTestOverflow - -class TestOverflow(BaseTestOverflow, CliTest): - pass diff --git a/pypy/translator/cli/test/test_pbc.py b/pypy/translator/cli/test/test_pbc.py deleted file mode 100644 index 35059125663faf61ad5a6693a0953b2cf5a999ca..0000000000000000000000000000000000000000 --- a/pypy/translator/cli/test/test_pbc.py +++ /dev/null @@ -1,6 +0,0 @@ -import py -from pypy.translator.cli.test.runtest import CliTest -from pypy.rpython.test.test_rpbc import BaseTestRPBC - -class TestCliPBC(CliTest, BaseTestRPBC): - pass diff --git a/pypy/translator/cli/test/test_weakref.py b/pypy/translator/cli/test/test_weakref.py deleted file mode 100644 index 6752db2996eca74f21bd36a12533931be480711d..0000000000000000000000000000000000000000 --- a/pypy/translator/cli/test/test_weakref.py +++ /dev/null @@ -1,6 +0,0 @@ -import py -from pypy.translator.cli.test.runtest import CliTest -from pypy.rpython.test.test_rweakref import BaseTestRweakref - -class TestCliWeakRef(CliTest, BaseTestRweakref): - pass diff --git a/pypy/translator/goal/autopath.py b/pypy/translator/goal/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/goal/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/translator/goal/test2/autopath.py b/pypy/translator/goal/test2/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/goal/test2/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/translator/jvm/test/test_bool.py b/pypy/translator/jvm/test/test_bool.py deleted file mode 100644 index bd54d533db1c171154462467938c0fec06362079..0000000000000000000000000000000000000000 --- a/pypy/translator/jvm/test/test_bool.py +++ /dev/null @@ -1,7 +0,0 @@ -import py -from pypy.translator.jvm.test.runtest import JvmTest -from pypy.rpython.test.test_rbool import BaseTestRbool - -class TestJvmBool(JvmTest, BaseTestRbool): - pass - diff --git a/pypy/translator/jvm/test/test_constant.py b/pypy/translator/jvm/test/test_constant.py deleted file mode 100644 index d835eb4553cbb3ac3001eedc8ea7d7206d5bcf93..0000000000000000000000000000000000000000 --- a/pypy/translator/jvm/test/test_constant.py +++ /dev/null @@ -1,6 +0,0 @@ -import py -from pypy.translator.oosupport.test_template.constant import BaseTestConstant -from pypy.translator.jvm.test.runtest import JvmTest - -class TestConstant(BaseTestConstant, JvmTest): - pass diff --git a/pypy/translator/jvm/test/test_objectmodel.py b/pypy/translator/jvm/test/test_objectmodel.py deleted file mode 100644 index b05f1f1979e2afca17b2447a5df8a0a8560e143c..0000000000000000000000000000000000000000 --- a/pypy/translator/jvm/test/test_objectmodel.py +++ /dev/null @@ -1,7 +0,0 @@ -import py -from pypy.translator.jvm.test.runtest import JvmTest -from pypy.translator.oosupport.test_template.objectmodel import \ - BaseTestObjectModel - -class TestJvmObjectModel(JvmTest, BaseTestObjectModel): - pass diff --git a/pypy/translator/jvm/test/test_op.py b/pypy/translator/jvm/test/test_op.py deleted file mode 100644 index 5a9d3626e2893e01b932a41b9bc921469ff28b2a..0000000000000000000000000000000000000000 --- a/pypy/translator/jvm/test/test_op.py +++ /dev/null @@ -1,8 +0,0 @@ -import py -from pypy.translator.jvm.test.runtest import JvmTest -from pypy.translator.oosupport.test_template.operations import BaseTestOperations - -# ====> ../../oosupport/test_template/operations.py - -class TestOperations(JvmTest, BaseTestOperations): - pass diff --git a/pypy/translator/jvm/test/test_overflow.py b/pypy/translator/jvm/test/test_overflow.py deleted file mode 100644 index 846b1950656191df75cd16d8f01de53f83ab1723..0000000000000000000000000000000000000000 --- a/pypy/translator/jvm/test/test_overflow.py +++ /dev/null @@ -1,7 +0,0 @@ -import py -from pypy.translator.jvm.test.runtest import JvmTest -from pypy.translator.oosupport.test_template.overflow import BaseTestOverflow - -class TestOverflow(BaseTestOverflow, JvmTest): - pass - diff --git a/pypy/translator/jvm/test/test_pbc.py b/pypy/translator/jvm/test/test_pbc.py deleted file mode 100644 index c4652301bcc4caf4d7e422bb96a5be2c794d886e..0000000000000000000000000000000000000000 --- a/pypy/translator/jvm/test/test_pbc.py +++ /dev/null @@ -1,6 +0,0 @@ -import py -from pypy.translator.jvm.test.runtest import JvmTest -from pypy.rpython.test.test_rpbc import BaseTestRPBC - -class TestJvmPBC(JvmTest, BaseTestRPBC): - pass diff --git a/pypy/translator/jvm/test/test_runtest.py b/pypy/translator/jvm/test/test_runtest.py deleted file mode 100644 index b06cfbe2992900b6aca25815ca6fe06ec0eba24c..0000000000000000000000000000000000000000 --- a/pypy/translator/jvm/test/test_runtest.py +++ /dev/null @@ -1,7 +0,0 @@ -from pypy.translator.oosupport.test_template.runtest import BaseTestRunTest -from pypy.translator.jvm.test.runtest import JvmTest - -class TestRunTest(BaseTestRunTest, JvmTest): - def test_big_ullong(self): - import py - py.test.skip('fixme!') diff --git a/pypy/translator/jvm/test/test_weakref.py b/pypy/translator/jvm/test/test_weakref.py deleted file mode 100644 index 13973e9d2b4b5e1c2129c62f59eed81e02531d4a..0000000000000000000000000000000000000000 --- a/pypy/translator/jvm/test/test_weakref.py +++ /dev/null @@ -1,6 +0,0 @@ -import py -from pypy.translator.jvm.test.runtest import JvmTest -from pypy.rpython.test.test_rweakref import BaseTestRweakref - -class TestJvmException(JvmTest, BaseTestRweakref): - pass \ No newline at end of file diff --git a/pypy/translator/platform/test/test_distutils.py b/pypy/translator/platform/test/test_distutils.py deleted file mode 100644 index 8982349f9077ba916f3a2524ced9969fef9de8af..0000000000000000000000000000000000000000 --- a/pypy/translator/platform/test/test_distutils.py +++ /dev/null @@ -1,10 +0,0 @@ - -from pypy.translator.platform.test.test_platform import TestPlatform as BasicTest -from pypy.translator.platform.distutils_platform import DistutilsPlatform -import py - -class TestDistutils(BasicTest): - platform = DistutilsPlatform() - - def test_nice_errors(self): - py.test.skip("Unsupported") diff --git a/pypy/translator/sandbox/autopath.py b/pypy/translator/sandbox/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/sandbox/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/translator/sandbox/test/autopath.py b/pypy/translator/sandbox/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/sandbox/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/translator/test/autopath.py b/pypy/translator/test/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/test/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/translator/tool/autopath.py b/pypy/translator/tool/autopath.py deleted file mode 100644 index bd6cbcfc5095f6973595223ffbcaa81c8bd9247e..0000000000000000000000000000000000000000 --- a/pypy/translator/tool/autopath.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -self cloning, automatic path configuration - -copy this into any subdirectory of pypy from which scripts need -to be run, typically all of the test subdirs. -The idea is that any such script simply issues - - import autopath - -and this will make sure that the parent directory containing "pypy" -is in sys.path. - -If you modify the master "autopath.py" version (in pypy/tool/autopath.py) -you can directly run it which will copy itself on all autopath.py files -it finds under the pypy root directory. - -This module always provides these attributes: - - pypydir pypy root directory path - this_dir directory where this autopath.py resides - -""" - -def __dirinfo(part): - """ return (partdir, this_dir) and insert parent of partdir - into sys.path. If the parent directories don't have the part - an EnvironmentError is raised.""" - - import sys, os - try: - head = this_dir = os.path.realpath(os.path.dirname(__file__)) - except NameError: - head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0])) - - error = None - while head: - partdir = head - head, tail = os.path.split(head) - if tail == part: - checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py') - if not os.path.exists(checkfile): - error = "Cannot find %r" % (os.path.normpath(checkfile),) - break - else: - error = "Cannot find the parent directory %r of the path %r" % ( - partdir, this_dir) - if not error: - # check for bogus end-of-line style (e.g. files checked out on - # Windows and moved to Unix) - f = open(__file__.replace('.pyc', '.py'), 'r') - data = f.read() - f.close() - if data.endswith('\r\n') or data.endswith('\r'): - error = ("Bad end-of-line style in the .py files. Typically " - "caused by a zip file or a checkout done on Windows and " - "moved to Unix or vice-versa.") - if error: - raise EnvironmentError("Invalid source tree - bogus checkout! " + - error) - - pypy_root = os.path.join(head, '') - try: - sys.path.remove(head) - except ValueError: - pass - sys.path.insert(0, head) - - munged = {} - for name, mod in sys.modules.items(): - if '.' in name: - continue - fn = getattr(mod, '__file__', None) - if not isinstance(fn, str): - continue - newname = os.path.splitext(os.path.basename(fn))[0] - if not newname.startswith(part + '.'): - continue - path = os.path.join(os.path.dirname(os.path.realpath(fn)), '') - if path.startswith(pypy_root) and newname != part: - modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep) - if newname != '__init__': - modpaths.append(newname) - modpath = '.'.join(modpaths) - if modpath not in sys.modules: - munged[modpath] = mod - - for name, mod in munged.iteritems(): - if name not in sys.modules: - sys.modules[name] = mod - if '.' in name: - prename = name[:name.rfind('.')] - postname = name[len(prename)+1:] - if prename not in sys.modules: - __import__(prename) - if not hasattr(sys.modules[prename], postname): - setattr(sys.modules[prename], postname, mod) - - return partdir, this_dir - -def __clone(): - """ clone master version of autopath.py into all subdirs """ - from os.path import join, walk - if not this_dir.endswith(join('pypy','tool')): - raise EnvironmentError("can only clone master version " - "'%s'" % join(pypydir, 'tool',_myname)) - - - def sync_walker(arg, dirname, fnames): - if _myname in fnames: - fn = join(dirname, _myname) - f = open(fn, 'rwb+') - try: - if f.read() == arg: - print "checkok", fn - else: - print "syncing", fn - f = open(fn, 'w') - f.write(arg) - finally: - f.close() - s = open(join(pypydir, 'tool', _myname), 'rb').read() - walk(pypydir, sync_walker, s) - -_myname = 'autopath.py' - -# set guaranteed attributes - -pypydir, this_dir = __dirinfo('pypy') - -if __name__ == '__main__': - __clone() diff --git a/pypy/annotation/test/__init__.py b/rpython/__init__.py similarity index 100% rename from pypy/annotation/test/__init__.py rename to rpython/__init__.py diff --git a/rpython/annotator/__init__.py b/rpython/annotator/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..84221f4ca15461d45198a095c3ad1af5bd61cc28 --- /dev/null +++ b/rpython/annotator/__init__.py @@ -0,0 +1,4 @@ +# workaround for a circular imports problem +# e.g. if you import rpython.annotator.listdef first + +import rpython.annotator.model diff --git a/pypy/annotation/annrpython.py b/rpython/annotator/annrpython.py similarity index 96% rename from pypy/annotation/annrpython.py rename to rpython/annotator/annrpython.py index 35ac1f2be3161a762d59d141c606af9abaab0faa..e980fe826013b13547e1d383b22e9f3366fcae66 100644 --- a/pypy/annotation/annrpython.py +++ b/rpython/annotator/annrpython.py @@ -1,15 +1,15 @@ from __future__ import absolute_import import types -from pypy.tool.ansi_print import ansi_log -from pypy.tool.pairtype import pair -from pypy.tool.error import (format_blocked_annotation_error, +from rpython.tool.ansi_print import ansi_log +from rpython.tool.pairtype import pair +from rpython.tool.error import (format_blocked_annotation_error, AnnotatorError, gather_error, ErrorWrapper) -from pypy.objspace.flow.model import (Variable, Constant, FunctionGraph, +from rpython.flowspace.model import (Variable, Constant, FunctionGraph, c_last_exception, checkgraph) -from pypy.translator import simplify, transform -from pypy.annotation import model as annmodel, signature, unaryop, binaryop -from pypy.annotation.bookkeeper import Bookkeeper +from rpython.translator import simplify, transform +from rpython.annotator import model as annmodel, signature, unaryop, binaryop +from rpython.annotator.bookkeeper import Bookkeeper import py log = py.log.Producer("annrpython") py.log.setconsumer("annrpython", ansi_log) @@ -22,13 +22,13 @@ class RPythonAnnotator(object): See description in doc/translation.txt.""" def __init__(self, translator=None, policy=None, bookkeeper=None): - import pypy.rpython.ootypesystem.ooregistry # has side effects - import pypy.rpython.extfuncregistry # has side effects - import pypy.rlib.nonconst # has side effects + import rpython.rtyper.ootypesystem.ooregistry # has side effects + import rpython.rtyper.extfuncregistry # has side effects + import rpython.rlib.nonconst # has side effects if translator is None: # interface for tests - from pypy.translator.translator import TranslationContext + from rpython.translator.translator import TranslationContext translator = TranslationContext() translator.annotator = self self.translator = translator @@ -45,7 +45,7 @@ class RPythonAnnotator(object): # --- end of debugging information --- self.frozen = False if policy is None: - from pypy.annotation.policy import AnnotatorPolicy + from rpython.annotator.policy import AnnotatorPolicy self.policy = AnnotatorPolicy() else: self.policy = policy @@ -72,7 +72,7 @@ class RPythonAnnotator(object): """Recursively build annotations about the specific entry point.""" assert isinstance(function, types.FunctionType), "fix that!" - from pypy.annotation.policy import AnnotatorPolicy + from rpython.annotator.policy import AnnotatorPolicy policy = AnnotatorPolicy() # make input arguments and set their type args_s = [self.typeannotation(t) for t in input_arg_types] @@ -111,7 +111,7 @@ class RPythonAnnotator(object): def annotate_helper(self, function, args_s, policy=None): if policy is None: - from pypy.annotation.policy import AnnotatorPolicy + from rpython.annotator.policy import AnnotatorPolicy policy = AnnotatorPolicy() graph, inputcells = self.get_call_parameters(function, args_s, policy) self.build_graph_types(graph, inputcells, complete_now=False) diff --git a/pypy/annotation/binaryop.py b/rpython/annotator/binaryop.py similarity index 95% rename from pypy/annotation/binaryop.py rename to rpython/annotator/binaryop.py index bef2f6be8a33593924f4e1a7e54896019ab2fdcf..cde876745bfc5e598d55c210d96c859068f137a2 100644 --- a/pypy/annotation/binaryop.py +++ b/rpython/annotator/binaryop.py @@ -4,25 +4,25 @@ Binary operations between SomeValues. import py import operator -from pypy.tool.pairtype import pair, pairtype -from pypy.annotation.model import SomeObject, SomeInteger, SomeBool, s_Bool -from pypy.annotation.model import SomeString, SomeChar, SomeList, SomeDict -from pypy.annotation.model import SomeUnicodeCodePoint, SomeUnicodeString -from pypy.annotation.model import SomeTuple, SomeImpossibleValue, s_ImpossibleValue -from pypy.annotation.model import SomeInstance, SomeBuiltin, SomeIterator -from pypy.annotation.model import SomePBC, SomeFloat, s_None, SomeByteArray -from pypy.annotation.model import SomeExternalObject, SomeWeakRef -from pypy.annotation.model import SomeAddress, SomeTypedAddressAccess -from pypy.annotation.model import SomeSingleFloat, SomeLongFloat, SomeType -from pypy.annotation.model import unionof, UnionError, missing_operation -from pypy.annotation.model import TLS -from pypy.annotation.model import read_can_only_throw -from pypy.annotation.model import add_knowntypedata, merge_knowntypedata -from pypy.annotation.model import SomeGenericCallable -from pypy.annotation.bookkeeper import getbookkeeper -from pypy.objspace.flow.model import Variable, Constant -from pypy.rlib import rarithmetic -from pypy.tool.error import AnnotatorError +from rpython.tool.pairtype import pair, pairtype +from rpython.annotator.model import SomeObject, SomeInteger, SomeBool, s_Bool +from rpython.annotator.model import SomeString, SomeChar, SomeList, SomeDict +from rpython.annotator.model import SomeUnicodeCodePoint, SomeUnicodeString +from rpython.annotator.model import SomeTuple, SomeImpossibleValue, s_ImpossibleValue +from rpython.annotator.model import SomeInstance, SomeBuiltin, SomeIterator +from rpython.annotator.model import SomePBC, SomeFloat, s_None, SomeByteArray +from rpython.annotator.model import SomeExternalObject, SomeWeakRef +from rpython.annotator.model import SomeAddress, SomeTypedAddressAccess +from rpython.annotator.model import SomeSingleFloat, SomeLongFloat, SomeType +from rpython.annotator.model import unionof, UnionError, missing_operation +from rpython.annotator.model import TLS +from rpython.annotator.model import read_can_only_throw +from rpython.annotator.model import add_knowntypedata, merge_knowntypedata +from rpython.annotator.model import SomeGenericCallable +from rpython.annotator.bookkeeper import getbookkeeper +from rpython.flowspace.model import Variable, Constant +from rpython.rlib import rarithmetic +from rpython.tool.error import AnnotatorError # convenience only! def immutablevalue(x): @@ -896,10 +896,10 @@ class __extend__(pairtype(SomeExternalObject, SomeExternalObject)): # ____________________________________________________________ # annotation of low-level types -from pypy.annotation.model import SomePtr, SomeOOInstance, SomeOOClass -from pypy.annotation.model import SomeOOObject -from pypy.annotation.model import ll_to_annotation, annotation_to_lltype -from pypy.rpython.ootypesystem import ootype +from rpython.annotator.model import SomePtr, SomeOOInstance, SomeOOClass +from rpython.annotator.model import SomeOOObject +from rpython.annotator.model import ll_to_annotation, annotation_to_lltype +from rpython.rtyper.ootypesystem import ootype _make_none_union('SomeOOInstance', 'ootype=obj.ootype, can_be_None=True') @@ -1014,12 +1014,12 @@ class __extend__(pairtype(SomeTypedAddressAccess, SomeTypedAddressAccess)): class __extend__(pairtype(SomeTypedAddressAccess, SomeInteger)): def getitem((s_taa, s_int)): - from pypy.annotation.model import lltype_to_annotation + from rpython.annotator.model import lltype_to_annotation return lltype_to_annotation(s_taa.type) getitem.can_only_throw = [] def setitem((s_taa, s_int), s_value): - from pypy.annotation.model import annotation_to_lltype + from rpython.annotator.model import annotation_to_lltype assert annotation_to_lltype(s_value) is s_taa.type setitem.can_only_throw = [] diff --git a/pypy/annotation/bookkeeper.py b/rpython/annotator/bookkeeper.py similarity index 97% rename from pypy/annotation/bookkeeper.py rename to rpython/annotator/bookkeeper.py index 659bab5db3d47089053e47070fa57037cd7d712b..ff9535f003a48e84e397657df34048655d42e655 100644 --- a/pypy/annotation/bookkeeper.py +++ b/rpython/annotator/bookkeeper.py @@ -6,26 +6,26 @@ from __future__ import absolute_import import sys, types, inspect, weakref -from pypy.objspace.flow.model import Constant -from pypy.annotation.model import SomeString, SomeChar, SomeFloat, \ +from rpython.flowspace.model import Constant +from rpython.annotator.model import SomeString, SomeChar, SomeFloat, \ SomePtr, unionof, SomeInstance, SomeDict, SomeBuiltin, SomePBC, \ SomeInteger, SomeOOInstance, SomeOOObject, TLS, SomeAddress, \ SomeUnicodeCodePoint, SomeOOStaticMeth, s_None, s_ImpossibleValue, \ SomeLLADTMeth, SomeBool, SomeTuple, SomeOOClass, SomeImpossibleValue, \ SomeUnicodeString, SomeList, SomeObject, HarmlesslyBlocked, \ SomeWeakRef, lltype_to_annotation, SomeType, SomeByteArray -from pypy.annotation.classdef import InstanceSource, ClassDef -from pypy.annotation.listdef import ListDef, ListItem -from pypy.annotation.dictdef import DictDef -from pypy.annotation import description -from pypy.annotation.signature import annotationoftype -from pypy.objspace.flow.argument import ArgumentsForTranslation -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 -from pypy.rpython import extregistry -from pypy.tool.identity_dict import identity_dict +from rpython.annotator.classdef import InstanceSource, ClassDef +from rpython.annotator.listdef import ListDef, ListItem +from rpython.annotator.dictdef import DictDef +from rpython.annotator import description +from rpython.annotator.signature import annotationoftype +from rpython.flowspace.argument import ArgumentsForTranslation +from rpython.rlib.objectmodel import r_dict, Symbolic +from rpython.tool.algo.unionfind import UnionFind +from rpython.rtyper.lltypesystem import lltype, llmemory +from rpython.rtyper.ootypesystem import ootype +from rpython.rtyper import extregistry +from rpython.tool.identity_dict import identity_dict class Stats(object): @@ -445,7 +445,7 @@ class Bookkeeper(object): result = SomeOOObject() elif tp is type: if (x is type(None) or # add cases here if needed - x.__module__ == 'pypy.rpython.lltypesystem.lltype'): + x.__module__ == 'rpython.rtyper.lltypesystem.lltype'): result = SomeType() else: result = SomePBC([self.getdesc(x)]) @@ -793,5 +793,5 @@ def getbookkeeper(): def delayed_imports(): # import ordering hack global BUILTIN_ANALYZERS - from pypy.annotation.builtin import BUILTIN_ANALYZERS + from rpython.annotator.builtin import BUILTIN_ANALYZERS diff --git a/pypy/annotation/builtin.py b/rpython/annotator/builtin.py similarity index 89% rename from pypy/annotation/builtin.py rename to rpython/annotator/builtin.py index 009b43df1d25c8cc2d90548cffb809dbda8c9fee..243f21fc078b91438221f921d7db98941757f255 100644 --- a/pypy/annotation/builtin.py +++ b/rpython/annotator/builtin.py @@ -3,22 +3,22 @@ Built-in functions. """ import sys -from pypy.annotation.model import SomeInteger, SomeObject, SomeChar, SomeBool -from pypy.annotation.model import SomeString, SomeTuple, s_Bool, SomeBuiltin -from pypy.annotation.model import SomeUnicodeCodePoint, SomeAddress -from pypy.annotation.model import SomeFloat, unionof, SomeUnicodeString -from pypy.annotation.model import SomePBC, SomeInstance, SomeDict, SomeList -from pypy.annotation.model import SomeWeakRef, SomeIterator -from pypy.annotation.model import SomeOOObject, SomeByteArray -from pypy.annotation.model import annotation_to_lltype, lltype_to_annotation, ll_to_annotation -from pypy.annotation.model import add_knowntypedata -from pypy.annotation.model import s_ImpossibleValue -from pypy.annotation.bookkeeper import getbookkeeper -from pypy.annotation import description -from pypy.objspace.flow.model import Constant -from pypy.tool.error import AnnotatorError -import pypy.rlib.rarithmetic -import pypy.rlib.objectmodel +from rpython.annotator.model import SomeInteger, SomeObject, SomeChar, SomeBool +from rpython.annotator.model import SomeString, SomeTuple, s_Bool, SomeBuiltin +from rpython.annotator.model import SomeUnicodeCodePoint, SomeAddress +from rpython.annotator.model import SomeFloat, unionof, SomeUnicodeString +from rpython.annotator.model import SomePBC, SomeInstance, SomeDict, SomeList +from rpython.annotator.model import SomeWeakRef, SomeIterator +from rpython.annotator.model import SomeOOObject, SomeByteArray +from rpython.annotator.model import annotation_to_lltype, lltype_to_annotation, ll_to_annotation +from rpython.annotator.model import add_knowntypedata +from rpython.annotator.model import s_ImpossibleValue +from rpython.annotator.bookkeeper import getbookkeeper +from rpython.annotator import description +from rpython.flowspace.model import Constant +from rpython.tool.error import AnnotatorError +import rpython.rlib.rarithmetic +import rpython.rlib.objectmodel # convenience only! def immutablevalue(x): @@ -124,7 +124,7 @@ def builtin_bytearray(s_str): def our_issubclass(cls1, cls2): """ we're going to try to be less silly in the face of old-style classes""" - from pypy.annotation.classdef import ClassDef + from rpython.annotator.classdef import ClassDef if cls2 is object: return True def classify(cls): @@ -156,7 +156,7 @@ def builtin_isinstance(s_obj, s_type, variables=None): r = SomeBool() if s_type.is_constant(): typ = s_type.const - if issubclass(typ, pypy.rlib.rarithmetic.base_int): + if issubclass(typ, rpython.rlib.rarithmetic.base_int): r.const = issubclass(s_obj.knowntype, typ) else: if typ == long: @@ -278,7 +278,7 @@ def rarith_intmask(s_obj): return SomeInteger() def rarith_longlongmask(s_obj): - return SomeInteger(knowntype=pypy.rlib.rarithmetic.r_longlong) + return SomeInteger(knowntype=rpython.rlib.rarithmetic.r_longlong) def robjmodel_instantiate(s_clspbc): assert isinstance(s_clspbc, SomePBC) @@ -307,8 +307,8 @@ def robjmodel_r_dict(s_eqfn, s_hashfn, s_force_non_null=None): def robjmodel_hlinvoke(s_repr, s_llcallable, *args_s): - from pypy.rpython import rmodel - from pypy.rpython.error import TyperError + from rpython.rtyper import rmodel + from rpython.rtyper.error import TyperError assert s_repr.is_constant() and isinstance(s_repr.const, rmodel.Repr), "hlinvoke expects a constant repr as first argument" r_func, nimplicitarg = s_repr.const.get_r_implfunc() @@ -329,7 +329,7 @@ def robjmodel_keepalive_until_here(*args_s): return immutablevalue(None) def llmemory_cast_ptr_to_adr(s): - from pypy.annotation.model import SomeInteriorPtr + from rpython.annotator.model import SomeInteriorPtr assert not isinstance(s, SomeInteriorPtr) return SomeAddress() @@ -360,16 +360,16 @@ for name, value in globals().items(): original = getattr(__builtin__, name[8:]) BUILTIN_ANALYZERS[original] = value -BUILTIN_ANALYZERS[pypy.rlib.rarithmetic.intmask] = rarith_intmask -BUILTIN_ANALYZERS[pypy.rlib.rarithmetic.longlongmask] = rarith_longlongmask -BUILTIN_ANALYZERS[pypy.rlib.objectmodel.instantiate] = robjmodel_instantiate -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.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 -BUILTIN_ANALYZERS[pypy.rpython.lltypesystem.llmemory.cast_int_to_adr] = llmemory_cast_int_to_adr +BUILTIN_ANALYZERS[rpython.rlib.rarithmetic.intmask] = rarith_intmask +BUILTIN_ANALYZERS[rpython.rlib.rarithmetic.longlongmask] = rarith_longlongmask +BUILTIN_ANALYZERS[rpython.rlib.objectmodel.instantiate] = robjmodel_instantiate +BUILTIN_ANALYZERS[rpython.rlib.objectmodel.r_dict] = robjmodel_r_dict +BUILTIN_ANALYZERS[rpython.rlib.objectmodel.hlinvoke] = robjmodel_hlinvoke +BUILTIN_ANALYZERS[rpython.rlib.objectmodel.keepalive_until_here] = robjmodel_keepalive_until_here +BUILTIN_ANALYZERS[rpython.rtyper.lltypesystem.llmemory.cast_ptr_to_adr] = llmemory_cast_ptr_to_adr +BUILTIN_ANALYZERS[rpython.rtyper.lltypesystem.llmemory.cast_adr_to_ptr] = llmemory_cast_adr_to_ptr +BUILTIN_ANALYZERS[rpython.rtyper.lltypesystem.llmemory.cast_adr_to_int] = llmemory_cast_adr_to_int +BUILTIN_ANALYZERS[rpython.rtyper.lltypesystem.llmemory.cast_int_to_adr] = llmemory_cast_int_to_adr BUILTIN_ANALYZERS[getattr(OSError.__init__, 'im_func', OSError.__init__)] = ( OSError_init) @@ -401,13 +401,13 @@ else: BUILTIN_ANALYZERS[__import__] = import_func # annotation of low-level types -from pypy.annotation.model import SomePtr -from pypy.rpython.lltypesystem import lltype +from rpython.annotator.model import SomePtr +from rpython.rtyper.lltypesystem import lltype def malloc(s_T, s_n=None, s_flavor=None, s_zero=None, s_track_allocation=None, s_add_memory_pressure=None): assert (s_n is None or s_n.knowntype == int - or issubclass(s_n.knowntype, pypy.rlib.rarithmetic.base_int)) + or issubclass(s_n.knowntype, rpython.rlib.rarithmetic.base_int)) assert s_T.is_constant() if s_n is not None: n = 1 @@ -524,8 +524,8 @@ BUILTIN_ANALYZERS[lltype.runtime_type_info] = runtime_type_info BUILTIN_ANALYZERS[lltype.Ptr] = constPtr # ootype -from pypy.annotation.model import SomeOOInstance, SomeOOClass, SomeOOStaticMeth -from pypy.rpython.ootypesystem import ootype +from rpython.annotator.model import SomeOOInstance, SomeOOClass, SomeOOStaticMeth +from rpython.rtyper.ootypesystem import ootype def new(I): assert I.is_constant() @@ -658,7 +658,7 @@ def llcast_weakrefptr_to_ptr(s_ptrtype, s_wref): "got %s" % (s_wref,)) return SomePtr(s_ptrtype.const) -from pypy.rpython.lltypesystem import llmemory +from rpython.rtyper.lltypesystem import llmemory BUILTIN_ANALYZERS[llmemory.weakref_create] = llweakref_create BUILTIN_ANALYZERS[llmemory.weakref_deref ] = llweakref_deref BUILTIN_ANALYZERS[llmemory.cast_ptr_to_weakrefptr] = llcast_ptr_to_weakrefptr @@ -670,7 +670,7 @@ BUILTIN_ANALYZERS[llmemory.cast_weakrefptr_to_ptr] = llcast_weakrefptr_to_ptr def robjmodel_free_non_gc_object(obj): pass -BUILTIN_ANALYZERS[pypy.rlib.objectmodel.free_non_gc_object] = ( +BUILTIN_ANALYZERS[rpython.rlib.objectmodel.free_non_gc_object] = ( robjmodel_free_non_gc_object) #_________________________________ diff --git a/pypy/annotation/classdef.py b/rpython/annotator/classdef.py similarity index 99% rename from pypy/annotation/classdef.py rename to rpython/annotator/classdef.py index f7b02258ba1673d4fbbfe65a2ccc5e5e67b4c53b..7686c3b8dc861b697c799a4a64125c15468b0913 100644 --- a/pypy/annotation/classdef.py +++ b/rpython/annotator/classdef.py @@ -1,9 +1,9 @@ """ Type inference for user-defined classes. """ -from pypy.annotation.model import SomePBC, s_ImpossibleValue, unionof -from pypy.annotation.model import SomeInteger, SomeTuple, SomeString -from pypy.annotation import description +from rpython.annotator.model import SomePBC, s_ImpossibleValue, unionof +from rpython.annotator.model import SomeInteger, SomeTuple, SomeString +from rpython.annotator import description # The main purpose of a ClassDef is to collect information about class/instance diff --git a/pypy/annotation/description.py b/rpython/annotator/description.py similarity index 95% rename from pypy/annotation/description.py rename to rpython/annotator/description.py index 2a01b197fe0f895358ad4efae8f0b23c983c2a02..fb907a11ef86aee4f83caa2875f47633c5125142 100644 --- a/pypy/annotation/description.py +++ b/rpython/annotator/description.py @@ -1,11 +1,11 @@ from __future__ import absolute_import import types, py -from pypy.annotation.signature import enforce_signature_args, enforce_signature_return -from pypy.objspace.flow.model import Constant, FunctionGraph -from pypy.objspace.flow.bytecode import cpython_code_signature -from pypy.objspace.flow.argument import rawshape, ArgErr -from pypy.tool.sourcetools import valid_identifier -from pypy.tool.pairtype import extendabletype +from rpython.annotator.signature import enforce_signature_args, enforce_signature_return +from rpython.flowspace.model import Constant, FunctionGraph +from rpython.flowspace.bytecode import cpython_code_signature +from rpython.flowspace.argument import rawshape, ArgErr +from rpython.tool.sourcetools import valid_identifier +from rpython.tool.pairtype import extendabletype class CallFamily(object): """A family of Desc objects that could be called from common call sites. @@ -74,7 +74,7 @@ class FrozenAttrFamily(object): try: return self.attrs[attrname] except KeyError: - from pypy.annotation.model import s_ImpossibleValue + from rpython.annotator.model import s_ImpossibleValue return s_ImpossibleValue def set_s_value(self, attrname, s_value): @@ -96,13 +96,13 @@ class ClassAttrFamily(object): # ClassAttrFamily is more precise: it is only about one attribut name. def __init__(self, desc): - from pypy.annotation.model import s_ImpossibleValue + from rpython.annotator.model import s_ImpossibleValue self.descs = { desc: True } self.read_locations = {} # set of position_keys self.s_value = s_ImpossibleValue # union of possible values def update(self, other): - from pypy.annotation.model import unionof + from rpython.annotator.model import unionof self.descs.update(other.descs) self.read_locations.update(other.read_locations) self.s_value = unionof(self.s_value, other.s_value) @@ -182,7 +182,7 @@ class FunctionDesc(Desc): name = pyobj.func_name if signature is None: if hasattr(pyobj, '_generator_next_method_of_'): - from pypy.objspace.flow.argument import Signature + from rpython.flowspace.argument import Signature signature = Signature(['entry']) # haaaaaack defaults = () else: @@ -282,7 +282,7 @@ class FunctionDesc(Desc): raise Exception("%r: signature and enforceargs cannot both be used" % (self,)) if enforceargs: if not callable(enforceargs): - from pypy.annotation.policy import Sig + from rpython.annotator.policy import Sig enforceargs = Sig(*enforceargs) self.pyobj._annenforceargs_ = enforceargs enforceargs(self, inputcells) # can modify inputcells in-place @@ -311,7 +311,7 @@ class FunctionDesc(Desc): # Some specializations may break the invariant of returning # annotations that are always more general than the previous time. # We restore it here: - from pypy.annotation.model import unionof + from rpython.annotator.model import unionof result = unionof(result, s_previous_result) return result @@ -344,7 +344,7 @@ class FunctionDesc(Desc): def row_to_consider(descs, args, op): # see comments in CallFamily - from pypy.annotation.model import s_ImpossibleValue + from rpython.annotator.model import s_ImpossibleValue row = {} for desc in descs: def enlist(graph, ignore): @@ -465,7 +465,7 @@ class ClassDesc(Desc): if (self.is_builtin_exception_class() and self.all_enforced_attrs is None): - from pypy.annotation import classdef + from rpython.annotator import classdef if self.pyobj not in classdef.FORCE_ATTRIBUTES_INTO_CLASSES: self.all_enforced_attrs = [] # no attribute allowed @@ -477,7 +477,7 @@ class ClassDesc(Desc): if self.specialize: # make a custom funcdesc that specializes on its first # argument (i.e. 'self'). - from pypy.annotation.specialize import specialize_argtype + from rpython.annotator.specialize import specialize_argtype def argtype0(funcdesc, args_s): return specialize_argtype(funcdesc, args_s, 0) funcdesc = FunctionDesc(self.bookkeeper, value, @@ -502,7 +502,7 @@ class ClassDesc(Desc): if name == '__init__' and self.is_builtin_exception_class(): # pretend that built-in exceptions have no __init__, # unless explicitly specified in builtin.py - from pypy.annotation.builtin import BUILTIN_ANALYZERS + from rpython.annotator.builtin import BUILTIN_ANALYZERS value = getattr(value, 'im_func', value) if value not in BUILTIN_ANALYZERS: return @@ -544,7 +544,7 @@ class ClassDesc(Desc): try: return self._classdefs[key] except KeyError: - from pypy.annotation.classdef import ClassDef, FORCE_ATTRIBUTES_INTO_CLASSES + from rpython.annotator.classdef import ClassDef, FORCE_ATTRIBUTES_INTO_CLASSES classdef = ClassDef(self.bookkeeper, self) self.bookkeeper.classdefs.append(classdef) self._classdefs[key] = classdef @@ -565,7 +565,7 @@ class ClassDesc(Desc): classdef.setup(classsources) # look for a __del__ method and annotate it if it's there if '__del__' in self.classdict: - from pypy.annotation.model import s_None, SomeInstance + from rpython.annotator.model import s_None, SomeInstance s_func = self.s_read_attribute('__del__') args_s = [SomeInstance(classdef)] s = self.bookkeeper.emulate_pbc_call(classdef, s_func, args_s) @@ -579,7 +579,7 @@ class ClassDesc(Desc): return self.getclassdef(None) def pycall(self, schedule, args, s_previous_result, op=None): - from pypy.annotation.model import SomeInstance, SomeImpossibleValue + from rpython.annotator.model import SomeInstance, SomeImpossibleValue if self.specialize: if self.specialize == 'specialize:ctr_location': # We use the SomeInstance annotation returned the last time @@ -613,7 +613,7 @@ class ClassDesc(Desc): except ValueError: pass else: - from pypy.annotation.model import SomePtr + from rpython.annotator.model import SomePtr assert not isinstance(s_arg, SomePtr) else: # call the constructor @@ -656,7 +656,7 @@ class ClassDesc(Desc): # look up an attribute in the class cdesc = self.lookup(name) if cdesc is None: - from pypy.annotation.model import s_ImpossibleValue + from rpython.annotator.model import s_ImpossibleValue return s_ImpossibleValue else: # delegate to s_get_value to turn it into an annotation @@ -675,7 +675,7 @@ class ClassDesc(Desc): if classdef is not None: s_value = s_value.bind_callables_under(classdef, name) elif isinstance(obj, Desc): - from pypy.annotation.model import SomePBC + from rpython.annotator.model import SomePBC if classdef is not None: obj = obj.bind_under(classdef, name) s_value = SomePBC([obj]) @@ -705,7 +705,7 @@ class ClassDesc(Desc): # either 'lst[*]' or 'lst?[*]' # should really return an immutable list as a result. Implemented # by changing the result's annotation (but not, of course, doing an - # actual copy in the rtyper). Tested in pypy.rpython.test.test_rlist, + # actual copy in the rtyper). Tested in rpython.rtyper.test.test_rlist, # test_immutable_list_out_of_instance. search1 = '%s[*]' % (attr,) search2 = '%s?[*]' % (attr,) @@ -722,7 +722,7 @@ class ClassDesc(Desc): return s_result # common case def consider_call_site(bookkeeper, family, descs, args, s_result, op): - from pypy.annotation.model import SomeInstance, SomePBC, s_None + from rpython.annotator.model import SomeInstance, SomePBC, s_None if len(descs) == 1: # call to a single class, look at the result annotation # in case it was specialized @@ -840,7 +840,7 @@ class MethodDesc(Desc): return self.funcdesc.getuniquegraph() def pycall(self, schedule, args, s_previous_result, op=None): - from pypy.annotation.model import SomeInstance + from rpython.annotator.model import SomeInstance if self.selfclassdef is None: raise Exception("calling %r" % (self,)) s_instance = SomeInstance(self.selfclassdef, flags = self.flags) @@ -962,7 +962,7 @@ class FrozenDesc(Desc): try: value = self.read_attribute(attr) except AttributeError: - from pypy.annotation.model import s_ImpossibleValue + from rpython.annotator.model import s_ImpossibleValue return s_ImpossibleValue else: return self.bookkeeper.immutablevalue(value) @@ -1014,7 +1014,7 @@ class MethodOfFrozenDesc(Desc): self.frozendesc) def pycall(self, schedule, args, s_previous_result, op=None): - from pypy.annotation.model import SomePBC + from rpython.annotator.model import SomePBC s_self = SomePBC([self.frozendesc]) args = args.prepend(s_self) return self.funcdesc.pycall(schedule, args, s_previous_result, op) diff --git a/pypy/annotation/dictdef.py b/rpython/annotator/dictdef.py similarity index 92% rename from pypy/annotation/dictdef.py rename to rpython/annotator/dictdef.py index 48338b3f9148bd3ecf228edd527df75c09bc4d0b..2068cfc0d7994b307363f0924248ad0b6493896d 100644 --- a/pypy/annotation/dictdef.py +++ b/rpython/annotator/dictdef.py @@ -1,8 +1,8 @@ -from pypy.annotation.model import SomeObject, s_ImpossibleValue -from pypy.annotation.model import SomeInteger, s_Bool, unionof -from pypy.annotation.model import SomeInstance -from pypy.annotation.listdef import ListItem -from pypy.rlib.objectmodel import compute_hash +from rpython.annotator.model import SomeObject, s_ImpossibleValue +from rpython.annotator.model import SomeInteger, s_Bool, unionof +from rpython.annotator.model import SomeInstance +from rpython.annotator.listdef import ListItem +from rpython.rlib.objectmodel import compute_hash class DictKey(ListItem): @@ -97,7 +97,7 @@ class DictDef(object): def read_key(self, position_key=None): if position_key is None: if self.bookkeeper is None: # for tests - from pypy.annotation.bookkeeper import getbookkeeper + from rpython.annotator.bookkeeper import getbookkeeper position_key = getbookkeeper().position_key else: position_key = self.bookkeeper.position_key @@ -107,7 +107,7 @@ class DictDef(object): def read_value(self, position_key=None): if position_key is None: if self.bookkeeper is None: # for tests - from pypy.annotation.bookkeeper import getbookkeeper + from rpython.annotator.bookkeeper import getbookkeeper position_key = getbookkeeper().position_key else: position_key = self.bookkeeper.position_key diff --git a/pypy/annotation/listdef.py b/rpython/annotator/listdef.py similarity index 96% rename from pypy/annotation/listdef.py rename to rpython/annotator/listdef.py index 708cdb085565cfee856e57c997475f87a6f58aae..041aae2f0303ea436c5aef60ad7416d5405c7232 100644 --- a/pypy/annotation/listdef.py +++ b/rpython/annotator/listdef.py @@ -1,6 +1,6 @@ -from pypy.annotation.model import SomeObject, s_ImpossibleValue -from pypy.annotation.model import SomeList, SomeString -from pypy.annotation.model import unionof, TLS, UnionError +from rpython.annotator.model import SomeObject, s_ImpossibleValue +from rpython.annotator.model import SomeList, SomeString +from rpython.annotator.model import unionof, TLS, UnionError class TooLateForChange(Exception): @@ -135,7 +135,7 @@ class ListDef(object): def getbookkeeper(self): if self.bookkeeper is None: - from pypy.annotation.bookkeeper import getbookkeeper + from rpython.annotator.bookkeeper import getbookkeeper return getbookkeeper() else: return self.bookkeeper diff --git a/pypy/annotation/model.py b/rpython/annotator/model.py similarity index 97% rename from pypy/annotation/model.py rename to rpython/annotator/model.py index 1795131e490eb96fb3d350b97dbbafba3ad76d95..9a5acbd2f40a511dfe17df1251fcc4117e4b5509 100644 --- a/pypy/annotation/model.py +++ b/rpython/annotator/model.py @@ -32,9 +32,9 @@ from __future__ import absolute_import from types import BuiltinFunctionType, MethodType, FunctionType import pypy from pypy.tool import descriptor -from pypy.tool.pairtype import pair, extendabletype -from pypy.rlib.rarithmetic import r_uint, r_ulonglong, base_int -from pypy.rlib.rarithmetic import r_singlefloat, r_longfloat +from rpython.tool.pairtype import pair, extendabletype +from rpython.rlib.rarithmetic import r_uint, r_ulonglong, base_int +from rpython.rlib.rarithmetic import r_singlefloat, r_longfloat import inspect, weakref class State(object): @@ -139,7 +139,7 @@ class SomeFloat(SomeObject): def __eq__(self, other): if (type(self) is SomeFloat and type(other) is SomeFloat and self.is_constant() and other.is_constant()): - from pypy.rlib.rfloat import isnan, copysign + from rpython.rlib.rfloat import isnan, copysign # NaN unpleasantness. if isnan(self.const) and isnan(other.const): return True @@ -187,7 +187,7 @@ class SomeInteger(SomeFloat): self.knowntype = knowntype unsigned = self.knowntype(-1) > 0 self.nonneg = unsigned or nonneg - self.unsigned = unsigned # pypy.rlib.rarithmetic.r_uint + self.unsigned = unsigned # rpython.rlib.rarithmetic.r_uint class SomeBool(SomeInteger): "Stands for true or false." @@ -391,7 +391,7 @@ class SomePBC(SomeObject): if desc.pyobj is not None: self.const = desc.pyobj elif len(descriptions) > 1: - from pypy.annotation.description import ClassDesc + from rpython.annotator.description import ClassDesc if self.getKind() is ClassDesc: # a PBC of several classes: enforce them all to be # built, without support for specialization. See @@ -484,7 +484,7 @@ class SomeBuiltinMethod(SomeBuiltin): class SomeExternalObject(SomeObject): """Stands for an object of 'external' type. External types have a Repr - controlled by pypy.rpython.extregistry.""" + controlled by rpython.rtyper.extregistry.""" def __init__(self, knowntype): self.knowntype = knowntype @@ -521,7 +521,7 @@ class SomeWeakRef(SomeObject): # ____________________________________________________________ # memory addresses -from pypy.rpython.lltypesystem import llmemory +from rpython.rtyper.lltypesystem import llmemory class SomeAddress(SomeObject): immutable = True @@ -546,8 +546,8 @@ class SomeTypedAddressAccess(SomeObject): #____________________________________________________________ # annotation of low-level types -from pypy.rpython.lltypesystem import lltype -from pypy.rpython.ootypesystem import ootype +from rpython.rtyper.lltypesystem import lltype +from rpython.rtyper.ootypesystem import ootype class SomePtr(SomeObject): knowntype = lltype._ptr @@ -748,7 +748,7 @@ def missing_operation(cls, name): for arg in flattened: if arg.__class__ is SomeObject and arg.knowntype is not type: return SomeObject() - bookkeeper = pypy.annotation.bookkeeper.getbookkeeper() + bookkeeper = rpython.annotator.bookkeeper.getbookkeeper() bookkeeper.warning("no precise annotation supplied for %s%r" % (name, args)) return s_ImpossibleValue setattr(cls, name, default_op) diff --git a/pypy/annotation/policy.py b/rpython/annotator/policy.py similarity index 82% rename from pypy/annotation/policy.py rename to rpython/annotator/policy.py index 60be645dc84bbe8d0418e788f011fd030e8c68de..0bffb7de5be642cf0bcf5dd9f7c885af64294d90 100644 --- a/pypy/annotation/policy.py +++ b/rpython/annotator/policy.py @@ -1,12 +1,12 @@ # base annotation policy for specialization -from pypy.annotation.specialize import default_specialize as default -from pypy.annotation.specialize import specialize_argvalue, specialize_argtype, specialize_arglistitemtype, specialize_arg_or_var -from pypy.annotation.specialize import memo, specialize_call_location +from rpython.annotator.specialize import default_specialize as default +from rpython.annotator.specialize import specialize_argvalue, specialize_argtype, specialize_arglistitemtype, specialize_arg_or_var +from rpython.annotator.specialize import memo, specialize_call_location # for some reason, model must be imported first, # or we create a cycle. -from pypy.annotation import model as annmodel -from pypy.annotation.bookkeeper import getbookkeeper -from pypy.annotation.signature import Sig +from rpython.annotator import model as annmodel +from rpython.annotator.bookkeeper import getbookkeeper +from rpython.annotator.signature import Sig class BasicAnnotatorPolicy(object): @@ -73,9 +73,9 @@ class AnnotatorPolicy(BasicAnnotatorPolicy): specialize__call_location = staticmethod(specialize_call_location) def specialize__ll(pol, *args): - from pypy.rpython.annlowlevel import LowLevelAnnotatorPolicy + from rpython.rtyper.annlowlevel import LowLevelAnnotatorPolicy return LowLevelAnnotatorPolicy.default_specialize(*args) def specialize__ll_and_arg(pol, *args): - from pypy.rpython.annlowlevel import LowLevelAnnotatorPolicy + from rpython.rtyper.annlowlevel import LowLevelAnnotatorPolicy return LowLevelAnnotatorPolicy.specialize__ll_and_arg(*args) diff --git a/pypy/annotation/signature.py b/rpython/annotator/signature.py similarity index 92% rename from pypy/annotation/signature.py rename to rpython/annotator/signature.py index 5173bd0ddd29ee2b5fb56f38c9674b09bfe8ada3..064eae788f56a800adc817cf6137f79c39ff0bd7 100644 --- a/pypy/annotation/signature.py +++ b/rpython/annotator/signature.py @@ -2,17 +2,17 @@ from __future__ import absolute_import import types -from pypy.annotation.model import SomeBool, SomeInteger, SomeString,\ +from rpython.annotator.model import SomeBool, SomeInteger, SomeString,\ SomeFloat, SomeList, SomeDict, s_None, \ SomeObject, SomeInstance, SomeTuple, lltype_to_annotation,\ unionof, SomeUnicodeString, SomeType -from pypy.annotation.listdef import ListDef -from pypy.annotation.dictdef import DictDef +from rpython.annotator.listdef import ListDef +from rpython.annotator.dictdef import DictDef _annotation_cache = {} def _annotation_key(t): - from pypy.rpython import extregistry + from rpython.rtyper import extregistry if type(t) is list: assert len(t) == 1 return ('list', _annotation_key(t[0])) @@ -38,8 +38,8 @@ def annotation(t, bookkeeper=None): return _compute_annotation(t, bookkeeper) def _compute_annotation(t, bookkeeper=None): - from pypy.rpython.lltypesystem import lltype - from pypy.rpython import extregistry + from rpython.rtyper.lltypesystem import lltype + from rpython.rtyper import extregistry if isinstance(t, SomeObject): return t elif isinstance(t, lltype.LowLevelType): @@ -65,7 +65,7 @@ def _compute_annotation(t, bookkeeper=None): return annotationoftype(t, bookkeeper) def annotationoftype(t, bookkeeper=False): - from pypy.rpython import extregistry + from rpython.rtyper import extregistry """The most precise SomeValue instance that contains all objects of type t.""" @@ -99,9 +99,9 @@ class Sig(object): self.argtypes = argtypes def __call__(self, funcdesc, inputcells): - from pypy.rpython.lltypesystem import lltype + from rpython.rtyper.lltypesystem import lltype args_s = [] - from pypy.annotation import model as annmodel + from rpython.annotator import model as annmodel for i, argtype in enumerate(self.argtypes): if isinstance(argtype, (types.FunctionType, types.MethodType)): argtype = argtype(*inputcells) @@ -132,7 +132,7 @@ class Sig(object): inputcells[:] = args_s def finish_type(paramtype, bookkeeper, func): - from pypy.rlib.types import SelfTypeMarker + from rpython.rlib.types import SelfTypeMarker if isinstance(paramtype, SomeObject): return paramtype elif isinstance(paramtype, SelfTypeMarker): diff --git a/pypy/annotation/specialize.py b/rpython/annotator/specialize.py similarity index 96% rename from pypy/annotation/specialize.py rename to rpython/annotator/specialize.py index 78aa70457ff04d259334bde7e22c3d0b92caff4f..378054208acdaff8d71fb0848fdc4190e2a7bd4d 100644 --- a/pypy/annotation/specialize.py +++ b/rpython/annotator/specialize.py @@ -1,12 +1,12 @@ # specialization support import py -from pypy.tool.uid import uid -from pypy.tool.sourcetools import func_with_new_name -from pypy.tool.algo.unionfind import UnionFind -from pypy.objspace.flow.model import Block, Link, Variable, SpaceOperation -from pypy.objspace.flow.model import Constant, checkgraph -from pypy.annotation import model as annmodel -from pypy.objspace.flow.argument import Signature +from rpython.tool.uid import uid +from rpython.tool.sourcetools import func_with_new_name +from rpython.tool.algo.unionfind import UnionFind +from rpython.flowspace.model import Block, Link, Variable, SpaceOperation +from rpython.flowspace.model import Constant, checkgraph +from rpython.annotator import model as annmodel +from rpython.flowspace.argument import Signature def flatten_star_args(funcdesc, args_s): argnames, vararg, kwarg = funcdesc.signature @@ -125,7 +125,7 @@ class MemoTable(object): def finish(self): if self.do_not_process: return - from pypy.annotation.model import unionof + from rpython.annotator.model import unionof assert self.graph is None, "MemoTable already finished" # list of which argument positions can take more than one value example_args, example_value = self.table.iteritems().next() @@ -248,8 +248,8 @@ class MemoTable(object): def memo(funcdesc, arglist_s): - from pypy.annotation.model import SomePBC, SomeImpossibleValue, SomeBool - from pypy.annotation.model import unionof + from rpython.annotator.model import SomePBC, SomeImpossibleValue, SomeBool + from rpython.annotator.model import unionof # call the function now, and collect possible results argvalues = [] for s in arglist_s: @@ -335,7 +335,7 @@ def maybe_star_args(funcdesc, key, args_s): return funcdesc.cachedgraph(key, builder=builder) def specialize_argvalue(funcdesc, args_s, *argindices): - from pypy.annotation.model import SomePBC + from rpython.annotator.model import SomePBC key = [] for i in argindices: s = args_s[i] diff --git a/pypy/jit/__init__.py b/rpython/annotator/test/__init__.py similarity index 100% rename from pypy/jit/__init__.py rename to rpython/annotator/test/__init__.py diff --git a/pypy/annotation/test/test_annmm.py b/rpython/annotator/test/test_annmm.py similarity index 94% rename from pypy/annotation/test/test_annmm.py rename to rpython/annotator/test/test_annmm.py index 3ca2f52ae6d831d0fd5a339da8bcd88ba331a277..7902ad581daf449f16c00ca77842b11f33a21f72 100644 --- a/pypy/annotation/test/test_annmm.py +++ b/rpython/annotator/test/test_annmm.py @@ -1,7 +1,5 @@ -import autopath - from pypy.objspace.std.multimethod import * -from pypy.annotation.annrpython import RPythonAnnotator +from rpython.annotator.annrpython import RPythonAnnotator class W_Root(object): pass diff --git a/pypy/annotation/test/test_annrpython.py b/rpython/annotator/test/test_annrpython.py similarity index 98% rename from pypy/annotation/test/test_annrpython.py rename to rpython/annotator/test/test_annrpython.py index 81e5e0c8b1ad66adce969cc38ee864172fb4dbc1..6cbd596302c7d887957e21c081a363acb2696b64 100644 --- a/pypy/annotation/test/test_annrpython.py +++ b/rpython/annotator/test/test_annrpython.py @@ -3,19 +3,19 @@ import py.test import sys from pypy import conftest -from pypy.annotation import model as annmodel -from pypy.annotation.annrpython import RPythonAnnotator as _RPythonAnnotator -from pypy.translator.translator import graphof as tgraphof -from pypy.annotation import policy -from pypy.annotation.listdef import ListDef, ListChangeUnallowed -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.rlib.rarithmetic import r_singlefloat -from pypy.rlib import objectmodel -from pypy.objspace.flow.objspace import FlowObjSpace, FlowingError - -from pypy.translator.test import snippet +from rpython.annotator import model as annmodel +from rpython.annotator.annrpython import RPythonAnnotator as _RPythonAnnotator +from rpython.translator.translator import graphof as tgraphof +from rpython.annotator import policy +from rpython.annotator.listdef import ListDef, ListChangeUnallowed +from rpython.annotator.dictdef import DictDef +from rpython.flowspace.model import * +from rpython.rlib.rarithmetic import r_uint, base_int, r_longlong, r_ulonglong +from rpython.rlib.rarithmetic import r_singlefloat +from rpython.rlib import objectmodel +from rpython.flowspace.objspace import FlowObjSpace, FlowingError + +from rpython.translator.test import snippet def graphof(a, func): return tgraphof(a.translator, func) @@ -1998,9 +1998,9 @@ class TestAnnotateTestCase: def test_emulated_pbc_call_simple(self): def f(a,b): return a + b - from pypy.annotation import annrpython + from rpython.annotator import annrpython a = annrpython.RPythonAnnotator() - from pypy.annotation import model as annmodel + from rpython.annotator import model as annmodel s_f = a.bookkeeper.immutablevalue(f) a.bookkeeper.emulate_pbc_call('f', s_f, [annmodel.SomeInteger(), annmodel.SomeInteger()]) @@ -2017,9 +2017,9 @@ class TestAnnotateTestCase: def test_emulated_pbc_call_callback(self): def f(a,b): return a + b - from pypy.annotation import annrpython + from rpython.annotator import annrpython a = annrpython.RPythonAnnotator() - from pypy.annotation import model as annmodel + from rpython.annotator import model as annmodel memo = [] def callb(ann, graph): @@ -2791,7 +2791,7 @@ class TestAnnotateTestCase: if works: a.build_types(fun, [int]) else: - from pypy.annotation.classdef import NoSuchAttrError + from rpython.annotator.classdef import NoSuchAttrError py.test.raises(NoSuchAttrError, a.build_types, fun, [int]) def test_slots_enforce_attrs(self): @@ -2840,7 +2840,7 @@ class TestAnnotateTestCase: if works: a.build_types(fun, [int]) else: - from pypy.annotation.classdef import NoSuchAttrError + from rpython.annotator.classdef import NoSuchAttrError py.test.raises(NoSuchAttrError, a.build_types, fun, [int]) def test_attrs_enforce_attrs(self): @@ -2989,7 +2989,7 @@ class TestAnnotateTestCase: def test_long_as_intermediate_value(self): from sys import maxint - from pypy.rlib.rarithmetic import intmask + from rpython.rlib.rarithmetic import intmask def fun(x): if x > 0: v = maxint @@ -3002,7 +3002,7 @@ class TestAnnotateTestCase: assert isinstance(s, annmodel.SomeInteger) def test_instance_with_flags(self): - from pypy.rlib.jit import hint + from rpython.rlib.jit import hint class A: _virtualizable2_ = [] @@ -3042,7 +3042,7 @@ class TestAnnotateTestCase: assert s.items[2].flags == {} def test_no_access_directly_on_heap(self): - from pypy.rlib.jit import hint + from rpython.rlib.jit import hint class A: _virtualizable2_ = [] @@ -3100,7 +3100,7 @@ class TestAnnotateTestCase: py.test.raises(AssertionError, a.build_types, f, []) def test_ctr_location(self): - from pypy.rlib.jit import hint + from rpython.rlib.jit import hint class A: _annspecialcase_ = 'specialize:ctr_location' @@ -3371,7 +3371,7 @@ class TestAnnotateTestCase: assert isinstance(s, annmodel.SomeInteger) def test_listitem_no_mutating(self): - from pypy.rlib.debug import check_annotation + from rpython.rlib.debug import check_annotation called = [] def checker(ann, bk): @@ -3393,7 +3393,7 @@ class TestAnnotateTestCase: assert called def test_listitem_no_mutating2(self): - from pypy.rlib.debug import make_sure_not_resized + from rpython.rlib.debug import make_sure_not_resized def f(): return make_sure_not_resized([1,2,3]) @@ -3415,7 +3415,7 @@ class TestAnnotateTestCase: py.test.raises(ListChangeUnallowed, a.build_types, fn, [int]) def test_listitem_never_resize(self): - from pypy.rlib.debug import check_annotation + from rpython.rlib.debug import check_annotation def checker(ann, bk): ann.listdef.never_resize() @@ -3500,7 +3500,7 @@ class TestAnnotateTestCase: assert a.bookkeeper.getdesc(f).getuniquegraph() def test_cannot_raise_ll_exception(self): - from pypy.rpython.annlowlevel import cast_instance_to_base_ptr + from rpython.rtyper.annlowlevel import cast_instance_to_base_ptr # def f(): e = OverflowError() @@ -3541,7 +3541,7 @@ class TestAnnotateTestCase: assert not s.is_constant() def test_make_sure_not_resized(self): - from pypy.rlib.debug import make_sure_not_resized + from rpython.rlib.debug import make_sure_not_resized def pycode(consts): make_sure_not_resized(consts) @@ -3688,7 +3688,7 @@ class TestAnnotateTestCase: assert isinstance(s, annmodel.SomeInteger) def test_join_none_and_nonnull(self): - from pypy.rlib.rstring import assert_str0 + from rpython.rlib.rstring import assert_str0 def f(i): a = str(i) diff --git a/pypy/annotation/test/test_annsimplifyrpython.py b/rpython/annotator/test/test_annsimplifyrpython.py similarity index 76% rename from pypy/annotation/test/test_annsimplifyrpython.py rename to rpython/annotator/test/test_annsimplifyrpython.py index 06f52b2ba70337c7af33b9341d960236de9e3784..e24912778ebb7195368661cc7bb5dadd6417b054 100644 --- a/pypy/annotation/test/test_annsimplifyrpython.py +++ b/rpython/annotator/test/test_annsimplifyrpython.py @@ -1,6 +1,5 @@ -import autopath -import pypy.annotation.test.test_annrpython -parent = pypy.annotation.test.test_annrpython.TestAnnotateTestCase +import rpython.annotator.test.test_annrpython +parent = rpython.annotator.test.test_annrpython.TestAnnotateTestCase class TestAnnotateAndSimplifyTestCase(parent): diff --git a/pypy/annotation/test/test_description.py b/rpython/annotator/test/test_description.py similarity index 91% rename from pypy/annotation/test/test_description.py rename to rpython/annotator/test/test_description.py index 9882b9ede180885faf76ddf000a76c99e4756645..6a5f1dcdf49cdb6d8c44dd8f3aa38ae9d4ca7d85 100644 --- a/pypy/annotation/test/test_description.py +++ b/rpython/annotator/test/test_description.py @@ -1,4 +1,4 @@ -from pypy.annotation.description import ClassDesc +from rpython.annotator.description import ClassDesc class FakeBookkeeper: def __init__(self): diff --git a/pypy/annotation/test/test_model.py b/rpython/annotator/test/test_model.py similarity index 97% rename from pypy/annotation/test/test_model.py rename to rpython/annotator/test/test_model.py index 2eb87cd6d66ee4fc4c4078b9306545b89345cf2f..4a3897aa90a8f408f2ca46eb5456e767f2c00b20 100644 --- a/pypy/annotation/test/test_model.py +++ b/rpython/annotator/test/test_model.py @@ -1,9 +1,7 @@ - -import autopath import py -from pypy.annotation.model import * -from pypy.annotation.listdef import ListDef -from pypy.rpython.ootypesystem.ootype import ROOT +from rpython.annotator.model import * +from rpython.annotator.listdef import ListDef +from rpython.rtyper.ootypesystem.ootype import ROOT listdef1 = ListDef(None, SomeTuple([SomeInteger(nonneg=True), SomeString()])) @@ -121,7 +119,7 @@ def test_ll_to_annotation(): assert isinstance(s_p, SomeOOInstance) and s_p.ootype == C def test_annotation_to_lltype(): - from pypy.rlib.rarithmetic import r_uint, r_singlefloat + from rpython.rlib.rarithmetic import r_uint, r_singlefloat s_i = SomeInteger() s_pos = SomeInteger(nonneg=True) s_1 = SomeInteger(nonneg=True); s_1.const = 1 diff --git a/pypy/annotation/test/test_signature.py b/rpython/annotator/test/test_signature.py similarity index 80% rename from pypy/annotation/test/test_signature.py rename to rpython/annotator/test/test_signature.py index a1d9ead7a1eb0bde9a3f56c290f4d136e8e06b8e..322ffd178c481ee6c2e83cd6ff96fc7758e17b51 100644 --- a/pypy/annotation/test/test_signature.py +++ b/rpython/annotator/test/test_signature.py @@ -1,5 +1,5 @@ import py -from pypy.annotation.signature import _annotation_key, annotation +from rpython.annotator.signature import _annotation_key, annotation def test__annotation_key(): assert _annotation_key([[str]]) == ('list', ('list', str)) @@ -9,7 +9,7 @@ def test__annotation_key(): def test_genericcallable(): py.test.skip("this two annotations should be equal - fix!") - from pypy.rpython.extfunc import genericcallable + from rpython.rtyper.extfunc import genericcallable s1 = annotation([genericcallable([str], int)]) s2 = annotation([genericcallable([str], int)]) assert s1 == s2 diff --git a/pypy/annotation/unaryop.py b/rpython/annotator/unaryop.py similarity index 97% rename from pypy/annotation/unaryop.py rename to rpython/annotator/unaryop.py index 0b3a2a553f12f113d414978072706927371e101a..4455c4b688a9ca9e9d6c116d52cee4a131d0e195 100644 --- a/pypy/annotation/unaryop.py +++ b/rpython/annotator/unaryop.py @@ -5,7 +5,7 @@ Unary operations on SomeValues. from __future__ import absolute_import from types import MethodType -from pypy.annotation.model import \ +from rpython.annotator.model import \ SomeObject, SomeInteger, SomeBool, SomeString, SomeChar, SomeList, \ SomeDict, SomeTuple, SomeImpossibleValue, SomeUnicodeCodePoint, \ SomeInstance, SomeBuiltin, SomeFloat, SomeIterator, SomePBC, \ @@ -13,11 +13,11 @@ from pypy.annotation.model import \ s_ImpossibleValue, s_Bool, s_None, \ unionof, missing_operation, add_knowntypedata, HarmlesslyBlocked, \ SomeGenericCallable, SomeWeakRef, SomeUnicodeString -from pypy.annotation.bookkeeper import getbookkeeper -from pypy.annotation import builtin -from pypy.annotation.binaryop import _clone ## XXX where to put this? -from pypy.rpython import extregistry -from pypy.tool.error import AnnotatorError +from rpython.annotator.bookkeeper import getbookkeeper +from rpython.annotator import builtin +from rpython.annotator.binaryop import _clone ## XXX where to put this? +from rpython.rtyper import extregistry +from rpython.tool.error import AnnotatorError # convenience only! def immutablevalue(x): @@ -766,9 +766,9 @@ class __extend__(SomeExternalObject): return s_Bool # annotation of low-level types -from pypy.annotation.model import SomePtr, SomeLLADTMeth -from pypy.annotation.model import SomeOOInstance, SomeOOBoundMeth, SomeOOStaticMeth -from pypy.annotation.model import ll_to_annotation, lltype_to_annotation, annotation_to_lltype +from rpython.annotator.model import SomePtr, SomeLLADTMeth +from rpython.annotator.model import SomeOOInstance, SomeOOBoundMeth, SomeOOStaticMeth +from rpython.annotator.model import ll_to_annotation, lltype_to_annotation, annotation_to_lltype class __extend__(SomePtr): @@ -782,7 +782,7 @@ class __extend__(SomePtr): return ll_to_annotation(v) else: if isinstance(v, MethodType): - from pypy.rpython.lltypesystem import lltype + from rpython.rtyper.lltypesystem import lltype ll_ptrtype = lltype.typeOf(v.im_self) assert isinstance(ll_ptrtype, (lltype.Ptr, lltype.InteriorPtr)) return SomeLLADTMeth(ll_ptrtype, v.im_func) @@ -822,7 +822,7 @@ class __extend__(SomeLLADTMeth): s_func = bookkeeper.immutablevalue(adtmeth.func) return s_func.call(args.prepend(lltype_to_annotation(adtmeth.ll_ptrtype))) -from pypy.rpython.ootypesystem import ootype +from rpython.rtyper.ootypesystem import ootype class __extend__(SomeOOInstance): def getattr(r, s_attr): assert s_attr.is_constant(), "getattr on ref %r with non-constant field-name" % r.ootype @@ -885,7 +885,7 @@ class __extend__(SomeWeakRef): #_________________________________________ # memory addresses -from pypy.rpython.lltypesystem import llmemory +from rpython.rtyper.lltypesystem import llmemory class __extend__(SomeAddress): def getattr(s_addr, s_attr): diff --git a/pypy/jit/backend/__init__.py b/rpython/flowspace/__init__.py similarity index 100% rename from pypy/jit/backend/__init__.py rename to rpython/flowspace/__init__.py diff --git a/pypy/objspace/flow/argument.py b/rpython/flowspace/argument.py similarity index 100% rename from pypy/objspace/flow/argument.py rename to rpython/flowspace/argument.py diff --git a/pypy/objspace/flow/bytecode.py b/rpython/flowspace/bytecode.py similarity index 94% rename from pypy/objspace/flow/bytecode.py rename to rpython/flowspace/bytecode.py index 1d8bef581b61ae8bb9d55761737fbf09e2986ea1..8c5fe763220a48000a7d0631fc9de2e0c8565741 100644 --- a/pypy/objspace/flow/bytecode.py +++ b/rpython/flowspace/bytecode.py @@ -1,10 +1,10 @@ """ Bytecode handling classes and functions for use by the flow space. """ -from pypy.tool.stdlib_opcode import (host_bytecode_spec, EXTENDED_ARG, +from rpython.tool.stdlib_opcode import (host_bytecode_spec, EXTENDED_ARG, HAVE_ARGUMENT) -from pypy.objspace.flow.argument import Signature -from pypy.objspace.flow.flowcontext import BytecodeCorruption +from rpython.flowspace.argument import Signature +from rpython.flowspace.flowcontext import BytecodeCorruption CO_GENERATOR = 0x0020 CO_VARARGS = 0x0004 diff --git a/pypy/objspace/flow/flowcontext.py b/rpython/flowspace/flowcontext.py similarity index 99% rename from pypy/objspace/flow/flowcontext.py rename to rpython/flowspace/flowcontext.py index 46ffbf2310ab5920fa7f88b0f8eef4b0dc76767c..b0d962eca073df3afe9ab4a05d864e50b83a7f94 100644 --- a/pypy/objspace/flow/flowcontext.py +++ b/rpython/flowspace/flowcontext.py @@ -1,18 +1,18 @@ """Implements the core parts of flow graph creation, in tandem -with pypy.objspace.flow.objspace. +with rpython.flowspace.objspace. """ import sys import collections -from pypy.tool.error import source_lines -from pypy.tool.stdlib_opcode import host_bytecode_spec -from pypy.objspace.flow.argument import ArgumentsForTranslation -from pypy.objspace.flow.model import (Constant, Variable, Block, Link, +from rpython.tool.error import source_lines +from rpython.tool.stdlib_opcode import host_bytecode_spec +from rpython.flowspace.argument import ArgumentsForTranslation +from rpython.flowspace.model import (Constant, Variable, Block, Link, UnwrapException, c_last_exception) -from pypy.objspace.flow.framestate import (FrameState, recursively_unflatten, +from rpython.flowspace.framestate import (FrameState, recursively_unflatten, recursively_flatten) -from pypy.objspace.flow.specialcase import (rpython_print_item, +from rpython.flowspace.specialcase import (rpython_print_item, rpython_print_newline) class FlowingError(Exception): diff --git a/pypy/objspace/flow/framestate.py b/rpython/flowspace/framestate.py similarity index 97% rename from pypy/objspace/flow/framestate.py rename to rpython/flowspace/framestate.py index c475916f15588f9215d3e0bd9d0f1b08428313ca..314a5b29844ed343d16b1daed0b0dca7573cd2e9 100644 --- a/pypy/objspace/flow/framestate.py +++ b/rpython/flowspace/framestate.py @@ -1,5 +1,5 @@ -from pypy.rlib.unroll import SpecTag -from pypy.objspace.flow.model import * +from rpython.rlib.unroll import SpecTag +from rpython.flowspace.model import * class FrameState: def __init__(self, mergeable, blocklist, next_instr): @@ -103,7 +103,7 @@ PICKLE_TAGS = {} UNPICKLE_TAGS = {} def recursively_flatten(space, lst): - from pypy.objspace.flow.flowcontext import SuspendedUnroller + from rpython.flowspace.flowcontext import SuspendedUnroller i = 0 while i < len(lst): unroller = lst[i] diff --git a/pypy/objspace/flow/generator.py b/rpython/flowspace/generator.py similarity index 93% rename from pypy/objspace/flow/generator.py rename to rpython/flowspace/generator.py index a507db60cbd4fb499bf352c385216e422547d7c8..a38e8bb3da1bcd5452bc47a5992f62a0298980f5 100644 --- a/pypy/objspace/flow/generator.py +++ b/rpython/flowspace/generator.py @@ -1,12 +1,12 @@ """Flow graph building for generators""" -from pypy.objspace.flow.model import Block, Link, SpaceOperation, checkgraph -from pypy.objspace.flow.model import Variable, Constant -from pypy.translator.unsimplify import insert_empty_startblock -from pypy.translator.unsimplify import split_block -from pypy.translator.simplify import eliminate_empty_blocks, simplify_graph -from pypy.tool.sourcetools import func_with_new_name -from pypy.objspace.flow.argument import Signature +from rpython.flowspace.model import Block, Link, SpaceOperation, checkgraph +from rpython.flowspace.model import Variable, Constant +from rpython.translator.unsimplify import insert_empty_startblock +from rpython.translator.unsimplify import split_block +from rpython.translator.simplify import eliminate_empty_blocks, simplify_graph +from rpython.tool.sourcetools import func_with_new_name +from rpython.flowspace.argument import Signature class AbstractPosition(object): diff --git a/pypy/objspace/flow/model.py b/rpython/flowspace/model.py similarity index 98% rename from pypy/objspace/flow/model.py rename to rpython/flowspace/model.py index e08f791002b8fab34821a35af9fb93b474afe13e..5262e21c0bd230f06edffc58f323d5c098f3b54b 100644 --- a/pypy/objspace/flow/model.py +++ b/rpython/flowspace/model.py @@ -4,9 +4,9 @@ # the below object/attribute model evolved from # a discussion in Berlin, 4th of october 2003 import py -from pypy.tool.uid import uid, Hashable -from pypy.tool.sourcetools import PY_IDENTIFIER, nice_repr_for_func -from pypy.rlib.rarithmetic import is_valid_int, r_longlong, r_ulonglong, r_uint +from rpython.tool.uid import uid, Hashable +from rpython.tool.sourcetools import PY_IDENTIFIER, nice_repr_for_func +from rpython.rlib.rarithmetic import is_valid_int, r_longlong, r_ulonglong, r_uint """ @@ -57,7 +57,7 @@ class FunctionGraph(object): def source(self): if hasattr(self, "_source"): return self._source - from pypy.tool.sourcetools import getsource + from rpython.tool.sourcetools import getsource self.func # can raise AttributeError src = getsource(self.func) if src is None: @@ -115,7 +115,7 @@ class FunctionGraph(object): yield block, op def show(self, t=None): - from pypy.translator.tool.graphpage import FlowGraphPage + from rpython.translator.tool.graphpage import FlowGraphPage FlowGraphPage(t, [self]).display() view = show @@ -171,7 +171,7 @@ class Link(object): return "link from %s to %s" % (str(self.prevblock), str(self.target)) def show(self): - from pypy.translator.tool.graphpage import try_show + from rpython.translator.tool.graphpage import try_show try_show(self) view = show @@ -248,7 +248,7 @@ class Block(object): self.exits = exits def show(self): - from pypy.translator.tool.graphpage import try_show + from rpython.translator.tool.graphpage import try_show try_show(self) view = show diff --git a/pypy/objspace/flow/objspace.py b/rpython/flowspace/objspace.py similarity index 97% rename from pypy/objspace/flow/objspace.py rename to rpython/flowspace/objspace.py index 0bc1023bb847ed17ea5636e6b908e2a96fc76e9c..18011d2c53023ab65f2a158f0054a6e78886e183 100644 --- a/pypy/objspace/flow/objspace.py +++ b/rpython/flowspace/objspace.py @@ -1,5 +1,5 @@ """Implements the core parts of flow graph creation, in tandem -with pypy.objspace.flow.flowcontext. +with rpython.flowspace.flowcontext. """ import __builtin__ @@ -7,20 +7,20 @@ import sys import types from inspect import CO_NEWLOCALS -from pypy.objspace.flow.argument import ArgumentsForTranslation -from pypy.objspace.flow.model import (Constant, Variable, WrapException, +from rpython.flowspace.argument import ArgumentsForTranslation +from rpython.flowspace.model import (Constant, Variable, WrapException, UnwrapException, checkgraph, SpaceOperation) -from pypy.objspace.flow.bytecode import HostCode -from pypy.objspace.flow import operation -from pypy.objspace.flow.flowcontext import (FlowSpaceFrame, fixeggblocks, +from rpython.flowspace.bytecode import HostCode +from rpython.flowspace import operation +from rpython.flowspace.flowcontext import (FlowSpaceFrame, fixeggblocks, FSException, FlowingError) -from pypy.objspace.flow.generator import (tweak_generator_graph, +from rpython.flowspace.generator import (tweak_generator_graph, bootstrap_generator) -from pypy.objspace.flow.pygraph import PyGraph -from pypy.objspace.flow.specialcase import SPECIAL_CASES -from pypy.rlib.unroll import unrolling_iterable, _unroller -from pypy.rlib import rstackovf, rarithmetic -from pypy.rlib.rarithmetic import is_valid_int +from rpython.flowspace.pygraph import PyGraph +from rpython.flowspace.specialcase import SPECIAL_CASES +from rpython.rlib.unroll import unrolling_iterable, _unroller +from rpython.rlib import rstackovf, rarithmetic +from rpython.rlib.rarithmetic import is_valid_int # method-wrappers have not enough introspection in CPython diff --git a/pypy/objspace/flow/operation.py b/rpython/flowspace/operation.py similarity index 99% rename from pypy/objspace/flow/operation.py rename to rpython/flowspace/operation.py index 92b33734aadde4d1e87002198f86054b3e55772a..abae28f282ad0abd25fb22c0728550f1f49aea89 100644 --- a/pypy/objspace/flow/operation.py +++ b/rpython/flowspace/operation.py @@ -6,8 +6,8 @@ built-in functions (or type constructors) implementing them. import __builtin__ import __future__ import operator -from pypy.tool.sourcetools import compile2 -from pypy.rlib.rarithmetic import ovfcheck +from rpython.tool.sourcetools import compile2 +from rpython.rlib.rarithmetic import ovfcheck # this is a copy that should be shared with standard objspace diff --git a/pypy/objspace/flow/pygraph.py b/rpython/flowspace/pygraph.py similarity index 85% rename from pypy/objspace/flow/pygraph.py rename to rpython/flowspace/pygraph.py index c4d8efaeb9b31bc6867f0dcdc6cad5f203793575..19aa30a8974425e5fb04563b5bb172a7d2926519 100644 --- a/pypy/objspace/flow/pygraph.py +++ b/rpython/flowspace/pygraph.py @@ -1,9 +1,9 @@ """ Implements flow graphs for Python callables """ -from pypy.objspace.flow.model import (FunctionGraph, Constant, Variable, +from rpython.flowspace.model import (FunctionGraph, Constant, Variable, SpaceOperation) -from pypy.objspace.flow.framestate import FrameState +from rpython.flowspace.framestate import FrameState class PyGraph(FunctionGraph): """ @@ -11,7 +11,7 @@ class PyGraph(FunctionGraph): """ def __init__(self, func, code): - from pypy.objspace.flow.flowcontext import SpamBlock + from rpython.flowspace.flowcontext import SpamBlock data = [None] * code.co_nlocals for i in range(code.formalargcount): data[i] = Variable() diff --git a/pypy/objspace/flow/specialcase.py b/rpython/flowspace/specialcase.py similarity index 92% rename from pypy/objspace/flow/specialcase.py rename to rpython/flowspace/specialcase.py index 21eb35158ce90b5ab77031a5289fdf86d628221c..b0fdf73c61d1339d9ba48f34ca3865580298c505 100644 --- a/pypy/objspace/flow/specialcase.py +++ b/rpython/flowspace/specialcase.py @@ -1,7 +1,7 @@ -from pypy.objspace.flow.model import Constant -from pypy.objspace.flow.operation import OperationName, Arity -from pypy.rlib.rarithmetic import r_uint -from pypy.rlib.objectmodel import we_are_translated +from rpython.flowspace.model import Constant +from rpython.flowspace.operation import OperationName, Arity +from rpython.rlib.rarithmetic import r_uint +from rpython.rlib.objectmodel import we_are_translated def sc_import(space, fn, args): args_w, kwds_w = args.unpack() diff --git a/pypy/objspace/flow/test/__init__.py b/rpython/flowspace/test/__init__.py similarity index 100% rename from pypy/objspace/flow/test/__init__.py rename to rpython/flowspace/test/__init__.py diff --git a/pypy/objspace/flow/test/test_argument.py b/rpython/flowspace/test/test_argument.py similarity index 99% rename from pypy/objspace/flow/test/test_argument.py rename to rpython/flowspace/test/test_argument.py index dec27b1d1bfae50b4ae135c3c94fe4e05e370b1c..bd3b32c20fdb124ea3d757de071e3e7a4ec20c94 100644 --- a/pypy/objspace/flow/test/test_argument.py +++ b/rpython/flowspace/test/test_argument.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import py -from pypy.objspace.flow.argument import (ArgumentsForTranslation, rawshape, +from rpython.flowspace.argument import (ArgumentsForTranslation, rawshape, Signature) diff --git a/pypy/objspace/flow/test/test_checkgraph.py b/rpython/flowspace/test/test_checkgraph.py similarity index 98% rename from pypy/objspace/flow/test/test_checkgraph.py rename to rpython/flowspace/test/test_checkgraph.py index 8a04327e90dc5bef8541d36ada0e457833393c0b..3c6c80a1228f01d4549094a8d6668a53c4185045 100644 --- a/pypy/objspace/flow/test/test_checkgraph.py +++ b/rpython/flowspace/test/test_checkgraph.py @@ -1,4 +1,4 @@ -from pypy.objspace.flow.model import * +from rpython.flowspace.model import * import py def test_mingraph(): diff --git a/pypy/objspace/flow/test/test_framestate.py b/rpython/flowspace/test/test_framestate.py similarity index 91% rename from pypy/objspace/flow/test/test_framestate.py rename to rpython/flowspace/test/test_framestate.py index 1ec7e6826437288af34db52cb74fb494950c24ca..6b93894dd8553cfbc80400ca19327f6ba8c88476 100644 --- a/pypy/objspace/flow/test/test_framestate.py +++ b/rpython/flowspace/test/test_framestate.py @@ -1,9 +1,9 @@ -from pypy.objspace.flow.model import * -from pypy.rlib.unroll import SpecTag -from pypy.objspace.flow.objspace import FlowObjSpace -from pypy.objspace.flow.flowcontext import FlowSpaceFrame -from pypy.objspace.flow.bytecode import HostCode -from pypy.objspace.flow.pygraph import PyGraph +from rpython.flowspace.model import * +from rpython.rlib.unroll import SpecTag +from rpython.flowspace.objspace import FlowObjSpace +from rpython.flowspace.flowcontext import FlowSpaceFrame +from rpython.flowspace.bytecode import HostCode +from rpython.flowspace.pygraph import PyGraph class TestFrameState: def setup_class(cls): diff --git a/pypy/objspace/flow/test/test_generator.py b/rpython/flowspace/test/test_generator.py similarity index 94% rename from pypy/objspace/flow/test/test_generator.py rename to rpython/flowspace/test/test_generator.py index 8e28e33b955bae71bd853f56e8b206cc466c0692..8abc95de725dbf580b8884dcf20fdc2c2ec25be1 100644 --- a/pypy/objspace/flow/test/test_generator.py +++ b/rpython/flowspace/test/test_generator.py @@ -1,9 +1,9 @@ from pypy.conftest import option -from pypy.objspace.flow.objspace import FlowObjSpace -from pypy.objspace.flow.model import Variable -from pypy.objspace.flow.generator import (make_generatoriterator_class, +from rpython.flowspace.objspace import FlowObjSpace +from rpython.flowspace.model import Variable +from rpython.flowspace.generator import (make_generatoriterator_class, replace_graph_with_bootstrap, get_variable_names, attach_next_method) -from pypy.translator.simplify import join_blocks +from rpython.translator.simplify import join_blocks # ____________________________________________________________ diff --git a/pypy/objspace/flow/test/test_model.py b/rpython/flowspace/test/test_model.py similarity index 99% rename from pypy/objspace/flow/test/test_model.py rename to rpython/flowspace/test/test_model.py index 061119bf801e58582d8f0d6b8ffd6666734f9018..fedee10fc38d4ce54089b95c051e04ff62ea2c43 100644 --- a/pypy/objspace/flow/test/test_model.py +++ b/rpython/flowspace/test/test_model.py @@ -1,6 +1,6 @@ import inspect -from pypy.objspace.flow.model import * +from rpython.flowspace.model import * def sample_function(i): diff --git a/pypy/objspace/flow/test/test_objspace.py b/rpython/flowspace/test/test_objspace.py similarity index 98% rename from pypy/objspace/flow/test/test_objspace.py rename to rpython/flowspace/test/test_objspace.py index fa7d57f6baf2b445eff6a6d52284bb8e5929ad9c..063fa391e064d0b68fbcf2457de2883ab01ee6ad 100644 --- a/pypy/objspace/flow/test/test_objspace.py +++ b/rpython/flowspace/test/test_objspace.py @@ -3,12 +3,12 @@ import new import py, sys from contextlib import contextmanager -from pypy.objspace.flow.model import Constant, mkentrymap, c_last_exception -from pypy.translator.simplify import simplify_graph -from pypy.objspace.flow.objspace import FlowObjSpace -from pypy.objspace.flow.flowcontext import FlowingError, FlowSpaceFrame +from rpython.flowspace.model import Constant, mkentrymap, c_last_exception +from rpython.translator.simplify import simplify_graph +from rpython.flowspace.objspace import FlowObjSpace +from rpython.flowspace.flowcontext import FlowingError, FlowSpaceFrame from pypy import conftest -from pypy.tool.stdlib_opcode import bytecode_spec, host_bytecode_spec +from rpython.tool.stdlib_opcode import bytecode_spec, host_bytecode_spec import os import operator @@ -523,7 +523,7 @@ class TestFlowObjSpace(Base): def test_specialcases(self): x = self.codetest(self.specialcases) - from pypy.translator.simplify import join_blocks + from rpython.translator.simplify import join_blocks join_blocks(x) assert len(x.startblock.operations) == 14 for op in x.startblock.operations: @@ -541,7 +541,7 @@ class TestFlowObjSpace(Base): #__________________________________________________________ def wearetranslated(x): - from pypy.rlib.objectmodel import we_are_translated + from rpython.rlib.objectmodel import we_are_translated if we_are_translated(): return x else: @@ -549,7 +549,7 @@ class TestFlowObjSpace(Base): def test_wearetranslated(self): x = self.codetest(self.wearetranslated) - from pypy.translator.simplify import join_blocks + from rpython.translator.simplify import join_blocks join_blocks(x) # check that 'x' is an empty graph assert len(x.startblock.operations) == 0 @@ -749,7 +749,7 @@ class TestFlowObjSpace(Base): def test_mergeable(self): def myfunc(x): if x: - from pypy.objspace.flow.flowcontext import BytecodeCorruption + from rpython.flowspace.flowcontext import BytecodeCorruption s = 12 else: s = x.abc diff --git a/pypy/objspace/flow/test/test_unroll.py b/rpython/flowspace/test/test_unroll.py similarity index 94% rename from pypy/objspace/flow/test/test_unroll.py rename to rpython/flowspace/test/test_unroll.py index 2c5b408d2d54aedd999322e7eea1da8c18654664..5fa6ea247a7e4ff6a14dccadb36f14228bdc9013 100644 --- a/pypy/objspace/flow/test/test_unroll.py +++ b/rpython/flowspace/test/test_unroll.py @@ -1,6 +1,6 @@ import operator -from pypy.objspace.flow.test.test_objspace import Base -from pypy.rlib.unroll import unrolling_zero, unrolling_iterable +from rpython.flowspace.test.test_objspace import Base +from rpython.rlib.unroll import unrolling_zero, unrolling_iterable class TestUnroll(Base): diff --git a/pypy/jit/backend/arm/__init__.py b/rpython/jit/__init__.py similarity index 100% rename from pypy/jit/backend/arm/__init__.py rename to rpython/jit/__init__.py diff --git a/pypy/jit/backend/arm/helper/__init__.py b/rpython/jit/backend/__init__.py similarity index 100% rename from pypy/jit/backend/arm/helper/__init__.py rename to rpython/jit/backend/__init__.py diff --git a/pypy/jit/backend/arm/test/__init__.py b/rpython/jit/backend/arm/__init__.py similarity index 100% rename from pypy/jit/backend/arm/test/__init__.py rename to rpython/jit/backend/arm/__init__.py diff --git a/pypy/jit/backend/arm/arch.py b/rpython/jit/backend/arm/arch.py similarity index 92% rename from pypy/jit/backend/arm/arch.py rename to rpython/jit/backend/arm/arch.py index 6ea8f3970c4f0ed922371e7e7d706a5cfa239555..c1122057c62bd749e208180bf0cf644f81813b33 100644 --- a/pypy/jit/backend/arm/arch.py +++ b/rpython/jit/backend/arm/arch.py @@ -1,5 +1,5 @@ -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.rarithmetic import r_uint +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.rarithmetic import r_uint FUNC_ALIGN = 8 @@ -14,7 +14,7 @@ MY_COPY_OF_REGS = WORD PC_OFFSET = 8 FORCE_INDEX_OFS = 0 -from pypy.translator.tool.cbuild import ExternalCompilationInfo +from rpython.translator.tool.cbuild import ExternalCompilationInfo eci = ExternalCompilationInfo(post_include_bits=[""" static int pypy__arm_int_div(int a, int b) { return a/b; diff --git a/pypy/jit/backend/arm/assembler.py b/rpython/jit/backend/arm/assembler.py similarity index 97% rename from pypy/jit/backend/arm/assembler.py rename to rpython/jit/backend/arm/assembler.py index 6363d7b7244844ef4311f0eb15886a104897dfa7..fa870032241c9acebca30ebfa3a25bdc89d3d4dd 100644 --- a/pypy/jit/backend/arm/assembler.py +++ b/rpython/jit/backend/arm/assembler.py @@ -1,36 +1,36 @@ from __future__ import with_statement import os -from pypy.jit.backend.arm.helper.assembler import saved_registers -from pypy.jit.backend.arm import conditions as c -from pypy.jit.backend.arm import registers as r -from pypy.jit.backend.arm.arch import WORD, DOUBLE_WORD, FUNC_ALIGN, \ +from rpython.jit.backend.arm.helper.assembler import saved_registers +from rpython.jit.backend.arm import conditions as c +from rpython.jit.backend.arm import registers as r +from rpython.jit.backend.arm.arch import WORD, DOUBLE_WORD, FUNC_ALIGN, \ N_REGISTERS_SAVED_BY_MALLOC -from pypy.jit.backend.arm.codebuilder import ARMv7Builder, OverwritingBuilder -from pypy.jit.backend.arm.locations import get_fp_offset -from pypy.jit.backend.arm.regalloc import (Regalloc, ARMFrameManager, +from rpython.jit.backend.arm.codebuilder import ARMv7Builder, OverwritingBuilder +from rpython.jit.backend.arm.locations import get_fp_offset +from rpython.jit.backend.arm.regalloc import (Regalloc, ARMFrameManager, CoreRegisterManager, check_imm_arg, operations as regalloc_operations, operations_with_guard as regalloc_operations_with_guard) -from pypy.jit.backend.llsupport.asmmemmgr import MachineDataBlockWrapper -from pypy.jit.backend.model import CompiledLoopToken -from pypy.jit.codewriter import longlong -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.metainterp.history import AbstractFailDescr, INT, REF, FLOAT -from pypy.jit.metainterp.history import BoxInt, ConstInt -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.rlib import rgc -from pypy.rlib.objectmodel import we_are_translated, specialize -from pypy.rpython.annlowlevel import llhelper -from pypy.rpython.lltypesystem import lltype, rffi, llmemory -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.jit.backend.arm.opassembler import ResOpAssembler -from pypy.rlib.debug import (debug_print, debug_start, debug_stop, +from rpython.jit.backend.llsupport.asmmemmgr import MachineDataBlockWrapper +from rpython.jit.backend.model import CompiledLoopToken +from rpython.jit.codewriter import longlong +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.metainterp.history import AbstractFailDescr, INT, REF, FLOAT +from rpython.jit.metainterp.history import BoxInt, ConstInt +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.rlib import rgc +from rpython.rlib.objectmodel import we_are_translated, specialize +from rpython.rtyper.annlowlevel import llhelper +from rpython.rtyper.lltypesystem import lltype, rffi, llmemory +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.jit.backend.arm.opassembler import ResOpAssembler +from rpython.rlib.debug import (debug_print, debug_start, debug_stop, have_debug_prints) -from pypy.rlib.jit import AsmInfo -from pypy.rlib.objectmodel import compute_unique_id +from rpython.rlib.jit import AsmInfo +from rpython.rlib.objectmodel import compute_unique_id # XXX Move to llsupport -from pypy.jit.backend.x86.support import values_array, memcpy_fn +from rpython.jit.backend.x86.support import values_array, memcpy_fn DEBUG_COUNTER = lltype.Struct('DEBUG_COUNTER', ('i', lltype.Signed), ('type', lltype.Char), # 'b'ridge, 'l'abel or diff --git a/pypy/jit/backend/arm/codebuilder.py b/rpython/jit/backend/arm/codebuilder.py similarity index 95% rename from pypy/jit/backend/arm/codebuilder.py rename to rpython/jit/backend/arm/codebuilder.py index 8ac0302475ad1d3ef44bac3cf4dea2edc8d700a2..c49f599403914a83dc5f0ae65813c3d6347ed537 100644 --- a/pypy/jit/backend/arm/codebuilder.py +++ b/rpython/jit/backend/arm/codebuilder.py @@ -1,12 +1,12 @@ -from pypy.jit.backend.arm import arch -from pypy.jit.backend.arm import conditions as cond -from pypy.jit.backend.arm import registers as reg -from pypy.jit.backend.arm.arch import (WORD, FUNC_ALIGN) -from pypy.jit.backend.arm.instruction_builder import define_instructions -from pypy.jit.backend.llsupport.asmmemmgr import BlockBuilderMixin -from pypy.rlib.objectmodel import we_are_translated -from pypy.rpython.lltypesystem import lltype, rffi, llmemory -from pypy.tool.udir import udir +from rpython.jit.backend.arm import arch +from rpython.jit.backend.arm import conditions as cond +from rpython.jit.backend.arm import registers as reg +from rpython.jit.backend.arm.arch import (WORD, FUNC_ALIGN) +from rpython.jit.backend.arm.instruction_builder import define_instructions +from rpython.jit.backend.llsupport.asmmemmgr import BlockBuilderMixin +from rpython.rlib.objectmodel import we_are_translated +from rpython.rtyper.lltypesystem import lltype, rffi, llmemory +from rpython.tool.udir import udir clear_cache = rffi.llexternal( "__clear_cache", diff --git a/pypy/jit/backend/arm/conditions.py b/rpython/jit/backend/arm/conditions.py similarity index 100% rename from pypy/jit/backend/arm/conditions.py rename to rpython/jit/backend/arm/conditions.py diff --git a/pypy/jit/backend/arm/detect.py b/rpython/jit/backend/arm/detect.py similarity index 78% rename from pypy/jit/backend/arm/detect.py rename to rpython/jit/backend/arm/detect.py index 303ddf2dad0ea68001d2f87c0fbd6903272a135f..5e2a3eca705b4a75c88e80e14b7a803235508b60 100644 --- a/pypy/jit/backend/arm/detect.py +++ b/rpython/jit/backend/arm/detect.py @@ -1,7 +1,7 @@ -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rpython.tool import rffi_platform -from pypy.translator.platform import CompilationError +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rtyper.tool import rffi_platform +from rpython.translator.platform import CompilationError eci = ExternalCompilationInfo( post_include_bits=[""" diff --git a/pypy/jit/backend/arm/tool/__init__.py b/rpython/jit/backend/arm/helper/__init__.py similarity index 100% rename from pypy/jit/backend/arm/tool/__init__.py rename to rpython/jit/backend/arm/helper/__init__.py diff --git a/pypy/jit/backend/arm/helper/assembler.py b/rpython/jit/backend/arm/helper/assembler.py similarity index 94% rename from pypy/jit/backend/arm/helper/assembler.py rename to rpython/jit/backend/arm/helper/assembler.py index cfee511c7902535c5693091315b6154997027a08..a7ecccb62b34ccc9deb4d65eca1402722f2ae244 100644 --- a/pypy/jit/backend/arm/helper/assembler.py +++ b/rpython/jit/backend/arm/helper/assembler.py @@ -1,10 +1,10 @@ from __future__ import with_statement -from pypy.jit.backend.arm import conditions as c -from pypy.jit.backend.arm import registers as r -from pypy.jit.backend.arm.codebuilder import AbstractARMv7Builder -from pypy.jit.metainterp.history import ConstInt, BoxInt, FLOAT -from pypy.rlib.rarithmetic import r_uint, r_longlong, intmask -from pypy.jit.metainterp.resoperation import rop +from rpython.jit.backend.arm import conditions as c +from rpython.jit.backend.arm import registers as r +from rpython.jit.backend.arm.codebuilder import AbstractARMv7Builder +from rpython.jit.metainterp.history import ConstInt, BoxInt, FLOAT +from rpython.rlib.rarithmetic import r_uint, r_longlong, intmask +from rpython.jit.metainterp.resoperation import rop def gen_emit_op_unary_cmp(name, true_cond): false_cond = c.get_opposite_of(true_cond) diff --git a/pypy/jit/backend/arm/helper/regalloc.py b/rpython/jit/backend/arm/helper/regalloc.py similarity index 93% rename from pypy/jit/backend/arm/helper/regalloc.py rename to rpython/jit/backend/arm/helper/regalloc.py index c81355f475a88ce828c93f6c92eb754f4e233443..978fdab1dfe535db6b0d28023919e320169e5634 100644 --- a/pypy/jit/backend/arm/helper/regalloc.py +++ b/rpython/jit/backend/arm/helper/regalloc.py @@ -1,9 +1,9 @@ -from pypy.jit.backend.arm import conditions as c -from pypy.jit.backend.arm import registers as r -from pypy.jit.backend.arm.codebuilder import AbstractARMv7Builder -from pypy.jit.metainterp.history import ConstInt, BoxInt, Box, FLOAT -from pypy.jit.metainterp.history import ConstInt -from pypy.rlib.objectmodel import we_are_translated +from rpython.jit.backend.arm import conditions as c +from rpython.jit.backend.arm import registers as r +from rpython.jit.backend.arm.codebuilder import AbstractARMv7Builder +from rpython.jit.metainterp.history import ConstInt, BoxInt, Box, FLOAT +from rpython.jit.metainterp.history import ConstInt +from rpython.rlib.objectmodel import we_are_translated def check_imm_arg(arg, size=0xFF, allow_zero=True): assert not isinstance(arg, ConstInt) diff --git a/pypy/jit/backend/arm/instruction_builder.py b/rpython/jit/backend/arm/instruction_builder.py similarity index 99% rename from pypy/jit/backend/arm/instruction_builder.py rename to rpython/jit/backend/arm/instruction_builder.py index da3d388c68fcb3072e75d2c72ba5764a6fcb8af4..442af2d91130124a63e197d33741f0733b5f0f3c 100644 --- a/pypy/jit/backend/arm/instruction_builder.py +++ b/rpython/jit/backend/arm/instruction_builder.py @@ -1,5 +1,5 @@ -from pypy.jit.backend.arm import conditions as cond -from pypy.jit.backend.arm import instructions +from rpython.jit.backend.arm import conditions as cond +from rpython.jit.backend.arm import instructions # move table lookup out of generated functions diff --git a/pypy/jit/backend/arm/instructions.py b/rpython/jit/backend/arm/instructions.py similarity index 100% rename from pypy/jit/backend/arm/instructions.py rename to rpython/jit/backend/arm/instructions.py diff --git a/pypy/jit/backend/arm/jump.py b/rpython/jit/backend/arm/jump.py similarity index 98% rename from pypy/jit/backend/arm/jump.py rename to rpython/jit/backend/arm/jump.py index b101641b2df4eef555ae1aaa377d62dd4b94c2ee..45386f28c0a084e42375c9383004b98138688fc2 100644 --- a/pypy/jit/backend/arm/jump.py +++ b/rpython/jit/backend/arm/jump.py @@ -80,7 +80,7 @@ def remap_frame_layout_mixed(assembler, src_locations2, dst_locations2, tmpreg2): # find and push the xmm stack locations from src_locations2 that # are going to be overwritten by dst_locations1 - from pypy.jit.backend.arm.arch import WORD + from rpython.jit.backend.arm.arch import WORD extrapushes = [] dst_keys = {} for loc in dst_locations1: diff --git a/pypy/jit/backend/arm/locations.py b/rpython/jit/backend/arm/locations.py similarity index 96% rename from pypy/jit/backend/arm/locations.py rename to rpython/jit/backend/arm/locations.py index 52d21fbba6b0baee14dc89bae8a0ee436726b0b0..fe764279fb304d53df5f05b1c8e3d9d017fed582 100644 --- a/pypy/jit/backend/arm/locations.py +++ b/rpython/jit/backend/arm/locations.py @@ -1,5 +1,5 @@ -from pypy.jit.metainterp.history import INT, FLOAT -from pypy.jit.backend.arm.arch import WORD, DOUBLE_WORD +from rpython.jit.metainterp.history import INT, FLOAT +from rpython.jit.backend.arm.arch import WORD, DOUBLE_WORD class AssemblerLocation(object): diff --git a/pypy/jit/backend/arm/opassembler.py b/rpython/jit/backend/arm/opassembler.py similarity index 98% rename from pypy/jit/backend/arm/opassembler.py rename to rpython/jit/backend/arm/opassembler.py index 505140c24152759b522dd4cc4769ce1fd98cc552..8428e433975d83305e446e93458dbd043fedffed 100644 --- a/pypy/jit/backend/arm/opassembler.py +++ b/rpython/jit/backend/arm/opassembler.py @@ -1,10 +1,10 @@ from __future__ import with_statement -from pypy.jit.backend.arm import conditions as c -from pypy.jit.backend.arm import registers as r -from pypy.jit.backend.arm import shift -from pypy.jit.backend.arm.arch import WORD, DOUBLE_WORD +from rpython.jit.backend.arm import conditions as c +from rpython.jit.backend.arm import registers as r +from rpython.jit.backend.arm import shift +from rpython.jit.backend.arm.arch import WORD, DOUBLE_WORD -from pypy.jit.backend.arm.helper.assembler import (gen_emit_op_by_helper_call, +from rpython.jit.backend.arm.helper.assembler import (gen_emit_op_by_helper_call, gen_emit_op_unary_cmp, gen_emit_guard_unary_cmp, gen_emit_op_ri, @@ -16,18 +16,18 @@ from pypy.jit.backend.arm.helper.assembler import (gen_emit_op_by_helper_call, gen_emit_unary_float_op, saved_registers, count_reg_args) -from pypy.jit.backend.arm.codebuilder import ARMv7Builder, OverwritingBuilder -from pypy.jit.backend.arm.jump import remap_frame_layout -from pypy.jit.backend.arm.regalloc import TempInt, TempPtr -from pypy.jit.backend.arm.locations import imm -from pypy.jit.backend.llsupport import symbolic -from pypy.jit.backend.llsupport.descr import InteriorFieldDescr -from pypy.jit.metainterp.history import (Box, AbstractFailDescr, +from rpython.jit.backend.arm.codebuilder import ARMv7Builder, OverwritingBuilder +from rpython.jit.backend.arm.jump import remap_frame_layout +from rpython.jit.backend.arm.regalloc import TempInt, TempPtr +from rpython.jit.backend.arm.locations import imm +from rpython.jit.backend.llsupport import symbolic +from rpython.jit.backend.llsupport.descr import InteriorFieldDescr +from rpython.jit.metainterp.history import (Box, AbstractFailDescr, INT, FLOAT, REF) -from pypy.jit.metainterp.history import JitCellToken, TargetToken -from pypy.jit.metainterp.resoperation import rop -from pypy.rlib.objectmodel import we_are_translated -from pypy.rpython.lltypesystem import rstr +from rpython.jit.metainterp.history import JitCellToken, TargetToken +from rpython.jit.metainterp.resoperation import rop +from rpython.rlib.objectmodel import we_are_translated +from rpython.rtyper.lltypesystem import rstr NO_FORCE_INDEX = -1 @@ -1168,7 +1168,7 @@ class ResOpAssembler(object): fast_path_cond = c.EQ # Reset the vable token --- XXX really too much special logic here:-( if jd.index_of_virtualizable >= 0: - from pypy.jit.backend.llsupport.descr import FieldDescr + from rpython.jit.backend.llsupport.descr import FieldDescr fielddescr = jd.vable_token_descr assert isinstance(fielddescr, FieldDescr) ofs = fielddescr.offset diff --git a/pypy/jit/backend/arm/regalloc.py b/rpython/jit/backend/arm/regalloc.py similarity index 97% rename from pypy/jit/backend/arm/regalloc.py rename to rpython/jit/backend/arm/regalloc.py index c1c54c636fc310e91154f9bad45c7d6b0956ed0a..afad1f2de197a3d478f53f3d054f752af6fb2eec 100644 --- a/pypy/jit/backend/arm/regalloc.py +++ b/rpython/jit/backend/arm/regalloc.py @@ -1,9 +1,9 @@ -from pypy.jit.backend.llsupport.regalloc import FrameManager, \ +from rpython.jit.backend.llsupport.regalloc import FrameManager, \ RegisterManager, TempBox, compute_vars_longevity -from pypy.jit.backend.arm import registers as r -from pypy.jit.backend.arm import locations -from pypy.jit.backend.arm.locations import imm, get_fp_offset -from pypy.jit.backend.arm.helper.regalloc import (prepare_op_by_helper_call, +from rpython.jit.backend.arm import registers as r +from rpython.jit.backend.arm import locations +from rpython.jit.backend.arm.locations import imm, get_fp_offset +from rpython.jit.backend.arm.helper.regalloc import (prepare_op_by_helper_call, prepare_op_unary_cmp, prepare_op_ri, prepare_cmp_op, @@ -11,24 +11,24 @@ from pypy.jit.backend.arm.helper.regalloc import (prepare_op_by_helper_call, check_imm_arg, check_imm_box ) -from pypy.jit.backend.arm.jump import remap_frame_layout_mixed -from pypy.jit.backend.arm.arch import MY_COPY_OF_REGS -from pypy.jit.backend.arm.arch import WORD -from pypy.jit.codewriter import longlong -from pypy.jit.metainterp.history import (Const, ConstInt, ConstFloat, ConstPtr, +from rpython.jit.backend.arm.jump import remap_frame_layout_mixed +from rpython.jit.backend.arm.arch import MY_COPY_OF_REGS +from rpython.jit.backend.arm.arch import WORD +from rpython.jit.codewriter import longlong +from rpython.jit.metainterp.history import (Const, ConstInt, ConstFloat, ConstPtr, Box, BoxPtr, INT, REF, FLOAT) -from pypy.jit.metainterp.history import JitCellToken, TargetToken -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.backend.llsupport.descr import ArrayDescr -from pypy.jit.backend.llsupport import symbolic -from pypy.rpython.lltypesystem import lltype, rffi, rstr, llmemory -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.backend.llsupport.descr import unpack_arraydescr -from pypy.jit.backend.llsupport.descr import unpack_fielddescr -from pypy.jit.backend.llsupport.descr import unpack_interiorfielddescr -from pypy.rlib.objectmodel import we_are_translated +from rpython.jit.metainterp.history import JitCellToken, TargetToken +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.backend.llsupport.descr import ArrayDescr +from rpython.jit.backend.llsupport import symbolic +from rpython.rtyper.lltypesystem import lltype, rffi, rstr, llmemory +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.backend.llsupport.descr import unpack_arraydescr +from rpython.jit.backend.llsupport.descr import unpack_fielddescr +from rpython.jit.backend.llsupport.descr import unpack_interiorfielddescr +from rpython.rlib.objectmodel import we_are_translated # xxx hack: set a default value for TargetToken._arm_loop_code. If 0, we know @@ -742,7 +742,7 @@ class Regalloc(object): classptr = y_val # here, we have to go back from 'classptr' to the value expected # from reading the 16 bits in the object header - from pypy.rpython.memory.gctypelayout import GCData + from rpython.rtyper.memory.gctypelayout import GCData sizeof_ti = rffi.sizeof(GCData.TYPE_INFO) type_info_group = llop.gc_get_type_info_group(llmemory.Address) type_info_group = rffi.cast(lltype.Signed, type_info_group) diff --git a/pypy/jit/backend/arm/registers.py b/rpython/jit/backend/arm/registers.py similarity index 87% rename from pypy/jit/backend/arm/registers.py rename to rpython/jit/backend/arm/registers.py index 66304318301936d104b5def52ce5e64254b0425d..218ecc4522a5133aa457f543f706cab00bdc2865 100644 --- a/pypy/jit/backend/arm/registers.py +++ b/rpython/jit/backend/arm/registers.py @@ -1,5 +1,5 @@ -from pypy.jit.backend.arm.locations import VFPRegisterLocation -from pypy.jit.backend.arm.locations import RegisterLocation +from rpython.jit.backend.arm.locations import VFPRegisterLocation +from rpython.jit.backend.arm.locations import RegisterLocation registers = [RegisterLocation(i) for i in range(16)] vfpregisters = [VFPRegisterLocation(i) for i in range(16)] diff --git a/pypy/jit/backend/arm/runner.py b/rpython/jit/backend/arm/runner.py similarity index 92% rename from pypy/jit/backend/arm/runner.py rename to rpython/jit/backend/arm/runner.py index 416f16e0f91bd3517b2ae91a74cb6c8cad43a3dd..b4b91c48097d942e11fb9c1728cd6c62883e72ed 100755 --- a/pypy/jit/backend/arm/runner.py +++ b/rpython/jit/backend/arm/runner.py @@ -1,10 +1,10 @@ -from pypy.jit.backend.arm.assembler import AssemblerARM -from pypy.jit.backend.arm.registers import all_regs, all_vfp_regs -from pypy.jit.backend.llsupport.llmodel import AbstractLLCPU -from pypy.rpython.llinterp import LLInterpreter -from pypy.rpython.lltypesystem import lltype, rffi, llmemory -from pypy.rlib.jit_hooks import LOOP_RUN_CONTAINER -from pypy.jit.backend.arm.arch import FORCE_INDEX_OFS +from rpython.jit.backend.arm.assembler import AssemblerARM +from rpython.jit.backend.arm.registers import all_regs, all_vfp_regs +from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU +from rpython.rtyper.llinterp import LLInterpreter +from rpython.rtyper.lltypesystem import lltype, rffi, llmemory +from rpython.rlib.jit_hooks import LOOP_RUN_CONTAINER +from rpython.jit.backend.arm.arch import FORCE_INDEX_OFS class AbstractARMCPU(AbstractLLCPU): @@ -138,7 +138,7 @@ class AbstractARMCPU(AbstractLLCPU): possible then to re-call invalidate_loop() on the same looptoken, which must invalidate all newer GUARD_NOT_INVALIDATED, but not the old one that already has a bridge attached to it.""" - from pypy.jit.backend.arm.codebuilder import ARMv7Builder + from rpython.jit.backend.arm.codebuilder import ARMv7Builder for jmp, tgt in looptoken.compiled_loop_token.invalidate_positions: mc = ARMv7Builder() diff --git a/pypy/jit/backend/arm/shift.py b/rpython/jit/backend/arm/shift.py similarity index 100% rename from pypy/jit/backend/arm/shift.py rename to rpython/jit/backend/arm/shift.py diff --git a/pypy/jit/backend/cli/__init__.py b/rpython/jit/backend/arm/test/__init__.py similarity index 100% rename from pypy/jit/backend/cli/__init__.py rename to rpython/jit/backend/arm/test/__init__.py diff --git a/pypy/jit/backend/arm/test/conftest.py b/rpython/jit/backend/arm/test/conftest.py similarity index 93% rename from pypy/jit/backend/arm/test/conftest.py rename to rpython/jit/backend/arm/test/conftest.py index cdc83a45acfacf680c9abe52a40e8e7b57e95bd8..9622148d80bf949d318272822b6e569adeaa4a8d 100644 --- a/pypy/jit/backend/arm/test/conftest.py +++ b/rpython/jit/backend/arm/test/conftest.py @@ -4,7 +4,7 @@ be disabled. Also it disables the backend tests on non ARMv7 platforms """ import py, os -from pypy.jit.backend import detect_cpu +from rpython.jit.backend import detect_cpu cpu = detect_cpu.autodetect() diff --git a/pypy/jit/backend/arm/test/gen.py b/rpython/jit/backend/arm/test/gen.py similarity index 93% rename from pypy/jit/backend/arm/test/gen.py rename to rpython/jit/backend/arm/test/gen.py index cfb3919f5c35c151dad391a2bf519b23aeeca9ce..0169f08b6d9bafdcb0f242ed2434a47d86d57111 100644 --- a/pypy/jit/backend/arm/test/gen.py +++ b/rpython/jit/backend/arm/test/gen.py @@ -1,7 +1,7 @@ import os -from pypy.tool.udir import udir +from rpython.tool.udir import udir import tempfile -from pypy.jit.backend.arm.test.support import AS +from rpython.jit.backend.arm.test.support import AS class ASMInstruction(object): asm_opts = '-mfpu=neon -mcpu=cortex-a8 -march=armv7-a' diff --git a/pypy/jit/backend/arm/test/support.py b/rpython/jit/backend/arm/test/support.py similarity index 92% rename from pypy/jit/backend/arm/test/support.py rename to rpython/jit/backend/arm/test/support.py index 756be9af8d665eaf65a31da877f7e615f71e3105..43079a8669b3fce839d14837ee67b6395a7106a1 100644 --- a/pypy/jit/backend/arm/test/support.py +++ b/rpython/jit/backend/arm/test/support.py @@ -2,10 +2,10 @@ import os import py import pytest -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.metainterp.test import support -from pypy.rlib.jit import JitDriver +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.metainterp.test import support +from rpython.rlib.jit import JitDriver class JitARMMixin(support.LLJitMixin): type_system = 'lltype' diff --git a/pypy/jit/backend/arm/test/test_arch.py b/rpython/jit/backend/arm/test/test_arch.py similarity index 93% rename from pypy/jit/backend/arm/test/test_arch.py rename to rpython/jit/backend/arm/test/test_arch.py index a17e007554d85b2b76ed24258e7cabcb82a78569..c937db82946ee9ea787424e5688181b4dbebf005 100644 --- a/pypy/jit/backend/arm/test/test_arch.py +++ b/rpython/jit/backend/arm/test/test_arch.py @@ -1,4 +1,4 @@ -from pypy.jit.backend.arm import arch +from rpython.jit.backend.arm import arch def test_mod(): assert arch.arm_int_mod(10, 2) == 0 diff --git a/pypy/jit/backend/arm/test/test_assembler.py b/rpython/jit/backend/arm/test/test_assembler.py similarity index 91% rename from pypy/jit/backend/arm/test/test_assembler.py rename to rpython/jit/backend/arm/test/test_assembler.py index 6d68ff14eaead7863a03e98d2ff92544b81b2ed0..87c99368cd94820f00279ce5d7430a8a38f904e7 100644 --- a/pypy/jit/backend/arm/test/test_assembler.py +++ b/rpython/jit/backend/arm/test/test_assembler.py @@ -1,16 +1,16 @@ -from pypy.jit.backend.arm import conditions as c -from pypy.jit.backend.arm import registers as r -from pypy.jit.backend.arm.arch import arm_int_div -from pypy.jit.backend.arm.assembler import AssemblerARM -from pypy.jit.backend.arm.locations import imm -from pypy.jit.backend.arm.test.support import run_asm -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.metainterp.resoperation import rop - -from pypy.rpython.annlowlevel import llhelper -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.jit.metainterp.history import JitCellToken -from pypy.jit.backend.model import CompiledLoopToken +from rpython.jit.backend.arm import conditions as c +from rpython.jit.backend.arm import registers as r +from rpython.jit.backend.arm.arch import arm_int_div +from rpython.jit.backend.arm.assembler import AssemblerARM +from rpython.jit.backend.arm.locations import imm +from rpython.jit.backend.arm.test.support import run_asm +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.metainterp.resoperation import rop + +from rpython.rtyper.annlowlevel import llhelper +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.jit.metainterp.history import JitCellToken +from rpython.jit.backend.model import CompiledLoopToken CPU = getcpuclass() @@ -28,7 +28,7 @@ class TestRunningAssembler(object): def test_make_operation_list(self): i = rop.INT_ADD - from pypy.jit.backend.arm import assembler + from rpython.jit.backend.arm import assembler assert assembler.asm_operations[i] \ is AssemblerARM.emit_op_int_add.im_func diff --git a/pypy/jit/backend/arm/test/test_basic.py b/rpython/jit/backend/arm/test/test_basic.py similarity index 88% rename from pypy/jit/backend/arm/test/test_basic.py rename to rpython/jit/backend/arm/test/test_basic.py index 28a3ce3dc2b38bc0299294cc9a18a3dbd124679d..ae3978802aa11ba95e1f466f2c267aecdc1ae01b 100644 --- a/pypy/jit/backend/arm/test/test_basic.py +++ b/rpython/jit/backend/arm/test/test_basic.py @@ -1,8 +1,8 @@ import py -from pypy.jit.metainterp.test import test_ajit -from pypy.rlib.jit import JitDriver -from pypy.jit.backend.arm.test.support import JitARMMixin -from pypy.jit.backend.detect_cpu import getcpuclass +from rpython.jit.metainterp.test import test_ajit +from rpython.rlib.jit import JitDriver +from rpython.jit.backend.arm.test.support import JitARMMixin +from rpython.jit.backend.detect_cpu import getcpuclass CPU = getcpuclass() diff --git a/pypy/jit/backend/arm/test/test_calling_convention.py b/rpython/jit/backend/arm/test/test_calling_convention.py similarity index 77% rename from pypy/jit/backend/arm/test/test_calling_convention.py rename to rpython/jit/backend/arm/test/test_calling_convention.py index 9bfe8a6e20f3e2cfbd8c93c0c70edb5f0ac81633..3ad379651022000419419eb28a185d888cdf6041 100644 --- a/pypy/jit/backend/arm/test/test_calling_convention.py +++ b/rpython/jit/backend/arm/test/test_calling_convention.py @@ -1,10 +1,10 @@ -from pypy.rpython.annlowlevel import llhelper -from pypy.jit.metainterp.history import JitCellToken -from pypy.jit.backend.test.calling_convention_test import TestCallingConv, parse -from pypy.rpython.lltypesystem import lltype -from pypy.jit.codewriter.effectinfo import EffectInfo +from rpython.rtyper.annlowlevel import llhelper +from rpython.jit.metainterp.history import JitCellToken +from rpython.jit.backend.test.calling_convention_test import TestCallingConv, parse +from rpython.rtyper.lltypesystem import lltype +from rpython.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.backend.arm.test.support import skip_unless_run_slow_tests +from rpython.jit.backend.arm.test.support import skip_unless_run_slow_tests skip_unless_run_slow_tests() class TestARMCallingConvention(TestCallingConv): diff --git a/pypy/jit/backend/arm/test/test_float.py b/rpython/jit/backend/arm/test/test_float.py similarity index 54% rename from pypy/jit/backend/arm/test/test_float.py rename to rpython/jit/backend/arm/test/test_float.py index 71e87ac8218839cb375a8cd940e8ca8bb3395d85..41189429d2cffaec191ffc4bdeb59e582b6cf287 100644 --- a/pypy/jit/backend/arm/test/test_float.py +++ b/rpython/jit/backend/arm/test/test_float.py @@ -1,7 +1,7 @@ import py -from pypy.jit.backend.arm.test.support import JitARMMixin -from pypy.jit.metainterp.test.test_float import FloatTests +from rpython.jit.backend.arm.test.support import JitARMMixin +from rpython.jit.metainterp.test.test_float import FloatTests class TestFloat(JitARMMixin, FloatTests): # for the individual tests see diff --git a/pypy/jit/backend/arm/test/test_gc_integration.py b/rpython/jit/backend/arm/test/test_gc_integration.py similarity index 88% rename from pypy/jit/backend/arm/test/test_gc_integration.py rename to rpython/jit/backend/arm/test/test_gc_integration.py index 1487283f0ae1b719f59e0ff0f2aaa17c7a4a3857..4bb0d51a3b1a665b7f1b3f37e3f97f93bc498b61 100644 --- a/pypy/jit/backend/arm/test/test_gc_integration.py +++ b/rpython/jit/backend/arm/test/test_gc_integration.py @@ -3,24 +3,24 @@ """ import py -from pypy.jit.metainterp.history import BoxInt, \ +from rpython.jit.metainterp.history import BoxInt, \ BoxPtr, TreeLoop, TargetToken -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.jit.codewriter import heaptracker -from pypy.jit.backend.llsupport.descr import GcCache -from pypy.jit.backend.llsupport.gc import GcLLDescription -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.arm.arch import WORD -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rpython.annlowlevel import llhelper -from pypy.rpython.lltypesystem import rclass -from pypy.jit.backend.llsupport.gc import GcLLDescr_framework - -from pypy.jit.backend.arm.test.test_regalloc import MockAssembler -from pypy.jit.backend.arm.test.test_regalloc import BaseTestRegalloc -from pypy.jit.backend.arm.regalloc import ARMFrameManager, VFPRegisterManager -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.backend.arm.regalloc import Regalloc +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.jit.codewriter import heaptracker +from rpython.jit.backend.llsupport.descr import GcCache +from rpython.jit.backend.llsupport.gc import GcLLDescription +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.arm.arch import WORD +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rtyper.annlowlevel import llhelper +from rpython.rtyper.lltypesystem import rclass +from rpython.jit.backend.llsupport.gc import GcLLDescr_framework + +from rpython.jit.backend.arm.test.test_regalloc import MockAssembler +from rpython.jit.backend.arm.test.test_regalloc import BaseTestRegalloc +from rpython.jit.backend.arm.regalloc import ARMFrameManager, VFPRegisterManager +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.backend.arm.regalloc import Regalloc CPU = getcpuclass() diff --git a/pypy/jit/backend/arm/test/test_generated.py b/rpython/jit/backend/arm/test/test_generated.py similarity index 98% rename from pypy/jit/backend/arm/test/test_generated.py rename to rpython/jit/backend/arm/test/test_generated.py index 64a60d9f7527dcbc2b4e984954bcbe71b75d19ed..bbb9571601f38b455657279603e5bec965ebb0ca 100644 --- a/pypy/jit/backend/arm/test/test_generated.py +++ b/rpython/jit/backend/arm/test/test_generated.py @@ -1,15 +1,15 @@ import py -from pypy.jit.metainterp.history import (AbstractFailDescr, +from rpython.jit.metainterp.history import (AbstractFailDescr, AbstractDescr, BasicFailDescr, BoxInt, Box, BoxPtr, ConstInt, ConstPtr, BoxObj, Const, ConstObj, BoxFloat, ConstFloat) -from pypy.jit.metainterp.history import JitCellToken -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.rpython.test.test_llinterp import interpret -from pypy.jit.backend.detect_cpu import getcpuclass +from rpython.jit.metainterp.history import JitCellToken +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.rtyper.test.test_llinterp import interpret +from rpython.jit.backend.detect_cpu import getcpuclass CPU = getcpuclass() class TestStuff(object): diff --git a/pypy/jit/backend/arm/test/test_helper.py b/rpython/jit/backend/arm/test/test_helper.py similarity index 84% rename from pypy/jit/backend/arm/test/test_helper.py rename to rpython/jit/backend/arm/test/test_helper.py index b355827b4011b2eb165939667e230d2645ba84c4..e613bcf7d674eadf068d7c98e91890aa87972553 100644 --- a/pypy/jit/backend/arm/test/test_helper.py +++ b/rpython/jit/backend/arm/test/test_helper.py @@ -1,5 +1,5 @@ -from pypy.jit.backend.arm.helper.assembler import count_reg_args -from pypy.jit.metainterp.history import (BoxInt, BoxPtr, BoxFloat, +from rpython.jit.backend.arm.helper.assembler import count_reg_args +from rpython.jit.metainterp.history import (BoxInt, BoxPtr, BoxFloat, INT, REF, FLOAT) diff --git a/pypy/jit/backend/arm/test/test_instr_codebuilder.py b/rpython/jit/backend/arm/test/test_instr_codebuilder.py similarity index 97% rename from pypy/jit/backend/arm/test/test_instr_codebuilder.py rename to rpython/jit/backend/arm/test/test_instr_codebuilder.py index 75ec4d4e65bcee41268d7d40dc552d6a2cf5b483..b85604704107173b8fe7d19b0640505dd4e217ce 100644 --- a/pypy/jit/backend/arm/test/test_instr_codebuilder.py +++ b/rpython/jit/backend/arm/test/test_instr_codebuilder.py @@ -1,8 +1,8 @@ -from pypy.jit.backend.arm import registers as r -from pypy.jit.backend.arm import codebuilder -from pypy.jit.backend.arm import conditions -from pypy.jit.backend.arm import instructions -from pypy.jit.backend.arm.test.support import (requires_arm_as, define_test, gen_test_function) +from rpython.jit.backend.arm import registers as r +from rpython.jit.backend.arm import codebuilder +from rpython.jit.backend.arm import conditions +from rpython.jit.backend.arm import instructions +from rpython.jit.backend.arm.test.support import (requires_arm_as, define_test, gen_test_function) from gen import assemble import py diff --git a/pypy/jit/backend/arm/test/test_jump.py b/rpython/jit/backend/arm/test/test_jump.py similarity index 97% rename from pypy/jit/backend/arm/test/test_jump.py rename to rpython/jit/backend/arm/test/test_jump.py index 9e313322fd5cd0358c948f056ee5bc07d91c895b..847cd9ff749cda18b323845e61c7c425d33b29fb 100644 --- a/pypy/jit/backend/arm/test/test_jump.py +++ b/rpython/jit/backend/arm/test/test_jump.py @@ -1,11 +1,11 @@ import random import py -from pypy.jit.backend.x86.test.test_jump import MockAssembler -from pypy.jit.backend.arm.registers import * -from pypy.jit.backend.arm.locations import * -from pypy.jit.backend.arm.regalloc import ARMFrameManager -from pypy.jit.backend.arm.jump import remap_frame_layout, remap_frame_layout_mixed -from pypy.jit.metainterp.history import INT +from rpython.jit.backend.x86.test.test_jump import MockAssembler +from rpython.jit.backend.arm.registers import * +from rpython.jit.backend.arm.locations import * +from rpython.jit.backend.arm.regalloc import ARMFrameManager +from rpython.jit.backend.arm.jump import remap_frame_layout, remap_frame_layout_mixed +from rpython.jit.metainterp.history import INT frame_pos = ARMFrameManager.frame_pos diff --git a/pypy/jit/backend/arm/test/test_list.py b/rpython/jit/backend/arm/test/test_list.py similarity index 52% rename from pypy/jit/backend/arm/test/test_list.py rename to rpython/jit/backend/arm/test/test_list.py index d3f3936235700350c01b85090434f8cf7c4c91a1..e329b940a77447966fa3b48d2b0fe8e94727faa1 100644 --- a/pypy/jit/backend/arm/test/test_list.py +++ b/rpython/jit/backend/arm/test/test_list.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.test.test_list import ListTests -from pypy.jit.backend.arm.test.support import JitARMMixin +from rpython.jit.metainterp.test.test_list import ListTests +from rpython.jit.backend.arm.test.support import JitARMMixin class TestList(JitARMMixin, ListTests): # for individual tests see diff --git a/pypy/jit/backend/x86/test/test_loop_unroll.py b/rpython/jit/backend/arm/test/test_loop_unroll.py similarity index 58% rename from pypy/jit/backend/x86/test/test_loop_unroll.py rename to rpython/jit/backend/arm/test/test_loop_unroll.py index 312deff9e555f97df3ded628611eb77e1f341148..fbd85b554affd2dfe74668a9af6079de68707dcf 100644 --- a/pypy/jit/backend/x86/test/test_loop_unroll.py +++ b/rpython/jit/backend/arm/test/test_loop_unroll.py @@ -1,6 +1,6 @@ import py -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin -from pypy.jit.metainterp.test import test_loop_unroll +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test import test_loop_unroll class TestLoopSpec(Jit386Mixin, test_loop_unroll.LoopUnrollTest): # for the individual tests see diff --git a/pypy/jit/backend/arm/test/test_recompilation.py b/rpython/jit/backend/arm/test/test_recompilation.py similarity index 98% rename from pypy/jit/backend/arm/test/test_recompilation.py rename to rpython/jit/backend/arm/test/test_recompilation.py index a111e3f8a4e1e514b1811bdb87255c6b8c925aad..1b99b2ec65dc9e5d5972991ecaf9dc3dba4e85eb 100644 --- a/pypy/jit/backend/arm/test/test_recompilation.py +++ b/rpython/jit/backend/arm/test/test_recompilation.py @@ -1,4 +1,4 @@ -from pypy.jit.backend.arm.test.test_regalloc import BaseTestRegalloc +from rpython.jit.backend.arm.test.test_regalloc import BaseTestRegalloc class TestRecompilation(BaseTestRegalloc): diff --git a/pypy/jit/backend/arm/test/test_recursive.py b/rpython/jit/backend/arm/test/test_recursive.py similarity index 53% rename from pypy/jit/backend/arm/test/test_recursive.py rename to rpython/jit/backend/arm/test/test_recursive.py index 8a95495752754fd88c65e7f70f0c75ef327e1ab4..8635a3e59315037c9beb2f5f6d391e545ca478ae 100644 --- a/pypy/jit/backend/arm/test/test_recursive.py +++ b/rpython/jit/backend/arm/test/test_recursive.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.test.test_recursive import RecursiveTests -from pypy.jit.backend.arm.test.support import JitARMMixin +from rpython.jit.metainterp.test.test_recursive import RecursiveTests +from rpython.jit.backend.arm.test.support import JitARMMixin class TestRecursive(JitARMMixin, RecursiveTests): # for the individual tests see diff --git a/pypy/jit/backend/arm/test/test_regalloc.py b/rpython/jit/backend/arm/test/test_regalloc.py similarity index 97% rename from pypy/jit/backend/arm/test/test_regalloc.py rename to rpython/jit/backend/arm/test/test_regalloc.py index 447f102206eed88c470ab3ab374279c3d31c414f..b715f596a2152f13826435c339601927ac1e75f7 100644 --- a/pypy/jit/backend/arm/test/test_regalloc.py +++ b/rpython/jit/backend/arm/test/test_regalloc.py @@ -3,20 +3,20 @@ """ import py -from pypy.jit.metainterp.history import BasicFailDescr, \ +from rpython.jit.metainterp.history import BasicFailDescr, \ JitCellToken, \ TargetToken -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.backend.llsupport.descr import GcCache -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.arm.regalloc import Regalloc, ARMFrameManager -from pypy.jit.backend.llsupport.regalloc import is_comparison_or_ovf_op -from pypy.jit.tool.oparser import parse -from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.rpython.annlowlevel import llhelper -from pypy.rpython.lltypesystem import rclass, rstr -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.codewriter import longlong +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.backend.llsupport.descr import GcCache +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.arm.regalloc import Regalloc, ARMFrameManager +from rpython.jit.backend.llsupport.regalloc import is_comparison_or_ovf_op +from rpython.jit.tool.oparser import parse +from rpython.rtyper.lltypesystem import lltype, llmemory +from rpython.rtyper.annlowlevel import llhelper +from rpython.rtyper.lltypesystem import rclass, rstr +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.codewriter import longlong def test_is_comparison_or_ovf_op(): diff --git a/pypy/jit/backend/arm/test/test_regalloc2.py b/rpython/jit/backend/arm/test/test_regalloc2.py similarity index 97% rename from pypy/jit/backend/arm/test/test_regalloc2.py rename to rpython/jit/backend/arm/test/test_regalloc2.py index ceda0148f737ce10756b1d9acaf3de9a22a04d71..24a439497e3f1d81ad4d68320e011e5c76c81b81 100644 --- a/pypy/jit/backend/arm/test/test_regalloc2.py +++ b/rpython/jit/backend/arm/test/test_regalloc2.py @@ -1,10 +1,10 @@ import py -from pypy.jit.metainterp.history import ResOperation, BoxInt, ConstInt,\ +from rpython.jit.metainterp.history import ResOperation, BoxInt, ConstInt,\ BoxPtr, ConstPtr, BasicFailDescr -from pypy.jit.metainterp.history import JitCellToken -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.arm.arch import WORD +from rpython.jit.metainterp.history import JitCellToken +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.arm.arch import WORD CPU = getcpuclass() def test_bug_rshift(): diff --git a/pypy/jit/backend/arm/test/test_regalloc_mov.py b/rpython/jit/backend/arm/test/test_regalloc_mov.py similarity index 97% rename from pypy/jit/backend/arm/test/test_regalloc_mov.py rename to rpython/jit/backend/arm/test/test_regalloc_mov.py index ae3d103c9552be05c40f346fe645ea484f996b31..0e1ef3b9d8b31e7e5f0a76d6521b535beeddb565 100644 --- a/pypy/jit/backend/arm/test/test_regalloc_mov.py +++ b/rpython/jit/backend/arm/test/test_regalloc_mov.py @@ -1,12 +1,12 @@ -from pypy.rlib.objectmodel import instantiate -from pypy.jit.backend.arm.assembler import AssemblerARM -from pypy.jit.backend.arm.locations import imm, ConstFloatLoc,\ +from rpython.rlib.objectmodel import instantiate +from rpython.jit.backend.arm.assembler import AssemblerARM +from rpython.jit.backend.arm.locations import imm, ConstFloatLoc,\ RegisterLocation, StackLocation, \ VFPRegisterLocation, get_fp_offset -from pypy.jit.backend.arm.registers import lr, ip, fp, vfp_ip -from pypy.jit.backend.arm.conditions import AL -from pypy.jit.backend.arm.arch import WORD -from pypy.jit.metainterp.history import FLOAT +from rpython.jit.backend.arm.registers import lr, ip, fp, vfp_ip +from rpython.jit.backend.arm.conditions import AL +from rpython.jit.backend.arm.arch import WORD +from rpython.jit.metainterp.history import FLOAT import py diff --git a/pypy/jit/backend/arm/test/test_runner.py b/rpython/jit/backend/arm/test/test_runner.py similarity index 94% rename from pypy/jit/backend/arm/test/test_runner.py rename to rpython/jit/backend/arm/test/test_runner.py index e498520bdbb06cd7d9c538cbb0d88e015ee35e8d..386066e532e6edc6194396cd1e503c6077a46670 100644 --- a/pypy/jit/backend/arm/test/test_runner.py +++ b/rpython/jit/backend/arm/test/test_runner.py @@ -1,18 +1,18 @@ import py -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.arm.arch import WORD -from pypy.jit.backend.test.runner_test import LLtypeBackendTest, \ +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.arm.arch import WORD +from rpython.jit.backend.test.runner_test import LLtypeBackendTest, \ boxfloat, \ constfloat -from pypy.jit.metainterp.history import (BasicFailDescr, +from rpython.jit.metainterp.history import (BasicFailDescr, BoxInt, ConstInt) -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.tool.oparser import parse -from pypy.rpython.lltypesystem import lltype, llmemory, rclass -from pypy.rpython.annlowlevel import llhelper -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.metainterp.history import JitCellToken, TargetToken +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.tool.oparser import parse +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass +from rpython.rtyper.annlowlevel import llhelper +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.metainterp.history import JitCellToken, TargetToken CPU = getcpuclass() @@ -206,7 +206,7 @@ class TestARM(LLtypeBackendTest): assert self.cpu.get_latest_value_int(0) == sum(args) def test_debugger_on(self): - from pypy.rlib import debug + from rpython.rlib import debug targettoken, preambletoken = TargetToken(), TargetToken() loop = """ diff --git a/pypy/jit/backend/arm/test/test_string.py b/rpython/jit/backend/arm/test/test_string.py similarity index 74% rename from pypy/jit/backend/arm/test/test_string.py rename to rpython/jit/backend/arm/test/test_string.py index b77c53c59003daa82d1a8f2cc5ab40d9a3db31fe..930469122908b9e05efde357773e348e749a6a6f 100644 --- a/pypy/jit/backend/arm/test/test_string.py +++ b/rpython/jit/backend/arm/test/test_string.py @@ -1,6 +1,6 @@ import py -from pypy.jit.metainterp.test import test_string -from pypy.jit.backend.arm.test.support import JitARMMixin +from rpython.jit.metainterp.test import test_string +from rpython.jit.backend.arm.test.support import JitARMMixin class TestString(JitARMMixin, test_string.TestLLtype): # for the individual tests see diff --git a/pypy/jit/backend/arm/test/test_trace_operations.py b/rpython/jit/backend/arm/test/test_trace_operations.py similarity index 87% rename from pypy/jit/backend/arm/test/test_trace_operations.py rename to rpython/jit/backend/arm/test/test_trace_operations.py index 1e92fbb2720fd799d3c8735454e99d11ba9c3d20..bddd2299be2b2dbe8b77a64ce140d514fbbe9df2 100644 --- a/pypy/jit/backend/arm/test/test_trace_operations.py +++ b/rpython/jit/backend/arm/test/test_trace_operations.py @@ -1,6 +1,6 @@ -from pypy.jit.backend.x86.test.test_regalloc import BaseTestRegalloc -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.rpython.lltypesystem import lltype, llmemory +from rpython.jit.backend.x86.test.test_regalloc import BaseTestRegalloc +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.rtyper.lltypesystem import lltype, llmemory CPU = getcpuclass() class TestConstPtr(BaseTestRegalloc): diff --git a/rpython/jit/backend/arm/test/test_zll_random.py b/rpython/jit/backend/arm/test/test_zll_random.py new file mode 100644 index 0000000000000000000000000000000000000000..05127a381786683ffb1e31a8637b9960e9ab4a23 --- /dev/null +++ b/rpython/jit/backend/arm/test/test_zll_random.py @@ -0,0 +1,15 @@ +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.test import test_ll_random +from rpython.jit.backend.test import test_random +from rpython.jit.backend.test.test_ll_random import LLtypeOperationBuilder +from rpython.jit.backend.test.test_random import check_random_function, Random +from rpython.jit.metainterp.resoperation import rop + +CPU = getcpuclass() + +def test_stress(): + cpu = CPU(None, None) + cpu.setup_once() + for i in range(100): + r = Random() + check_random_function(cpu, LLtypeOperationBuilder, r, i, 1000) diff --git a/pypy/jit/backend/arm/test/test_zrpy_gc.py b/rpython/jit/backend/arm/test/test_zrpy_gc.py similarity index 96% rename from pypy/jit/backend/arm/test/test_zrpy_gc.py rename to rpython/jit/backend/arm/test/test_zrpy_gc.py index 17a67fb5cd3128115609dfabe93a8349dabf778c..7a517455b2c7ec8d5aa9fbcebd63e4b7c5c87877 100644 --- a/pypy/jit/backend/arm/test/test_zrpy_gc.py +++ b/rpython/jit/backend/arm/test/test_zrpy_gc.py @@ -6,15 +6,15 @@ and the various cases of write barrier. import weakref import py, os -from pypy.annotation import policy as annpolicy -from pypy.rlib import rgc -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rlib.jit import JitDriver, dont_look_inside -from pypy.rlib.jit import elidable, unroll_safe -from pypy.jit.backend.llsupport.gc import GcLLDescr_framework -from pypy.tool.udir import udir +from rpython.annotator import policy as annpolicy +from rpython.rlib import rgc +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rlib.jit import JitDriver, dont_look_inside +from rpython.rlib.jit import elidable, unroll_safe +from rpython.jit.backend.llsupport.gc import GcLLDescr_framework +from rpython.tool.udir import udir from pypy.config.translationoption import DEFL_GC -from pypy.jit.backend.arm.test.support import skip_unless_run_slow_tests +from rpython.jit.backend.arm.test.support import skip_unless_run_slow_tests skip_unless_run_slow_tests() @@ -70,7 +70,7 @@ def get_entry(g): def get_functions_to_patch(): - from pypy.jit.backend.llsupport import gc + from rpython.jit.backend.llsupport import gc # can_use_nursery_malloc1 = gc.GcLLDescr_framework.can_use_nursery_malloc def can_use_nursery_malloc2(*args): @@ -85,10 +85,10 @@ def get_functions_to_patch(): can_use_nursery_malloc2} def compile(f, gc, enable_opts='', **kwds): - from pypy.annotation.listdef import s_list_of_strings - from pypy.translator.translator import TranslationContext - from pypy.jit.metainterp.warmspot import apply_jit - from pypy.translator.c import genc + from rpython.annotator.listdef import s_list_of_strings + from rpython.translator.translator import TranslationContext + from rpython.jit.metainterp.warmspot import apply_jit + from rpython.translator.c import genc # t = TranslationContext() t.config.translation.gc = gc @@ -245,7 +245,7 @@ class CompileFrameworkTests(BaseFrameworkTests): ## # the target of cast_base_ptr_to_instance. Note that the function ## # below is *never* called by any actual test, it's just annotated. ## # -## from pypy.rlib.libffi import get_libc_name, CDLL, types, ArgChain +## from rpython.rlib.libffi import get_libc_name, CDLL, types, ArgChain ## libc_name = get_libc_name() ## def f(n, x, *args): ## libc = CDLL(libc_name) @@ -360,7 +360,7 @@ class CompileFrameworkTests(BaseFrameworkTests): def define_compile_framework_4(cls): # Fourth version of the test, with __del__. - from pypy.rlib.debug import debug_print + from rpython.rlib.debug import debug_print class Counter: cnt = 0 counter = Counter() @@ -701,7 +701,7 @@ class CompileFrameworkTests(BaseFrameworkTests): self.run('compile_framework_bug1', 200) def define_compile_framework_vref(self): - from pypy.rlib.jit import virtual_ref, virtual_ref_finish + from rpython.rlib.jit import virtual_ref, virtual_ref_finish class A: pass glob = A() diff --git a/pypy/jit/backend/arm/test/test_ztranslation.py b/rpython/jit/backend/arm/test/test_ztranslation.py similarity index 90% rename from pypy/jit/backend/arm/test/test_ztranslation.py rename to rpython/jit/backend/arm/test/test_ztranslation.py index ce2658fbc2845096912bef5fb38cf1d29801ae58..b7ee830b6110e052995e2d942d985d1d53e297c1 100644 --- a/pypy/jit/backend/arm/test/test_ztranslation.py +++ b/rpython/jit/backend/arm/test/test_ztranslation.py @@ -1,17 +1,17 @@ import py, os, sys -from pypy.tool.udir import udir -from pypy.rlib.jit import JitDriver, unroll_parameters, set_param -from pypy.rlib.jit import PARAMETERS, dont_look_inside -from pypy.rlib.jit import promote -from pypy.rlib import jit_hooks -from pypy.jit.metainterp.jitprof import Profiler -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.test.support import CCompiledMixin -from pypy.jit.codewriter.policy import StopAtXPolicy -from pypy.translator.translator import TranslationContext +from rpython.tool.udir import udir +from rpython.rlib.jit import JitDriver, unroll_parameters, set_param +from rpython.rlib.jit import PARAMETERS, dont_look_inside +from rpython.rlib.jit import promote +from rpython.rlib import jit_hooks +from rpython.jit.metainterp.jitprof import Profiler +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.test.support import CCompiledMixin +from rpython.jit.codewriter.policy import StopAtXPolicy +from rpython.translator.translator import TranslationContext from pypy.config.translationoption import DEFL_GC -from pypy.rlib import rgc -from pypy.jit.backend.arm.test.support import skip_unless_run_slow_tests +from rpython.rlib import rgc +from rpython.jit.backend.arm.test.support import skip_unless_run_slow_tests skip_unless_run_slow_tests() class TestTranslationARM(CCompiledMixin): @@ -72,9 +72,9 @@ class TestTranslationARM(CCompiledMixin): if k - abs(-j): raise ValueError return chr(total % 253) # - from pypy.rpython.lltypesystem import lltype, rffi - from pypy.rlib.libffi import types, CDLL, ArgChain - from pypy.rlib.test.test_clibffi import get_libm_name + from rpython.rtyper.lltypesystem import lltype, rffi + from rpython.rlib.libffi import types, CDLL, ArgChain + from rpython.rlib.test.test_clibffi import get_libm_name libm_name = get_libm_name(sys.platform) jitdriver2 = JitDriver(greens=[], reds = ['i', 'func', 'res', 'x']) def libffi_stuff(i, j): @@ -101,7 +101,7 @@ class TestTranslationARM(CCompiledMixin): def test_direct_assembler_call_translates(self): """Test CALL_ASSEMBLER and the recursion limit""" - from pypy.rlib.rstackovf import StackOverflow + from rpython.rlib.rstackovf import StackOverflow class Thing(object): def __init__(self, val): diff --git a/pypy/jit/backend/cli/test/__init__.py b/rpython/jit/backend/arm/tool/__init__.py similarity index 100% rename from pypy/jit/backend/cli/test/__init__.py rename to rpython/jit/backend/arm/tool/__init__.py diff --git a/pypy/jit/backend/arm/tool/viewcode.py b/rpython/jit/backend/arm/tool/viewcode.py similarity index 95% rename from pypy/jit/backend/arm/tool/viewcode.py rename to rpython/jit/backend/arm/tool/viewcode.py index c1753cc4c94d5f347a4ed5dd2387b3b0f3a9a7ec..d1e0643d1b93f2126d9ae133cade9344a1b84f3e 100755 --- a/pypy/jit/backend/arm/tool/viewcode.py +++ b/rpython/jit/backend/arm/tool/viewcode.py @@ -31,7 +31,7 @@ def machine_code_dump(data, originaddr, backend_name, label_list=None): return format_code_dump_with_labels(originaddr, lines, label_list) def format_code_dump_with_labels(originaddr, lines, label_list): - from pypy.rlib.rarithmetic import r_uint + from rpython.rlib.rarithmetic import r_uint if not label_list: label_list = [] originaddr = r_uint(originaddr) @@ -59,7 +59,7 @@ def objdump(input): def get_tmp_file(): - # don't use pypy.tool.udir here to avoid removing old usessions which + # don't use rpython.tool.udir here to avoid removing old usessions which # might still contain interesting executables udir = py.path.local.make_numbered_dir(prefix='viewcode-', keep=2) tmpfile = str(udir.join('dump.tmp')) diff --git a/pypy/jit/backend/cli/README.txt b/rpython/jit/backend/cli/README.txt similarity index 100% rename from pypy/jit/backend/cli/README.txt rename to rpython/jit/backend/cli/README.txt diff --git a/pypy/jit/backend/llgraph/__init__.py b/rpython/jit/backend/cli/__init__.py similarity index 100% rename from pypy/jit/backend/llgraph/__init__.py rename to rpython/jit/backend/cli/__init__.py diff --git a/pypy/jit/backend/cli/method.py b/rpython/jit/backend/cli/method.py similarity index 97% rename from pypy/jit/backend/cli/method.py rename to rpython/jit/backend/cli/method.py index 1ccdf5d73c50726a3b10727eea0f797796bf9bec..6ad7146c56980a7f8d34e10c4c7f3757e1b09de2 100644 --- a/pypy/jit/backend/cli/method.py +++ b/rpython/jit/backend/cli/method.py @@ -1,18 +1,18 @@ import py import os -from pypy.rlib.debug import debug_start, debug_stop -from pypy.tool.pairtype import extendabletype -from pypy.rpython.ootypesystem import ootype -from pypy.translator.cli import dotnet -from pypy.translator.cli.dotnet import CLR -from pypy.translator.cli import opcodes -from pypy.jit.metainterp import history -from pypy.jit.metainterp.history import (AbstractValue, Const, ConstInt, ConstFloat, +from rpython.rlib.debug import debug_start, debug_stop +from rpython.tool.pairtype import extendabletype +from rpython.rtyper.ootypesystem import ootype +from rpython.translator.cli import dotnet +from rpython.translator.cli.dotnet import CLR +from rpython.translator.cli import opcodes +from rpython.jit.metainterp import history +from rpython.jit.metainterp.history import (AbstractValue, Const, ConstInt, ConstFloat, ConstObj, BoxInt, LoopToken) -from pypy.jit.metainterp.resoperation import rop, opname -from pypy.jit.metainterp.typesystem import oohelper -from pypy.jit.backend.cli import runner -from pypy.jit.backend.cli.methodfactory import get_method_wrapper +from rpython.jit.metainterp.resoperation import rop, opname +from rpython.jit.metainterp.typesystem import oohelper +from rpython.jit.backend.cli import runner +from rpython.jit.backend.cli.methodfactory import get_method_wrapper System = CLR.System OpCodes = System.Reflection.Emit.OpCodes diff --git a/pypy/jit/backend/cli/methodfactory.py b/rpython/jit/backend/cli/methodfactory.py similarity index 96% rename from pypy/jit/backend/cli/methodfactory.py rename to rpython/jit/backend/cli/methodfactory.py index 98399ee7fef4c7c594d8541661c82f0786887825..0c037d970b68c092b10c13809c2e46193e8a9401 100644 --- a/pypy/jit/backend/cli/methodfactory.py +++ b/rpython/jit/backend/cli/methodfactory.py @@ -1,6 +1,6 @@ import os -from pypy.translator.cli.dotnet import CLR -from pypy.translator.cli import dotnet +from rpython.translator.cli.dotnet import CLR +from rpython.translator.cli import dotnet System = CLR.System Utils = CLR.pypy.runtime.Utils AutoSaveAssembly = CLR.pypy.runtime.AutoSaveAssembly diff --git a/pypy/jit/backend/cli/runner.py b/rpython/jit/backend/cli/runner.py similarity index 91% rename from pypy/jit/backend/cli/runner.py rename to rpython/jit/backend/cli/runner.py index 5507c81498331bfc1cbb9db70b3f4f26dcbf66fd..558e07ce7f392dfbf9e480dcd6e73425a40bb363 100644 --- a/pypy/jit/backend/cli/runner.py +++ b/rpython/jit/backend/cli/runner.py @@ -1,17 +1,17 @@ -from pypy.tool.pairtype import extendabletype -from pypy.rpython.ootypesystem import ootype -from pypy.rlib.objectmodel import we_are_translated -from pypy.jit.metainterp import history -from pypy.jit.metainterp.history import AbstractDescr, AbstractMethDescr -from pypy.jit.metainterp.history import AbstractFailDescr, LoopToken -from pypy.jit.metainterp.history import Box, BoxInt, BoxObj, ConstObj, Const -from pypy.jit.metainterp import executor -from pypy.jit.metainterp.resoperation import rop, opname -from pypy.jit.backend import model -from pypy.jit.backend.llgraph.runner import KeyManager -from pypy.translator.cli import dotnet -from pypy.translator.cli.dotnet import CLR -from pypy.jit.metainterp.typesystem import oohelper +from rpython.tool.pairtype import extendabletype +from rpython.rtyper.ootypesystem import ootype +from rpython.rlib.objectmodel import we_are_translated +from rpython.jit.metainterp import history +from rpython.jit.metainterp.history import AbstractDescr, AbstractMethDescr +from rpython.jit.metainterp.history import AbstractFailDescr, LoopToken +from rpython.jit.metainterp.history import Box, BoxInt, BoxObj, ConstObj, Const +from rpython.jit.metainterp import executor +from rpython.jit.metainterp.resoperation import rop, opname +from rpython.jit.backend import model +from rpython.jit.backend.llgraph.runner import KeyManager +from rpython.translator.cli import dotnet +from rpython.translator.cli.dotnet import CLR +from rpython.jit.metainterp.typesystem import oohelper System = CLR.System OpCodes = System.Reflection.Emit.OpCodes @@ -111,7 +111,7 @@ class CliCPU(model.AbstractCPU): descr._guard_op = op def compile_loop(self, inputargs, operations, looptoken): - from pypy.jit.backend.cli.method import Method, ConstFunction + from rpython.jit.backend.cli.method import Method, ConstFunction name = 'Loop%d' % self.loopcount self.loopcount += 1 cliloop = CliLoop(name, inputargs, operations) @@ -122,7 +122,7 @@ class CliCPU(model.AbstractCPU): cliloop.funcbox.holder.SetFunc(meth.compile()) def compile_bridge(self, faildescr, inputargs, operations): - from pypy.jit.backend.cli.method import Method + from rpython.jit.backend.cli.method import Method op = faildescr._guard_op token = faildescr._loop_token token.guard2ops[op] = (inputargs, operations) @@ -239,7 +239,7 @@ class CliCPU(model.AbstractCPU): return calldescr.get_errbox() def _cast_instance_to_native_obj(self, e): - from pypy.rpython.annlowlevel import cast_instance_to_base_obj + from rpython.rtyper.annlowlevel import cast_instance_to_base_obj inst = cast_instance_to_base_obj(e) # SomeOOInstance obj = ootype.cast_to_object(inst) # SomeOOObject return dotnet.cast_to_native_object(obj) # System.Object @@ -319,8 +319,8 @@ class TypeDescr(DescrWithKey): def __init__(self, TYPE): DescrWithKey.__init__(self, TYPE) - from pypy.jit.backend.llgraph.runner import boxresult - from pypy.jit.metainterp.warmstate import unwrap + from rpython.jit.backend.llgraph.runner import boxresult + from rpython.jit.metainterp.warmstate import unwrap ARRAY = ootype.Array(TYPE) def create(): if isinstance(TYPE, ootype.OOType): @@ -387,7 +387,7 @@ class StaticMethDescr(DescrWithKey): def __init__(self, FUNC, ARGS, RESULT, extrainfo=None): DescrWithKey.__init__(self, (FUNC, ARGS, RESULT)) - from pypy.jit.backend.llgraph.runner import boxresult, make_getargs + from rpython.jit.backend.llgraph.runner import boxresult, make_getargs getargs = make_getargs(FUNC.ARGS) def callfunc(funcbox, argboxes): funcobj = funcbox.getref(FUNC) @@ -432,7 +432,7 @@ class MethDescr(AbstractMethDescr): new = classmethod(DescrWithKey.new.im_func) def __init__(self, SELFTYPE, methname): - from pypy.jit.backend.llgraph.runner import boxresult, make_getargs + from rpython.jit.backend.llgraph.runner import boxresult, make_getargs _, meth = SELFTYPE._lookup(methname) METH = ootype.typeOf(meth) getargs = make_getargs(METH.ARGS) @@ -486,8 +486,8 @@ class FieldDescr(DescrWithKey): def __init__(self, TYPE, fieldname): DescrWithKey.__init__(self, (TYPE, fieldname)) - from pypy.jit.backend.llgraph.runner import boxresult - from pypy.jit.metainterp.warmstate import unwrap + from rpython.jit.backend.llgraph.runner import boxresult + from rpython.jit.metainterp.warmstate import unwrap _, T = TYPE._lookup_field(fieldname) def getfield(objbox): obj = objbox.getref(TYPE) @@ -528,5 +528,5 @@ class FieldDescr(DescrWithKey): CPU = CliCPU -import pypy.jit.metainterp.executor -pypy.jit.metainterp.executor.make_execute_list(CPU) +import rpython.jit.metainterp.executor +rpython.jit.metainterp.executor.make_execute_list(CPU) diff --git a/pypy/jit/backend/llgraph/test/__init__.py b/rpython/jit/backend/cli/test/__init__.py similarity index 100% rename from pypy/jit/backend/llgraph/test/__init__.py rename to rpython/jit/backend/cli/test/__init__.py diff --git a/pypy/jit/backend/cli/test/conftest.py b/rpython/jit/backend/cli/test/conftest.py similarity index 100% rename from pypy/jit/backend/cli/test/conftest.py rename to rpython/jit/backend/cli/test/conftest.py diff --git a/pypy/jit/backend/cli/test/test_basic.py b/rpython/jit/backend/cli/test/test_basic.py similarity index 91% rename from pypy/jit/backend/cli/test/test_basic.py rename to rpython/jit/backend/cli/test/test_basic.py index 81599bae06dc54a67809c987331660a88a59c872..7ac9018df7f1563ec1da0f00381445b228374e04 100644 --- a/pypy/jit/backend/cli/test/test_basic.py +++ b/rpython/jit/backend/cli/test/test_basic.py @@ -1,11 +1,11 @@ import py -from pypy.jit.backend.cli.runner import CliCPU -from pypy.jit.metainterp.test import support, test_ajit +from rpython.jit.backend.cli.runner import CliCPU +from rpython.jit.metainterp.test import support, test_ajit class CliJitMixin(suport.OOJitMixin): CPUClass = CliCPU def setup_class(cls): - from pypy.translator.cli.support import PythonNet + from rpython.translator.cli.support import PythonNet PythonNet.System # possibly raises Skip class TestBasic(CliJitMixin, test_ajit.TestOOtype): diff --git a/pypy/jit/backend/cli/test/test_descr.py b/rpython/jit/backend/cli/test/test_descr.py similarity index 88% rename from pypy/jit/backend/cli/test/test_descr.py rename to rpython/jit/backend/cli/test/test_descr.py index 62333d26822d8ddd38cb95592d4701074bcf3daf..6a44ffc560fcbb811477f32abcde76f248de0611 100644 --- a/pypy/jit/backend/cli/test/test_descr.py +++ b/rpython/jit/backend/cli/test/test_descr.py @@ -1,5 +1,5 @@ -from pypy.rpython.ootypesystem import ootype -from pypy.jit.backend.cli.runner import CliCPU +from rpython.rtyper.ootypesystem import ootype +from rpython.jit.backend.cli.runner import CliCPU def test_fielddescr_ootype(): diff --git a/pypy/jit/backend/cli/test/test_exception.py b/rpython/jit/backend/cli/test/test_exception.py similarity index 87% rename from pypy/jit/backend/cli/test/test_exception.py rename to rpython/jit/backend/cli/test/test_exception.py index 15f9ab182ce5a44d803b6db672e1b907a3942dfa..335837f0b05594b270bc6bd443016c335b6cf09a 100644 --- a/pypy/jit/backend/cli/test/test_exception.py +++ b/rpython/jit/backend/cli/test/test_exception.py @@ -1,6 +1,6 @@ import py -from pypy.jit.metainterp.test import test_exception -from pypy.jit.backend.cli.test.test_basic import CliJitMixin +from rpython.jit.metainterp.test import test_exception +from rpython.jit.backend.cli.test.test_basic import CliJitMixin class TestException(CliJitMixin, test_exception.TestOOtype): diff --git a/pypy/jit/backend/cli/test/test_list.py b/rpython/jit/backend/cli/test/test_list.py similarity index 74% rename from pypy/jit/backend/cli/test/test_list.py rename to rpython/jit/backend/cli/test/test_list.py index 1b92f6dc688a7960244d97825ec46306ef2ac678..64e2af300d5bbd1e41087572f7c4fc0e1e6ab0ba 100644 --- a/pypy/jit/backend/cli/test/test_list.py +++ b/rpython/jit/backend/cli/test/test_list.py @@ -1,6 +1,6 @@ import py -from pypy.jit.metainterp.test import test_list -from pypy.jit.backend.cli.test.test_basic import CliJitMixin +from rpython.jit.metainterp.test import test_list +from rpython.jit.backend.cli.test.test_basic import CliJitMixin class TestVlist(CliJitMixin, test_list.TestOOtype): diff --git a/pypy/jit/backend/cli/test/test_loop.py b/rpython/jit/backend/cli/test/test_loop.py similarity index 83% rename from pypy/jit/backend/cli/test/test_loop.py rename to rpython/jit/backend/cli/test/test_loop.py index fc68537e2f64b556f33cb3104bccf9d5d3012a16..0dea6fabc2faedf6e6fc71b3f5f0e8a683d0f825 100644 --- a/pypy/jit/backend/cli/test/test_loop.py +++ b/rpython/jit/backend/cli/test/test_loop.py @@ -1,6 +1,6 @@ import py -from pypy.jit.metainterp.test import test_loop -from pypy.jit.backend.cli.test.test_basic import CliJitMixin +from rpython.jit.metainterp.test import test_loop +from rpython.jit.backend.cli.test.test_basic import CliJitMixin class TestLoop(CliJitMixin, test_loop.TestOOtype): diff --git a/pypy/jit/backend/cli/test/test_runner.py b/rpython/jit/backend/cli/test/test_runner.py similarity index 91% rename from pypy/jit/backend/cli/test/test_runner.py rename to rpython/jit/backend/cli/test/test_runner.py index 45c9a0278592e2783169d4cdd905f180dc99f4be..d30539697504a8152f2302e0f84e30aa8b5bba99 100644 --- a/pypy/jit/backend/cli/test/test_runner.py +++ b/rpython/jit/backend/cli/test/test_runner.py @@ -1,6 +1,6 @@ import py -from pypy.jit.backend.cli.runner import CliCPU -from pypy.jit.backend.test.runner_test import OOtypeBackendTest +from rpython.jit.backend.cli.runner import CliCPU +from rpython.jit.backend.test.runner_test import OOtypeBackendTest class FakeStats(object): pass @@ -50,7 +50,7 @@ class TestRunner(CliJitMixin, OOtypeBackendTest): def test_pypycliopt(): import os - from pypy.jit.backend.cli.method import Method + from rpython.jit.backend.cli.method import Method def getmeth(value): oldenv = os.environ.get('PYPYJITOPT') diff --git a/pypy/jit/backend/cli/test/test_zrpy_basic.py b/rpython/jit/backend/cli/test/test_zrpy_basic.py similarity index 80% rename from pypy/jit/backend/cli/test/test_zrpy_basic.py rename to rpython/jit/backend/cli/test/test_zrpy_basic.py index 535f2f0a291f631ee5ddb3cdcf1ca156589be4a6..627e7cac2467638b463b3a7eb942e383cb16c90b 100644 --- a/pypy/jit/backend/cli/test/test_zrpy_basic.py +++ b/rpython/jit/backend/cli/test/test_zrpy_basic.py @@ -1,13 +1,13 @@ import py -from pypy.jit.backend.cli.runner import CliCPU -from pypy.jit.backend.test.support import CliCompiledMixin -from pypy.jit.metainterp.test import test_basic +from rpython.jit.backend.cli.runner import CliCPU +from rpython.jit.backend.test.support import CliCompiledMixin +from rpython.jit.metainterp.test import test_basic class CliTranslatedJitMixin(CliCompiledMixin): CPUClass = CliCPU def meta_interp(self, *args, **kwds): - from pypy.rlib.jit import OPTIMIZER_SIMPLE + from rpython.rlib.jit import OPTIMIZER_SIMPLE kwds['optimizer'] = OPTIMIZER_SIMPLE return CliCompiledMixin.meta_interp(self, *args, **kwds) diff --git a/pypy/jit/backend/cli/test/test_zrpy_exception.py b/rpython/jit/backend/cli/test/test_zrpy_exception.py similarity index 57% rename from pypy/jit/backend/cli/test/test_zrpy_exception.py rename to rpython/jit/backend/cli/test/test_zrpy_exception.py index 6440f787ef0ee584a9d3940df85c25cd25f6b47b..ec11f9476bdaaba00d836d06f8b7e8c97686396a 100644 --- a/pypy/jit/backend/cli/test/test_zrpy_exception.py +++ b/rpython/jit/backend/cli/test/test_zrpy_exception.py @@ -1,6 +1,6 @@ import py -from pypy.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin -from pypy.jit.metainterp.test import test_exception +from rpython.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin +from rpython.jit.metainterp.test import test_exception class TestException(CliTranslatedJitMixin, test_exception.TestOOtype): diff --git a/pypy/jit/backend/cli/test/test_zrpy_list.py b/rpython/jit/backend/cli/test/test_zrpy_list.py similarity index 56% rename from pypy/jit/backend/cli/test/test_zrpy_list.py rename to rpython/jit/backend/cli/test/test_zrpy_list.py index a7e94c316625ff80266faeb001d49117da29048f..a4117862d4d5d0c5739cd6ccde5f4c38d5bf1990 100644 --- a/pypy/jit/backend/cli/test/test_zrpy_list.py +++ b/rpython/jit/backend/cli/test/test_zrpy_list.py @@ -1,6 +1,6 @@ import py -from pypy.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin -from pypy.jit.metainterp.test import test_list +from rpython.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin +from rpython.jit.metainterp.test import test_list class TestVList(CliTranslatedJitMixin, test_list.TestOOtype): diff --git a/pypy/jit/backend/cli/test/test_zrpy_loop.py b/rpython/jit/backend/cli/test/test_zrpy_loop.py similarity index 77% rename from pypy/jit/backend/cli/test/test_zrpy_loop.py rename to rpython/jit/backend/cli/test/test_zrpy_loop.py index 41707f1f852677b7b14fbf401907ede012a80efa..1db9b83ca448cb4b9b679e128c9cb6f31dedc00f 100644 --- a/pypy/jit/backend/cli/test/test_zrpy_loop.py +++ b/rpython/jit/backend/cli/test/test_zrpy_loop.py @@ -1,6 +1,6 @@ import py -from pypy.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin -from pypy.jit.metainterp.test import test_loop +from rpython.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin +from rpython.jit.metainterp.test import test_loop class TestLoop(CliTranslatedJitMixin, test_loop.TestOOtype): diff --git a/pypy/jit/backend/cli/test/test_zrpy_send.py b/rpython/jit/backend/cli/test/test_zrpy_send.py similarity index 80% rename from pypy/jit/backend/cli/test/test_zrpy_send.py rename to rpython/jit/backend/cli/test/test_zrpy_send.py index 52cd0ab8da6f43f4fbe06f4d2370e9d093b78401..e3e8b87650128b41187e1f29771efc5904476382 100644 --- a/pypy/jit/backend/cli/test/test_zrpy_send.py +++ b/rpython/jit/backend/cli/test/test_zrpy_send.py @@ -1,6 +1,6 @@ import py -from pypy.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin -from pypy.jit.metainterp.test import test_send +from rpython.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin +from rpython.jit.metainterp.test import test_send class TestSend(CliTranslatedJitMixin, test_send.TestOOtype): diff --git a/pypy/jit/backend/cli/test/test_zrpy_slist.py b/rpython/jit/backend/cli/test/test_zrpy_slist.py similarity index 61% rename from pypy/jit/backend/cli/test/test_zrpy_slist.py rename to rpython/jit/backend/cli/test/test_zrpy_slist.py index 92596d91b71cb161f6ef91df01ba1723439a8f3d..90204379b769f0880ab0d33de2fea4c9a0670b50 100644 --- a/pypy/jit/backend/cli/test/test_zrpy_slist.py +++ b/rpython/jit/backend/cli/test/test_zrpy_slist.py @@ -1,7 +1,7 @@ import py py.test.skip('decide what to do') -from pypy.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin -from pypy.jit.metainterp.test import test_slist +from rpython.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin +from rpython.jit.metainterp.test import test_slist class TestSList(CliTranslatedJitMixin, test_slist.TestOOtype): diff --git a/pypy/jit/backend/cli/test/test_zrpy_virtualizable.py b/rpython/jit/backend/cli/test/test_zrpy_virtualizable.py similarity index 58% rename from pypy/jit/backend/cli/test/test_zrpy_virtualizable.py rename to rpython/jit/backend/cli/test/test_zrpy_virtualizable.py index f092e59eead252aab3996b08507783390c4641c7..b0008858650328e2b14b7a15a651079b012563dd 100644 --- a/pypy/jit/backend/cli/test/test_zrpy_virtualizable.py +++ b/rpython/jit/backend/cli/test/test_zrpy_virtualizable.py @@ -1,6 +1,6 @@ import py -from pypy.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin -from pypy.jit.metainterp.test import test_virtualizable +from rpython.jit.backend.cli.test.test_zrpy_basic import CliTranslatedJitMixin +from rpython.jit.metainterp.test import test_virtualizable class TestVirtualizable(CliTranslatedJitMixin, test_virtualizable.TestOOtype): diff --git a/pypy/jit/backend/conftest.py b/rpython/jit/backend/conftest.py similarity index 100% rename from pypy/jit/backend/conftest.py rename to rpython/jit/backend/conftest.py diff --git a/pypy/jit/backend/detect_cpu.py b/rpython/jit/backend/detect_cpu.py similarity index 82% rename from pypy/jit/backend/detect_cpu.py rename to rpython/jit/backend/detect_cpu.py index 09f2040c960641970f858897594a9c6a7aaecdbe..ae4c61a18d143d08a93feff17528e2f49b7b4b54 100644 --- a/pypy/jit/backend/detect_cpu.py +++ b/rpython/jit/backend/detect_cpu.py @@ -1,7 +1,6 @@ """ Processor auto-detection """ -import autopath import sys, os @@ -56,11 +55,11 @@ def autodetect(): else: assert sys.maxint == 2**31-1 if model == 'x86': - from pypy.jit.backend.x86.detect_sse2 import detect_sse2 + from rpython.jit.backend.x86.detect_sse2 import detect_sse2 if not detect_sse2(): model = 'x86-without-sse2' if model == 'arm': - from pypy.jit.backend.arm.detect import detect_hardfloat, detect_float + from rpython.jit.backend.arm.detect import detect_hardfloat, detect_float if detect_hardfloat(): model = 'armhf' assert detect_float(), 'the JIT-compiler requires a vfp unit' @@ -70,17 +69,17 @@ def getcpuclassname(backend_name="auto"): if backend_name == "auto": backend_name = autodetect() if backend_name == 'x86': - return "pypy.jit.backend.x86.runner", "CPU" + return "rpython.jit.backend.x86.runner", "CPU" elif backend_name == 'x86-without-sse2': - return "pypy.jit.backend.x86.runner", "CPU386_NO_SSE2" + return "rpython.jit.backend.x86.runner", "CPU386_NO_SSE2" elif backend_name == 'x86_64': - return "pypy.jit.backend.x86.runner", "CPU_X86_64" + return "rpython.jit.backend.x86.runner", "CPU_X86_64" elif backend_name == 'cli': - return "pypy.jit.backend.cli.runner", "CliCPU" + return "rpython.jit.backend.cli.runner", "CliCPU" elif backend_name == 'arm': - return "pypy.jit.backend.arm.runner", "CPU_ARM" + return "rpython.jit.backend.arm.runner", "CPU_ARM" elif backend_name == 'armhf': - return "pypy.jit.backend.arm.runner", "CPU_ARMHF" + return "rpython.jit.backend.arm.runner", "CPU_ARMHF" else: raise ProcessorAutodetectError, ( "we have no JIT backend for this cpu: '%s'" % backend_name) diff --git a/pypy/jit/backend/hlinfo.py b/rpython/jit/backend/hlinfo.py similarity index 100% rename from pypy/jit/backend/hlinfo.py rename to rpython/jit/backend/hlinfo.py diff --git a/pypy/jit/backend/llsupport/__init__.py b/rpython/jit/backend/llgraph/__init__.py similarity index 100% rename from pypy/jit/backend/llsupport/__init__.py rename to rpython/jit/backend/llgraph/__init__.py diff --git a/pypy/jit/backend/llgraph/llimpl.py b/rpython/jit/backend/llgraph/llimpl.py similarity index 98% rename from pypy/jit/backend/llgraph/llimpl.py rename to rpython/jit/backend/llgraph/llimpl.py index 5c2c886bffc8b92db1f4242011dc98290bb35352..d28ec62145f8c6481e1198b4672762041bf371ed 100644 --- a/pypy/jit/backend/llgraph/llimpl.py +++ b/rpython/jit/backend/llgraph/llimpl.py @@ -5,30 +5,30 @@ when executing on top of the llinterpreter. """ import weakref -from pypy.objspace.flow.model import Variable, Constant -from pypy.annotation import model as annmodel -from pypy.jit.metainterp.history import REF, INT, FLOAT -from pypy.jit.metainterp import history -from pypy.jit.codewriter import heaptracker -from pypy.rpython.lltypesystem import lltype, llmemory, rclass, rstr, rffi -from pypy.rpython.ootypesystem import ootype -from pypy.rpython.module.support import LLSupport, OOSupport -from pypy.rpython.llinterp import LLException -from pypy.rpython.extregistry import ExtRegistryEntry - -from pypy.jit.metainterp import resoperation -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.backend.llgraph import symbolic -from pypy.jit.codewriter import longlong -from pypy.jit.codewriter.effectinfo import EffectInfo - -from pypy.rlib.objectmodel import ComputedIntSymbolic, we_are_translated -from pypy.rlib.rarithmetic import ovfcheck -from pypy.rlib.rarithmetic import r_longlong, r_ulonglong, r_uint -from pypy.rlib.rtimer import read_timestamp +from rpython.flowspace.model import Variable, Constant +from rpython.annotator import model as annmodel +from rpython.jit.metainterp.history import REF, INT, FLOAT +from rpython.jit.metainterp import history +from rpython.jit.codewriter import heaptracker +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass, rstr, rffi +from rpython.rtyper.ootypesystem import ootype +from rpython.rtyper.module.support import LLSupport, OOSupport +from rpython.rtyper.llinterp import LLException +from rpython.rtyper.extregistry import ExtRegistryEntry + +from rpython.jit.metainterp import resoperation +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.backend.llgraph import symbolic +from rpython.jit.codewriter import longlong +from rpython.jit.codewriter.effectinfo import EffectInfo + +from rpython.rlib.objectmodel import ComputedIntSymbolic, we_are_translated +from rpython.rlib.rarithmetic import ovfcheck +from rpython.rlib.rarithmetic import r_longlong, r_ulonglong, r_uint +from rpython.rlib.rtimer import read_timestamp import py -from pypy.tool.ansi_print import ansi_log +from rpython.tool.ansi_print import ansi_log log = py.log.Producer('runner') py.log.setconsumer('runner', ansi_log) @@ -343,14 +343,14 @@ def compile_add(loop, opnum): loop.operations.append(Operation(opnum)) def compile_add_descr(loop, ofs, type, arg_types, extrainfo, width): - from pypy.jit.backend.llgraph.runner import Descr + from rpython.jit.backend.llgraph.runner import Descr loop = _from_opaque(loop) op = loop.operations[-1] assert isinstance(type, str) and len(type) == 1 op.descr = Descr(ofs, type, arg_types=arg_types, extrainfo=extrainfo, width=width) def compile_add_descr_arg(loop, ofs, type, arg_types): - from pypy.jit.backend.llgraph.runner import Descr + from rpython.jit.backend.llgraph.runner import Descr loop = _from_opaque(loop) op = loop.operations[-1] assert isinstance(type, str) and len(type) == 1 @@ -482,7 +482,7 @@ class Frame(object): self._may_force = -1 def getenv(self, v): - from pypy.jit.backend.llgraph.runner import Descr + from rpython.jit.backend.llgraph.runner import Descr if isinstance(v, Constant): return v.value elif isinstance(v, Descr): @@ -644,7 +644,7 @@ class Frame(object): @classmethod def _make_impl_from_blackhole_interp(cls, opname): - from pypy.jit.metainterp.blackhole import BlackholeInterpreter + from rpython.jit.metainterp.blackhole import BlackholeInterpreter name = 'bhimpl_' + opname.lower() func = BlackholeInterpreter.__dict__[name] for argtype in func.argtypes: @@ -666,7 +666,7 @@ class Frame(object): self.env = newenv def op_debug_merge_point(self, _, *args): - from pypy.jit.metainterp.warmspot import get_stats + from rpython.jit.metainterp.warmspot import get_stats try: stats = get_stats() except AttributeError: diff --git a/pypy/jit/backend/llgraph/runner.py b/rpython/jit/backend/llgraph/runner.py similarity index 97% rename from pypy/jit/backend/llgraph/runner.py rename to rpython/jit/backend/llgraph/runner.py index 35234f42aecbdf5f9d7da95038191772a542467b..afb72ae58b94de2c0f6c79417d3a43aa53c19791 100644 --- a/pypy/jit/backend/llgraph/runner.py +++ b/rpython/jit/backend/llgraph/runner.py @@ -2,20 +2,20 @@ Minimal-API wrapper around the llinterpreter to run operations. """ -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.jit_hooks import LOOP_RUN_CONTAINER -from pypy.rpython.lltypesystem import lltype, llmemory, rclass -from pypy.rpython.ootypesystem import ootype -from pypy.rpython.llinterp import LLInterpreter -from pypy.jit.metainterp import history -from pypy.jit.metainterp.history import REF, INT, FLOAT, STRUCT -from pypy.jit.metainterp.warmstate import unwrap -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.backend import model -from pypy.jit.backend.llgraph import llimpl, symbolic -from pypy.jit.metainterp.typesystem import llhelper, oohelper -from pypy.jit.codewriter import heaptracker, longlong +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.jit_hooks import LOOP_RUN_CONTAINER +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass +from rpython.rtyper.ootypesystem import ootype +from rpython.rtyper.llinterp import LLInterpreter +from rpython.jit.metainterp import history +from rpython.jit.metainterp.history import REF, INT, FLOAT, STRUCT +from rpython.jit.metainterp.warmstate import unwrap +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.backend import model +from rpython.jit.backend.llgraph import llimpl, symbolic +from rpython.jit.metainterp.typesystem import llhelper, oohelper +from rpython.jit.codewriter import heaptracker, longlong class MiniStats: pass @@ -362,8 +362,8 @@ class LLtypeCPU(BaseCPU): arg_types=''.join(arg_types)) def calldescrof_dynamic(self, cif_description, extrainfo): - from pypy.jit.backend.llsupport.ffisupport import get_ffi_type_kind - from pypy.jit.backend.llsupport.ffisupport import UnsupportedKind + from rpython.jit.backend.llsupport.ffisupport import get_ffi_type_kind + from rpython.jit.backend.llsupport.ffisupport import UnsupportedKind arg_types = [] try: for itp in range(cif_description.nargs): @@ -380,7 +380,7 @@ class LLtypeCPU(BaseCPU): def _calldescr_dynamic_for_tests(self, atypes, rtype, abiname='FFI_DEFAULT_ABI'): - from pypy.jit.backend.llsupport import ffisupport + from rpython.jit.backend.llsupport import ffisupport return ffisupport.calldescr_dynamic_for_tests(self, atypes, rtype, abiname) diff --git a/pypy/jit/backend/llgraph/symbolic.py b/rpython/jit/backend/llgraph/symbolic.py similarity index 91% rename from pypy/jit/backend/llgraph/symbolic.py rename to rpython/jit/backend/llgraph/symbolic.py index 49409b8fad3dda3287369782bdf15effbe5069af..d64f94770289c81008ce44cef7aef04253685ea7 100644 --- a/pypy/jit/backend/llgraph/symbolic.py +++ b/rpython/jit/backend/llgraph/symbolic.py @@ -1,4 +1,4 @@ -from pypy.rpython.lltypesystem import lltype, rffi, rclass +from rpython.rtyper.lltypesystem import lltype, rffi, rclass Size2Type = [None] * 100 diff --git a/pypy/jit/backend/llsupport/test/__init__.py b/rpython/jit/backend/llgraph/test/__init__.py similarity index 100% rename from pypy/jit/backend/llsupport/test/__init__.py rename to rpython/jit/backend/llgraph/test/__init__.py diff --git a/pypy/jit/backend/llgraph/test/test_llgraph.py b/rpython/jit/backend/llgraph/test/test_llgraph.py similarity index 60% rename from pypy/jit/backend/llgraph/test/test_llgraph.py rename to rpython/jit/backend/llgraph/test/test_llgraph.py index 994577b07a9aa13fcf0f6a103e6932834bf887f0..654a1b769ca602166db107c1ed4f734b34110908 100644 --- a/pypy/jit/backend/llgraph/test/test_llgraph.py +++ b/rpython/jit/backend/llgraph/test/test_llgraph.py @@ -1,20 +1,20 @@ import py -from pypy.rpython.lltypesystem import lltype, llmemory, rstr, rclass -from pypy.rpython.test.test_llinterp import interpret -from pypy.rlib.unroll import unrolling_iterable +from rpython.rtyper.lltypesystem import lltype, llmemory, rstr, rclass +from rpython.rtyper.test.test_llinterp import interpret +from rpython.rlib.unroll import unrolling_iterable -from pypy.jit.metainterp.history import BoxInt, BoxPtr, Const, ConstInt,\ +from rpython.jit.metainterp.history import BoxInt, BoxPtr, Const, ConstInt,\ TreeLoop -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.metainterp.executor import execute -from pypy.jit.codewriter import heaptracker -from pypy.jit.backend.test.runner_test import LLtypeBackendTest +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.metainterp.executor import execute +from rpython.jit.codewriter import heaptracker +from rpython.jit.backend.test.runner_test import LLtypeBackendTest class TestLLTypeLLGraph(LLtypeBackendTest): # for individual tests see: # ====> ../../test/runner_test.py - from pypy.jit.backend.llgraph.runner import LLtypeCPU as cpu_type + from rpython.jit.backend.llgraph.runner import LLtypeCPU as cpu_type def setup_method(self, _): self.cpu = self.cpu_type(None) @@ -37,12 +37,12 @@ def test_cast_adr_to_int_and_back(): ## these tests never worked ## class TestOOTypeLLGraph(LLGraphTest): -## from pypy.jit.backend.llgraph.runner import OOtypeCPU as cpu_type +## from rpython.jit.backend.llgraph.runner import OOtypeCPU as cpu_type def test_fielddescr_ootype(): py.test.skip("ootype tests skipped") - from pypy.rpython.ootypesystem import ootype - from pypy.jit.backend.llgraph.runner import OOtypeCPU + from rpython.rtyper.ootypesystem import ootype + from rpython.jit.backend.llgraph.runner import OOtypeCPU A = ootype.Instance("A", ootype.ROOT, {"foo": ootype.Signed}) B = ootype.Instance("B", A) cpu = OOtypeCPU(None) diff --git a/pypy/jit/backend/test/__init__.py b/rpython/jit/backend/llsupport/__init__.py similarity index 100% rename from pypy/jit/backend/test/__init__.py rename to rpython/jit/backend/llsupport/__init__.py diff --git a/pypy/jit/backend/llsupport/asmmemmgr.py b/rpython/jit/backend/llsupport/asmmemmgr.py similarity index 96% rename from pypy/jit/backend/llsupport/asmmemmgr.py rename to rpython/jit/backend/llsupport/asmmemmgr.py index 5bdf067835a0406e80ea2d030a8bef56297f8c68..1627b37a4682efc46d3bbc8355fd52814105e8cd 100644 --- a/pypy/jit/backend/llsupport/asmmemmgr.py +++ b/rpython/jit/backend/llsupport/asmmemmgr.py @@ -1,10 +1,10 @@ import sys -from pypy.rlib.rarithmetic import intmask, r_uint, LONG_BIT -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib import rmmap -from pypy.rlib.debug import debug_start, debug_print, debug_stop -from pypy.rlib.debug import have_debug_prints -from pypy.rpython.lltypesystem import lltype, llmemory, rffi +from rpython.rlib.rarithmetic import intmask, r_uint, LONG_BIT +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib import rmmap +from rpython.rlib.debug import debug_start, debug_print, debug_stop +from rpython.rlib.debug import have_debug_prints +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi class AsmMemoryManager(object): @@ -274,7 +274,7 @@ class BlockBuilderMixin(object): if backend is not None: debug_print('BACKEND', backend) # - from pypy.jit.backend.hlinfo import highleveljitinfo + from rpython.jit.backend.hlinfo import highleveljitinfo if highleveljitinfo.sys_executable: debug_print('SYS_EXECUTABLE', highleveljitinfo.sys_executable) else: diff --git a/pypy/jit/backend/llsupport/descr.py b/rpython/jit/backend/llsupport/descr.py similarity index 96% rename from pypy/jit/backend/llsupport/descr.py rename to rpython/jit/backend/llsupport/descr.py index ad413ab9cedb2de7ca72c548c6001fe8f23e7c15..038490b7fb7e91bab5c0689d03a20cee81e2b08e 100644 --- a/pypy/jit/backend/llsupport/descr.py +++ b/rpython/jit/backend/llsupport/descr.py @@ -1,11 +1,11 @@ import py -from pypy.rpython.lltypesystem import lltype, rffi, llmemory -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.jit.backend.llsupport import symbolic, support -from pypy.jit.metainterp.history import AbstractDescr, getkind -from pypy.jit.metainterp import history -from pypy.jit.codewriter import heaptracker, longlong -from pypy.jit.codewriter.longlong import is_longlong +from rpython.rtyper.lltypesystem import lltype, rffi, llmemory +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.jit.backend.llsupport import symbolic, support +from rpython.jit.metainterp.history import AbstractDescr, getkind +from rpython.jit.metainterp import history +from rpython.jit.codewriter import heaptracker, longlong +from rpython.jit.codewriter.longlong import is_longlong class GcCache(object): @@ -295,7 +295,7 @@ class CallDescr(AbstractDescr): res += ' EF=%r' % extraeffect oopspecindex = getattr(self.extrainfo, 'oopspecindex', 0) if oopspecindex: - from pypy.jit.codewriter.effectinfo import EffectInfo + from rpython.jit.codewriter.effectinfo import EffectInfo for key, value in EffectInfo.__dict__.items(): if key.startswith('OS_') and value == oopspecindex: break @@ -311,7 +311,7 @@ class CallDescr(AbstractDescr): return self.ffi_flags def get_call_conv(self): - from pypy.rlib.clibffi import get_call_conv + from rpython.rlib.clibffi import get_call_conv return get_call_conv(self.ffi_flags, True) def get_arg_types(self): @@ -327,7 +327,7 @@ class CallDescr(AbstractDescr): return self.result_flag == FLAG_SIGNED def create_call_stub(self, rtyper, RESULT): - from pypy.rlib.clibffi import FFI_DEFAULT_ABI + from rpython.rlib.clibffi import FFI_DEFAULT_ABI assert self.get_call_conv() == FFI_DEFAULT_ABI, ( "%r: create_call_stub() with a non-default call ABI" % (self,)) diff --git a/pypy/jit/backend/llsupport/ffisupport.py b/rpython/jit/backend/llsupport/ffisupport.py similarity index 86% rename from pypy/jit/backend/llsupport/ffisupport.py rename to rpython/jit/backend/llsupport/ffisupport.py index 884a143f075fb6e872296fc97182b5cd8ed1957b..80bc6517da74e0d9dbb4adaaa458e001b45ff3ab 100644 --- a/pypy/jit/backend/llsupport/ffisupport.py +++ b/rpython/jit/backend/llsupport/ffisupport.py @@ -1,7 +1,7 @@ -from pypy.rlib.rarithmetic import intmask -from pypy.rlib.objectmodel import specialize -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.jit.backend.llsupport.descr import CallDescr +from rpython.rlib.rarithmetic import intmask +from rpython.rlib.objectmodel import specialize +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.jit.backend.llsupport.descr import CallDescr class UnsupportedKind(Exception): pass @@ -24,7 +24,7 @@ def get_call_descr_dynamic(cpu, cif_description, extrainfo): result_size, extrainfo, ffi_flags=cif_description.abi) def get_ffi_type_kind(cpu, ffi_type): - from pypy.rlib.jit_libffi import types + from rpython.rlib.jit_libffi import types kind = types.getkind(ffi_type) if ((not cpu.supports_floats and kind == 'f') or (not cpu.supports_longlong and kind == 'L') or @@ -36,7 +36,7 @@ def get_ffi_type_kind(cpu, ffi_type): return kind def is_ffi_type_signed(ffi_type): - from pypy.rlib.jit_libffi import types + from rpython.rlib.jit_libffi import types kind = types.getkind(ffi_type) return kind != 'u' @@ -72,7 +72,7 @@ def _get_ffi2descr_dict(cpu): return d def get_arg_descr(cpu, ffi_type): - from pypy.rlib.jit_libffi import types + from rpython.rlib.jit_libffi import types kind = types.getkind(ffi_type) if kind == 'i' or kind == 'u': size = rffi.getintfield(ffi_type, 'c_size') @@ -81,9 +81,9 @@ def get_arg_descr(cpu, ffi_type): return _get_ffi2descr_dict(cpu)[kind, size] def calldescr_dynamic_for_tests(cpu, atypes, rtype, abiname='FFI_DEFAULT_ABI'): - from pypy.rlib import clibffi - from pypy.rlib.jit_libffi import CIF_DESCRIPTION, FFI_TYPE_PP - from pypy.jit.codewriter.effectinfo import EffectInfo + from rpython.rlib import clibffi + from rpython.rlib.jit_libffi import CIF_DESCRIPTION, FFI_TYPE_PP + from rpython.jit.codewriter.effectinfo import EffectInfo # p = lltype.malloc(CIF_DESCRIPTION, len(atypes), flavor='raw', immortal=True) diff --git a/pypy/jit/backend/llsupport/gc.py b/rpython/jit/backend/llsupport/gc.py similarity index 95% rename from pypy/jit/backend/llsupport/gc.py rename to rpython/jit/backend/llsupport/gc.py index 375efcce92c5d1ff86b437ec306e8eea4e02c5af..195e1a6243f13ad490c9767d525ece3497061439 100644 --- a/pypy/jit/backend/llsupport/gc.py +++ b/rpython/jit/backend/llsupport/gc.py @@ -1,23 +1,23 @@ import os -from pypy.rlib import rgc -from pypy.rlib.objectmodel import we_are_translated, specialize -from pypy.rlib.rarithmetic import ovfcheck -from pypy.rpython.lltypesystem import lltype, llmemory, rffi, rclass, rstr -from pypy.rpython.lltypesystem import llgroup -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.rpython.annlowlevel import llhelper -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.jit.codewriter import heaptracker -from pypy.jit.metainterp.history import ConstPtr, AbstractDescr -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.backend.llsupport import symbolic -from pypy.jit.backend.llsupport.symbolic import WORD -from pypy.jit.backend.llsupport.descr import SizeDescr, ArrayDescr -from pypy.jit.backend.llsupport.descr import GcCache, get_field_descr -from pypy.jit.backend.llsupport.descr import get_array_descr -from pypy.jit.backend.llsupport.descr import get_call_descr -from pypy.jit.backend.llsupport.rewrite import GcRewriterAssembler -from pypy.rpython.memory.gctransform import asmgcroot +from rpython.rlib import rgc +from rpython.rlib.objectmodel import we_are_translated, specialize +from rpython.rlib.rarithmetic import ovfcheck +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi, rclass, rstr +from rpython.rtyper.lltypesystem import llgroup +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.rtyper.annlowlevel import llhelper +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.jit.codewriter import heaptracker +from rpython.jit.metainterp.history import ConstPtr, AbstractDescr +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.backend.llsupport import symbolic +from rpython.jit.backend.llsupport.symbolic import WORD +from rpython.jit.backend.llsupport.descr import SizeDescr, ArrayDescr +from rpython.jit.backend.llsupport.descr import GcCache, get_field_descr +from rpython.jit.backend.llsupport.descr import get_array_descr +from rpython.jit.backend.llsupport.descr import get_call_descr +from rpython.jit.backend.llsupport.rewrite import GcRewriterAssembler +from rpython.rtyper.memory.gctransform import asmgcroot # ____________________________________________________________ @@ -129,7 +129,7 @@ class GcLLDescr_boehm(GcLLDescription): """ if hasattr(cls, 'malloc_fn_ptr'): return cls.malloc_fn_ptr - from pypy.rpython.tool import rffi_platform + from rpython.rtyper.tool import rffi_platform compilation_info = rffi_platform.configure_boehm() # on some platform GC_init is required before any other @@ -253,7 +253,7 @@ class GcRootMap_asmgcc(object): if self._gcmap_curlength: addr += rffi.sizeof(lltype.Signed) * self._gcmap_curlength if not we_are_translated() and type(addr) is long: - from pypy.rpython.lltypesystem import ll2ctypes + from rpython.rtyper.lltypesystem import ll2ctypes addr = ll2ctypes._lladdress(addr) # XXX workaround return addr @@ -414,7 +414,7 @@ class GcRootMap_shadowstack(object): # Note that across CALL_MAY_FORCE or CALL_ASSEMBLER, we can also go # from the force_index to a ResumeGuardForcedDescr instance, which # is used if the virtualizable or the virtualrefs need to be forced - # (see pypy.jit.backend.model). The force_index number in the stack + # (see rpython.jit.backend.model). The force_index number in the stack # frame is initially set to a non-negative value x, but it is # occasionally turned into (~x) in case of forcing. @@ -679,7 +679,7 @@ class GcLLDescr_framework(GcLLDescription): def _make_layoutbuilder(self): # make a TransformerLayoutBuilder and save it on the translator # where it can be fished and reused by the FrameworkGCTransformer - from pypy.rpython.memory.gctransform import framework + from rpython.rtyper.memory.gctransform import framework translator = self.translator self.layoutbuilder = framework.TransformerLayoutBuilder(translator) self.layoutbuilder.delay_encoding() @@ -687,7 +687,7 @@ class GcLLDescr_framework(GcLLDescription): self.gcrootmap.add_jit2gc_hooks(translator._jit2gc) def _setup_gcclass(self): - from pypy.rpython.memory.gcheader import GCHeaderBuilder + from rpython.rtyper.memory.gcheader import GCHeaderBuilder self.GCClass = self.layoutbuilder.GCClass self.moving_gc = self.GCClass.moving_gc self.HDRPTR = lltype.Ptr(self.GCClass.HDR) @@ -708,7 +708,7 @@ class GcLLDescr_framework(GcLLDescription): self.write_barrier_descr = WriteBarrierDescr(self) def _make_functions(self, really_not_translated): - from pypy.rpython.memory.gctypelayout import check_typeid + from rpython.rtyper.memory.gctypelayout import check_typeid llop1 = self.llop1 (self.standard_array_basesize, _, self.standard_array_length_ofs) = \ symbolic.get_array_token(lltype.GcArray(lltype.Signed), @@ -794,7 +794,7 @@ class GcLLDescr_framework(GcLLDescription): [lltype.Signed] * 2) def _bh_malloc(self, sizedescr): - from pypy.rpython.memory.gctypelayout import check_typeid + from rpython.rtyper.memory.gctypelayout import check_typeid llop1 = self.llop1 type_id = llop.extract_ushort(llgroup.HALFWORD, sizedescr.tid) check_typeid(type_id) @@ -803,7 +803,7 @@ class GcLLDescr_framework(GcLLDescription): False, False, False) def _bh_malloc_array(self, num_elem, arraydescr): - from pypy.rpython.memory.gctypelayout import check_typeid + from rpython.rtyper.memory.gctypelayout import check_typeid llop1 = self.llop1 type_id = llop.extract_ushort(llgroup.HALFWORD, arraydescr.tid) check_typeid(type_id) diff --git a/pypy/jit/backend/llsupport/llmodel.py b/rpython/jit/backend/llsupport/llmodel.py similarity index 96% rename from pypy/jit/backend/llsupport/llmodel.py rename to rpython/jit/backend/llsupport/llmodel.py index 3d076e73abbbcc1e83e02f3074a18b06bb726a69..eadd8e8635fcf005165895ce4dd39c9bf5cf75b2 100644 --- a/pypy/jit/backend/llsupport/llmodel.py +++ b/rpython/jit/backend/llsupport/llmodel.py @@ -1,29 +1,29 @@ -from pypy.rpython.lltypesystem import lltype, llmemory, rffi, rclass, rstr -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.rpython.llinterp import LLInterpreter -from pypy.rpython.annlowlevel import llhelper -from pypy.rlib.objectmodel import we_are_translated, specialize -from pypy.jit.metainterp import history -from pypy.jit.codewriter import heaptracker, longlong -from pypy.jit.backend.model import AbstractCPU -from pypy.jit.backend.llsupport import symbolic -from pypy.jit.backend.llsupport.symbolic import WORD, unroll_basic_sizes -from pypy.jit.backend.llsupport.descr import ( +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi, rclass, rstr +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.rtyper.llinterp import LLInterpreter +from rpython.rtyper.annlowlevel import llhelper +from rpython.rlib.objectmodel import we_are_translated, specialize +from rpython.jit.metainterp import history +from rpython.jit.codewriter import heaptracker, longlong +from rpython.jit.backend.model import AbstractCPU +from rpython.jit.backend.llsupport import symbolic +from rpython.jit.backend.llsupport.symbolic import WORD, unroll_basic_sizes +from rpython.jit.backend.llsupport.descr import ( get_size_descr, get_field_descr, get_array_descr, get_call_descr, get_interiorfield_descr, FieldDescr, ArrayDescr, CallDescr, InteriorFieldDescr) -from pypy.jit.backend.llsupport.asmmemmgr import AsmMemoryManager +from rpython.jit.backend.llsupport.asmmemmgr import AsmMemoryManager class AbstractLLCPU(AbstractCPU): - from pypy.jit.metainterp.typesystem import llhelper as ts + from rpython.jit.metainterp.typesystem import llhelper as ts def __init__(self, rtyper, stats, opts, translate_support_code=False, gcdescr=None): assert type(opts) is not bool self.opts = opts - from pypy.jit.backend.llsupport.gc import get_ll_description + from rpython.jit.backend.llsupport.gc import get_ll_description AbstractCPU.__init__(self) self.rtyper = rtyper self.stats = stats @@ -123,7 +123,7 @@ class AbstractLLCPU(AbstractCPU): self.saved_exc_value = exc_value def save_exception_memoryerr(): - from pypy.rpython.annlowlevel import cast_instance_to_base_ptr + from rpython.rtyper.annlowlevel import cast_instance_to_base_ptr save_exception() if not self.saved_exc_value: exc = MemoryError() @@ -131,7 +131,7 @@ class AbstractLLCPU(AbstractCPU): exc = lltype.cast_opaque_ptr(llmemory.GCREF, exc) self.saved_exc_value = exc - from pypy.rlib import rstack + from rpython.rlib import rstack STACK_CHECK_SLOWPATH = lltype.Ptr(lltype.FuncType([lltype.Signed], lltype.Void)) def insert_stack_check(): @@ -266,13 +266,13 @@ class AbstractLLCPU(AbstractCPU): return get_call_descr(self.gc_ll_descr, ARGS, RESULT, extrainfo) def calldescrof_dynamic(self, cif_description, extrainfo): - from pypy.jit.backend.llsupport import ffisupport + from rpython.jit.backend.llsupport import ffisupport return ffisupport.get_call_descr_dynamic(self, cif_description, extrainfo) def _calldescr_dynamic_for_tests(self, atypes, rtype, abiname='FFI_DEFAULT_ABI'): - from pypy.jit.backend.llsupport import ffisupport + from rpython.jit.backend.llsupport import ffisupport return ffisupport.calldescr_dynamic_for_tests(self, atypes, rtype, abiname) diff --git a/pypy/jit/backend/llsupport/regalloc.py b/rpython/jit/backend/llsupport/regalloc.py similarity index 98% rename from pypy/jit/backend/llsupport/regalloc.py rename to rpython/jit/backend/llsupport/regalloc.py index 94cc27cf92c80acfd3a8a020e19361c824324208..dea2ede12aa6af6d3b9b708415cf06c78b3ad189 100644 --- a/pypy/jit/backend/llsupport/regalloc.py +++ b/rpython/jit/backend/llsupport/regalloc.py @@ -1,7 +1,7 @@ import os -from pypy.jit.metainterp.history import Const, Box, REF -from pypy.rlib.objectmodel import we_are_translated -from pypy.jit.metainterp.resoperation import rop +from rpython.jit.metainterp.history import Const, Box, REF +from rpython.rlib.objectmodel import we_are_translated +from rpython.jit.metainterp.resoperation import rop class TempBox(Box): def __init__(self): @@ -537,7 +537,7 @@ def compute_vars_longevity(inputargs, operations): return longevity, last_real_usage def is_comparison_or_ovf_op(opnum): - from pypy.jit.metainterp.resoperation import opclasses + from rpython.jit.metainterp.resoperation import opclasses cls = opclasses[opnum] # hack hack: in theory they are instance method, but they don't use # any instance field, we can use a fake object diff --git a/pypy/jit/backend/llsupport/rewrite.py b/rpython/jit/backend/llsupport/rewrite.py similarity index 97% rename from pypy/jit/backend/llsupport/rewrite.py rename to rpython/jit/backend/llsupport/rewrite.py index cdb6a252470a79c6c21ae570073d38a51f668505..91e3347a22baf3b616f7a10ccb5b0739cf6c6f64 100644 --- a/pypy/jit/backend/llsupport/rewrite.py +++ b/rpython/jit/backend/llsupport/rewrite.py @@ -1,10 +1,10 @@ import sys -from pypy.rlib.rarithmetic import ovfcheck -from pypy.jit.metainterp.history import ConstInt, BoxPtr, ConstPtr -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.codewriter import heaptracker -from pypy.jit.backend.llsupport.symbolic import WORD -from pypy.jit.backend.llsupport.descr import SizeDescr, ArrayDescr +from rpython.rlib.rarithmetic import ovfcheck +from rpython.jit.metainterp.history import ConstInt, BoxPtr, ConstPtr +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.codewriter import heaptracker +from rpython.jit.backend.llsupport.symbolic import WORD +from rpython.jit.backend.llsupport.descr import SizeDescr, ArrayDescr class GcRewriterAssembler(object): @@ -329,7 +329,7 @@ class GcRewriterAssembler(object): if not self.gc_ll_descr.round_up: return size if self.gc_ll_descr.translate_support_code: - from pypy.rpython.lltypesystem import llarena + from rpython.rtyper.lltypesystem import llarena return llarena.round_up_for_allocation( size, self.gc_ll_descr.minimal_size_in_nursery) else: diff --git a/pypy/jit/backend/llsupport/support.py b/rpython/jit/backend/llsupport/support.py similarity index 90% rename from pypy/jit/backend/llsupport/support.py rename to rpython/jit/backend/llsupport/support.py index d7c114f22ca087a9dab8f772b94fbe78214e339f..514d6bec58fc974af2b771cfc6587843f4b53163 100644 --- a/pypy/jit/backend/llsupport/support.py +++ b/rpython/jit/backend/llsupport/support.py @@ -1,7 +1,7 @@ -from pypy.translator.simplify import get_funcobj -from pypy.rpython.llinterp import LLInterpreter -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rpython.extregistry import ExtRegistryEntry +from rpython.translator.simplify import get_funcobj +from rpython.rtyper.llinterp import LLInterpreter +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rtyper.extregistry import ExtRegistryEntry def maybe_on_top_of_llinterp(rtyper, fnptr): # Run a generated graph on top of the llinterp for testing. diff --git a/pypy/jit/backend/llsupport/symbolic.py b/rpython/jit/backend/llsupport/symbolic.py similarity index 94% rename from pypy/jit/backend/llsupport/symbolic.py rename to rpython/jit/backend/llsupport/symbolic.py index 5262533105da7e61ef2bc6d038c896019b2993ab..704413e000646ba65fde7520fbfbf59bac1eff19 100644 --- a/pypy/jit/backend/llsupport/symbolic.py +++ b/rpython/jit/backend/llsupport/symbolic.py @@ -1,7 +1,7 @@ import ctypes -from pypy.rpython.lltypesystem import lltype, ll2ctypes, llmemory, rffi -from pypy.rlib.objectmodel import specialize -from pypy.rlib.unroll import unrolling_iterable +from rpython.rtyper.lltypesystem import lltype, ll2ctypes, llmemory, rffi +from rpython.rlib.objectmodel import specialize +from rpython.rlib.unroll import unrolling_iterable @specialize.memo() def get_field_token(STRUCT, fieldname, translate_support_code): diff --git a/pypy/jit/backend/tool/__init__.py b/rpython/jit/backend/llsupport/test/__init__.py similarity index 100% rename from pypy/jit/backend/tool/__init__.py rename to rpython/jit/backend/llsupport/test/__init__.py diff --git a/pypy/jit/backend/llsupport/test/test_asmmemmgr.py b/rpython/jit/backend/llsupport/test/test_asmmemmgr.py similarity index 96% rename from pypy/jit/backend/llsupport/test/test_asmmemmgr.py rename to rpython/jit/backend/llsupport/test/test_asmmemmgr.py index 257863ccd79323294bf67fac81581e24fa4124c1..b07c061af0c900e2d3f43f045244972f15015d27 100644 --- a/pypy/jit/backend/llsupport/test/test_asmmemmgr.py +++ b/rpython/jit/backend/llsupport/test/test_asmmemmgr.py @@ -1,9 +1,9 @@ import random -from pypy.jit.backend.llsupport.asmmemmgr import AsmMemoryManager -from pypy.jit.backend.llsupport.asmmemmgr import MachineDataBlockWrapper -from pypy.jit.backend.llsupport.asmmemmgr import BlockBuilderMixin -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib import debug +from rpython.jit.backend.llsupport.asmmemmgr import AsmMemoryManager +from rpython.jit.backend.llsupport.asmmemmgr import MachineDataBlockWrapper +from rpython.jit.backend.llsupport.asmmemmgr import BlockBuilderMixin +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib import debug def test_get_index(): diff --git a/pypy/jit/backend/llsupport/test/test_descr.py b/rpython/jit/backend/llsupport/test/test_descr.py similarity index 97% rename from pypy/jit/backend/llsupport/test/test_descr.py rename to rpython/jit/backend/llsupport/test/test_descr.py index 563cb9038eeca597b07606f345171092f4c314fc..2d4dac40fbc24d3e28535db3d8129b019180ca03 100644 --- a/pypy/jit/backend/llsupport/test/test_descr.py +++ b/rpython/jit/backend/llsupport/test/test_descr.py @@ -1,10 +1,10 @@ -from pypy.rpython.lltypesystem import lltype, rffi, rstr -from pypy.jit.backend.llsupport.descr import * -from pypy.jit.backend.llsupport import symbolic -from pypy.rlib.objectmodel import Symbolic -from pypy.rpython.annlowlevel import llhelper -from pypy.jit.metainterp import history -from pypy.jit.codewriter import longlong +from rpython.rtyper.lltypesystem import lltype, rffi, rstr +from rpython.jit.backend.llsupport.descr import * +from rpython.jit.backend.llsupport import symbolic +from rpython.rlib.objectmodel import Symbolic +from rpython.rtyper.annlowlevel import llhelper +from rpython.jit.metainterp import history +from rpython.jit.codewriter import longlong import sys, struct, py def test_get_size_descr(): @@ -386,8 +386,8 @@ def test_call_stubs_2(): assert longlong.getrealfloat(res) == 4.5 def test_call_stubs_single_float(): - from pypy.rlib.longlong2float import uint2singlefloat, singlefloat2uint - from pypy.rlib.rarithmetic import r_singlefloat, intmask + from rpython.rlib.longlong2float import uint2singlefloat, singlefloat2uint + from rpython.rlib.rarithmetic import r_singlefloat, intmask # c0 = GcCache(False) ARGS = [lltype.SingleFloat, lltype.SingleFloat, lltype.SingleFloat] diff --git a/pypy/jit/backend/llsupport/test/test_ffisupport.py b/rpython/jit/backend/llsupport/test/test_ffisupport.py similarity index 87% rename from pypy/jit/backend/llsupport/test/test_ffisupport.py rename to rpython/jit/backend/llsupport/test/test_ffisupport.py index abae387260ce69c1f63b5ab386029d41c7292ad6..2ef032f8a6bac1a5bec25674c8c3667fa1cea059 100644 --- a/pypy/jit/backend/llsupport/test/test_ffisupport.py +++ b/rpython/jit/backend/llsupport/test/test_ffisupport.py @@ -1,10 +1,10 @@ -from pypy.rlib.jit_libffi import types, CIF_DESCRIPTION, FFI_TYPE_PP -from pypy.rlib.clibffi import FFI_DEFAULT_ABI -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.jit.codewriter.longlong import is_64_bit -from pypy.jit.backend.llsupport.descr import * -from pypy.jit.backend.llsupport.ffisupport import * -from pypy.rlib.rarithmetic import is_emulated_long +from rpython.rlib.jit_libffi import types, CIF_DESCRIPTION, FFI_TYPE_PP +from rpython.rlib.clibffi import FFI_DEFAULT_ABI +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.jit.codewriter.longlong import is_64_bit +from rpython.jit.backend.llsupport.descr import * +from rpython.jit.backend.llsupport.ffisupport import * +from rpython.rlib.rarithmetic import is_emulated_long class FakeCPU: diff --git a/pypy/jit/backend/llsupport/test/test_gc.py b/rpython/jit/backend/llsupport/test/test_gc.py similarity index 95% rename from pypy/jit/backend/llsupport/test/test_gc.py rename to rpython/jit/backend/llsupport/test/test_gc.py index 29f488eb7138451edf28452a0a2559b413eec011..861ca2efc78c1ebb1b303e0e889ef2d236a287c3 100644 --- a/pypy/jit/backend/llsupport/test/test_gc.py +++ b/rpython/jit/backend/llsupport/test/test_gc.py @@ -1,17 +1,17 @@ import random -from pypy.rpython.lltypesystem import lltype, llmemory, rffi, rstr -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.rpython.annlowlevel import llhelper -from pypy.jit.backend.llsupport.descr import * -from pypy.jit.backend.llsupport.gc import * -from pypy.jit.backend.llsupport import symbolic -from pypy.jit.metainterp.gc import get_description -from pypy.jit.metainterp.history import BoxPtr, BoxInt, ConstPtr -from pypy.jit.metainterp.resoperation import get_deep_immutable_oplist -from pypy.jit.tool.oparser import parse -from pypy.rpython.lltypesystem.rclass import OBJECT, OBJECT_VTABLE -from pypy.jit.metainterp.optimizeopt.util import equaloplists -from pypy.rlib.rarithmetic import is_valid_int +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi, rstr +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.rtyper.annlowlevel import llhelper +from rpython.jit.backend.llsupport.descr import * +from rpython.jit.backend.llsupport.gc import * +from rpython.jit.backend.llsupport import symbolic +from rpython.jit.metainterp.gc import get_description +from rpython.jit.metainterp.history import BoxPtr, BoxInt, ConstPtr +from rpython.jit.metainterp.resoperation import get_deep_immutable_oplist +from rpython.jit.tool.oparser import parse +from rpython.rtyper.lltypesystem.rclass import OBJECT, OBJECT_VTABLE +from rpython.jit.metainterp.optimizeopt.util import equaloplists +from rpython.rlib.rarithmetic import is_valid_int def test_boehm(): gc_ll_descr = GcLLDescr_boehm(None, None, None) @@ -154,7 +154,7 @@ class TestGcRootMapAsmGcc: check() def test_freeing_block(self): - from pypy.jit.backend.llsupport import gc + from rpython.jit.backend.llsupport import gc class Asmgcroot: arrayitemsize = 2 * llmemory.sizeof(llmemory.Address) sort_count = 0 diff --git a/pypy/jit/backend/llsupport/test/test_regalloc.py b/rpython/jit/backend/llsupport/test/test_regalloc.py similarity index 98% rename from pypy/jit/backend/llsupport/test/test_regalloc.py rename to rpython/jit/backend/llsupport/test/test_regalloc.py index 6d265f503ee3f96aa936ce362fda88e971878423..a2fb1e4e6d70c600550c468581f119ff9d3722bc 100644 --- a/pypy/jit/backend/llsupport/test/test_regalloc.py +++ b/rpython/jit/backend/llsupport/test/test_regalloc.py @@ -1,9 +1,9 @@ import py -from pypy.jit.metainterp.history import BoxInt, ConstInt, BoxFloat, INT, FLOAT -from pypy.jit.backend.llsupport.regalloc import FrameManager -from pypy.jit.backend.llsupport.regalloc import RegisterManager as BaseRegMan -from pypy.jit.tool.oparser import parse -from pypy.jit.backend.detect_cpu import getcpuclass +from rpython.jit.metainterp.history import BoxInt, ConstInt, BoxFloat, INT, FLOAT +from rpython.jit.backend.llsupport.regalloc import FrameManager +from rpython.jit.backend.llsupport.regalloc import RegisterManager as BaseRegMan +from rpython.jit.tool.oparser import parse +from rpython.jit.backend.detect_cpu import getcpuclass def newboxes(*values): return [BoxInt(v) for v in values] diff --git a/pypy/jit/backend/llsupport/test/test_rewrite.py b/rpython/jit/backend/llsupport/test/test_rewrite.py similarity index 98% rename from pypy/jit/backend/llsupport/test/test_rewrite.py rename to rpython/jit/backend/llsupport/test/test_rewrite.py index 1eed65c5ef6b9c34382bfc4c0762ba91b5382b2f..3f553b037f086ebb7d8fb6a4b4ce637735893ec0 100644 --- a/pypy/jit/backend/llsupport/test/test_rewrite.py +++ b/rpython/jit/backend/llsupport/test/test_rewrite.py @@ -1,9 +1,9 @@ -from pypy.jit.backend.llsupport.descr import * -from pypy.jit.backend.llsupport.gc import * -from pypy.jit.metainterp.gc import get_description -from pypy.jit.tool.oparser import parse -from pypy.jit.metainterp.optimizeopt.util import equaloplists -from pypy.jit.codewriter.heaptracker import register_known_gctype +from rpython.jit.backend.llsupport.descr import * +from rpython.jit.backend.llsupport.gc import * +from rpython.jit.metainterp.gc import get_description +from rpython.jit.tool.oparser import parse +from rpython.jit.metainterp.optimizeopt.util import equaloplists +from rpython.jit.codewriter.heaptracker import register_known_gctype class Evaluator(object): diff --git a/pypy/jit/backend/llsupport/test/test_runner.py b/rpython/jit/backend/llsupport/test/test_runner.py similarity index 80% rename from pypy/jit/backend/llsupport/test/test_runner.py rename to rpython/jit/backend/llsupport/test/test_runner.py index e033406d37455e47ba206b1ba08d7ad69f1eb70e..ba2ff478a0b2b24027835ac793e7ed602c3fe7e1 100644 --- a/pypy/jit/backend/llsupport/test/test_runner.py +++ b/rpython/jit/backend/llsupport/test/test_runner.py @@ -1,6 +1,6 @@ import py -from pypy.jit.backend.llsupport.llmodel import AbstractLLCPU -from pypy.jit.backend.test.runner_test import LLtypeBackendTest +from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU +from rpython.jit.backend.test.runner_test import LLtypeBackendTest class FakeStats(object): diff --git a/pypy/jit/backend/llsupport/test/test_symbolic.py b/rpython/jit/backend/llsupport/test/test_symbolic.py similarity index 95% rename from pypy/jit/backend/llsupport/test/test_symbolic.py rename to rpython/jit/backend/llsupport/test/test_symbolic.py index 67a854c290558f37fefbb6477e04da846c73c341..23ca415ca51cb4d5a8fab70a8caa1dc00b39284a 100644 --- a/pypy/jit/backend/llsupport/test/test_symbolic.py +++ b/rpython/jit/backend/llsupport/test/test_symbolic.py @@ -1,7 +1,7 @@ import py -from pypy.jit.backend.llsupport.symbolic import * -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rpython.memory.lltypelayout import convert_offset_to_int +from rpython.jit.backend.llsupport.symbolic import * +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rtyper.memory.lltypelayout import convert_offset_to_int WORD = rffi.sizeof(lltype.Signed) diff --git a/pypy/jit/backend/model.py b/rpython/jit/backend/model.py similarity index 98% rename from pypy/jit/backend/model.py rename to rpython/jit/backend/model.py index b25c4202ce66d6c58e345d92e15f94c3abbe1564..faf99c4fc374e8b5dd1323d8da28b94b468bed75 100644 --- a/pypy/jit/backend/model.py +++ b/rpython/jit/backend/model.py @@ -1,6 +1,6 @@ -from pypy.rlib.debug import debug_start, debug_print, debug_stop -from pypy.jit.metainterp import history -from pypy.rpython.lltypesystem import lltype +from rpython.rlib.debug import debug_start, debug_print, debug_stop +from rpython.jit.metainterp import history +from rpython.rtyper.lltypesystem import lltype class AbstractCPU(object): diff --git a/pypy/jit/backend/x86/__init__.py b/rpython/jit/backend/test/__init__.py similarity index 100% rename from pypy/jit/backend/x86/__init__.py rename to rpython/jit/backend/test/__init__.py diff --git a/pypy/jit/backend/test/calling_convention_test.py b/rpython/jit/backend/test/calling_convention_test.py similarity index 94% rename from pypy/jit/backend/test/calling_convention_test.py rename to rpython/jit/backend/test/calling_convention_test.py index 355c2fcf45c66915ca0c25a9eff9ed60c5e7ea0b..4eefa3153e308334c97d556bb2ba35556818aecd 100644 --- a/pypy/jit/backend/test/calling_convention_test.py +++ b/rpython/jit/backend/test/calling_convention_test.py @@ -1,4 +1,4 @@ -from pypy.jit.metainterp.history import (AbstractFailDescr, +from rpython.jit.metainterp.history import (AbstractFailDescr, AbstractDescr, BasicFailDescr, BoxInt, Box, BoxPtr, @@ -6,18 +6,18 @@ from pypy.jit.metainterp.history import (AbstractFailDescr, ConstInt, ConstPtr, BoxObj, Const, ConstObj, BoxFloat, ConstFloat) -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.metainterp.typesystem import deref -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.tool.oparser import parse -from pypy.rpython.lltypesystem import lltype, llmemory, rstr, rffi, rclass -from pypy.rpython.ootypesystem import ootype -from pypy.rpython.annlowlevel import llhelper -from pypy.rpython.llinterp import LLException -from pypy.jit.codewriter import heaptracker, longlong -from pypy.rlib.rarithmetic import intmask -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.test.runner_test import Runner +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.metainterp.typesystem import deref +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.tool.oparser import parse +from rpython.rtyper.lltypesystem import lltype, llmemory, rstr, rffi, rclass +from rpython.rtyper.ootypesystem import ootype +from rpython.rtyper.annlowlevel import llhelper +from rpython.rtyper.llinterp import LLException +from rpython.jit.codewriter import heaptracker, longlong +from rpython.rlib.rarithmetic import intmask +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.test.runner_test import Runner import py def boxfloat(x): @@ -296,7 +296,7 @@ class TestCallingConv(Runner): def test_call_with_imm_values_bug_constint0(self): - from pypy.rlib.libffi import types + from rpython.rlib.libffi import types cpu = self.cpu I = lltype.Signed @@ -328,7 +328,7 @@ class TestCallingConv(Runner): py.test.skip('requires floats and singlefloats') import random - from pypy.rlib.rarithmetic import r_singlefloat + from rpython.rlib.rarithmetic import r_singlefloat def func(*args): res = 0.0 diff --git a/pypy/jit/backend/test/runner_test.py b/rpython/jit/backend/test/runner_test.py similarity index 98% rename from pypy/jit/backend/test/runner_test.py rename to rpython/jit/backend/test/runner_test.py index 8f0bf55a2740d3fd6e007a146dc825da4ac0507f..fc37a7431a0425ef6e1df24ded857115c4d4fcd7 100644 --- a/pypy/jit/backend/test/runner_test.py +++ b/rpython/jit/backend/test/runner_test.py @@ -1,5 +1,5 @@ import py, sys, random, os, struct, operator -from pypy.jit.metainterp.history import (AbstractFailDescr, +from rpython.jit.metainterp.history import (AbstractFailDescr, AbstractDescr, BasicFailDescr, BoxInt, Box, BoxPtr, @@ -7,18 +7,18 @@ from pypy.jit.metainterp.history import (AbstractFailDescr, ConstInt, ConstPtr, BoxObj, ConstObj, BoxFloat, ConstFloat) -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.metainterp.typesystem import deref -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.tool.oparser import parse -from pypy.rpython.lltypesystem import lltype, llmemory, rstr, rffi, rclass -from pypy.rpython.ootypesystem import ootype -from pypy.rpython.annlowlevel import llhelper -from pypy.rpython.llinterp import LLException -from pypy.jit.codewriter import heaptracker, longlong -from pypy.rlib import longlong2float -from pypy.rlib.rarithmetic import intmask, is_valid_int -from pypy.jit.backend.detect_cpu import autodetect_main_model_and_size +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.metainterp.typesystem import deref +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.tool.oparser import parse +from rpython.rtyper.lltypesystem import lltype, llmemory, rstr, rffi, rclass +from rpython.rtyper.ootypesystem import ootype +from rpython.rtyper.annlowlevel import llhelper +from rpython.rtyper.llinterp import LLException +from rpython.jit.codewriter import heaptracker, longlong +from rpython.rlib import longlong2float +from rpython.rlib.rarithmetic import intmask, is_valid_int +from rpython.jit.backend.detect_cpu import autodetect_main_model_and_size def boxfloat(x): @@ -432,13 +432,13 @@ class BaseBackendTest(Runner): assert self.cpu.get_latest_value_int(1) == 55 def test_int_operations(self): - from pypy.jit.metainterp.test.test_executor import get_int_tests + from rpython.jit.metainterp.test.test_executor import get_int_tests for opnum, boxargs, retvalue in get_int_tests(): res = self.execute_operation(opnum, boxargs, 'int') assert res.value == retvalue def test_float_operations(self): - from pypy.jit.metainterp.test.test_executor import get_float_tests + from rpython.jit.metainterp.test.test_executor import get_float_tests for opnum, boxargs, rettype, retvalue in get_float_tests(self.cpu): res = self.execute_operation(opnum, boxargs, rettype) if isinstance(res, BoxFloat): @@ -530,7 +530,7 @@ class BaseBackendTest(Runner): assert longlong.getrealfloat(x) == 3.5 - 42 def test_call(self): - from pypy.rlib.jit_libffi import types + from rpython.rlib.jit_libffi import types def func_int(a, b): return a + b @@ -1595,7 +1595,7 @@ class BaseBackendTest(Runner): def test_unused_result_int(self): # test pure operations on integers whose result is not used - from pypy.jit.metainterp.test.test_executor import get_int_tests + from rpython.jit.metainterp.test.test_executor import get_int_tests int_tests = list(get_int_tests()) int_tests = [(opnum, boxargs, 'int', retvalue) for opnum, boxargs, retvalue in int_tests] @@ -1603,7 +1603,7 @@ class BaseBackendTest(Runner): def test_unused_result_float(self): # same as test_unused_result_int, for float operations - from pypy.jit.metainterp.test.test_executor import get_float_tests + from rpython.jit.metainterp.test.test_executor import get_float_tests float_tests = list(get_float_tests(self.cpu)) self._test_unused_result(float_tests) @@ -1647,8 +1647,8 @@ class BaseBackendTest(Runner): if not self.cpu.supports_floats: py.test.skip("requires floats") - from pypy.rlib.rfloat import INFINITY, NAN, isinf, isnan - from pypy.jit.metainterp.resoperation import opname + from rpython.rlib.rfloat import INFINITY, NAN, isinf, isnan + from rpython.jit.metainterp.resoperation import opname fzer = boxfloat(0.0) fone = boxfloat(1.0) @@ -2329,8 +2329,8 @@ class LLtypeBackendTest(BaseBackendTest): assert values == [1, 10, token] def test_call_to_c_function(self): - from pypy.rlib.libffi import CDLL, types, ArgChain, FUNCFLAG_CDECL - from pypy.rpython.lltypesystem.ll2ctypes import libc_name + from rpython.rlib.libffi import CDLL, types, ArgChain, FUNCFLAG_CDECL + from rpython.rtyper.lltypesystem.ll2ctypes import libc_name libc = CDLL(libc_name) c_tolower = libc.getpointer('tolower', [types.uchar], types.sint) argchain = ArgChain().arg(ord('A')) @@ -2358,8 +2358,8 @@ class LLtypeBackendTest(BaseBackendTest): assert self.cpu.get_latest_value_int(0) == ord('g') def test_call_to_c_function_with_callback(self): - from pypy.rlib.libffi import CDLL, types, ArgChain, clibffi - from pypy.rpython.lltypesystem.ll2ctypes import libc_name + from rpython.rlib.libffi import CDLL, types, ArgChain, clibffi + from rpython.rtyper.lltypesystem.ll2ctypes import libc_name libc = CDLL(libc_name) types_size_t = clibffi.cast_type_to_ffitype(rffi.SIZE_T) c_qsort = libc.getpointer('qsort', [types.pointer, types_size_t, @@ -2421,11 +2421,11 @@ class LLtypeBackendTest(BaseBackendTest): lltype.free(raw, flavor='raw') def test_call_to_winapi_function(self): - from pypy.rlib.clibffi import _WIN32, FUNCFLAG_STDCALL + from rpython.rlib.clibffi import _WIN32, FUNCFLAG_STDCALL if not _WIN32: py.test.skip("Windows test only") - from pypy.rlib.libffi import CDLL, types, ArgChain - from pypy.rlib.rwin32 import DWORD + from rpython.rlib.libffi import CDLL, types, ArgChain + from rpython.rlib.rwin32 import DWORD libc = CDLL('KERNEL32') c_GetCurrentDir = libc.getpointer('GetCurrentDirectoryA', [types.ulong, types.pointer], @@ -3101,7 +3101,7 @@ class LLtypeBackendTest(BaseBackendTest): def test_short_result_of_call_direct(self): # Test that calling a function that returns a CHAR, SHORT or INT, # signed or unsigned, properly gets zero-extended or sign-extended. - from pypy.translator.tool.cbuild import ExternalCompilationInfo + from rpython.translator.tool.cbuild import ExternalCompilationInfo for RESTYPE in [rffi.SIGNEDCHAR, rffi.UCHAR, rffi.SHORT, rffi.USHORT, rffi.INT, rffi.UINT, @@ -3135,7 +3135,7 @@ class LLtypeBackendTest(BaseBackendTest): def test_short_result_of_call_compiled(self): # Test that calling a function that returns a CHAR, SHORT or INT, # signed or unsigned, properly gets zero-extended or sign-extended. - from pypy.translator.tool.cbuild import ExternalCompilationInfo + from rpython.translator.tool.cbuild import ExternalCompilationInfo for RESTYPE in [rffi.SIGNEDCHAR, rffi.UCHAR, rffi.SHORT, rffi.USHORT, rffi.INT, rffi.UINT, @@ -3175,8 +3175,8 @@ class LLtypeBackendTest(BaseBackendTest): def test_longlong_result_of_call_direct(self): if not self.cpu.supports_longlong: py.test.skip("longlong test") - from pypy.translator.tool.cbuild import ExternalCompilationInfo - from pypy.rlib.rarithmetic import r_longlong + from rpython.translator.tool.cbuild import ExternalCompilationInfo + from rpython.rlib.rarithmetic import r_longlong eci = ExternalCompilationInfo( separate_module_sources=[""" long long fn_test_result_of_call(long long x) @@ -3203,8 +3203,8 @@ class LLtypeBackendTest(BaseBackendTest): def test_longlong_result_of_call_compiled(self): if not self.cpu.supports_longlong: py.test.skip("test of longlong result") - from pypy.translator.tool.cbuild import ExternalCompilationInfo - from pypy.rlib.rarithmetic import r_longlong + from rpython.translator.tool.cbuild import ExternalCompilationInfo + from rpython.rlib.rarithmetic import r_longlong eci = ExternalCompilationInfo( separate_module_sources=[""" long long fn_test_result_of_call(long long x) @@ -3232,8 +3232,8 @@ class LLtypeBackendTest(BaseBackendTest): def test_singlefloat_result_of_call_direct(self): if not self.cpu.supports_singlefloats: py.test.skip("singlefloat test") - from pypy.translator.tool.cbuild import ExternalCompilationInfo - from pypy.rlib.rarithmetic import r_singlefloat + from rpython.translator.tool.cbuild import ExternalCompilationInfo + from rpython.rlib.rarithmetic import r_singlefloat eci = ExternalCompilationInfo( separate_module_sources=[""" float fn_test_result_of_call(float x) @@ -3262,8 +3262,8 @@ class LLtypeBackendTest(BaseBackendTest): def test_singlefloat_result_of_call_compiled(self): if not self.cpu.supports_singlefloats: py.test.skip("test of singlefloat result") - from pypy.translator.tool.cbuild import ExternalCompilationInfo - from pypy.rlib.rarithmetic import r_singlefloat + from rpython.translator.tool.cbuild import ExternalCompilationInfo + from rpython.rlib.rarithmetic import r_singlefloat eci = ExternalCompilationInfo( separate_module_sources=[""" float fn_test_result_of_call(float x) @@ -3291,7 +3291,7 @@ class LLtypeBackendTest(BaseBackendTest): assert res.value == iexpected def test_free_loop_and_bridges(self): - from pypy.jit.backend.llsupport.llmodel import AbstractLLCPU + from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU if not isinstance(self.cpu, AbstractLLCPU): py.test.skip("not a subclass of llmodel.AbstractLLCPU") if hasattr(self.cpu, 'setup_once'): @@ -3331,7 +3331,7 @@ class LLtypeBackendTest(BaseBackendTest): def math_sqrt(a): assert False, 'should not be called' - from pypy.jit.codewriter.effectinfo import EffectInfo + from rpython.jit.codewriter.effectinfo import EffectInfo effectinfo = EffectInfo([], [], [], [], EffectInfo.EF_CANNOT_RAISE, EffectInfo.OS_MATH_SQRT) FPTR = self.Ptr(self.FuncType([lltype.Float], lltype.Float)) @@ -3403,10 +3403,10 @@ class LLtypeBackendTest(BaseBackendTest): assert outp == self.cpu.get_latest_value_int(0) def test_compile_asmlen(self): - from pypy.jit.backend.llsupport.llmodel import AbstractLLCPU + from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU if not isinstance(self.cpu, AbstractLLCPU): py.test.skip("pointless test on non-asm") - from pypy.jit.backend.tool.viewcode import machine_code_dump + from rpython.jit.backend.tool.viewcode import machine_code_dump import ctypes ops = """ [i2] @@ -3556,7 +3556,7 @@ class LLtypeBackendTest(BaseBackendTest): assert fail.identifier == 99 def test_raw_load_int(self): - from pypy.rlib import rawstorage + from rpython.rlib import rawstorage for T in [rffi.UCHAR, rffi.SIGNEDCHAR, rffi.USHORT, rffi.SHORT, rffi.UINT, rffi.INT, @@ -3584,7 +3584,7 @@ class LLtypeBackendTest(BaseBackendTest): def test_raw_load_float(self): if not self.cpu.supports_floats: py.test.skip("requires floats") - from pypy.rlib import rawstorage + from rpython.rlib import rawstorage for T in [rffi.DOUBLE]: ops = """ [i0, i1] @@ -3608,7 +3608,7 @@ class LLtypeBackendTest(BaseBackendTest): rawstorage.free_raw_storage(p) def test_raw_store_int(self): - from pypy.rlib import rawstorage + from rpython.rlib import rawstorage for T in [rffi.UCHAR, rffi.SIGNEDCHAR, rffi.USHORT, rffi.SHORT, rffi.UINT, rffi.INT, @@ -3635,7 +3635,7 @@ class LLtypeBackendTest(BaseBackendTest): def test_raw_store_float(self): if not self.cpu.supports_floats: py.test.skip("requires floats") - from pypy.rlib import rawstorage + from rpython.rlib import rawstorage for T in [rffi.DOUBLE]: ops = """ [i0, i1, f2] diff --git a/pypy/jit/backend/test/support.py b/rpython/jit/backend/test/support.py similarity index 85% rename from pypy/jit/backend/test/support.py rename to rpython/jit/backend/test/support.py index eeb0fa111748f8dea3d610348f19b708f6c299ed..3a4cfd9db0cad11b13484bf3f29ba52cc813123d 100644 --- a/pypy/jit/backend/test/support.py +++ b/rpython/jit/backend/test/support.py @@ -1,9 +1,9 @@ import py import sys -from pypy.rlib.debug import debug_print -from pypy.translator.translator import TranslationContext, graphof -from pypy.jit.metainterp.optimizeopt import ALL_OPTS_NAMES -from pypy.rlib.rarithmetic import is_valid_int +from rpython.rlib.debug import debug_print +from rpython.translator.translator import TranslationContext, graphof +from rpython.jit.metainterp.optimizeopt import ALL_OPTS_NAMES +from rpython.rlib.rarithmetic import is_valid_int class BaseCompiledMixin(object): @@ -20,9 +20,9 @@ class BaseCompiledMixin(object): # XXX backendopt is ignored def meta_interp(self, function, args, repeat=1, inline=False, trace_limit=sys.maxint, backendopt=None, listcomp=False, **kwds): # XXX ignored - from pypy.jit.metainterp.warmspot import WarmRunnerDesc - from pypy.annotation.listdef import s_list_of_strings - from pypy.annotation import model as annmodel + from rpython.jit.metainterp.warmspot import WarmRunnerDesc + from rpython.annotator.listdef import s_list_of_strings + from rpython.annotator import model as annmodel for arg in args: assert is_valid_int(arg) @@ -116,7 +116,7 @@ class CCompiledMixin(BaseCompiledMixin): def setup_class(cls): if cls.slow: - from pypy.jit.conftest import option + from rpython.jit.conftest import option if not option.run_slow_tests: py.test.skip("use --slow to execute this long-running test") @@ -127,7 +127,7 @@ class CCompiledMixin(BaseCompiledMixin): return t def _compile_and_run(self, t, entry_point, entry_point_graph, args): - from pypy.translator.c.genc import CStandaloneBuilder as CBuilder + from rpython.translator.c.genc import CStandaloneBuilder as CBuilder # XXX patch exceptions cbuilder = CBuilder(t, entry_point, config=t.config) cbuilder.generate_source() @@ -146,20 +146,20 @@ class CliCompiledMixin(BaseCompiledMixin): type_system = 'ootype' def pre_translation_hook(self): - from pypy.translator.oosupport.support import patch_os + from rpython.translator.oosupport.support import patch_os self.olddefs = patch_os() def post_translation_hook(self): - from pypy.translator.oosupport.support import unpatch_os + from rpython.translator.oosupport.support import unpatch_os unpatch_os(self.olddefs) # restore original values def _compile_and_run(self, t, entry_point, entry_point_graph, args): - from pypy.translator.cli.test.runtest import compile_graph + from rpython.translator.cli.test.runtest import compile_graph func = compile_graph(entry_point_graph, t, nowrap=True, standalone=True) return func(*args) def run_directly(self, fn, args): - from pypy.translator.cli.test.runtest import compile_function, get_annotation + from rpython.translator.cli.test.runtest import compile_function, get_annotation ann = [get_annotation(x) for x in args] clifunc = compile_function(fn, ann) return clifunc(*args) diff --git a/pypy/jit/backend/test/test_detect_cpu.py b/rpython/jit/backend/test/test_detect_cpu.py similarity index 84% rename from pypy/jit/backend/test/test_detect_cpu.py rename to rpython/jit/backend/test/test_detect_cpu.py index 9a860686b99423589f63205946bbefd1751a753a..2a76bf89961d0b0640a830920d38aae638c408c4 100644 --- a/pypy/jit/backend/test/test_detect_cpu.py +++ b/rpython/jit/backend/test/test_detect_cpu.py @@ -1,4 +1,4 @@ -from pypy.jit.backend.detect_cpu import * +from rpython.jit.backend.detect_cpu import * def test_autodetect(): @@ -24,5 +24,5 @@ def test_getcpuclass(): except ProcessorAutodetectError: pass else: - from pypy.jit.backend.model import AbstractCPU + from rpython.jit.backend.model import AbstractCPU assert issubclass(cpu, AbstractCPU) diff --git a/pypy/jit/backend/test/test_ll_random.py b/rpython/jit/backend/test/test_ll_random.py similarity index 97% rename from pypy/jit/backend/test/test_ll_random.py rename to rpython/jit/backend/test/test_ll_random.py index 7848eb0fdae47a961015f1f7a8199cab59fad9a3..e7a8325d223a9bd1f60af5a50523a2c9d027126c 100644 --- a/pypy/jit/backend/test/test_ll_random.py +++ b/rpython/jit/backend/test/test_ll_random.py @@ -1,15 +1,15 @@ import py -from pypy.rpython.lltypesystem import lltype, llmemory, rclass, rffi, rstr -from pypy.jit.backend.test import test_random -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.metainterp.history import ConstInt, ConstPtr -from pypy.jit.metainterp.history import BoxPtr, BoxInt -from pypy.jit.metainterp.history import BasicFailDescr -from pypy.jit.codewriter import heaptracker -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.rpython.annlowlevel import llhelper -from pypy.rlib.rarithmetic import intmask -from pypy.rpython.llinterp import LLException +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass, rffi, rstr +from rpython.jit.backend.test import test_random +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.metainterp.history import ConstInt, ConstPtr +from rpython.jit.metainterp.history import BoxPtr, BoxInt +from rpython.jit.metainterp.history import BasicFailDescr +from rpython.jit.codewriter import heaptracker +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.rtyper.annlowlevel import llhelper +from rpython.rlib.rarithmetic import intmask +from rpython.rtyper.llinterp import LLException class LLtypeOperationBuilder(test_random.OperationBuilder): HAVE_SHORT_FIELDS = False diff --git a/pypy/jit/backend/test/test_model.py b/rpython/jit/backend/test/test_model.py similarity index 83% rename from pypy/jit/backend/test/test_model.py rename to rpython/jit/backend/test/test_model.py index 54c20a13f8310b4cab3c9d894c12a834dc8fea50..96e40f876c4459fb32bbf71665ef8d79048da826 100644 --- a/pypy/jit/backend/test/test_model.py +++ b/rpython/jit/backend/test/test_model.py @@ -1,5 +1,5 @@ -from pypy.jit.metainterp.history import AbstractFailDescr -from pypy.jit.backend.model import AbstractCPU +from rpython.jit.metainterp.history import AbstractFailDescr +from rpython.jit.backend.model import AbstractCPU def test_faildescr_numbering(): diff --git a/pypy/jit/backend/test/test_random.py b/rpython/jit/backend/test/test_random.py similarity index 97% rename from pypy/jit/backend/test/test_random.py rename to rpython/jit/backend/test/test_random.py index 7e93d05a608b06c8b67b80252c13715150e76828..8088bf30108d74d09527d3d32b2fc43adc2d652e 100644 --- a/pypy/jit/backend/test/test_random.py +++ b/rpython/jit/backend/test/test_random.py @@ -1,16 +1,16 @@ import py, sys import pytest -from pypy.rlib.rarithmetic import intmask, LONG_BIT -from pypy.rpython.lltypesystem import llmemory -from pypy.jit.metainterp.history import BasicFailDescr, TreeLoop -from pypy.jit.metainterp.history import BoxInt, ConstInt, JitCellToken -from pypy.jit.metainterp.history import BoxPtr, ConstPtr, TargetToken -from pypy.jit.metainterp.history import BoxFloat, ConstFloat, Const -from pypy.jit.metainterp.history import INT, FLOAT -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.metainterp.executor import execute_nonspec -from pypy.jit.metainterp.resoperation import opname -from pypy.jit.codewriter import longlong +from rpython.rlib.rarithmetic import intmask, LONG_BIT +from rpython.rtyper.lltypesystem import llmemory +from rpython.jit.metainterp.history import BasicFailDescr, TreeLoop +from rpython.jit.metainterp.history import BoxInt, ConstInt, JitCellToken +from rpython.jit.metainterp.history import BoxPtr, ConstPtr, TargetToken +from rpython.jit.metainterp.history import BoxFloat, ConstFloat, Const +from rpython.jit.metainterp.history import INT, FLOAT +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.metainterp.executor import execute_nonspec +from rpython.jit.metainterp.resoperation import opname +from rpython.jit.codewriter import longlong class PleaseRewriteMe(Exception): pass @@ -515,10 +515,10 @@ def Random(): def get_cpu(): if pytest.config.option.backend == 'llgraph': - from pypy.jit.backend.llgraph.runner import LLtypeCPU + from rpython.jit.backend.llgraph.runner import LLtypeCPU return LLtypeCPU(None) elif pytest.config.option.backend == 'cpu': - from pypy.jit.backend.detect_cpu import getcpuclass + from rpython.jit.backend.detect_cpu import getcpuclass return getcpuclass()(None, None) else: assert 0, "unknown backend %r" % pytest.config.option.backend diff --git a/pypy/jit/backend/test/test_zll_stress.py b/rpython/jit/backend/test/test_zll_stress.py similarity index 59% rename from pypy/jit/backend/test/test_zll_stress.py rename to rpython/jit/backend/test/test_zll_stress.py index 9825a8c981082b236f641de2faa87a6ac13d73ee..63187373e75cee873d3bf733eae60f71b4da2f74 100644 --- a/pypy/jit/backend/test/test_zll_stress.py +++ b/rpython/jit/backend/test/test_zll_stress.py @@ -1,6 +1,6 @@ -from pypy.jit.backend.test.test_random import check_random_function, Random -from pypy.jit.backend.test.test_ll_random import LLtypeOperationBuilder -from pypy.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.test.test_random import check_random_function, Random +from rpython.jit.backend.test.test_ll_random import LLtypeOperationBuilder +from rpython.jit.backend.detect_cpu import getcpuclass import platform CPU = getcpuclass() diff --git a/pypy/jit/backend/x86/test/__init__.py b/rpython/jit/backend/tool/__init__.py similarity index 100% rename from pypy/jit/backend/x86/test/__init__.py rename to rpython/jit/backend/tool/__init__.py diff --git a/pypy/jit/backend/tool/viewcode.py b/rpython/jit/backend/tool/viewcode.py similarity index 56% rename from pypy/jit/backend/tool/viewcode.py rename to rpython/jit/backend/tool/viewcode.py index 8975374a2a83abee7531f997650bb4697b6ffc33..d6fd0d8b5cd87af558fd7a526af4ea3896669dfb 100644 --- a/pypy/jit/backend/tool/viewcode.py +++ b/rpython/jit/backend/tool/viewcode.py @@ -1,4 +1,4 @@ -from pypy.jit.backend.detect_cpu import autodetect_main_model +from rpython.jit.backend.detect_cpu import autodetect_main_model import sys @@ -7,5 +7,5 @@ def get_module(mod): return sys.modules[mod] cpu = autodetect_main_model() -viewcode = get_module("pypy.jit.backend.%s.tool.viewcode" % cpu) +viewcode = get_module("rpython.jit.backend.%s.tool.viewcode" % cpu) machine_code_dump = getattr(viewcode, 'machine_code_dump') diff --git a/pypy/jit/backend/x86/tool/__init__.py b/rpython/jit/backend/x86/__init__.py similarity index 100% rename from pypy/jit/backend/x86/tool/__init__.py rename to rpython/jit/backend/x86/__init__.py diff --git a/pypy/jit/backend/x86/arch.py b/rpython/jit/backend/x86/arch.py similarity index 100% rename from pypy/jit/backend/x86/arch.py rename to rpython/jit/backend/x86/arch.py diff --git a/pypy/jit/backend/x86/assembler.py b/rpython/jit/backend/x86/assembler.py similarity index 98% rename from pypy/jit/backend/x86/assembler.py rename to rpython/jit/backend/x86/assembler.py index 9f1a278967db828af55f90bdf8ba5abc440e5664..12d1e54ee34110800f61080d0a4e6570b695523b 100644 --- a/pypy/jit/backend/x86/assembler.py +++ b/rpython/jit/backend/x86/assembler.py @@ -1,21 +1,21 @@ import sys, os -from pypy.jit.backend.llsupport import symbolic -from pypy.jit.backend.llsupport.asmmemmgr import MachineDataBlockWrapper -from pypy.jit.metainterp.history import Const, Box, BoxInt, ConstInt -from pypy.jit.metainterp.history import AbstractFailDescr, INT, REF, FLOAT -from pypy.jit.metainterp.history import JitCellToken -from pypy.rpython.lltypesystem import lltype, rffi, rstr, llmemory -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.rpython.annlowlevel import llhelper -from pypy.rlib.jit import AsmInfo -from pypy.jit.backend.model import CompiledLoopToken -from pypy.jit.backend.x86.regalloc import (RegAlloc, get_ebp_ofs, _get_scale, +from rpython.jit.backend.llsupport import symbolic +from rpython.jit.backend.llsupport.asmmemmgr import MachineDataBlockWrapper +from rpython.jit.metainterp.history import Const, Box, BoxInt, ConstInt +from rpython.jit.metainterp.history import AbstractFailDescr, INT, REF, FLOAT +from rpython.jit.metainterp.history import JitCellToken +from rpython.rtyper.lltypesystem import lltype, rffi, rstr, llmemory +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.rtyper.annlowlevel import llhelper +from rpython.rlib.jit import AsmInfo +from rpython.jit.backend.model import CompiledLoopToken +from rpython.jit.backend.x86.regalloc import (RegAlloc, get_ebp_ofs, _get_scale, gpr_reg_mgr_cls, xmm_reg_mgr_cls, _valid_addressing_size) -from pypy.jit.backend.x86.arch import (FRAME_FIXED_SIZE, FORCE_INDEX_OFS, WORD, +from rpython.jit.backend.x86.arch import (FRAME_FIXED_SIZE, FORCE_INDEX_OFS, WORD, IS_X86_32, IS_X86_64) -from pypy.jit.backend.x86.regloc import (eax, ecx, edx, ebx, +from rpython.jit.backend.x86.regloc import (eax, ecx, edx, ebx, esp, ebp, esi, edi, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, @@ -27,20 +27,20 @@ from pypy.jit.backend.x86.regloc import (eax, ecx, edx, ebx, ImmedLoc, AddressLoc, imm, imm0, imm1, FloatImmedLoc) -from pypy.rlib.objectmodel import we_are_translated, specialize -from pypy.jit.backend.x86 import rx86, regloc, codebuf -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.jit.backend.x86.support import values_array -from pypy.jit.backend.x86 import support -from pypy.rlib.debug import (debug_print, debug_start, debug_stop, +from rpython.rlib.objectmodel import we_are_translated, specialize +from rpython.jit.backend.x86 import rx86, regloc, codebuf +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.jit.backend.x86.support import values_array +from rpython.jit.backend.x86 import support +from rpython.rlib.debug import (debug_print, debug_start, debug_stop, have_debug_prints) -from pypy.rlib import rgc -from pypy.rlib.clibffi import FFI_DEFAULT_ABI -from pypy.jit.backend.x86.jump import remap_frame_layout -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.codewriter import longlong -from pypy.rlib.rarithmetic import intmask -from pypy.rlib.objectmodel import compute_unique_id +from rpython.rlib import rgc +from rpython.rlib.clibffi import FFI_DEFAULT_ABI +from rpython.jit.backend.x86.jump import remap_frame_layout +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.codewriter import longlong +from rpython.rlib.rarithmetic import intmask +from rpython.rlib.objectmodel import compute_unique_id # darwin requires the stack to be 16 bytes aligned on calls. Same for gcc 4.5.0, # better safe than sorry @@ -435,7 +435,7 @@ class Assembler386(object): @rgc.no_collect def _release_gil_asmgcc(css): # similar to trackgcroot.py:pypy_asm_stackwalk, first part - from pypy.rpython.memory.gctransform import asmgcroot + from rpython.rtyper.memory.gctransform import asmgcroot new = rffi.cast(asmgcroot.ASM_FRAMEDATA_HEAD_PTR, css) next = asmgcroot.gcrootanchor.next new.next = next @@ -455,7 +455,7 @@ class Assembler386(object): if after: after() # similar to trackgcroot.py:pypy_asm_stackwalk, second part - from pypy.rpython.memory.gctransform import asmgcroot + from rpython.rtyper.memory.gctransform import asmgcroot old = rffi.cast(asmgcroot.ASM_FRAMEDATA_HEAD_PTR, css) prev = old.prev next = old.next @@ -1139,7 +1139,7 @@ class Assembler386(object): self._regalloc.needed_extra_stack_locations(p//WORD) def _fix_stdcall(self, callconv, p): - from pypy.rlib.clibffi import FFI_STDCALL + from rpython.rlib.clibffi import FFI_STDCALL assert callconv == FFI_STDCALL # it's a bit stupid, but we're just going to cancel the fact that # the called function just added 'p' to ESP, by subtracting it again. @@ -1795,7 +1795,7 @@ class Assembler386(object): # from reading the half-word in the object header. Note that # this half-word is at offset 0 on a little-endian machine; # it would be at offset 2 or 4 on a big-endian machine. - from pypy.rpython.memory.gctypelayout import GCData + from rpython.rtyper.memory.gctypelayout import GCData sizeof_ti = rffi.sizeof(GCData.TYPE_INFO) type_info_group = llop.gc_get_type_info_group(llmemory.Address) type_info_group = rffi.cast(lltype.Signed, type_info_group) @@ -1919,7 +1919,7 @@ class Assembler386(object): assert len(failargs) <= self.fail_boxes_int.SIZE def rebuild_faillocs_from_descr(self, bytecode): - from pypy.jit.backend.x86.regalloc import X86FrameManager + from rpython.jit.backend.x86.regalloc import X86FrameManager descr_to_box_type = [REF, INT, FLOAT] bytecode = rffi.cast(rffi.UCHARP, bytecode) arglocs = [] @@ -2176,7 +2176,7 @@ class Assembler386(object): self._genop_call(op, arglocs, resloc, force_index) def _genop_call(self, op, arglocs, resloc, force_index): - from pypy.jit.backend.llsupport.descr import CallDescr + from rpython.jit.backend.llsupport.descr import CallDescr sizeloc = arglocs[0] assert isinstance(sizeloc, ImmedLoc) @@ -2283,7 +2283,7 @@ class Assembler386(object): # like %eax that would be destroyed by this call, *and* they are # used by arglocs for the *next* call, then trouble; for now we # will just push/pop them. - from pypy.rpython.memory.gctransform import asmgcroot + from rpython.rtyper.memory.gctransform import asmgcroot css = self._regalloc.close_stack_struct if css == 0: use_words = (2 + max(asmgcroot.INDEX_OF_EBP, @@ -2411,7 +2411,7 @@ class Assembler386(object): # # Reset the vable token --- XXX really too much special logic here:-( if jd.index_of_virtualizable >= 0: - from pypy.jit.backend.llsupport.descr import FieldDescr + from rpython.jit.backend.llsupport.descr import FieldDescr fielddescr = jd.vable_token_descr assert isinstance(fielddescr, FieldDescr) ofs = fielddescr.offset diff --git a/pypy/jit/backend/x86/codebuf.py b/rpython/jit/backend/x86/codebuf.py similarity index 74% rename from pypy/jit/backend/x86/codebuf.py rename to rpython/jit/backend/x86/codebuf.py index 74534746558d438f58a6bae3709e6bb1c1aa036e..647eebf2afa85364fe3d780d7873a3f80debbdc1 100644 --- a/pypy/jit/backend/x86/codebuf.py +++ b/rpython/jit/backend/x86/codebuf.py @@ -1,12 +1,12 @@ -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.rarithmetic import intmask -from pypy.rlib.debug import debug_start, debug_print, debug_stop -from pypy.rlib.debug import have_debug_prints -from pypy.jit.backend.llsupport.asmmemmgr import BlockBuilderMixin -from pypy.jit.backend.x86.rx86 import X86_32_CodeBuilder, X86_64_CodeBuilder -from pypy.jit.backend.x86.regloc import LocationCodeBuilder -from pypy.jit.backend.x86.arch import IS_X86_32, IS_X86_64, WORD -from pypy.jit.backend.x86 import valgrind +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.rarithmetic import intmask +from rpython.rlib.debug import debug_start, debug_print, debug_stop +from rpython.rlib.debug import have_debug_prints +from rpython.jit.backend.llsupport.asmmemmgr import BlockBuilderMixin +from rpython.jit.backend.x86.rx86 import X86_32_CodeBuilder, X86_64_CodeBuilder +from rpython.jit.backend.x86.regloc import LocationCodeBuilder +from rpython.jit.backend.x86.arch import IS_X86_32, IS_X86_64, WORD +from rpython.jit.backend.x86 import valgrind # XXX: Seems nasty to change the superclass of MachineCodeBlockWrapper # like this diff --git a/pypy/jit/backend/x86/detect_sse2.py b/rpython/jit/backend/x86/detect_sse2.py similarity index 87% rename from pypy/jit/backend/x86/detect_sse2.py rename to rpython/jit/backend/x86/detect_sse2.py index e430986eb83be3be9a9ef8b93c02ea90266fa67f..bf44ea787a00d0dc20e08089e0f6be389ae65424 100644 --- a/pypy/jit/backend/x86/detect_sse2.py +++ b/rpython/jit/backend/x86/detect_sse2.py @@ -1,6 +1,5 @@ -import autopath -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.rmmap import alloc, free +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.rmmap import alloc, free def detect_sse2(): diff --git a/pypy/jit/backend/x86/jump.py b/rpython/jit/backend/x86/jump.py similarity index 96% rename from pypy/jit/backend/x86/jump.py rename to rpython/jit/backend/x86/jump.py index 8ba6975cee422fc538e50464a3f08880fc47c965..6a7756caaa240f5a774e9a4d97545b9983728ba4 100644 --- a/pypy/jit/backend/x86/jump.py +++ b/rpython/jit/backend/x86/jump.py @@ -1,6 +1,6 @@ import sys -from pypy.tool.pairtype import extendabletype -from pypy.jit.backend.x86.regloc import ImmediateAssemblerLocation, StackLoc +from rpython.tool.pairtype import extendabletype +from rpython.jit.backend.x86.regloc import ImmediateAssemblerLocation, StackLoc def remap_frame_layout(assembler, src_locations, dst_locations, tmpreg): pending_dests = len(dst_locations) @@ -85,7 +85,7 @@ def remap_frame_layout_mixed(assembler, src_locations2, dst_locations2, tmpreg2): # find and push the xmm stack locations from src_locations2 that # are going to be overwritten by dst_locations1 - from pypy.jit.backend.x86.arch import WORD + from rpython.jit.backend.x86.arch import WORD extrapushes = [] dst_keys = {} for loc in dst_locations1: diff --git a/pypy/jit/backend/x86/oprofile.py b/rpython/jit/backend/x86/oprofile.py similarity index 85% rename from pypy/jit/backend/x86/oprofile.py rename to rpython/jit/backend/x86/oprofile.py index ab08c6d51d5df9e998e4e8904099782c89d1afd1..59a3a94b1f673033bb854822c0ff61496791a6dc 100644 --- a/pypy/jit/backend/x86/oprofile.py +++ b/rpython/jit/backend/x86/oprofile.py @@ -1,9 +1,9 @@ -from pypy.rpython.tool import rffi_platform -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.rposix import get_errno -from pypy.jit.backend.x86 import profagent +from rpython.rtyper.tool import rffi_platform +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.rposix import get_errno +from rpython.jit.backend.x86 import profagent class OProfileError(Exception): def __init__(self, errno, where): diff --git a/pypy/jit/backend/x86/profagent.py b/rpython/jit/backend/x86/profagent.py similarity index 100% rename from pypy/jit/backend/x86/profagent.py rename to rpython/jit/backend/x86/profagent.py diff --git a/pypy/jit/backend/x86/regalloc.py b/rpython/jit/backend/x86/regalloc.py similarity index 97% rename from pypy/jit/backend/x86/regalloc.py rename to rpython/jit/backend/x86/regalloc.py index 693d0e39e99a82195cb1a19a7c8c9dddc2b8e5a5..c0af8a7aeec00f9ffcd484115018367ffaac9684 100644 --- a/pypy/jit/backend/x86/regalloc.py +++ b/rpython/jit/backend/x86/regalloc.py @@ -3,31 +3,31 @@ """ import os -from pypy.jit.metainterp.history import (Box, Const, ConstInt, ConstPtr, +from rpython.jit.metainterp.history import (Box, Const, ConstInt, ConstPtr, ResOperation, BoxPtr, ConstFloat, BoxFloat, INT, REF, FLOAT, TargetToken, JitCellToken) -from pypy.jit.backend.x86.regloc import * -from pypy.rpython.lltypesystem import lltype, rffi, rstr -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib import rgc -from pypy.jit.backend.llsupport import symbolic -from pypy.jit.backend.x86.jump import remap_frame_layout_mixed -from pypy.jit.codewriter import heaptracker, longlong -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.backend.llsupport.descr import FieldDescr, ArrayDescr -from pypy.jit.backend.llsupport.descr import CallDescr, SizeDescr -from pypy.jit.backend.llsupport.descr import InteriorFieldDescr -from pypy.jit.backend.llsupport.descr import unpack_arraydescr -from pypy.jit.backend.llsupport.descr import unpack_fielddescr -from pypy.jit.backend.llsupport.descr import unpack_interiorfielddescr -from pypy.jit.backend.llsupport.regalloc import FrameManager, RegisterManager,\ +from rpython.jit.backend.x86.regloc import * +from rpython.rtyper.lltypesystem import lltype, rffi, rstr +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib import rgc +from rpython.jit.backend.llsupport import symbolic +from rpython.jit.backend.x86.jump import remap_frame_layout_mixed +from rpython.jit.codewriter import heaptracker, longlong +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.backend.llsupport.descr import FieldDescr, ArrayDescr +from rpython.jit.backend.llsupport.descr import CallDescr, SizeDescr +from rpython.jit.backend.llsupport.descr import InteriorFieldDescr +from rpython.jit.backend.llsupport.descr import unpack_arraydescr +from rpython.jit.backend.llsupport.descr import unpack_fielddescr +from rpython.jit.backend.llsupport.descr import unpack_interiorfielddescr +from rpython.jit.backend.llsupport.regalloc import FrameManager, RegisterManager,\ TempBox, compute_vars_longevity, is_comparison_or_ovf_op -from pypy.jit.backend.x86.arch import WORD, FRAME_FIXED_SIZE -from pypy.jit.backend.x86.arch import IS_X86_32, IS_X86_64, MY_COPY_OF_REGS -from pypy.jit.backend.x86 import rx86 -from pypy.rlib.rarithmetic import r_longlong +from rpython.jit.backend.x86.arch import WORD, FRAME_FIXED_SIZE +from rpython.jit.backend.x86.arch import IS_X86_32, IS_X86_64, MY_COPY_OF_REGS +from rpython.jit.backend.x86 import rx86 +from rpython.rlib.rarithmetic import r_longlong class X86RegisterManager(RegisterManager): diff --git a/pypy/jit/backend/x86/regloc.py b/rpython/jit/backend/x86/regloc.py similarity index 97% rename from pypy/jit/backend/x86/regloc.py rename to rpython/jit/backend/x86/regloc.py index b34694533520514f50ca288c02c96c5786893a27..ae423082eb3564754ea724b2dd6e2bd384661db0 100644 --- a/pypy/jit/backend/x86/regloc.py +++ b/rpython/jit/backend/x86/regloc.py @@ -1,12 +1,12 @@ -from pypy.jit.metainterp.history import AbstractValue, ConstInt -from pypy.jit.backend.x86 import rx86 -from pypy.rlib.unroll import unrolling_iterable -from pypy.jit.backend.x86.arch import WORD, IS_X86_32, IS_X86_64 -from pypy.tool.sourcetools import func_with_new_name -from pypy.rlib.objectmodel import specialize, instantiate -from pypy.rlib.rarithmetic import intmask -from pypy.jit.metainterp.history import FLOAT -from pypy.jit.codewriter import longlong +from rpython.jit.metainterp.history import AbstractValue, ConstInt +from rpython.jit.backend.x86 import rx86 +from rpython.rlib.unroll import unrolling_iterable +from rpython.jit.backend.x86.arch import WORD, IS_X86_32, IS_X86_64 +from rpython.tool.sourcetools import func_with_new_name +from rpython.rlib.objectmodel import specialize, instantiate +from rpython.rlib.rarithmetic import intmask +from rpython.jit.metainterp.history import FLOAT +from rpython.jit.codewriter import longlong # # This module adds support for "locations", which can be either in a Const, @@ -112,7 +112,7 @@ class ImmedLoc(ImmediateAssemblerLocation): _location_code = 'i' def __init__(self, value): - from pypy.rpython.lltypesystem import rffi, lltype + from rpython.rtyper.lltypesystem import rffi, lltype # force as a real int self.value = rffi.cast(lltype.Signed, value) @@ -245,7 +245,7 @@ if IS_X86_32: if IS_X86_64: def FloatImmedLoc(floatstorage): - from pypy.rlib.longlong2float import float2longlong + from rpython.rlib.longlong2float import float2longlong value = intmask(float2longlong(floatstorage)) return ImmedLoc(value) diff --git a/pypy/jit/backend/x86/runner.py b/rpython/jit/backend/x86/runner.py similarity index 89% rename from pypy/jit/backend/x86/runner.py rename to rpython/jit/backend/x86/runner.py index d944a9d9028a86c23ad025e9406f07b0ad3155bb..973919c80e3a469a44668b0ace76a7042d20600d 100644 --- a/pypy/jit/backend/x86/runner.py +++ b/rpython/jit/backend/x86/runner.py @@ -1,19 +1,19 @@ import py -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.rpython.llinterp import LLInterpreter -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.jit_hooks import LOOP_RUN_CONTAINER -from pypy.jit.codewriter import longlong -from pypy.jit.metainterp import history, compile -from pypy.jit.backend.x86.assembler import Assembler386 -from pypy.jit.backend.x86.arch import FORCE_INDEX_OFS, IS_X86_32 -from pypy.jit.backend.x86.profagent import ProfileAgent -from pypy.jit.backend.llsupport.llmodel import AbstractLLCPU -from pypy.jit.backend.x86 import regloc +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.rtyper.llinterp import LLInterpreter +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.jit_hooks import LOOP_RUN_CONTAINER +from rpython.jit.codewriter import longlong +from rpython.jit.metainterp import history, compile +from rpython.jit.backend.x86.assembler import Assembler386 +from rpython.jit.backend.x86.arch import FORCE_INDEX_OFS, IS_X86_32 +from rpython.jit.backend.x86.profagent import ProfileAgent +from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU +from rpython.jit.backend.x86 import regloc import sys -from pypy.tool.ansi_print import ansi_log +from rpython.tool.ansi_print import ansi_log log = py.log.Producer('jitbackend') py.log.setconsumer('jitbackend', ansi_log) @@ -37,7 +37,7 @@ class AbstractX86CPU(AbstractLLCPU): if rtyper is not None: config = rtyper.annotator.translator.config if config.translation.jit_profiler == "oprofile": - from pypy.jit.backend.x86 import oprofile + from rpython.jit.backend.x86 import oprofile if not oprofile.OPROFILE_AVAILABLE: log.WARNING('oprofile support was explicitly enabled, but oprofile headers seem not to be available') profile_agent = oprofile.OProfileAgent() @@ -71,7 +71,7 @@ class AbstractX86CPU(AbstractLLCPU): """ NOT_RPYTHON """ - from pypy.jit.backend.x86.tool.viewcode import machine_code_dump + from rpython.jit.backend.x86.tool.viewcode import machine_code_dump data = [] label_list = [(offset, name) for name, offset in looptoken._x86_ops_offset.iteritems()] @@ -175,7 +175,7 @@ class AbstractX86CPU(AbstractLLCPU): self.assembler.redirect_call_assembler(oldlooptoken, newlooptoken) def invalidate_loop(self, looptoken): - from pypy.jit.backend.x86 import codebuf + from rpython.jit.backend.x86 import codebuf for addr, tgt in looptoken.compiled_loop_token.invalidate_positions: mc = codebuf.MachineCodeBlockWrapper() diff --git a/pypy/jit/backend/x86/rx86.py b/rpython/jit/backend/x86/rx86.py similarity index 99% rename from pypy/jit/backend/x86/rx86.py rename to rpython/jit/backend/x86/rx86.py index 3fbf9bfa0fa171c6e0728de3e7bf3ceb79218759..601dae8e7afd00837991179b584b568fc9a46767 100644 --- a/pypy/jit/backend/x86/rx86.py +++ b/rpython/jit/backend/x86/rx86.py @@ -1,9 +1,9 @@ import py -from pypy.rlib.objectmodel import ComputedIntSymbolic, we_are_translated -from pypy.rlib.objectmodel import specialize -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.rarithmetic import intmask -from pypy.rpython.lltypesystem import rffi +from rpython.rlib.objectmodel import ComputedIntSymbolic, we_are_translated +from rpython.rlib.objectmodel import specialize +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.rarithmetic import intmask +from rpython.rtyper.lltypesystem import rffi BYTE_REG_FLAG = 0x20 NO_BASE_REGISTER = -1 diff --git a/pypy/jit/backend/x86/support.py b/rpython/jit/backend/x86/support.py similarity index 87% rename from pypy/jit/backend/x86/support.py rename to rpython/jit/backend/x86/support.py index bd81f62c9fec28843421e6dd5918b94a73975614..2272455f087d698a1d8da94b8f61778cf1f78276 100644 --- a/pypy/jit/backend/x86/support.py +++ b/rpython/jit/backend/x86/support.py @@ -1,7 +1,7 @@ import sys -from pypy.rpython.lltypesystem import lltype, rffi, llmemory -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.jit.backend.x86.arch import WORD +from rpython.rtyper.lltypesystem import lltype, rffi, llmemory +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.jit.backend.x86.arch import WORD def values_array(TP, size): diff --git a/pypy/jit/codewriter/__init__.py b/rpython/jit/backend/x86/test/__init__.py similarity index 100% rename from pypy/jit/codewriter/__init__.py rename to rpython/jit/backend/x86/test/__init__.py diff --git a/pypy/jit/backend/x86/test/conftest.py b/rpython/jit/backend/x86/test/conftest.py similarity index 77% rename from pypy/jit/backend/x86/test/conftest.py rename to rpython/jit/backend/x86/test/conftest.py index 4c6783bf6eac68d83af05ae70935d4c4ada302ed..0d64741cfb90adbe1b2a55605c6137a7db82dbc2 100644 --- a/pypy/jit/backend/x86/test/conftest.py +++ b/rpython/jit/backend/x86/test/conftest.py @@ -1,5 +1,5 @@ import py, os -from pypy.jit.backend import detect_cpu +from rpython.jit.backend import detect_cpu cpu = detect_cpu.autodetect() def pytest_runtest_setup(item): @@ -8,5 +8,5 @@ def pytest_runtest_setup(item): if cpu == 'x86_64': if os.name == "nt": py.test.skip("Windows cannot allocate non-reserved memory") - from pypy.rpython.lltypesystem import ll2ctypes + from rpython.rtyper.lltypesystem import ll2ctypes ll2ctypes.do_allocation_in_far_regions() diff --git a/pypy/jit/backend/x86/test/test_assembler.py b/rpython/jit/backend/x86/test/test_assembler.py similarity index 93% rename from pypy/jit/backend/x86/test/test_assembler.py rename to rpython/jit/backend/x86/test/test_assembler.py index b42b9d4db484da621bff37f01c27f4c98bbfa3b6..872f5d1d26fda198538f969b4b36d9be5e9ffae6 100644 --- a/pypy/jit/backend/x86/test/test_assembler.py +++ b/rpython/jit/backend/x86/test/test_assembler.py @@ -1,14 +1,14 @@ -from pypy.jit.backend.x86.regloc import * -from pypy.jit.backend.x86.assembler import Assembler386 -from pypy.jit.backend.x86.regalloc import X86FrameManager, get_ebp_ofs -from pypy.jit.metainterp.history import BoxInt, BoxPtr, BoxFloat, ConstFloat -from pypy.jit.metainterp.history import INT, REF, FLOAT -from pypy.rlib.rarithmetic import intmask -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.jit.backend.x86.arch import WORD, IS_X86_32, IS_X86_64 -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.x86.regalloc import X86RegisterManager, X86_64_RegisterManager, X86XMMRegisterManager, X86_64_XMMRegisterManager -from pypy.jit.codewriter import longlong +from rpython.jit.backend.x86.regloc import * +from rpython.jit.backend.x86.assembler import Assembler386 +from rpython.jit.backend.x86.regalloc import X86FrameManager, get_ebp_ofs +from rpython.jit.metainterp.history import BoxInt, BoxPtr, BoxFloat, ConstFloat +from rpython.jit.metainterp.history import INT, REF, FLOAT +from rpython.rlib.rarithmetic import intmask +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.jit.backend.x86.arch import WORD, IS_X86_32, IS_X86_64 +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.x86.regalloc import X86RegisterManager, X86_64_RegisterManager, X86XMMRegisterManager, X86_64_XMMRegisterManager +from rpython.jit.codewriter import longlong import ctypes import py @@ -250,8 +250,8 @@ def do_failure_recovery_func(withfloats): class TestRegallocPushPop(object): def do_test(self, callback): - from pypy.jit.backend.x86.regalloc import X86FrameManager - from pypy.jit.backend.x86.regalloc import X86XMMRegisterManager + from rpython.jit.backend.x86.regalloc import X86FrameManager + from rpython.jit.backend.x86.regalloc import X86XMMRegisterManager class FakeToken: class compiled_loop_token: asmmemmgr_blocks = None diff --git a/pypy/jit/backend/x86/test/test_basic.py b/rpython/jit/backend/x86/test/test_basic.py similarity index 80% rename from pypy/jit/backend/x86/test/test_basic.py rename to rpython/jit/backend/x86/test/test_basic.py index e0fc901957b5f9eec00feed82acc729ee1ab06a4..eba911e804b68d183411a722cbd7f7d07d8d4765 100644 --- a/pypy/jit/backend/x86/test/test_basic.py +++ b/rpython/jit/backend/x86/test/test_basic.py @@ -1,9 +1,9 @@ import py -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.metainterp.warmspot import ll_meta_interp -from pypy.jit.metainterp.test import support, test_ajit -from pypy.jit.codewriter.policy import StopAtXPolicy -from pypy.rlib.jit import JitDriver +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.metainterp.warmspot import ll_meta_interp +from rpython.jit.metainterp.test import support, test_ajit +from rpython.jit.codewriter.policy import StopAtXPolicy +from rpython.rlib.jit import JitDriver class Jit386Mixin(support.LLJitMixin): type_system = 'lltype' diff --git a/rpython/jit/backend/x86/test/test_calling_convention.py b/rpython/jit/backend/x86/test/test_calling_convention.py new file mode 100644 index 0000000000000000000000000000000000000000..090662bb59c5de3371800305713e72e2bcddea52 --- /dev/null +++ b/rpython/jit/backend/x86/test/test_calling_convention.py @@ -0,0 +1 @@ +from rpython.jit.backend.test.calling_convention_test import TestCallingConv diff --git a/pypy/jit/backend/x86/test/test_del.py b/rpython/jit/backend/x86/test/test_del.py similarity index 52% rename from pypy/jit/backend/x86/test/test_del.py rename to rpython/jit/backend/x86/test/test_del.py index d7620cbddba733c4a104b21accf340631b083418..309dc9cd13a892ddae4a1ff9a6cd73a617d706ef 100644 --- a/pypy/jit/backend/x86/test/test_del.py +++ b/rpython/jit/backend/x86/test/test_del.py @@ -1,6 +1,6 @@ -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin -from pypy.jit.metainterp.test.test_del import DelTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_del import DelTests class TestDel(Jit386Mixin, DelTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_dict.py b/rpython/jit/backend/x86/test/test_dict.py similarity index 52% rename from pypy/jit/backend/x86/test/test_dict.py rename to rpython/jit/backend/x86/test/test_dict.py index 2171ae4d398eb24561370385cc9ee150663a0974..79c612d3edc6d2aa9e677def9a30f1e37c0784da 100644 --- a/pypy/jit/backend/x86/test/test_dict.py +++ b/rpython/jit/backend/x86/test/test_dict.py @@ -1,6 +1,6 @@ -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin -from pypy.jit.metainterp.test.test_dict import DictTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_dict import DictTests class TestDict(Jit386Mixin, DictTests): diff --git a/pypy/jit/backend/x86/test/test_exception.py b/rpython/jit/backend/x86/test/test_exception.py similarity index 64% rename from pypy/jit/backend/x86/test/test_exception.py rename to rpython/jit/backend/x86/test/test_exception.py index 072a90a328326d69c95b6a6bd5403a16d80db5e2..819dd9c02ad71600e946549f145989f09097be69 100644 --- a/pypy/jit/backend/x86/test/test_exception.py +++ b/rpython/jit/backend/x86/test/test_exception.py @@ -1,7 +1,7 @@ import py -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin -from pypy.jit.metainterp.test.test_exception import ExceptionTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_exception import ExceptionTests class TestExceptions(Jit386Mixin, ExceptionTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_fficall.py b/rpython/jit/backend/x86/test/test_fficall.py similarity index 58% rename from pypy/jit/backend/x86/test/test_fficall.py rename to rpython/jit/backend/x86/test/test_fficall.py index 174270ecdee72c7e70aae6baf8c345b3639a570f..b50e485f11e37a7a98737c224014a776b09fd00f 100644 --- a/pypy/jit/backend/x86/test/test_fficall.py +++ b/rpython/jit/backend/x86/test/test_fficall.py @@ -1,6 +1,6 @@ import py -from pypy.jit.metainterp.test import test_fficall -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test import test_fficall +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin class TestFfiCall(Jit386Mixin, test_fficall.FfiCallTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_float.py b/rpython/jit/backend/x86/test/test_float.py similarity index 54% rename from pypy/jit/backend/x86/test/test_float.py rename to rpython/jit/backend/x86/test/test_float.py index fbe83e889e403bf02a90da2d385838987eee1a89..ac1e99a1a51090b60fc4be641eb17c4b96518721 100644 --- a/pypy/jit/backend/x86/test/test_float.py +++ b/rpython/jit/backend/x86/test/test_float.py @@ -1,7 +1,7 @@ import py -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin -from pypy.jit.metainterp.test.test_float import FloatTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_float import FloatTests class TestFloat(Jit386Mixin, FloatTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_gc_integration.py b/rpython/jit/backend/x86/test/test_gc_integration.py similarity index 94% rename from pypy/jit/backend/x86/test/test_gc_integration.py rename to rpython/jit/backend/x86/test/test_gc_integration.py index a49f67b916f3b1d47910ce159b200fce0d9406ec..ad7cdbee35956cdd84aa9a5fc0845a57be18ef60 100644 --- a/pypy/jit/backend/x86/test/test_gc_integration.py +++ b/rpython/jit/backend/x86/test/test_gc_integration.py @@ -3,25 +3,25 @@ """ import py -from pypy.jit.metainterp.history import BoxInt, ConstInt,\ +from rpython.jit.metainterp.history import BoxInt, ConstInt,\ BoxPtr, ConstPtr, TreeLoop, TargetToken -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.jit.codewriter import heaptracker -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.backend.llsupport.descr import GcCache, FieldDescr, FLAG_SIGNED -from pypy.jit.backend.llsupport.gc import GcLLDescription -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.x86.regalloc import RegAlloc -from pypy.jit.backend.x86.arch import WORD, FRAME_FIXED_SIZE -from pypy.jit.tool.oparser import parse -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rpython.annlowlevel import llhelper -from pypy.rpython.lltypesystem import rclass, rstr -from pypy.jit.backend.llsupport.gc import GcLLDescr_framework - -from pypy.jit.backend.x86.test.test_regalloc import MockAssembler -from pypy.jit.backend.x86.test.test_regalloc import BaseTestRegalloc -from pypy.jit.backend.x86.regalloc import X86RegisterManager, X86FrameManager,\ +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.jit.codewriter import heaptracker +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.backend.llsupport.descr import GcCache, FieldDescr, FLAG_SIGNED +from rpython.jit.backend.llsupport.gc import GcLLDescription +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.x86.regalloc import RegAlloc +from rpython.jit.backend.x86.arch import WORD, FRAME_FIXED_SIZE +from rpython.jit.tool.oparser import parse +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rtyper.annlowlevel import llhelper +from rpython.rtyper.lltypesystem import rclass, rstr +from rpython.jit.backend.llsupport.gc import GcLLDescr_framework + +from rpython.jit.backend.x86.test.test_regalloc import MockAssembler +from rpython.jit.backend.x86.test.test_regalloc import BaseTestRegalloc +from rpython.jit.backend.x86.regalloc import X86RegisterManager, X86FrameManager,\ X86XMMRegisterManager CPU = getcpuclass() @@ -367,7 +367,7 @@ class MockShadowStackRootMap(MockGcRootMap): frame_addr = self.addrs[3] # pushed by the asm frame assert self.addrs[4] == self.MARKER_FRAME # pushed by the asm frame # - from pypy.jit.backend.x86.arch import FORCE_INDEX_OFS + from rpython.jit.backend.x86.arch import FORCE_INDEX_OFS addr = rffi.cast(rffi.CArrayPtr(lltype.Signed), frame_addr + FORCE_INDEX_OFS) force_index = addr[0] diff --git a/pypy/jit/backend/x86/test/test_jump.py b/rpython/jit/backend/x86/test/test_jump.py similarity index 97% rename from pypy/jit/backend/x86/test/test_jump.py rename to rpython/jit/backend/x86/test/test_jump.py index a6e3444501f34b69b5111809e4d17a73a70113e3..f0974dc88dcd73f26c01ea6ffa98f84c9d4bf82a 100644 --- a/pypy/jit/backend/x86/test/test_jump.py +++ b/rpython/jit/backend/x86/test/test_jump.py @@ -1,9 +1,9 @@ import random -from pypy.jit.backend.x86.regloc import * -from pypy.jit.backend.x86.regalloc import X86FrameManager -from pypy.jit.backend.x86.jump import remap_frame_layout -from pypy.jit.backend.x86.jump import remap_frame_layout_mixed -from pypy.jit.metainterp.history import INT +from rpython.jit.backend.x86.regloc import * +from rpython.jit.backend.x86.regalloc import X86FrameManager +from rpython.jit.backend.x86.jump import remap_frame_layout +from rpython.jit.backend.x86.jump import remap_frame_layout_mixed +from rpython.jit.metainterp.history import INT frame_pos = X86FrameManager.frame_pos @@ -412,5 +412,5 @@ def test_overflow_bug(): main() # but it used to crash when translated, # because of a -sys.maxint-2 overflowing to sys.maxint - from pypy.rpython.test.test_llinterp import interpret + from rpython.rtyper.test.test_llinterp import interpret interpret(main, []) diff --git a/pypy/jit/backend/x86/test/test_list.py b/rpython/jit/backend/x86/test/test_list.py similarity index 51% rename from pypy/jit/backend/x86/test/test_list.py rename to rpython/jit/backend/x86/test/test_list.py index c17c0e6917c43d1e1a412eaeddca7a41fb0c119a..d67e61936a41969c7a9a44a5878dd0f90001827e 100644 --- a/pypy/jit/backend/x86/test/test_list.py +++ b/rpython/jit/backend/x86/test/test_list.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.test.test_list import ListTests -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_list import ListTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin class TestList(Jit386Mixin, ListTests): # for individual tests see diff --git a/pypy/jit/backend/x86/test/test_longlong.py b/rpython/jit/backend/x86/test/test_longlong.py similarity index 57% rename from pypy/jit/backend/x86/test/test_longlong.py rename to rpython/jit/backend/x86/test/test_longlong.py index 549c114dd01998f1d042147df1f5df8a08186b60..5dd66b88ee581cd8aa383283845657a8b9838179 100644 --- a/pypy/jit/backend/x86/test/test_longlong.py +++ b/rpython/jit/backend/x86/test/test_longlong.py @@ -1,5 +1,5 @@ -from pypy.jit.metainterp.test import test_longlong -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test import test_longlong +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin class TestLongLong(Jit386Mixin, test_longlong.LongLongTests): # for the individual tests see diff --git a/pypy/jit/backend/arm/test/test_loop_unroll.py b/rpython/jit/backend/x86/test/test_loop_unroll.py similarity index 58% rename from pypy/jit/backend/arm/test/test_loop_unroll.py rename to rpython/jit/backend/x86/test/test_loop_unroll.py index 312deff9e555f97df3ded628611eb77e1f341148..fbd85b554affd2dfe74668a9af6079de68707dcf 100644 --- a/pypy/jit/backend/arm/test/test_loop_unroll.py +++ b/rpython/jit/backend/x86/test/test_loop_unroll.py @@ -1,6 +1,6 @@ import py -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin -from pypy.jit.metainterp.test import test_loop_unroll +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test import test_loop_unroll class TestLoopSpec(Jit386Mixin, test_loop_unroll.LoopUnrollTest): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_quasiimmut.py b/rpython/jit/backend/x86/test/test_quasiimmut.py similarity index 58% rename from pypy/jit/backend/x86/test/test_quasiimmut.py rename to rpython/jit/backend/x86/test/test_quasiimmut.py index 2bcf3f2068544439d767a23babe47f9de75492b6..e054cd15b335b0fe09c1a19b3bfa4b865419126f 100644 --- a/pypy/jit/backend/x86/test/test_quasiimmut.py +++ b/rpython/jit/backend/x86/test/test_quasiimmut.py @@ -1,7 +1,7 @@ import py -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin -from pypy.jit.metainterp.test import test_quasiimmut +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test import test_quasiimmut class TestLoopSpec(Jit386Mixin, test_quasiimmut.QuasiImmutTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_rawmem.py b/rpython/jit/backend/x86/test/test_rawmem.py similarity index 52% rename from pypy/jit/backend/x86/test/test_rawmem.py rename to rpython/jit/backend/x86/test/test_rawmem.py index 599da4e0d63cbb0b1dbf58047f5846435c6e0c4a..0344f6adf82ffbb6ea59852196b9981ecb2c833f 100644 --- a/pypy/jit/backend/x86/test/test_rawmem.py +++ b/rpython/jit/backend/x86/test/test_rawmem.py @@ -1,6 +1,6 @@ -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin -from pypy.jit.metainterp.test.test_rawmem import RawMemTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_rawmem import RawMemTests class TestRawMem(Jit386Mixin, RawMemTests): diff --git a/pypy/jit/backend/x86/test/test_recompilation.py b/rpython/jit/backend/x86/test/test_recompilation.py similarity index 97% rename from pypy/jit/backend/x86/test/test_recompilation.py rename to rpython/jit/backend/x86/test/test_recompilation.py index aa73418a5f3a7a00e1a5ff71c99f77a32bf8c27a..d49d5a176d7cf21f56443ac60006ddead1b35ee4 100644 --- a/pypy/jit/backend/x86/test/test_recompilation.py +++ b/rpython/jit/backend/x86/test/test_recompilation.py @@ -1,5 +1,5 @@ -from pypy.jit.backend.x86.test.test_regalloc import BaseTestRegalloc -from pypy.jit.backend.x86.arch import IS_X86_32, IS_X86_64 +from rpython.jit.backend.x86.test.test_regalloc import BaseTestRegalloc +from rpython.jit.backend.x86.arch import IS_X86_32, IS_X86_64 class TestRecompilation(BaseTestRegalloc): def test_compile_bridge_not_deeper(self): diff --git a/pypy/jit/backend/x86/test/test_recursive.py b/rpython/jit/backend/x86/test/test_recursive.py similarity index 52% rename from pypy/jit/backend/x86/test/test_recursive.py rename to rpython/jit/backend/x86/test/test_recursive.py index fa2068e8feb2321ef2ef4f3180d16a20122f0d59..05d120828ea3f508c7a65bf35ce5445462916b47 100644 --- a/pypy/jit/backend/x86/test/test_recursive.py +++ b/rpython/jit/backend/x86/test/test_recursive.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.test.test_recursive import RecursiveTests -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_recursive import RecursiveTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin class TestRecursive(Jit386Mixin, RecursiveTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_regalloc.py b/rpython/jit/backend/x86/test/test_regalloc.py similarity index 96% rename from pypy/jit/backend/x86/test/test_regalloc.py rename to rpython/jit/backend/x86/test/test_regalloc.py index c80f4d3e56cc0b99859efe95594a3bc97eb6e25e..4be0317456c71d9cd72c05a407410c4e3cb16a80 100644 --- a/pypy/jit/backend/x86/test/test_regalloc.py +++ b/rpython/jit/backend/x86/test/test_regalloc.py @@ -3,21 +3,21 @@ """ import py -from pypy.jit.metainterp.history import BoxInt, ConstInt,\ +from rpython.jit.metainterp.history import BoxInt, ConstInt,\ BoxPtr, ConstPtr, BasicFailDescr, JitCellToken, TargetToken -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.jit.backend.llsupport.descr import GcCache -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.x86.regalloc import RegAlloc, X86RegisterManager,\ +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.jit.backend.llsupport.descr import GcCache +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.x86.regalloc import RegAlloc, X86RegisterManager,\ is_comparison_or_ovf_op -from pypy.jit.backend.x86.arch import IS_X86_32, IS_X86_64 -from pypy.jit.tool.oparser import parse -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rpython.annlowlevel import llhelper -from pypy.rpython.lltypesystem import rclass, rstr -from pypy.jit.codewriter import longlong -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.backend.x86.rx86 import * +from rpython.jit.backend.x86.arch import IS_X86_32, IS_X86_64 +from rpython.jit.tool.oparser import parse +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rtyper.annlowlevel import llhelper +from rpython.rtyper.lltypesystem import rclass, rstr +from rpython.jit.codewriter import longlong +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.backend.x86.rx86 import * def test_is_comparison_or_ovf_op(): assert not is_comparison_or_ovf_op(rop.INT_ADD) diff --git a/pypy/jit/backend/x86/test/test_regalloc2.py b/rpython/jit/backend/x86/test/test_regalloc2.py similarity index 97% rename from pypy/jit/backend/x86/test/test_regalloc2.py rename to rpython/jit/backend/x86/test/test_regalloc2.py index cd4b77378fd00e004153a12f9e86bc921bdfac05..ab2727e828be1eab54de7855675d3736ae0b5d01 100644 --- a/pypy/jit/backend/x86/test/test_regalloc2.py +++ b/rpython/jit/backend/x86/test/test_regalloc2.py @@ -1,9 +1,9 @@ import py -from pypy.jit.metainterp.history import ResOperation, BoxInt, ConstInt,\ +from rpython.jit.metainterp.history import ResOperation, BoxInt, ConstInt,\ BoxPtr, ConstPtr, BasicFailDescr, JitCellToken -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.x86.arch import WORD +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.x86.arch import WORD CPU = getcpuclass() def test_bug_rshift(): diff --git a/pypy/jit/backend/x86/test/test_regloc.py b/rpython/jit/backend/x86/test/test_regloc.py similarity index 97% rename from pypy/jit/backend/x86/test/test_regloc.py rename to rpython/jit/backend/x86/test/test_regloc.py index 621792ecac8dd36549edd205cc547c181ef37475..23d4166bce21dd1641ee1b47aa628dd600e27adc 100644 --- a/pypy/jit/backend/x86/test/test_regloc.py +++ b/rpython/jit/backend/x86/test/test_regloc.py @@ -1,9 +1,9 @@ import struct, sys -from pypy.jit.backend.x86.regloc import * -from pypy.jit.backend.x86.test.test_rx86 import CodeBuilder32, CodeBuilder64, assert_encodes_as -from pypy.jit.backend.x86.assembler import heap -from pypy.jit.backend.x86.arch import IS_X86_64, IS_X86_32 -from pypy.rlib.rarithmetic import intmask +from rpython.jit.backend.x86.regloc import * +from rpython.jit.backend.x86.test.test_rx86 import CodeBuilder32, CodeBuilder64, assert_encodes_as +from rpython.jit.backend.x86.assembler import heap +from rpython.jit.backend.x86.arch import IS_X86_64, IS_X86_32 +from rpython.rlib.rarithmetic import intmask import py.test class LocationCodeBuilder32(CodeBuilder32, LocationCodeBuilder): @@ -47,8 +47,8 @@ def test_cmp_16(): assert_encodes_as(cb64, "CMP16", (AddressLoc(r13, ImmedLoc(0), 0, 0), ImmedLoc(12345)), '\x66\x41\x81\x7D\x00\x39\x30') def test_relocation(): - from pypy.rpython.lltypesystem import lltype, rffi - from pypy.jit.backend.x86 import codebuf + from rpython.rtyper.lltypesystem import lltype, rffi + from rpython.jit.backend.x86 import codebuf for target in [0x01020304, -0x05060708, 0x0102030405060708]: if target > sys.maxint: continue diff --git a/pypy/jit/backend/x86/test/test_runner.py b/rpython/jit/backend/x86/test/test_runner.py similarity index 95% rename from pypy/jit/backend/x86/test/test_runner.py rename to rpython/jit/backend/x86/test/test_runner.py index 660def74d1b504d7693e7bab1453f56adf06c4ac..5d099b4f9da86ee06571f686d0f02a182d31dec5 100644 --- a/pypy/jit/backend/x86/test/test_runner.py +++ b/rpython/jit/backend/x86/test/test_runner.py @@ -1,19 +1,19 @@ import py -from pypy.rpython.lltypesystem import lltype, llmemory, rffi, rstr, rclass -from pypy.rpython.annlowlevel import llhelper -from pypy.jit.metainterp.history import ResOperation, TargetToken, JitCellToken -from pypy.jit.metainterp.history import (BoxInt, BoxPtr, ConstInt, ConstFloat, +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi, rstr, rclass +from rpython.rtyper.annlowlevel import llhelper +from rpython.jit.metainterp.history import ResOperation, TargetToken, JitCellToken +from rpython.jit.metainterp.history import (BoxInt, BoxPtr, ConstInt, ConstFloat, ConstPtr, Box, BoxFloat, BasicFailDescr) -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.x86.arch import WORD -from pypy.jit.backend.x86.rx86 import fits_in_32bits -from pypy.jit.backend.llsupport import symbolic -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.metainterp.executor import execute -from pypy.jit.backend.test.runner_test import LLtypeBackendTest -from pypy.jit.tool.oparser import parse -from pypy.tool.udir import udir +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.x86.arch import WORD +from rpython.jit.backend.x86.rx86 import fits_in_32bits +from rpython.jit.backend.llsupport import symbolic +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.metainterp.executor import execute +from rpython.jit.backend.test.runner_test import LLtypeBackendTest +from rpython.jit.tool.oparser import parse +from rpython.tool.udir import udir import ctypes import sys import os @@ -77,7 +77,7 @@ class TestX86(LLtypeBackendTest): def test_allocations(self): py.test.skip("rewrite or kill") - from pypy.rpython.lltypesystem import rstr + from rpython.rtyper.lltypesystem import rstr allocs = [None] all = [] @@ -123,7 +123,7 @@ class TestX86(LLtypeBackendTest): assert resbuf[ofs/WORD] == 10 def test_stringitems(self): - from pypy.rpython.lltypesystem.rstr import STR + from rpython.rtyper.lltypesystem.rstr import STR ofs = symbolic.get_field_token(STR, 'chars', False)[0] ofs_items = symbolic.get_field_token(STR.chars, 'items', False)[0] @@ -409,7 +409,7 @@ class TestX86(LLtypeBackendTest): assert res == 20 def test_ops_offset(self): - from pypy.rlib import debug + from rpython.rlib import debug i0 = BoxInt() i1 = BoxInt() i2 = BoxInt() @@ -438,10 +438,10 @@ class TestX86(LLtypeBackendTest): def test_calling_convention(self, monkeypatch): if WORD != 4: py.test.skip("32-bit only test") - from pypy.jit.backend.x86.regloc import eax, edx - from pypy.jit.backend.x86 import codebuf - from pypy.jit.codewriter.effectinfo import EffectInfo - from pypy.rlib.libffi import types, clibffi + from rpython.jit.backend.x86.regloc import eax, edx + from rpython.jit.backend.x86 import codebuf + from rpython.jit.codewriter.effectinfo import EffectInfo + from rpython.rlib.libffi import types, clibffi had_stdcall = hasattr(clibffi, 'FFI_STDCALL') if not had_stdcall: # not running on Windows, but we can still test monkeypatch.setattr(clibffi, 'FFI_STDCALL', 12345, raising=False) @@ -522,8 +522,8 @@ class TestDebuggingAssembler(object): self.cpu.setup_once() def test_debugger_on(self): - from pypy.tool.logparser import parse_log_file, extract_category - from pypy.rlib import debug + from rpython.tool.logparser import parse_log_file, extract_category + from rpython.rlib import debug targettoken, preambletoken = TargetToken(), TargetToken() loop = """ diff --git a/pypy/jit/backend/x86/test/test_rx86.py b/rpython/jit/backend/x86/test/test_rx86.py similarity index 99% rename from pypy/jit/backend/x86/test/test_rx86.py rename to rpython/jit/backend/x86/test/test_rx86.py index 0aec50b63cb1aaa2cc87370f2811d8e4cf0a0aff..710094e5a9a2dd23bc2e02b8d2b85aa21bd0b488 100644 --- a/pypy/jit/backend/x86/test/test_rx86.py +++ b/rpython/jit/backend/x86/test/test_rx86.py @@ -1,5 +1,5 @@ import py, struct -from pypy.jit.backend.x86.rx86 import * +from rpython.jit.backend.x86.rx86 import * globals().update(R.__dict__) class CodeBuilderMixin(object): diff --git a/pypy/jit/backend/x86/test/test_rx86_32_auto_encoding.py b/rpython/jit/backend/x86/test/test_rx86_32_auto_encoding.py similarity index 99% rename from pypy/jit/backend/x86/test/test_rx86_32_auto_encoding.py rename to rpython/jit/backend/x86/test/test_rx86_32_auto_encoding.py index 882b10cf494f42f7906113c7e396f2695e3362a0..db61f479ba41966e9a2444e812db9d435ec8c780 100644 --- a/pypy/jit/backend/x86/test/test_rx86_32_auto_encoding.py +++ b/rpython/jit/backend/x86/test/test_rx86_32_auto_encoding.py @@ -1,8 +1,8 @@ import os, random, struct import py -from pypy.jit.backend.x86 import rx86 -from pypy.rlib.rarithmetic import intmask -from pypy.tool.udir import udir +from rpython.jit.backend.x86 import rx86 +from rpython.rlib.rarithmetic import intmask +from rpython.tool.udir import udir INPUTNAME = 'checkfile_%s.s' FILENAME = 'checkfile_%s.o' diff --git a/pypy/jit/backend/x86/test/test_rx86_64_auto_encoding.py b/rpython/jit/backend/x86/test/test_rx86_64_auto_encoding.py similarity index 94% rename from pypy/jit/backend/x86/test/test_rx86_64_auto_encoding.py rename to rpython/jit/backend/x86/test/test_rx86_64_auto_encoding.py index 27176278579c7d028aebb1d32f84207c2bef8966..e1059216b497677be313ec98253d7a56210f455b 100644 --- a/pypy/jit/backend/x86/test/test_rx86_64_auto_encoding.py +++ b/rpython/jit/backend/x86/test/test_rx86_64_auto_encoding.py @@ -1,6 +1,6 @@ import random -from pypy.jit.backend.x86 import rx86 -from pypy.jit.backend.x86.test import test_rx86_32_auto_encoding +from rpython.jit.backend.x86 import rx86 +from rpython.jit.backend.x86.test import test_rx86_32_auto_encoding class TestRx86_64(test_rx86_32_auto_encoding.TestRx86_32): diff --git a/pypy/jit/backend/x86/test/test_send.py b/rpython/jit/backend/x86/test/test_send.py similarity index 74% rename from pypy/jit/backend/x86/test/test_send.py rename to rpython/jit/backend/x86/test/test_send.py index d9d77495899baf51b1f052985432446f24e9e603..9ceda124eaf3be52f8c98faae6e043ddae10a2fb 100644 --- a/pypy/jit/backend/x86/test/test_send.py +++ b/rpython/jit/backend/x86/test/test_send.py @@ -1,8 +1,8 @@ import py -from pypy.jit.metainterp.test.test_send import SendTests -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin -from pypy.rlib import jit +from rpython.jit.metainterp.test.test_send import SendTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.rlib import jit class TestSend(Jit386Mixin, SendTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_slist.py b/rpython/jit/backend/x86/test/test_slist.py similarity index 68% rename from pypy/jit/backend/x86/test/test_slist.py rename to rpython/jit/backend/x86/test/test_slist.py index 90e4ee551c876a20a9e12a6426b897adfeaa5285..afc00a161d19e6904b328fd92466717df69a6684 100644 --- a/pypy/jit/backend/x86/test/test_slist.py +++ b/rpython/jit/backend/x86/test/test_slist.py @@ -1,6 +1,6 @@ import py -from pypy.jit.metainterp.test import test_slist -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test import test_slist +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin class TestSList(Jit386Mixin, test_slist.ListTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_string.py b/rpython/jit/backend/x86/test/test_string.py similarity index 73% rename from pypy/jit/backend/x86/test/test_string.py rename to rpython/jit/backend/x86/test/test_string.py index 6a7b6790165f188e3c089f1d90ca21e82308a2de..a9fd177a1ed5b0c548490801d5f33355c7b48b95 100644 --- a/pypy/jit/backend/x86/test/test_string.py +++ b/rpython/jit/backend/x86/test/test_string.py @@ -1,6 +1,6 @@ import py -from pypy.jit.metainterp.test import test_string -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test import test_string +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin class TestString(Jit386Mixin, test_string.TestLLtype): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_support.py b/rpython/jit/backend/x86/test/test_support.py similarity index 84% rename from pypy/jit/backend/x86/test/test_support.py rename to rpython/jit/backend/x86/test/test_support.py index 0fdce6ab71ade0b00978ee18039cac7d551f7662..d739663ea5033c9e4a1f0312835eacd44aab2261 100644 --- a/pypy/jit/backend/x86/test/test_support.py +++ b/rpython/jit/backend/x86/test/test_support.py @@ -1,6 +1,6 @@ -from pypy.jit.backend.x86.support import values_array -from pypy.rpython.lltypesystem import lltype, llmemory, rffi +from rpython.jit.backend.x86.support import values_array +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi def test_values_array_signed(): ar = values_array(lltype.Signed, 50) diff --git a/pypy/jit/backend/x86/test/test_symbolic_x86.py b/rpython/jit/backend/x86/test/test_symbolic_x86.py similarity index 95% rename from pypy/jit/backend/x86/test/test_symbolic_x86.py rename to rpython/jit/backend/x86/test/test_symbolic_x86.py index cb0fdae826c033170de9d61c1ddd1f0dde78b2f9..4d678444c0abfa66d80226ca00aebe39a20bd306 100644 --- a/pypy/jit/backend/x86/test/test_symbolic_x86.py +++ b/rpython/jit/backend/x86/test/test_symbolic_x86.py @@ -1,7 +1,7 @@ import py -from pypy.jit.backend.llsupport.symbolic import * -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.jit.backend.x86.arch import WORD +from rpython.jit.backend.llsupport.symbolic import * +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.jit.backend.x86.arch import WORD # This test file is here and not in llsupport/test/ because it checks # that we get correct numbers for a 32-bit machine. diff --git a/pypy/jit/backend/x86/test/test_tl.py b/rpython/jit/backend/x86/test/test_tl.py similarity index 53% rename from pypy/jit/backend/x86/test/test_tl.py rename to rpython/jit/backend/x86/test/test_tl.py index de4137d2e0b26fcc52a91a00da98789a77882e8f..0efaf97df1e6b97001e7d9f4db4c6074d5b5d36d 100644 --- a/pypy/jit/backend/x86/test/test_tl.py +++ b/rpython/jit/backend/x86/test/test_tl.py @@ -1,7 +1,7 @@ import py -from pypy.jit.metainterp.test.test_tl import ToyLanguageTests -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_tl import ToyLanguageTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin class TestTL(Jit386Mixin, ToyLanguageTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_tlc.py b/rpython/jit/backend/x86/test/test_tlc.py similarity index 82% rename from pypy/jit/backend/x86/test/test_tlc.py rename to rpython/jit/backend/x86/test/test_tlc.py index c7bd67be6ef08f285b9c33d8b8e90cc7664e1322..0b0630f10c795d717dbf03436223865656ac9e66 100644 --- a/pypy/jit/backend/x86/test/test_tlc.py +++ b/rpython/jit/backend/x86/test/test_tlc.py @@ -1,8 +1,8 @@ import py -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin -from pypy.jit.metainterp.test.test_tlc import TLCTests -from pypy.jit.tl import tlc +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_tlc import TLCTests +from rpython.jit.tl import tlc class TestTL(Jit386Mixin, TLCTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_virtual.py b/rpython/jit/backend/x86/test/test_virtual.py similarity index 74% rename from pypy/jit/backend/x86/test/test_virtual.py rename to rpython/jit/backend/x86/test/test_virtual.py index 2fac3d75a0ebb5740f0daaaeed480c196cda73c2..e6499eaf54a95ca3804165ca0ebc96920b490a0e 100644 --- a/pypy/jit/backend/x86/test/test_virtual.py +++ b/rpython/jit/backend/x86/test/test_virtual.py @@ -1,5 +1,5 @@ -from pypy.jit.metainterp.test.test_virtual import VirtualTests, VirtualMiscTests -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_virtual import VirtualTests, VirtualMiscTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin class MyClass: pass diff --git a/pypy/jit/backend/x86/test/test_virtualizable.py b/rpython/jit/backend/x86/test/test_virtualizable.py similarity index 54% rename from pypy/jit/backend/x86/test/test_virtualizable.py rename to rpython/jit/backend/x86/test/test_virtualizable.py index 2de3901c420075c90ab29190fc4012269b461c43..67af442a6a4f288fe75540c53bc4838e3dc610ad 100644 --- a/pypy/jit/backend/x86/test/test_virtualizable.py +++ b/rpython/jit/backend/x86/test/test_virtualizable.py @@ -1,7 +1,7 @@ import py -from pypy.jit.metainterp.test.test_virtualizable import ImplicitVirtualizableTests -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_virtualizable import ImplicitVirtualizableTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin class TestVirtualizable(Jit386Mixin, ImplicitVirtualizableTests): def test_blackhole_should_not_reenter(self): diff --git a/pypy/jit/backend/x86/test/test_virtualref.py b/rpython/jit/backend/x86/test/test_virtualref.py similarity index 52% rename from pypy/jit/backend/x86/test/test_virtualref.py rename to rpython/jit/backend/x86/test/test_virtualref.py index b71a7b0d3862452eecae1f08995593b07738a392..cbf509e3c3bd5075fa76d6cdf1702c43e237fa44 100644 --- a/pypy/jit/backend/x86/test/test_virtualref.py +++ b/rpython/jit/backend/x86/test/test_virtualref.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.test.test_virtualref import VRefTests -from pypy.jit.backend.x86.test.test_basic import Jit386Mixin +from rpython.jit.metainterp.test.test_virtualref import VRefTests +from rpython.jit.backend.x86.test.test_basic import Jit386Mixin class TestVRef(Jit386Mixin, VRefTests): # for the individual tests see diff --git a/pypy/jit/backend/x86/test/test_zmath.py b/rpython/jit/backend/x86/test/test_zmath.py similarity index 87% rename from pypy/jit/backend/x86/test/test_zmath.py rename to rpython/jit/backend/x86/test/test_zmath.py index d2b8b8f833785c3176c07caf77079b928a2d2e43..ff1656b351827bc86ce8ec4dae228fa39bb8c6bd 100644 --- a/pypy/jit/backend/x86/test/test_zmath.py +++ b/rpython/jit/backend/x86/test/test_zmath.py @@ -3,11 +3,11 @@ """ import py, math from pypy.module.math.test import test_direct -from pypy.translator.c.test.test_genc import compile -from pypy.jit.backend.x86.support import ensure_sse2_floats -from pypy.rlib import rfloat -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.debug import debug_print +from rpython.translator.c.test.test_genc import compile +from rpython.jit.backend.x86.support import ensure_sse2_floats +from rpython.rlib import rfloat +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.debug import debug_print def get_test_case((fnname, args, expected)): diff --git a/pypy/jit/backend/x86/test/test_zrpy_gc.py b/rpython/jit/backend/x86/test/test_zrpy_gc.py similarity index 96% rename from pypy/jit/backend/x86/test/test_zrpy_gc.py rename to rpython/jit/backend/x86/test/test_zrpy_gc.py index 7d765fa504ccbea78184c5ba1fea65b914e4db95..47ec9f25f0b5c3b463c23d7b209825e14b48cd49 100644 --- a/pypy/jit/backend/x86/test/test_zrpy_gc.py +++ b/rpython/jit/backend/x86/test/test_zrpy_gc.py @@ -6,13 +6,13 @@ and the various cases of write barrier. import weakref import py, os -from pypy.annotation import policy as annpolicy -from pypy.rlib import rgc -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rlib.jit import JitDriver, dont_look_inside -from pypy.rlib.jit import elidable, unroll_safe -from pypy.jit.backend.llsupport.gc import GcLLDescr_framework -from pypy.tool.udir import udir +from rpython.annotator import policy as annpolicy +from rpython.rlib import rgc +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rlib.jit import JitDriver, dont_look_inside +from rpython.rlib.jit import elidable, unroll_safe +from rpython.jit.backend.llsupport.gc import GcLLDescr_framework +from rpython.tool.udir import udir from pypy.config.translationoption import DEFL_GC class X(object): @@ -67,7 +67,7 @@ def get_entry(g): def get_functions_to_patch(): - from pypy.jit.backend.llsupport import gc + from rpython.jit.backend.llsupport import gc # can_use_nursery_malloc1 = gc.GcLLDescr_framework.can_use_nursery_malloc def can_use_nursery_malloc2(*args): @@ -82,10 +82,10 @@ def get_functions_to_patch(): can_use_nursery_malloc2} def compile(f, gc, enable_opts='', **kwds): - from pypy.annotation.listdef import s_list_of_strings - from pypy.translator.translator import TranslationContext - from pypy.jit.metainterp.warmspot import apply_jit - from pypy.translator.c import genc + from rpython.annotator.listdef import s_list_of_strings + from rpython.translator.translator import TranslationContext + from rpython.jit.metainterp.warmspot import apply_jit + from rpython.translator.c import genc # t = TranslationContext() t.config.translation.gc = gc @@ -242,7 +242,7 @@ class CompileFrameworkTests(BaseFrameworkTests): ## # the target of cast_base_ptr_to_instance. Note that the function ## # below is *never* called by any actual test, it's just annotated. ## # -## from pypy.rlib.libffi import get_libc_name, CDLL, types, ArgChain +## from rpython.rlib.libffi import get_libc_name, CDLL, types, ArgChain ## libc_name = get_libc_name() ## def f(n, x, *args): ## libc = CDLL(libc_name) @@ -357,7 +357,7 @@ class CompileFrameworkTests(BaseFrameworkTests): def define_compile_framework_4(cls): # Fourth version of the test, with __del__. - from pypy.rlib.debug import debug_print + from rpython.rlib.debug import debug_print class Counter: cnt = 0 counter = Counter() @@ -698,7 +698,7 @@ class CompileFrameworkTests(BaseFrameworkTests): self.run('compile_framework_bug1', 200) def define_compile_framework_vref(self): - from pypy.rlib.jit import virtual_ref, virtual_ref_finish + from rpython.rlib.jit import virtual_ref, virtual_ref_finish class A: pass glob = A() diff --git a/pypy/jit/backend/x86/test/test_zrpy_platform.py b/rpython/jit/backend/x86/test/test_zrpy_platform.py similarity index 93% rename from pypy/jit/backend/x86/test/test_zrpy_platform.py rename to rpython/jit/backend/x86/test/test_zrpy_platform.py index 5f8c70fc107e02acf9d891a91003bf92f5060fd1..004eeb84f409b19c711dafabb93ae9404c7610da 100644 --- a/pypy/jit/backend/x86/test/test_zrpy_platform.py +++ b/rpython/jit/backend/x86/test/test_zrpy_platform.py @@ -1,10 +1,10 @@ import sys import py -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib import jit -from pypy.jit.backend.x86.test.test_zrpy_gc import compile_and_run +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib import jit +from rpython.jit.backend.x86.test.test_zrpy_gc import compile_and_run -from pypy.jit.metainterp import pyjitpl +from rpython.jit.metainterp import pyjitpl #pyjitpl.DEBUG = 4 diff --git a/pypy/jit/backend/x86/test/test_zrpy_releasegil.py b/rpython/jit/backend/x86/test/test_zrpy_releasegil.py similarity index 87% rename from pypy/jit/backend/x86/test/test_zrpy_releasegil.py rename to rpython/jit/backend/x86/test/test_zrpy_releasegil.py index 0dc05551d0ba85281c523d1da4f19654cfb4b5fd..b075460b4f0d15e5236ee786e9300a55bd1d2fe8 100644 --- a/pypy/jit/backend/x86/test/test_zrpy_releasegil.py +++ b/rpython/jit/backend/x86/test/test_zrpy_releasegil.py @@ -1,13 +1,13 @@ -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rlib.jit import dont_look_inside -from pypy.jit.metainterp.optimizeopt import ALL_OPTS_NAMES +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rlib.jit import dont_look_inside +from rpython.jit.metainterp.optimizeopt import ALL_OPTS_NAMES -from pypy.rlib.libffi import CDLL, types, ArgChain, clibffi -from pypy.rpython.lltypesystem.ll2ctypes import libc_name -from pypy.rpython.annlowlevel import llhelper +from rpython.rlib.libffi import CDLL, types, ArgChain, clibffi +from rpython.rtyper.lltypesystem.ll2ctypes import libc_name +from rpython.rtyper.annlowlevel import llhelper -from pypy.jit.backend.x86.test.test_zrpy_gc import BaseFrameworkTests -from pypy.jit.backend.x86.test.test_zrpy_gc import check +from rpython.jit.backend.x86.test.test_zrpy_gc import BaseFrameworkTests +from rpython.jit.backend.x86.test.test_zrpy_gc import check class ReleaseGILTests(BaseFrameworkTests): diff --git a/pypy/jit/backend/x86/test/test_ztranslation.py b/rpython/jit/backend/x86/test/test_ztranslation.py similarity index 91% rename from pypy/jit/backend/x86/test/test_ztranslation.py rename to rpython/jit/backend/x86/test/test_ztranslation.py index 520a6c10b4ceb0b5afa5a2c87c3f55bb7866ab5c..2b42f2344de0f49d4317324d9be70f2cfc3194ef 100644 --- a/pypy/jit/backend/x86/test/test_ztranslation.py +++ b/rpython/jit/backend/x86/test/test_ztranslation.py @@ -1,17 +1,17 @@ import py, os, sys -from pypy.tool.udir import udir -from pypy.rlib.jit import JitDriver, unroll_parameters, set_param -from pypy.rlib.jit import PARAMETERS, dont_look_inside -from pypy.rlib.jit import promote -from pypy.rlib import jit_hooks -from pypy.jit.metainterp.jitprof import Profiler -from pypy.jit.backend.detect_cpu import getcpuclass -from pypy.jit.backend.test.support import CCompiledMixin -from pypy.jit.codewriter.policy import StopAtXPolicy -from pypy.translator.translator import TranslationContext -from pypy.jit.backend.x86.arch import IS_X86_32, IS_X86_64 +from rpython.tool.udir import udir +from rpython.rlib.jit import JitDriver, unroll_parameters, set_param +from rpython.rlib.jit import PARAMETERS, dont_look_inside +from rpython.rlib.jit import promote +from rpython.rlib import jit_hooks +from rpython.jit.metainterp.jitprof import Profiler +from rpython.jit.backend.detect_cpu import getcpuclass +from rpython.jit.backend.test.support import CCompiledMixin +from rpython.jit.codewriter.policy import StopAtXPolicy +from rpython.translator.translator import TranslationContext +from rpython.jit.backend.x86.arch import IS_X86_32, IS_X86_64 from pypy.config.translationoption import DEFL_GC -from pypy.rlib import rgc +from rpython.rlib import rgc class TestTranslationX86(CCompiledMixin): CPUClass = getcpuclass() @@ -68,9 +68,9 @@ class TestTranslationX86(CCompiledMixin): if k - abs(-j): raise ValueError return chr(total % 253) # - from pypy.rpython.lltypesystem import lltype, rffi - from pypy.rlib.libffi import types, CDLL, ArgChain - from pypy.rlib.test.test_clibffi import get_libm_name + from rpython.rtyper.lltypesystem import lltype, rffi + from rpython.rlib.libffi import types, CDLL, ArgChain + from rpython.rlib.test.test_clibffi import get_libm_name libm_name = get_libm_name(sys.platform) jitdriver2 = JitDriver(greens=[], reds = ['i', 'func', 'res', 'x']) def libffi_stuff(i, j): @@ -97,7 +97,7 @@ class TestTranslationX86(CCompiledMixin): def test_direct_assembler_call_translates(self): """Test CALL_ASSEMBLER and the recursion limit""" - from pypy.rlib.rstackovf import StackOverflow + from rpython.rlib.rstackovf import StackOverflow class Thing(object): def __init__(self, val): diff --git a/pypy/jit/codewriter/test/__init__.py b/rpython/jit/backend/x86/tool/__init__.py similarity index 100% rename from pypy/jit/codewriter/test/__init__.py rename to rpython/jit/backend/x86/tool/__init__.py diff --git a/pypy/jit/backend/x86/tool/instruction_encoding.sh b/rpython/jit/backend/x86/tool/instruction_encoding.sh similarity index 100% rename from pypy/jit/backend/x86/tool/instruction_encoding.sh rename to rpython/jit/backend/x86/tool/instruction_encoding.sh diff --git a/pypy/jit/backend/x86/tool/jumpto.py b/rpython/jit/backend/x86/tool/jumpto.py similarity index 100% rename from pypy/jit/backend/x86/tool/jumpto.py rename to rpython/jit/backend/x86/tool/jumpto.py diff --git a/pypy/jit/backend/x86/tool/test/test_viewcode.py b/rpython/jit/backend/x86/tool/test/test_viewcode.py similarity index 87% rename from pypy/jit/backend/x86/tool/test/test_viewcode.py rename to rpython/jit/backend/x86/tool/test/test_viewcode.py index f3d0ca8e238837208982e509618ba856a4fe6536..8862b7d87d4e3b2aa1fb3487c8015d17b5f78216 100644 --- a/pypy/jit/backend/x86/tool/test/test_viewcode.py +++ b/rpython/jit/backend/x86/tool/test/test_viewcode.py @@ -1,10 +1,10 @@ from cStringIO import StringIO -from pypy.jit.backend.x86.tool.viewcode import format_code_dump_with_labels -from pypy.jit.backend.x86.tool.viewcode import find_objdump +from rpython.jit.backend.x86.tool.viewcode import format_code_dump_with_labels +from rpython.jit.backend.x86.tool.viewcode import find_objdump import os import py import tempfile -from pypy.tool.udir import udir +from rpython.tool.udir import udir def test_format_code_dump_with_labels(): lines = StringIO(""" diff --git a/pypy/jit/backend/x86/tool/viewcode.py b/rpython/jit/backend/x86/tool/viewcode.py similarity index 97% rename from pypy/jit/backend/x86/tool/viewcode.py rename to rpython/jit/backend/x86/tool/viewcode.py index 763d9a0c51c854943106bd8922d1674fd78a183b..b30fee38bf7896f0c40737ba3bbad411d9356baf 100755 --- a/pypy/jit/backend/x86/tool/viewcode.py +++ b/rpython/jit/backend/x86/tool/viewcode.py @@ -17,17 +17,17 @@ import sys import subprocess from bisect import bisect_left -# don't use pypy.tool.udir here to avoid removing old usessions which +# don't use rpython.tool.udir here to avoid removing old usessions which # might still contain interesting executables udir = py.path.local.make_numbered_dir(prefix='viewcode-', keep=2) tmpfile = str(udir.join('dump.tmp')) # hack hack import pypy.tool -mod = new.module('pypy.tool.udir') +mod = new.module('rpython.tool.udir') mod.udir = udir -sys.modules['pypy.tool.udir'] = mod -pypy.tool.udir = mod +sys.modules['rpython.tool.udir'] = mod +rpython.tool.udir = mod # ____________________________________________________________ # Some support code from Psyco. There is more over there, @@ -76,7 +76,7 @@ def machine_code_dump(data, originaddr, backend_name, label_list=None): return format_code_dump_with_labels(originaddr, lines, label_list) def format_code_dump_with_labels(originaddr, lines, label_list): - from pypy.rlib.rarithmetic import r_uint + from rpython.rlib.rarithmetic import r_uint if not label_list: label_list = [] originaddr = r_uint(originaddr) @@ -365,7 +365,7 @@ def tab2columns(text): # http://codespeak.net/svn/user/arigo/hack/misc/graphlib.py # but needs to be a bit more subtle later -from pypy.translator.tool.make_dot import DotGen +from rpython.translator.tool.make_dot import DotGen from dotviewer.graphclient import display_page class Graph(DotGen): @@ -434,7 +434,7 @@ if __name__ == '__main__': sys.exit(2) # import cStringIO - from pypy.tool import logparser + from rpython.tool import logparser log1 = logparser.parse_log_file(sys.argv[1]) text1 = logparser.extract_category(log1, catprefix='jit-backend-dump') f = cStringIO.StringIO() diff --git a/pypy/jit/backend/x86/valgrind.py b/rpython/jit/backend/x86/valgrind.py similarity index 76% rename from pypy/jit/backend/x86/valgrind.py rename to rpython/jit/backend/x86/valgrind.py index 49cb2662605ea68815cf5aaf5a2cc06f5fea86e4..36d8d8a0090547cb5a9fc2ae41649602eea3087f 100644 --- a/pypy/jit/backend/x86/valgrind.py +++ b/rpython/jit/backend/x86/valgrind.py @@ -2,10 +2,10 @@ Support for valgrind: tell it when we patch code in-place. """ -from pypy.rpython.tool import rffi_platform -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.translator.tool.cbuild import ExternalCompilationInfo -from pypy.rlib.objectmodel import we_are_translated +from rpython.rtyper.tool import rffi_platform +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.translator.tool.cbuild import ExternalCompilationInfo +from rpython.rlib.objectmodel import we_are_translated eci = ExternalCompilationInfo(includes = ['valgrind/valgrind.h']) diff --git a/pypy/jit/metainterp/__init__.py b/rpython/jit/codewriter/__init__.py similarity index 100% rename from pypy/jit/metainterp/__init__.py rename to rpython/jit/codewriter/__init__.py diff --git a/pypy/jit/codewriter/assembler.py b/rpython/jit/codewriter/assembler.py similarity index 95% rename from pypy/jit/codewriter/assembler.py rename to rpython/jit/codewriter/assembler.py index 6b72bc2d16fd546e2a93191fd093484a86999109..ccd903230b29dd7c675a5d6eeb3d89f835c11382 100644 --- a/pypy/jit/codewriter/assembler.py +++ b/rpython/jit/codewriter/assembler.py @@ -1,12 +1,12 @@ -from pypy.jit.metainterp.history import AbstractDescr, getkind -from pypy.jit.codewriter.flatten import Register, Label, TLabel, KINDS -from pypy.jit.codewriter.flatten import ListOfKind, IndirectCallTargets -from pypy.jit.codewriter.format import format_assembler -from pypy.jit.codewriter.jitcode import SwitchDictDescr, JitCode -from pypy.jit.codewriter import heaptracker, longlong -from pypy.rlib.objectmodel import ComputedIntSymbolic -from pypy.objspace.flow.model import Constant -from pypy.rpython.lltypesystem import lltype, llmemory, rclass, rffi +from rpython.jit.metainterp.history import AbstractDescr, getkind +from rpython.jit.codewriter.flatten import Register, Label, TLabel, KINDS +from rpython.jit.codewriter.flatten import ListOfKind, IndirectCallTargets +from rpython.jit.codewriter.format import format_assembler +from rpython.jit.codewriter.jitcode import SwitchDictDescr, JitCode +from rpython.jit.codewriter import heaptracker, longlong +from rpython.rlib.objectmodel import ComputedIntSymbolic +from rpython.flowspace.model import Constant +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass, rffi class AssemblerError(Exception): diff --git a/pypy/jit/codewriter/call.py b/rpython/jit/codewriter/call.py similarity index 96% rename from pypy/jit/codewriter/call.py rename to rpython/jit/codewriter/call.py index 24b63f5c1e76caae369315b800b1d5fa7831d6ee..5788f8e1113500c51effcdcd6e82c67fcc86a82a 100644 --- a/pypy/jit/codewriter/call.py +++ b/rpython/jit/codewriter/call.py @@ -3,15 +3,15 @@ # to transform to JitCodes or not. # -from pypy.jit.codewriter import support -from pypy.jit.codewriter.jitcode import JitCode -from pypy.jit.codewriter.effectinfo import (VirtualizableAnalyzer, +from rpython.jit.codewriter import support +from rpython.jit.codewriter.jitcode import JitCode +from rpython.jit.codewriter.effectinfo import (VirtualizableAnalyzer, QuasiImmutAnalyzer, RandomEffectsAnalyzer, effectinfo_from_writeanalyze, EffectInfo, CallInfoCollection) -from pypy.translator.simplify import get_funcobj, get_functype -from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.translator.backendopt.canraise import RaiseAnalyzer -from pypy.translator.backendopt.writeanalyze import ReadWriteAnalyzer +from rpython.translator.simplify import get_funcobj, get_functype +from rpython.rtyper.lltypesystem import lltype, llmemory +from rpython.translator.backendopt.canraise import RaiseAnalyzer +from rpython.translator.backendopt.writeanalyze import ReadWriteAnalyzer class CallControl(object): @@ -103,7 +103,7 @@ class CallControl(object): # the 'instantiate' methods. This check is a bit imprecise # but it's not too bad if we mistake a random indirect call # for the one to 'instantiate'. - from pypy.rpython.lltypesystem import rclass + from rpython.rtyper.lltypesystem import rclass CALLTYPE = op.args[0].concretetype if (op.opname == 'indirect_call' and len(op.args) == 2 and CALLTYPE == rclass.OBJECT_VTABLE.instantiate): diff --git a/pypy/jit/codewriter/codewriter.py b/rpython/jit/codewriter/codewriter.py similarity index 85% rename from pypy/jit/codewriter/codewriter.py rename to rpython/jit/codewriter/codewriter.py index 384640e5558878688cf97ba789665091b4eacece..024c28114c08e4dcfda08ce7a0e928368379abe3 100644 --- a/pypy/jit/codewriter/codewriter.py +++ b/rpython/jit/codewriter/codewriter.py @@ -1,14 +1,14 @@ -from pypy.jit.codewriter import support, heaptracker -from pypy.jit.codewriter.regalloc import perform_register_allocation -from pypy.jit.codewriter.flatten import flatten_graph, KINDS -from pypy.jit.codewriter.assembler import Assembler, JitCode -from pypy.jit.codewriter.jtransform import transform_graph -from pypy.jit.codewriter.format import format_assembler -from pypy.jit.codewriter.liveness import compute_liveness -from pypy.jit.codewriter.call import CallControl -from pypy.jit.codewriter.policy import log -from pypy.objspace.flow.model import copygraph -from pypy.tool.udir import udir +from rpython.jit.codewriter import support, heaptracker +from rpython.jit.codewriter.regalloc import perform_register_allocation +from rpython.jit.codewriter.flatten import flatten_graph, KINDS +from rpython.jit.codewriter.assembler import Assembler, JitCode +from rpython.jit.codewriter.jtransform import transform_graph +from rpython.jit.codewriter.format import format_assembler +from rpython.jit.codewriter.liveness import compute_liveness +from rpython.jit.codewriter.call import CallControl +from rpython.jit.codewriter.policy import log +from rpython.flowspace.model import copygraph +from rpython.tool.udir import udir class CodeWriter(object): @@ -84,7 +84,7 @@ class CodeWriter(object): def setup_jitdriver(self, jitdriver_sd): # Must be called once per jitdriver. Usually jitdriver_sd is an - # instance of pypy.jit.metainterp.jitdriver.JitDriverStaticData. + # instance of rpython.jit.metainterp.jitdriver.JitDriverStaticData. self.callcontrol.jitdrivers_sd.append(jitdriver_sd) def find_all_graphs(self, policy): diff --git a/pypy/jit/codewriter/effectinfo.py b/rpython/jit/codewriter/effectinfo.py similarity index 96% rename from pypy/jit/codewriter/effectinfo.py rename to rpython/jit/codewriter/effectinfo.py index bc59d9f58aff6f50f6abaa4da6ac806678602a90..108847e6740219e6cbca0ad6ab4b7f2b5876d28c 100644 --- a/pypy/jit/codewriter/effectinfo.py +++ b/rpython/jit/codewriter/effectinfo.py @@ -1,8 +1,8 @@ -from pypy.jit.metainterp.typesystem import deref, fieldType, arrayItem -from pypy.rpython.lltypesystem.rclass import OBJECT -from pypy.rpython.lltypesystem import lltype -from pypy.rpython.ootypesystem import ootype -from pypy.translator.backendopt.graphanalyze import BoolGraphAnalyzer +from rpython.jit.metainterp.typesystem import deref, fieldType, arrayItem +from rpython.rtyper.lltypesystem.rclass import OBJECT +from rpython.rtyper.lltypesystem import lltype +from rpython.rtyper.ootypesystem import ootype +from rpython.translator.backendopt.graphanalyze import BoolGraphAnalyzer class EffectInfo(object): @@ -157,7 +157,7 @@ def effectinfo_from_writeanalyze(effects, cpu, extraeffect=EffectInfo.EF_CAN_RAISE, oopspecindex=EffectInfo.OS_NONE, can_invalidate=False): - from pypy.translator.backendopt.writeanalyze import top_set + from rpython.translator.backendopt.writeanalyze import top_set if effects is top_set or extraeffect == EffectInfo.EF_RANDOM_EFFECTS: readonly_descrs_fields = None readonly_descrs_arrays = None @@ -284,7 +284,7 @@ class CallInfoCollection(object): return (None, 0) def _funcptr_for_oopspec_memo(self, oopspecindex): - from pypy.jit.codewriter import heaptracker + from rpython.jit.codewriter import heaptracker _, func_as_int = self.callinfo_for_oopspec(oopspecindex) funcadr = heaptracker.int2adr(func_as_int) return funcadr.ptr diff --git a/pypy/jit/codewriter/flatten.py b/rpython/jit/codewriter/flatten.py similarity index 98% rename from pypy/jit/codewriter/flatten.py rename to rpython/jit/codewriter/flatten.py index d9ba25fc1637ce11dfada82047315b30b68ea486..af3451572f6bb3c5fb17e74d9aeebc878b6cfae4 100644 --- a/pypy/jit/codewriter/flatten.py +++ b/rpython/jit/codewriter/flatten.py @@ -1,6 +1,6 @@ -from pypy.objspace.flow.model import Variable, Constant, c_last_exception -from pypy.jit.metainterp.history import AbstractDescr, getkind -from pypy.rpython.lltypesystem import lltype +from rpython.flowspace.model import Variable, Constant, c_last_exception +from rpython.jit.metainterp.history import AbstractDescr, getkind +from rpython.rtyper.lltypesystem import lltype class SSARepr(object): @@ -258,7 +258,7 @@ class GraphFlattener(object): if len(switches) >= 5 and kind == 'int': # A large switch on an integer, implementable efficiently # with the help of a SwitchDictDescr - from pypy.jit.codewriter.jitcode import SwitchDictDescr + from rpython.jit.codewriter.jitcode import SwitchDictDescr switchdict = SwitchDictDescr() switchdict._labels = [] self.emitline('switch', self.getcolor(block.exitswitch), diff --git a/pypy/jit/codewriter/format.py b/rpython/jit/codewriter/format.py similarity index 94% rename from pypy/jit/codewriter/format.py rename to rpython/jit/codewriter/format.py index d46470377ee803096cd19c8fe08163c7b2bc0912..b038ae36b92f3ff4e83b26cab28265e0ac610f29 100644 --- a/pypy/jit/codewriter/format.py +++ b/rpython/jit/codewriter/format.py @@ -1,10 +1,10 @@ import py -from pypy.objspace.flow.model import Constant -from pypy.rpython.lltypesystem import lltype -from pypy.jit.codewriter.flatten import SSARepr, Label, TLabel, Register -from pypy.jit.codewriter.flatten import ListOfKind, IndirectCallTargets -from pypy.jit.codewriter.jitcode import SwitchDictDescr -from pypy.jit.metainterp.history import AbstractDescr +from rpython.flowspace.model import Constant +from rpython.rtyper.lltypesystem import lltype +from rpython.jit.codewriter.flatten import SSARepr, Label, TLabel, Register +from rpython.jit.codewriter.flatten import ListOfKind, IndirectCallTargets +from rpython.jit.codewriter.jitcode import SwitchDictDescr +from rpython.jit.metainterp.history import AbstractDescr def format_assembler(ssarepr): diff --git a/pypy/jit/codewriter/heaptracker.py b/rpython/jit/codewriter/heaptracker.py similarity index 96% rename from pypy/jit/codewriter/heaptracker.py rename to rpython/jit/codewriter/heaptracker.py index f4d6a61e253864dbf5c283698467a713d5758bf8..e466ad9c6b87c1d4c98ea811cbc60b68d442603b 100644 --- a/pypy/jit/codewriter/heaptracker.py +++ b/rpython/jit/codewriter/heaptracker.py @@ -1,5 +1,5 @@ -from pypy.rpython.lltypesystem import lltype, llmemory, rclass -from pypy.rlib.objectmodel import we_are_translated +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass +from rpython.rlib.objectmodel import we_are_translated def adr2int(addr): @@ -124,7 +124,7 @@ def vtable2descr(cpu, vtable): raise KeyError(vtable) def descr2vtable(cpu, descr): - from pypy.jit.metainterp import history + from rpython.jit.metainterp import history assert isinstance(descr, history.AbstractDescr) vtable = descr.as_vtable_size_descr()._corresponding_vtable vtable = llmemory.cast_ptr_to_adr(vtable) diff --git a/pypy/jit/codewriter/jitcode.py b/rpython/jit/codewriter/jitcode.py similarity index 96% rename from pypy/jit/codewriter/jitcode.py rename to rpython/jit/codewriter/jitcode.py index 1f6aa395d87ec8a3457d95f3f1502c6117fc9656..010b89a3104db26bd4f7f23e405684161561b190 100644 --- a/pypy/jit/codewriter/jitcode.py +++ b/rpython/jit/codewriter/jitcode.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.history import AbstractDescr -from pypy.jit.codewriter import heaptracker -from pypy.rlib.objectmodel import we_are_translated +from rpython.jit.metainterp.history import AbstractDescr +from rpython.jit.codewriter import heaptracker +from rpython.rlib.objectmodel import we_are_translated class JitCode(AbstractDescr): @@ -93,7 +93,7 @@ class JitCode(AbstractDescr): if self._ssarepr is None: return '' % (self.name,) else: - from pypy.jit.codewriter.format import format_assembler + from rpython.jit.codewriter.format import format_assembler return format_assembler(self._ssarepr) def __repr__(self): diff --git a/pypy/jit/codewriter/jtransform.py b/rpython/jit/codewriter/jtransform.py similarity index 98% rename from pypy/jit/codewriter/jtransform.py rename to rpython/jit/codewriter/jtransform.py index f81597918275af2597d8e2307e61f377690ad513..85e8cc4b60bcdb6a21d1e3a8170395efe12438ad 100644 --- a/pypy/jit/codewriter/jtransform.py +++ b/rpython/jit/codewriter/jtransform.py @@ -1,21 +1,21 @@ import py -from pypy.jit.codewriter import support, heaptracker, longlong -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.codewriter.flatten import ListOfKind, IndirectCallTargets -from pypy.jit.codewriter.policy import log -from pypy.jit.metainterp import quasiimmut -from pypy.jit.metainterp.history import getkind -from pypy.jit.metainterp.typesystem import deref, arrayItem -from pypy.jit.metainterp.blackhole import BlackholeInterpreter -from pypy.objspace.flow.model import SpaceOperation, Variable, Constant, c_last_exception -from pypy.rlib import objectmodel -from pypy.rlib.jit import _we_are_jitted -from pypy.rlib.rgc import lltype_is_gc -from pypy.rpython.lltypesystem import lltype, llmemory, rstr, rclass, rffi -from pypy.rpython.rclass import IR_QUASIIMMUTABLE, IR_QUASIIMMUTABLE_ARRAY -from pypy.translator.simplify import get_funcobj -from pypy.translator.unsimplify import varoftype +from rpython.jit.codewriter import support, heaptracker, longlong +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.codewriter.flatten import ListOfKind, IndirectCallTargets +from rpython.jit.codewriter.policy import log +from rpython.jit.metainterp import quasiimmut +from rpython.jit.metainterp.history import getkind +from rpython.jit.metainterp.typesystem import deref, arrayItem +from rpython.jit.metainterp.blackhole import BlackholeInterpreter +from rpython.flowspace.model import SpaceOperation, Variable, Constant, c_last_exception +from rpython.rlib import objectmodel +from rpython.rlib.jit import _we_are_jitted +from rpython.rlib.rgc import lltype_is_gc +from rpython.rtyper.lltypesystem import lltype, llmemory, rstr, rclass, rffi +from rpython.rtyper.rclass import IR_QUASIIMMUTABLE, IR_QUASIIMMUTABLE_ARRAY +from rpython.translator.simplify import get_funcobj +from rpython.translator.unsimplify import varoftype class UnsupportedMallocFlags(Exception): pass diff --git a/pypy/jit/codewriter/liveness.py b/rpython/jit/codewriter/liveness.py similarity index 95% rename from pypy/jit/codewriter/liveness.py rename to rpython/jit/codewriter/liveness.py index 09b076324860d94f02b1a9476bb0438c52be8a29..6110df609879b4572cf9c05d7e5cfa7e72b5ef55 100644 --- a/pypy/jit/codewriter/liveness.py +++ b/rpython/jit/codewriter/liveness.py @@ -1,5 +1,5 @@ -from pypy.jit.codewriter.flatten import Register, ListOfKind, Label, TLabel -from pypy.jit.codewriter.jitcode import SwitchDictDescr +from rpython.jit.codewriter.flatten import Register, ListOfKind, Label, TLabel +from rpython.jit.codewriter.jitcode import SwitchDictDescr # Some instructions require liveness information (the ones that can end up diff --git a/pypy/jit/codewriter/longlong.py b/rpython/jit/codewriter/longlong.py similarity index 90% rename from pypy/jit/codewriter/longlong.py rename to rpython/jit/codewriter/longlong.py index 5507bff4f3804c2250ad3a4665e7c1032d8c8f9c..7438b1286c8f0d2bac7be20127699a1a1969e914 100644 --- a/pypy/jit/codewriter/longlong.py +++ b/rpython/jit/codewriter/longlong.py @@ -7,9 +7,9 @@ converting them back and forth. """ import sys -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib import rarithmetic, longlong2float -from pypy.rlib.objectmodel import compute_hash +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib import rarithmetic, longlong2float +from rpython.rlib.objectmodel import compute_hash if sys.maxint > 2147483647: diff --git a/pypy/jit/codewriter/policy.py b/rpython/jit/codewriter/policy.py similarity index 92% rename from pypy/jit/codewriter/policy.py rename to rpython/jit/codewriter/policy.py index bdc2fda3f4cb2fa866a87ca2810b86e699c0e67b..23a0551983f31d2df5de6914fd945ba546515569 100644 --- a/pypy/jit/codewriter/policy.py +++ b/rpython/jit/codewriter/policy.py @@ -1,8 +1,8 @@ -from pypy.jit.metainterp import history -from pypy.tool.udir import udir +from rpython.jit.metainterp import history +from rpython.tool.udir import udir import py -from pypy.tool.ansi_print import ansi_log +from rpython.tool.ansi_print import ansi_log log = py.log.Producer('jitcodewriter') py.log.setconsumer('jitcodewriter', ansi_log) @@ -14,7 +14,7 @@ class JitPolicy(object): self.supports_longlong = False self.supports_singlefloats = False if jithookiface is None: - from pypy.rlib.jit import JitHookInterface + from rpython.rlib.jit import JitHookInterface jithookiface = JitHookInterface() self.jithookiface = jithookiface @@ -44,14 +44,14 @@ class JitPolicy(object): # explicitly elidable functions are always opaque if getattr(func, '_elidable_function_', False): return True - # pypy.rpython.module.* are opaque helpers + # rpython.rtyper.module.* are opaque helpers mod = func.__module__ or '?' - if mod.startswith('pypy.rpython.module.'): + if mod.startswith('rpython.rtyper.module.'): return True return False def look_inside_graph(self, graph): - from pypy.translator.backendopt.support import find_backedges + from rpython.translator.backendopt.support import find_backedges contains_loop = bool(find_backedges(graph)) try: func = graph.func diff --git a/pypy/jit/codewriter/regalloc.py b/rpython/jit/codewriter/regalloc.py similarity index 56% rename from pypy/jit/codewriter/regalloc.py rename to rpython/jit/codewriter/regalloc.py index 9efef7e632c398b80b57bb69e3114eae4ac7a495..bd2cc88e74c2013c54b92dc1cf06d997318ea04b 100644 --- a/pypy/jit/codewriter/regalloc.py +++ b/rpython/jit/codewriter/regalloc.py @@ -1,6 +1,6 @@ -from pypy.tool.algo import regalloc -from pypy.jit.metainterp.history import getkind -from pypy.jit.codewriter.flatten import ListOfKind +from rpython.tool.algo import regalloc +from rpython.jit.metainterp.history import getkind +from rpython.jit.codewriter.flatten import ListOfKind def perform_register_allocation(graph, kind): diff --git a/pypy/jit/codewriter/support.py b/rpython/jit/codewriter/support.py similarity index 94% rename from pypy/jit/codewriter/support.py rename to rpython/jit/codewriter/support.py index a08bda9cabb5ab711c915a6982402a892d7cb634..3acbb33f760bfea0e62bb817686158707ea091fe 100644 --- a/pypy/jit/codewriter/support.py +++ b/rpython/jit/codewriter/support.py @@ -1,30 +1,30 @@ import sys -from pypy.rpython.lltypesystem import lltype, rclass, rffi -from pypy.rpython.ootypesystem import ootype -from pypy.rpython import rlist -from pypy.rpython.lltypesystem import rstr as ll_rstr, rdict as ll_rdict -from pypy.rpython.lltypesystem import rlist as lltypesystem_rlist -from pypy.rpython.lltypesystem.module import ll_math -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.rpython.ootypesystem import rdict as oo_rdict -from pypy.rpython.llinterp import LLInterpreter -from pypy.rpython.extregistry import ExtRegistryEntry -from pypy.rpython.annlowlevel import cast_base_ptr_to_instance -from pypy.translator.simplify import get_funcobj -from pypy.translator.unsimplify import split_block -from pypy.objspace.flow.model import Constant -from pypy.translator.translator import TranslationContext -from pypy.annotation.policy import AnnotatorPolicy -from pypy.annotation import model as annmodel -from pypy.rpython.annlowlevel import MixLevelHelperAnnotator -from pypy.jit.metainterp.typesystem import deref -from pypy.rlib import rgc -from pypy.rlib.jit import elidable -from pypy.rlib.rarithmetic import r_longlong, r_ulonglong, r_uint, intmask +from rpython.rtyper.lltypesystem import lltype, rclass, rffi +from rpython.rtyper.ootypesystem import ootype +from rpython.rtyper import rlist +from rpython.rtyper.lltypesystem import rstr as ll_rstr, rdict as ll_rdict +from rpython.rtyper.lltypesystem import rlist as lltypesystem_rlist +from rpython.rtyper.lltypesystem.module import ll_math +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.rtyper.ootypesystem import rdict as oo_rdict +from rpython.rtyper.llinterp import LLInterpreter +from rpython.rtyper.extregistry import ExtRegistryEntry +from rpython.rtyper.annlowlevel import cast_base_ptr_to_instance +from rpython.translator.simplify import get_funcobj +from rpython.translator.unsimplify import split_block +from rpython.flowspace.model import Constant +from rpython.translator.translator import TranslationContext +from rpython.annotator.policy import AnnotatorPolicy +from rpython.annotator import model as annmodel +from rpython.rtyper.annlowlevel import MixLevelHelperAnnotator +from rpython.jit.metainterp.typesystem import deref +from rpython.rlib import rgc +from rpython.rlib.jit import elidable +from rpython.rlib.rarithmetic import r_longlong, r_ulonglong, r_uint, intmask def getargtypes(annotator, values): if values is None: # for backend tests producing stand-alone exe's - from pypy.annotation.listdef import s_list_of_strings + from rpython.annotator.listdef import s_list_of_strings return [s_list_of_strings] return [_annotation(annotator, x) for x in values] @@ -51,7 +51,7 @@ def annotate(func, values, inline=None, backendoptimize=True, #if inline: # auto_inlining(t, threshold=inline) if backendoptimize: - from pypy.translator.backendopt.all import backend_optimizations + from rpython.translator.backendopt.all import backend_optimizations backend_optimizations(t, inline_threshold=inline or 0, remove_asserts=True, really_remove_asserts=True) @@ -79,7 +79,7 @@ def split_before_jit_merge_point(graph, portalblock, portalopindex): return link.target def sort_vars(args_v): - from pypy.jit.metainterp.history import getkind + from rpython.jit.metainterp.history import getkind _kind2count = {'int': 1, 'ref': 2, 'float': 3} return sorted(args_v, key=lambda v: _kind2count[getkind(v.concretetype)]) @@ -134,7 +134,7 @@ class Entry(ExtRegistryEntry): # ____________________________________________________________ # # Manually map oopspec'ed operations back to their ll implementation -# coming from modules like pypy.rpython.rlist. The following +# coming from modules like rpython.rtyper.rlist. The following # functions are fished from the globals() by setup_extra_builtin(). def _ll_0_newlist(LIST): diff --git a/pypy/jit/metainterp/optimizeopt/test/__init__.py b/rpython/jit/codewriter/test/__init__.py similarity index 100% rename from pypy/jit/metainterp/optimizeopt/test/__init__.py rename to rpython/jit/codewriter/test/__init__.py diff --git a/pypy/jit/codewriter/test/test_assembler.py b/rpython/jit/codewriter/test/test_assembler.py similarity index 94% rename from pypy/jit/codewriter/test/test_assembler.py rename to rpython/jit/codewriter/test/test_assembler.py index 5746bd3806d9aa48343ebf488c5993345243a683..3bb5db952817ee98074fb7a08c0bb65988b31fce 100644 --- a/pypy/jit/codewriter/test/test_assembler.py +++ b/rpython/jit/codewriter/test/test_assembler.py @@ -1,12 +1,12 @@ import py, struct, sys -from pypy.jit.codewriter.assembler import Assembler, AssemblerError -from pypy.jit.codewriter.flatten import SSARepr, Label, TLabel, Register -from pypy.jit.codewriter.flatten import ListOfKind, IndirectCallTargets -from pypy.jit.codewriter.jitcode import MissingLiveness -from pypy.jit.codewriter import heaptracker, longlong -from pypy.jit.metainterp.history import AbstractDescr -from pypy.objspace.flow.model import Constant -from pypy.rpython.lltypesystem import lltype, llmemory +from rpython.jit.codewriter.assembler import Assembler, AssemblerError +from rpython.jit.codewriter.flatten import SSARepr, Label, TLabel, Register +from rpython.jit.codewriter.flatten import ListOfKind, IndirectCallTargets +from rpython.jit.codewriter.jitcode import MissingLiveness +from rpython.jit.codewriter import heaptracker, longlong +from rpython.jit.metainterp.history import AbstractDescr +from rpython.flowspace.model import Constant +from rpython.rtyper.lltypesystem import lltype, llmemory def test_assemble_simple(): @@ -68,7 +68,7 @@ def test_assemble_float_consts(): def test_assemble_llong_consts(): if sys.maxint > 2147483647: py.test.skip("only for 32-bit platforms") - from pypy.rlib.rarithmetic import r_longlong, r_ulonglong + from rpython.rlib.rarithmetic import r_longlong, r_ulonglong ssarepr = SSARepr("test") ssarepr.insns = [ ('float_return', Constant(r_longlong(-18000000000000000), diff --git a/pypy/jit/codewriter/test/test_call.py b/rpython/jit/codewriter/test/test_call.py similarity index 91% rename from pypy/jit/codewriter/test/test_call.py rename to rpython/jit/codewriter/test/test_call.py index 307c4e63b98d13ba8275595c1f679d3f35fe3f4d..0970c111586949e0159c00f5547a489a7e946aba 100644 --- a/pypy/jit/codewriter/test/test_call.py +++ b/rpython/jit/codewriter/test/test_call.py @@ -1,10 +1,10 @@ import py -from pypy.objspace.flow.model import SpaceOperation, Constant, Variable -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.translator.unsimplify import varoftype -from pypy.rlib import jit -from pypy.jit.codewriter.call import CallControl -from pypy.jit.codewriter import support +from rpython.flowspace.model import SpaceOperation, Constant, Variable +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.translator.unsimplify import varoftype +from rpython.rlib import jit +from rpython.jit.codewriter.call import CallControl +from rpython.jit.codewriter import support class FakePolicy: def look_inside_graph(self, graph): @@ -147,7 +147,7 @@ def test_guess_call_kind_and_calls_from_graphs(): # ____________________________________________________________ def test_get_jitcode(): - from pypy.jit.codewriter.test.test_flatten import FakeCPU + from rpython.jit.codewriter.test.test_flatten import FakeCPU class FakeRTyper: class annotator: translator = None @@ -173,7 +173,7 @@ def test_jit_force_virtualizable_effectinfo(): py.test.skip("XXX add a test for CallControl.getcalldescr() -> EF_xxx") def test_releases_gil_analyzer(): - from pypy.jit.backend.llgraph.runner import LLtypeCPU + from rpython.jit.backend.llgraph.runner import LLtypeCPU T = rffi.CArrayPtr(rffi.TIME_T) external = rffi.llexternal("time", [T], rffi.TIME_T, threadsafe=True) @@ -194,10 +194,10 @@ def test_releases_gil_analyzer(): assert call_descr.extrainfo.has_random_effects() def test_random_effects_on_stacklet_switch(): - from pypy.jit.backend.llgraph.runner import LLtypeCPU - from pypy.translator.platform import CompilationError + from rpython.jit.backend.llgraph.runner import LLtypeCPU + from rpython.translator.platform import CompilationError try: - from pypy.rlib._rffi_stacklet import switch, thread_handle, handle + from rpython.rlib._rffi_stacklet import switch, thread_handle, handle except CompilationError as e: if "Unsupported platform!" in e.out: py.test.skip("Unsupported platform!") diff --git a/pypy/jit/codewriter/test/test_codewriter.py b/rpython/jit/codewriter/test/test_codewriter.py similarity index 94% rename from pypy/jit/codewriter/test/test_codewriter.py rename to rpython/jit/codewriter/test/test_codewriter.py index d371a64775acf48547d13479b9cc0d8965808a20..2f8ab02326dc9e31845b82bdf5cb9adf1993f537 100644 --- a/pypy/jit/codewriter/test/test_codewriter.py +++ b/rpython/jit/codewriter/test/test_codewriter.py @@ -1,10 +1,10 @@ import py -from pypy.jit.codewriter import support -from pypy.jit.codewriter.codewriter import CodeWriter -from pypy.jit.metainterp.history import AbstractDescr -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.translator.backendopt.all import backend_optimizations +from rpython.jit.codewriter import support +from rpython.jit.codewriter.codewriter import CodeWriter +from rpython.jit.metainterp.history import AbstractDescr +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.translator.backendopt.all import backend_optimizations class FakeCallDescr(AbstractDescr): @@ -74,7 +74,7 @@ def test_loop(): assert jitcode.num_regs_f() == 0 assert jitcode._live_vars(5) == '%i0 %i1' # - from pypy.jit.codewriter.jitcode import MissingLiveness + from rpython.jit.codewriter.jitcode import MissingLiveness for i in range(len(jitcode.code)+1): if i != 5: py.test.raises(MissingLiveness, jitcode._live_vars, i) @@ -101,7 +101,7 @@ def test_call(): assert isinstance(jitcode2.calldescr, FakeCallDescr) def test_integration(): - from pypy.jit.metainterp.blackhole import BlackholeInterpBuilder + from rpython.jit.metainterp.blackhole import BlackholeInterpBuilder def f(a, b): while a > 2: b += a diff --git a/pypy/jit/codewriter/test/test_effectinfo.py b/rpython/jit/codewriter/test/test_effectinfo.py similarity index 95% rename from pypy/jit/codewriter/test/test_effectinfo.py rename to rpython/jit/codewriter/test/test_effectinfo.py index 552a6acd54064a775e264e20db495994c850cc26..dc1f1832f4de93a20e09b82398de63021aff0f2a 100644 --- a/pypy/jit/codewriter/test/test_effectinfo.py +++ b/rpython/jit/codewriter/test/test_effectinfo.py @@ -1,7 +1,7 @@ -from pypy.rpython.lltypesystem.rclass import OBJECT -from pypy.rpython.lltypesystem import lltype -from pypy.rpython.ootypesystem import ootype -from pypy.jit.codewriter.effectinfo import effectinfo_from_writeanalyze,\ +from rpython.rtyper.lltypesystem.rclass import OBJECT +from rpython.rtyper.lltypesystem import lltype +from rpython.rtyper.ootypesystem import ootype +from rpython.jit.codewriter.effectinfo import effectinfo_from_writeanalyze,\ EffectInfo class FakeCPU: diff --git a/pypy/jit/codewriter/test/test_flatten.py b/rpython/jit/codewriter/test/test_flatten.py similarity index 96% rename from pypy/jit/codewriter/test/test_flatten.py rename to rpython/jit/codewriter/test/test_flatten.py index 86b5c82757544a5e9a9a23609445a7de3c23d8f4..43d40ddd8f300ec2878921bb2bbd7bd7f0b5917a 100644 --- a/pypy/jit/codewriter/test/test_flatten.py +++ b/rpython/jit/codewriter/test/test_flatten.py @@ -1,17 +1,17 @@ import py, sys -from pypy.jit.codewriter import support -from pypy.jit.codewriter.flatten import flatten_graph, reorder_renaming_list -from pypy.jit.codewriter.flatten import GraphFlattener, ListOfKind, Register -from pypy.jit.codewriter.format import assert_format -from pypy.jit.codewriter import longlong -from pypy.jit.metainterp.history import AbstractDescr -from pypy.rpython.lltypesystem import lltype, rclass, rstr, rffi -from pypy.objspace.flow.model import SpaceOperation, Variable, Constant -from pypy.translator.unsimplify import varoftype -from pypy.rlib.rarithmetic import ovfcheck, r_uint, r_longlong, r_ulonglong -from pypy.rlib.jit import dont_look_inside, _we_are_jitted, JitDriver -from pypy.rlib.objectmodel import keepalive_until_here -from pypy.rlib import jit +from rpython.jit.codewriter import support +from rpython.jit.codewriter.flatten import flatten_graph, reorder_renaming_list +from rpython.jit.codewriter.flatten import GraphFlattener, ListOfKind, Register +from rpython.jit.codewriter.format import assert_format +from rpython.jit.codewriter import longlong +from rpython.jit.metainterp.history import AbstractDescr +from rpython.rtyper.lltypesystem import lltype, rclass, rstr, rffi +from rpython.flowspace.model import SpaceOperation, Variable, Constant +from rpython.translator.unsimplify import varoftype +from rpython.rlib.rarithmetic import ovfcheck, r_uint, r_longlong, r_ulonglong +from rpython.rlib.jit import dont_look_inside, _we_are_jitted, JitDriver +from rpython.rlib.objectmodel import keepalive_until_here +from rpython.rlib import jit class FakeRegAlloc: @@ -129,13 +129,13 @@ class TestFlatten: graphs = self.make_graphs(func, args) #graphs[0].show() if transform: - from pypy.jit.codewriter.jtransform import transform_graph + from rpython.jit.codewriter.jtransform import transform_graph cc = cc or FakeCallControl() transform_graph(graphs[0], FakeCPU(self.rtyper), cc, jd) ssarepr = flatten_graph(graphs[0], fake_regallocs(), _include_all_exc_links=not transform) if liveness: - from pypy.jit.codewriter.liveness import compute_liveness + from rpython.jit.codewriter.liveness import compute_liveness compute_liveness(ssarepr) assert_format(ssarepr, expected) @@ -709,7 +709,7 @@ class TestFlatten: """, transform=True) def test_string_operations(self): - from pypy.rpython.lltypesystem import rstr + from rpython.rtyper.lltypesystem import rstr def f(n): s = lltype.malloc(rstr.STR, 2) s.chars[1] = chr(n) @@ -734,7 +734,7 @@ class TestFlatten: """, transform=True) def test_int_between(self): - from pypy.rpython.lltypesystem.lloperation import llop + from rpython.rtyper.lltypesystem.lloperation import llop def f(n, m, p): return llop.int_between(lltype.Bool, n, m, p) self.encoding_test(f, [5, 6, 7], """ @@ -969,7 +969,7 @@ class TestFlatten: """, transform=True) def test_convert_float_bytes(self): - from pypy.rlib.longlong2float import float2longlong, longlong2float + from rpython.rlib.longlong2float import float2longlong, longlong2float def f(x): ll = float2longlong(x) return longlong2float(ll) diff --git a/pypy/jit/codewriter/test/test_format.py b/rpython/jit/codewriter/test/test_format.py similarity index 91% rename from pypy/jit/codewriter/test/test_format.py rename to rpython/jit/codewriter/test/test_format.py index 9d96c8730f6038c6ee35da1d563f37ec19503592..e03c4770073287d817e35296d0b142aa8854d289 100644 --- a/pypy/jit/codewriter/test/test_format.py +++ b/rpython/jit/codewriter/test/test_format.py @@ -1,11 +1,11 @@ import py -from pypy.objspace.flow.model import Constant -from pypy.jit.codewriter.format import format_assembler, unformat_assembler -from pypy.jit.codewriter.flatten import Label, TLabel, SSARepr, Register -from pypy.jit.codewriter.flatten import ListOfKind -from pypy.jit.metainterp.history import AbstractDescr -from pypy.jit.codewriter.jitcode import SwitchDictDescr -from pypy.rpython.lltypesystem import lltype +from rpython.flowspace.model import Constant +from rpython.jit.codewriter.format import format_assembler, unformat_assembler +from rpython.jit.codewriter.flatten import Label, TLabel, SSARepr, Register +from rpython.jit.codewriter.flatten import ListOfKind +from rpython.jit.metainterp.history import AbstractDescr +from rpython.jit.codewriter.jitcode import SwitchDictDescr +from rpython.rtyper.lltypesystem import lltype def test_format_assembler_simple(): diff --git a/pypy/jit/codewriter/test/test_jitcode.py b/rpython/jit/codewriter/test/test_jitcode.py similarity index 93% rename from pypy/jit/codewriter/test/test_jitcode.py rename to rpython/jit/codewriter/test/test_jitcode.py index 2f45cc70a9f87a239ae937d9fd062445afd4b5c4..dc1bb08eed98683895d0c6111534eb1a69227ffe 100644 --- a/pypy/jit/codewriter/test/test_jitcode.py +++ b/rpython/jit/codewriter/test/test_jitcode.py @@ -1,4 +1,4 @@ -from pypy.jit.codewriter.jitcode import JitCode +from rpython.jit.codewriter.jitcode import JitCode def test_num_regs(): diff --git a/pypy/jit/codewriter/test/test_jtransform.py b/rpython/jit/codewriter/test/test_jtransform.py similarity index 98% rename from pypy/jit/codewriter/test/test_jtransform.py rename to rpython/jit/codewriter/test/test_jtransform.py index e5ddd2d4eed397fe39b5546608e47f64956ce564..911e675270f5d2f0f88ab5ceea1d47cb79784b12 100644 --- a/pypy/jit/codewriter/test/test_jtransform.py +++ b/rpython/jit/codewriter/test/test_jtransform.py @@ -15,15 +15,15 @@ except ImportError: for prod in result: yield tuple(prod) -from pypy.objspace.flow.model import FunctionGraph, Block, Link -from pypy.objspace.flow.model import SpaceOperation, Variable, Constant -from pypy.rpython.lltypesystem import lltype, llmemory, rclass, rstr, rffi -from pypy.rpython.lltypesystem.module import ll_math -from pypy.translator.unsimplify import varoftype -from pypy.jit.codewriter import heaptracker, effectinfo -from pypy.jit.codewriter.flatten import ListOfKind -from pypy.jit.codewriter.jtransform import Transformer, UnsupportedMallocFlags -from pypy.jit.metainterp.history import getkind +from rpython.flowspace.model import FunctionGraph, Block, Link +from rpython.flowspace.model import SpaceOperation, Variable, Constant +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass, rstr, rffi +from rpython.rtyper.lltypesystem.module import ll_math +from rpython.translator.unsimplify import varoftype +from rpython.jit.codewriter import heaptracker, effectinfo +from rpython.jit.codewriter.flatten import ListOfKind +from rpython.jit.codewriter.jtransform import Transformer, UnsupportedMallocFlags +from rpython.jit.metainterp.history import getkind def const(x): return Constant(x, lltype.typeOf(x)) @@ -400,7 +400,7 @@ def indirect_residual_call_test(argtypes, restype, expectedkind): def indirect_regular_call_test(argtypes, restype, expectedkind): # a regular indirect call is preceded by a guard_value on the # function address, so that pyjitpl can know which jitcode to follow - from pypy.jit.codewriter.flatten import IndirectCallTargets + from rpython.jit.codewriter.flatten import IndirectCallTargets op = get_direct_call_op(argtypes, restype) op.opname = 'indirect_call' op.args[0] = varoftype(op.args[0].concretetype) @@ -1156,7 +1156,7 @@ def test_unicode_eq_checknull_char(): assert cic.has_oopspec(effectinfo.EffectInfo.OS_UNIEQ_CHECKNULL_CHAR) def test_list_ll_arraycopy(): - from pypy.rlib.rgc import ll_arraycopy + from rpython.rlib.rgc import ll_arraycopy LIST = lltype.GcArray(lltype.Signed) PLIST = lltype.Ptr(LIST) INT = lltype.Signed @@ -1197,7 +1197,7 @@ def test_math_sqrt(): assert op1.result == v2 def test_quasi_immutable(): - from pypy.rpython.rclass import FieldListAccessor, IR_QUASIIMMUTABLE + from rpython.rtyper.rclass import FieldListAccessor, IR_QUASIIMMUTABLE accessor = FieldListAccessor() accessor.initialize(None, {'inst_x': IR_QUASIIMMUTABLE}) v2 = varoftype(lltype.Signed) @@ -1222,7 +1222,7 @@ def test_quasi_immutable(): assert op2.result is op.result def test_quasi_immutable_setfield(): - from pypy.rpython.rclass import FieldListAccessor, IR_QUASIIMMUTABLE + from rpython.rtyper.rclass import FieldListAccessor, IR_QUASIIMMUTABLE accessor = FieldListAccessor() accessor.initialize(None, {'inst_x': IR_QUASIIMMUTABLE}) v1 = varoftype(lltype.Signed) diff --git a/pypy/jit/codewriter/test/test_list.py b/rpython/jit/codewriter/test/test_list.py similarity index 95% rename from pypy/jit/codewriter/test/test_list.py rename to rpython/jit/codewriter/test/test_list.py index 90a66b5ecb5ca6bc5ac2ef9daf52f38cd5281198..82b278f1770307893168ffa33eb147178cccea43 100644 --- a/pypy/jit/codewriter/test/test_list.py +++ b/rpython/jit/codewriter/test/test_list.py @@ -1,12 +1,12 @@ -from pypy.rpython.lltypesystem import lltype -from pypy.translator.unsimplify import varoftype -from pypy.objspace.flow.model import Constant, SpaceOperation - -from pypy.jit.codewriter.jtransform import Transformer, NotSupported -from pypy.jit.codewriter.flatten import GraphFlattener -from pypy.jit.codewriter.format import assert_format -from pypy.jit.codewriter.test.test_flatten import fake_regallocs -from pypy.jit.metainterp.history import AbstractDescr +from rpython.rtyper.lltypesystem import lltype +from rpython.translator.unsimplify import varoftype +from rpython.flowspace.model import Constant, SpaceOperation + +from rpython.jit.codewriter.jtransform import Transformer, NotSupported +from rpython.jit.codewriter.flatten import GraphFlattener +from rpython.jit.codewriter.format import assert_format +from rpython.jit.codewriter.test.test_flatten import fake_regallocs +from rpython.jit.metainterp.history import AbstractDescr # ____________________________________________________________ diff --git a/pypy/jit/codewriter/test/test_liveness.py b/rpython/jit/codewriter/test/test_liveness.py similarity index 97% rename from pypy/jit/codewriter/test/test_liveness.py rename to rpython/jit/codewriter/test/test_liveness.py index 28b55f10093a73d911a860100e99f11b58d0a126..6138391f348bea0a5e60782df332b0fe992b8af7 100644 --- a/pypy/jit/codewriter/test/test_liveness.py +++ b/rpython/jit/codewriter/test/test_liveness.py @@ -1,5 +1,5 @@ -from pypy.jit.codewriter.liveness import compute_liveness -from pypy.jit.codewriter.format import unformat_assembler, assert_format +from rpython.jit.codewriter.liveness import compute_liveness +from rpython.jit.codewriter.format import unformat_assembler, assert_format class TestFlatten: diff --git a/pypy/jit/codewriter/test/test_longlong.py b/rpython/jit/codewriter/test/test_longlong.py similarity index 95% rename from pypy/jit/codewriter/test/test_longlong.py rename to rpython/jit/codewriter/test/test_longlong.py index ed85b1fe466521c9409866b88638ffbf4ca35aa5..32c572528d6c1df75600e77275f791b7bad92e2c 100644 --- a/pypy/jit/codewriter/test/test_longlong.py +++ b/rpython/jit/codewriter/test/test_longlong.py @@ -1,14 +1,14 @@ import py, sys -from pypy.rlib.rarithmetic import r_longlong, intmask, is_valid_int -from pypy.objspace.flow.model import SpaceOperation, Variable, Constant -from pypy.objspace.flow.model import Block, Link -from pypy.translator.unsimplify import varoftype -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.jit.codewriter.jtransform import Transformer, NotSupported -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.codewriter.test.test_jtransform import const -from pypy.jit.codewriter import longlong +from rpython.rlib.rarithmetic import r_longlong, intmask, is_valid_int +from rpython.flowspace.model import SpaceOperation, Variable, Constant +from rpython.flowspace.model import Block, Link +from rpython.translator.unsimplify import varoftype +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.jit.codewriter.jtransform import Transformer, NotSupported +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.codewriter.test.test_jtransform import const +from rpython.jit.codewriter import longlong class FakeRTyper: diff --git a/pypy/jit/codewriter/test/test_policy.py b/rpython/jit/codewriter/test/test_policy.py similarity index 90% rename from pypy/jit/codewriter/test/test_policy.py rename to rpython/jit/codewriter/test/test_policy.py index d714c425a74491c3ce8c659815fba5e6ae994cd8..27a889fb3114a45ffeb4ee7cacba62beca304a4e 100644 --- a/pypy/jit/codewriter/test/test_policy.py +++ b/rpython/jit/codewriter/test/test_policy.py @@ -1,10 +1,10 @@ import sys import py -from pypy.jit.codewriter.policy import contains_unsupported_variable_type -from pypy.jit.codewriter.policy import JitPolicy -from pypy.jit.codewriter import support -from pypy.rlib.rarithmetic import r_singlefloat, r_longlong -from pypy.rlib import jit +from rpython.jit.codewriter.policy import contains_unsupported_variable_type +from rpython.jit.codewriter.policy import JitPolicy +from rpython.jit.codewriter import support +from rpython.rlib.rarithmetic import r_singlefloat, r_longlong +from rpython.rlib import jit def test_contains_unsupported_variable_type(): def f(x): @@ -112,8 +112,8 @@ def test_str_join(): if JitPolicy().look_inside_graph(called_graph): # the calls to join() and str() should be residual mod = called_graph.func.__module__ - assert (mod == 'pypy.rpython.rlist' or - mod == 'pypy.rpython.lltypesystem.rlist') + assert (mod == 'rpython.rtyper.rlist' or + mod == 'rpython.rtyper.lltypesystem.rlist') def test_access_directly_but_not_seen(): class X: diff --git a/pypy/jit/codewriter/test/test_regalloc.py b/rpython/jit/codewriter/test/test_regalloc.py similarity index 93% rename from pypy/jit/codewriter/test/test_regalloc.py rename to rpython/jit/codewriter/test/test_regalloc.py index 9d8400d1bb22e62272fa0c52eac099d656a0b615..b834d96adb363ac30aa6781645aff64f161d8e22 100644 --- a/pypy/jit/codewriter/test/test_regalloc.py +++ b/rpython/jit/codewriter/test/test_regalloc.py @@ -1,14 +1,14 @@ import py, sys -from pypy.jit.codewriter import support -from pypy.jit.codewriter.regalloc import perform_register_allocation -from pypy.jit.codewriter.flatten import flatten_graph, ListOfKind -from pypy.jit.codewriter.format import assert_format -from pypy.jit.metainterp.history import AbstractDescr -from pypy.objspace.flow.model import Variable, Constant, SpaceOperation -from pypy.objspace.flow.model import FunctionGraph, Block, Link -from pypy.objspace.flow.model import c_last_exception -from pypy.rpython.lltypesystem import lltype, llmemory, rclass -from pypy.rlib.rarithmetic import ovfcheck +from rpython.jit.codewriter import support +from rpython.jit.codewriter.regalloc import perform_register_allocation +from rpython.jit.codewriter.flatten import flatten_graph, ListOfKind +from rpython.jit.codewriter.format import assert_format +from rpython.jit.metainterp.history import AbstractDescr +from rpython.flowspace.model import Variable, Constant, SpaceOperation +from rpython.flowspace.model import FunctionGraph, Block, Link +from rpython.flowspace.model import c_last_exception +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass +from rpython.rlib.rarithmetic import ovfcheck class TestRegAlloc: @@ -23,7 +23,7 @@ class TestRegAlloc: # graphs must first be transformed by jtransform.py before they can be # subjected to register allocation and flattening. if transform: - from pypy.jit.codewriter.jtransform import transform_graph + from rpython.jit.codewriter.jtransform import transform_graph transform_graph(graph, callcontrol=callcontrol) regalloc = perform_register_allocation(graph, 'int') regalloc2 = perform_register_allocation(graph, 'ref') diff --git a/pypy/jit/codewriter/test/test_support.py b/rpython/jit/codewriter/test/test_support.py similarity index 95% rename from pypy/jit/codewriter/test/test_support.py rename to rpython/jit/codewriter/test/test_support.py index e1cf7a96872dd34ed2f64da2d73ea39680f74a3b..f32eff9c5ddaa34d9f56aaf978d03aaf83935cf2 100644 --- a/pypy/jit/codewriter/test/test_support.py +++ b/rpython/jit/codewriter/test/test_support.py @@ -1,8 +1,8 @@ import py -from pypy.rpython.lltypesystem import lltype -from pypy.rpython.annlowlevel import llstr -from pypy.objspace.flow.model import Variable, Constant, SpaceOperation -from pypy.jit.codewriter.support import decode_builtin_call, LLtypeHelpers +from rpython.rtyper.lltypesystem import lltype +from rpython.rtyper.annlowlevel import llstr +from rpython.flowspace.model import Variable, Constant, SpaceOperation +from rpython.jit.codewriter.support import decode_builtin_call, LLtypeHelpers def newconst(x): return Constant(x, lltype.typeOf(x)) diff --git a/pypy/jit/codewriter/test/test_void_list.py b/rpython/jit/codewriter/test/test_void_list.py similarity index 94% rename from pypy/jit/codewriter/test/test_void_list.py rename to rpython/jit/codewriter/test/test_void_list.py index 46c638f4a44a5aeb4ae02372dcbbaff9a457d691..2c6299bf7ec2230c8a2c29d074324c742006e4e4 100644 --- a/pypy/jit/codewriter/test/test_void_list.py +++ b/rpython/jit/codewriter/test/test_void_list.py @@ -1,9 +1,9 @@ -from pypy.rpython.lltypesystem import lltype -from pypy.translator.unsimplify import varoftype -from pypy.objspace.flow.model import Constant -from pypy.jit.codewriter.jtransform import NotSupported +from rpython.rtyper.lltypesystem import lltype +from rpython.translator.unsimplify import varoftype +from rpython.flowspace.model import Constant +from rpython.jit.codewriter.jtransform import NotSupported -from pypy.jit.codewriter.test.test_list import builtin_test +from rpython.jit.codewriter.test.test_list import builtin_test # ____________________________________________________________ # XXX support for lists of voids is limited right now diff --git a/pypy/jit/conftest.py b/rpython/jit/conftest.py similarity index 100% rename from pypy/jit/conftest.py rename to rpython/jit/conftest.py diff --git a/pypy/jit/metainterp/test/__init__.py b/rpython/jit/metainterp/__init__.py similarity index 100% rename from pypy/jit/metainterp/test/__init__.py rename to rpython/jit/metainterp/__init__.py diff --git a/pypy/jit/metainterp/blackhole.py b/rpython/jit/metainterp/blackhole.py similarity index 98% rename from pypy/jit/metainterp/blackhole.py rename to rpython/jit/metainterp/blackhole.py index 24f667f59e962343850be1e8bfd8a27f0f2023a7..cc3967cdd3dc6f55c49e64701e3f9d34e26cdc6e 100644 --- a/pypy/jit/metainterp/blackhole.py +++ b/rpython/jit/metainterp/blackhole.py @@ -1,15 +1,15 @@ -from pypy.jit.codewriter import heaptracker, longlong -from pypy.jit.codewriter.jitcode import JitCode, SwitchDictDescr -from pypy.jit.metainterp.compile import ResumeAtPositionDescr -from pypy.jit.metainterp.jitexc import JitException, get_llexception, reraise -from pypy.rlib import longlong2float -from pypy.rlib.debug import debug_start, debug_stop, ll_assert, make_sure_not_resized -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.rarithmetic import intmask, LONG_BIT, r_uint, ovfcheck -from pypy.rlib.rtimer import read_timestamp -from pypy.rlib.unroll import unrolling_iterable -from pypy.rpython.lltypesystem import lltype, llmemory, rclass -from pypy.rpython.lltypesystem.lloperation import llop +from rpython.jit.codewriter import heaptracker, longlong +from rpython.jit.codewriter.jitcode import JitCode, SwitchDictDescr +from rpython.jit.metainterp.compile import ResumeAtPositionDescr +from rpython.jit.metainterp.jitexc import JitException, get_llexception, reraise +from rpython.rlib import longlong2float +from rpython.rlib.debug import debug_start, debug_stop, ll_assert, make_sure_not_resized +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.rarithmetic import intmask, LONG_BIT, r_uint, ovfcheck +from rpython.rlib.rtimer import read_timestamp +from rpython.rlib.unroll import unrolling_iterable +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass +from rpython.rtyper.lltypesystem.lloperation import llop def arguments(*argtypes, **kwds): @@ -660,7 +660,7 @@ class BlackholeInterpreter(object): @arguments("f", returns="i") def bhimpl_cast_float_to_singlefloat(a): - from pypy.rlib.rarithmetic import r_singlefloat + from rpython.rlib.rarithmetic import r_singlefloat a = longlong.getrealfloat(a) a = r_singlefloat(a) return longlong.singlefloat2int(a) @@ -1296,7 +1296,7 @@ class BlackholeInterpreter(object): @arguments("cpu", "r", "d") def bhimpl_jit_force_quasi_immutable(cpu, struct, mutatefielddescr): - from pypy.jit.metainterp import quasiimmut + from rpython.jit.metainterp import quasiimmut quasiimmut.do_force_quasi_immutable(cpu, struct, mutatefielddescr) @arguments("cpu", "d", returns="r") @@ -1387,7 +1387,7 @@ class BlackholeInterpreter(object): return lltype.nullptr(rclass.OBJECTPTR.TO) def _prepare_resume_from_failure(self, opnum, dont_change_position=False): - from pypy.jit.metainterp.resoperation import rop + from rpython.jit.metainterp.resoperation import rop # if opnum == rop.GUARD_TRUE: # Produced directly by some goto_if_not_xxx() opcode that did not @@ -1434,7 +1434,7 @@ class BlackholeInterpreter(object): elif opnum == rop.GUARD_NOT_INVALIDATED: pass else: - from pypy.jit.metainterp.resoperation import opname + from rpython.jit.metainterp.resoperation import opname raise NotImplementedError(opname[opnum]) return lltype.nullptr(rclass.OBJECTPTR.TO) @@ -1547,7 +1547,7 @@ def _handle_jitexception(blackholeinterp, jitexc): def resume_in_blackhole(metainterp_sd, jitdriver_sd, resumedescr, all_virtuals=None): - from pypy.jit.metainterp.resume import blackhole_from_resumedata + from rpython.jit.metainterp.resume import blackhole_from_resumedata #debug_start('jit-blackhole') blackholeinterp = blackhole_from_resumedata( metainterp_sd.blackholeinterpbuilder, diff --git a/pypy/jit/metainterp/compile.py b/rpython/jit/metainterp/compile.py similarity index 95% rename from pypy/jit/metainterp/compile.py rename to rpython/jit/metainterp/compile.py index b234b746e72e70d6fe814df3249ce7f16c89a72d..a1b4ea0ddaece05d418dd7352b7c748704443055 100644 --- a/pypy/jit/metainterp/compile.py +++ b/rpython/jit/metainterp/compile.py @@ -1,27 +1,27 @@ import weakref -from pypy.rpython.lltypesystem import lltype -from pypy.rpython.ootypesystem import ootype -from pypy.objspace.flow.model import Constant, Variable -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.debug import debug_start, debug_stop, debug_print -from pypy.rlib import rstack -from pypy.rlib.jit import JitDebugInfo, Counters +from rpython.rtyper.lltypesystem import lltype +from rpython.rtyper.ootypesystem import ootype +from rpython.flowspace.model import Constant, Variable +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.debug import debug_start, debug_stop, debug_print +from rpython.rlib import rstack +from rpython.rlib.jit import JitDebugInfo, Counters from pypy.conftest import option -from pypy.tool.sourcetools import func_with_new_name - -from pypy.jit.metainterp.resoperation import ResOperation, rop, get_deep_immutable_oplist -from pypy.jit.metainterp.history import TreeLoop, Box, History, JitCellToken, TargetToken -from pypy.jit.metainterp.history import AbstractFailDescr, BoxInt -from pypy.jit.metainterp.history import BoxPtr, BoxObj, BoxFloat, Const, ConstInt -from pypy.jit.metainterp import history -from pypy.jit.metainterp.typesystem import llhelper, oohelper -from pypy.jit.metainterp.optimize import InvalidLoop -from pypy.jit.metainterp.inliner import Inliner -from pypy.jit.metainterp.resume import NUMBERING, PENDINGFIELDSP -from pypy.jit.codewriter import heaptracker, longlong +from rpython.tool.sourcetools import func_with_new_name + +from rpython.jit.metainterp.resoperation import ResOperation, rop, get_deep_immutable_oplist +from rpython.jit.metainterp.history import TreeLoop, Box, History, JitCellToken, TargetToken +from rpython.jit.metainterp.history import AbstractFailDescr, BoxInt +from rpython.jit.metainterp.history import BoxPtr, BoxObj, BoxFloat, Const, ConstInt +from rpython.jit.metainterp import history +from rpython.jit.metainterp.typesystem import llhelper, oohelper +from rpython.jit.metainterp.optimize import InvalidLoop +from rpython.jit.metainterp.inliner import Inliner +from rpython.jit.metainterp.resume import NUMBERING, PENDINGFIELDSP +from rpython.jit.codewriter import heaptracker, longlong def giveup(): - from pypy.jit.metainterp.pyjitpl import SwitchToBlackhole + from rpython.jit.metainterp.pyjitpl import SwitchToBlackhole raise SwitchToBlackhole(Counters.ABORT_BRIDGE) def show_procedures(metainterp_sd, procedure=None, error=None): @@ -111,7 +111,7 @@ def compile_loop(metainterp, greenkey, start, """Try to compile a new procedure by closing the current history back to the first operation. """ - from pypy.jit.metainterp.optimizeopt import optimize_trace + from rpython.jit.metainterp.optimizeopt import optimize_trace metainterp_sd = metainterp.staticdata jitdriver_sd = metainterp.jitdriver_sd @@ -191,7 +191,7 @@ def compile_retrace(metainterp, greenkey, start, """Try to compile a new procedure by closing the current history back to the first operation. """ - from pypy.jit.metainterp.optimizeopt import optimize_trace + from rpython.jit.metainterp.optimizeopt import optimize_trace history = metainterp.history metainterp_sd = metainterp.staticdata @@ -535,7 +535,7 @@ class ResumeGuardDescr(ResumeDescr): finally: self.done_compiling() else: - from pypy.jit.metainterp.blackhole import resume_in_blackhole + from rpython.jit.metainterp.blackhole import resume_in_blackhole resume_in_blackhole(metainterp_sd, jitdriver_sd, self) assert 0, "unreachable" @@ -544,7 +544,7 @@ class ResumeGuardDescr(ResumeDescr): # of the jit_merge_point where we started the loop, even if the # loop itself may contain temporarily recursion into other # jitdrivers. - from pypy.jit.metainterp.pyjitpl import MetaInterp + from rpython.jit.metainterp.pyjitpl import MetaInterp metainterp = MetaInterp(metainterp_sd, jitdriver_sd) metainterp.handle_guard_failure(self) _trace_and_compile_from_bridge._dont_inline_ = True @@ -657,7 +657,7 @@ class ResumeGuardForcedDescr(ResumeGuardDescr): # always just blackholed. First fish for the data saved when # the virtualrefs and virtualizable have been forced by # handle_async_forcing() just a moment ago. - from pypy.jit.metainterp.blackhole import resume_in_blackhole + from rpython.jit.metainterp.blackhole import resume_in_blackhole token = metainterp_sd.cpu.get_latest_force_token() all_virtuals = self.fetch_data(token) if all_virtuals is None: @@ -684,7 +684,7 @@ class ResumeGuardForcedDescr(ResumeGuardDescr): rstack._stack_criticalcode_stop() def handle_async_forcing(self, force_token): - from pypy.jit.metainterp.resume import force_from_resumedata + from rpython.jit.metainterp.resume import force_from_resumedata metainterp_sd = self.metainterp_sd vinfo = self.jitdriver_sd.virtualizable_info ginfo = self.jitdriver_sd.greenfield_info @@ -815,7 +815,7 @@ def compile_trace(metainterp, resumekey, resume_at_jump_descr=None): """Try to compile a new bridge leading from the beginning of the history to some existing place. """ - from pypy.jit.metainterp.optimizeopt import optimize_trace + from rpython.jit.metainterp.optimizeopt import optimize_trace # The history contains new operations to attach as the code for the # failure of 'resumekey.guard_op'. diff --git a/pypy/jit/metainterp/executor.py b/rpython/jit/metainterp/executor.py similarity index 96% rename from pypy/jit/metainterp/executor.py rename to rpython/jit/metainterp/executor.py index c96fc59b5efcaee6fbf26f254c6d20702561f224..08e5e5848dd32c36b8c60a6b0ca115357a8e559b 100644 --- a/pypy/jit/metainterp/executor.py +++ b/rpython/jit/metainterp/executor.py @@ -1,16 +1,16 @@ """This implements pyjitpl's execution of operations. """ -from pypy.rpython.lltypesystem import lltype, rstr -from pypy.rlib.rarithmetic import ovfcheck, r_longlong, is_valid_int -from pypy.rlib.rtimer import read_timestamp -from pypy.rlib.unroll import unrolling_iterable -from pypy.jit.metainterp.history import BoxInt, BoxPtr, BoxFloat, check_descr -from pypy.jit.metainterp.history import INT, REF, FLOAT, VOID, AbstractDescr -from pypy.jit.metainterp import resoperation -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.metainterp.blackhole import BlackholeInterpreter, NULL -from pypy.jit.codewriter import longlong +from rpython.rtyper.lltypesystem import lltype, rstr +from rpython.rlib.rarithmetic import ovfcheck, r_longlong, is_valid_int +from rpython.rlib.rtimer import read_timestamp +from rpython.rlib.unroll import unrolling_iterable +from rpython.jit.metainterp.history import BoxInt, BoxPtr, BoxFloat, check_descr +from rpython.jit.metainterp.history import INT, REF, FLOAT, VOID, AbstractDescr +from rpython.jit.metainterp import resoperation +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.metainterp.blackhole import BlackholeInterpreter, NULL +from rpython.jit.codewriter import longlong # ____________________________________________________________ @@ -200,7 +200,7 @@ def do_raw_load(cpu, _, addrbox, offsetbox, arraydescr): return BoxInt(cpu.bh_raw_load_i(addr, offset, arraydescr)) def exec_new_with_vtable(cpu, clsbox): - from pypy.jit.codewriter import heaptracker + from rpython.jit.codewriter import heaptracker vtable = clsbox.getint() descr = heaptracker.vtable2descr(cpu, vtable) return cpu.bh_new_with_vtable(vtable, descr) @@ -288,7 +288,7 @@ def do_keepalive(cpu, _, x): ## raise NotImplementedError ##def do_debug_merge_point(cpu, box1): -## from pypy.jit.metainterp.warmspot import get_stats +## from rpython.jit.metainterp.warmspot import get_stats ## loc = box1._get_str() ## get_stats().add_merge_point_location(loc) diff --git a/pypy/jit/metainterp/gc.py b/rpython/jit/metainterp/gc.py similarity index 100% rename from pypy/jit/metainterp/gc.py rename to rpython/jit/metainterp/gc.py diff --git a/pypy/jit/metainterp/graphpage.py b/rpython/jit/metainterp/graphpage.py similarity index 97% rename from pypy/jit/metainterp/graphpage.py rename to rpython/jit/metainterp/graphpage.py index 8caa457ba18df995d217b6c21be10094ad2776ef..6be041bbae71c09e1f8e4aff433364dffaad312b 100644 --- a/pypy/jit/metainterp/graphpage.py +++ b/rpython/jit/metainterp/graphpage.py @@ -1,8 +1,8 @@ -from pypy.translator.tool.graphpage import GraphPage -from pypy.translator.tool.make_dot import DotGen -from pypy.jit.metainterp.history import Box -from pypy.jit.metainterp.resoperation import rop +from rpython.translator.tool.graphpage import GraphPage +from rpython.translator.tool.make_dot import DotGen +from rpython.jit.metainterp.history import Box +from rpython.jit.metainterp.resoperation import rop class SubGraph: def __init__(self, suboperations): diff --git a/pypy/jit/metainterp/greenfield.py b/rpython/jit/metainterp/greenfield.py similarity index 94% rename from pypy/jit/metainterp/greenfield.py rename to rpython/jit/metainterp/greenfield.py index cd5acef41d6f2c274485cef146e2b0c0309a931b..26347616053e2d2cc62bde91ee7782bc595ae862 100644 --- a/pypy/jit/metainterp/greenfield.py +++ b/rpython/jit/metainterp/greenfield.py @@ -1,4 +1,4 @@ -from pypy.jit.metainterp.typesystem import deref +from rpython.jit.metainterp.typesystem import deref class GreenFieldInfo(object): diff --git a/pypy/jit/metainterp/heapcache.py b/rpython/jit/metainterp/heapcache.py similarity index 99% rename from pypy/jit/metainterp/heapcache.py rename to rpython/jit/metainterp/heapcache.py index 62f41e0fa316f5f9a230f48f0a08f1be9486e8ff..5fbf5208046521c91f20fa5b983b48a7e3457891 100644 --- a/pypy/jit/metainterp/heapcache.py +++ b/rpython/jit/metainterp/heapcache.py @@ -1,5 +1,5 @@ -from pypy.jit.metainterp.history import ConstInt -from pypy.jit.metainterp.resoperation import rop +from rpython.jit.metainterp.history import ConstInt +from rpython.jit.metainterp.resoperation import rop class HeapCache(object): diff --git a/pypy/jit/metainterp/history.py b/rpython/jit/metainterp/history.py similarity index 96% rename from pypy/jit/metainterp/history.py rename to rpython/jit/metainterp/history.py index 2710edacb019d8aaa7b3c0b254d3926362d16e01..1ec28b66fbb716788e0483b952c30cf500f7aed2 100644 --- a/pypy/jit/metainterp/history.py +++ b/rpython/jit/metainterp/history.py @@ -1,16 +1,16 @@ -from pypy.rpython.extregistry import ExtRegistryEntry -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rpython.ootypesystem import ootype -from pypy.rlib.objectmodel import we_are_translated, Symbolic -from pypy.rlib.objectmodel import compute_unique_id -from pypy.rlib.rarithmetic import r_int64, is_valid_int +from rpython.rtyper.extregistry import ExtRegistryEntry +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rtyper.ootypesystem import ootype +from rpython.rlib.objectmodel import we_are_translated, Symbolic +from rpython.rlib.objectmodel import compute_unique_id +from rpython.rlib.rarithmetic import r_int64, is_valid_int from pypy.conftest import option -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.codewriter import heaptracker, longlong -from pypy.rlib.objectmodel import compute_identity_hash +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.codewriter import heaptracker, longlong +from rpython.rlib.objectmodel import compute_identity_hash import weakref # ____________________________________________________________ @@ -56,7 +56,7 @@ def getkind(TYPE, supports_floats=True, getkind._annspecialcase_ = 'specialize:memo' def repr_pointer(box): - from pypy.rpython.lltypesystem import rstr + from rpython.rtyper.lltypesystem import rstr try: T = box.value._obj.container._normalizedcontainer(check=False)._TYPE if T is rstr.STR: @@ -331,8 +331,8 @@ class ConstPtr(Const): return repr_rpython(self, 'cp') def _get_str(self): # for debugging only - from pypy.rpython.annlowlevel import hlstr - from pypy.rpython.lltypesystem import rstr + from rpython.rtyper.annlowlevel import hlstr + from rpython.rtyper.lltypesystem import rstr try: return hlstr(lltype.cast_opaque_ptr(lltype.Ptr(rstr.STR), self.value)) @@ -388,7 +388,7 @@ class ConstObj(Const): return repr_rpython(self, 'co') def _get_str(self): # for debugging only - from pypy.rpython.annlowlevel import hlstr + from rpython.rtyper.annlowlevel import hlstr return hlstr(ootype.cast_from_object(ootype.String, self.value)) class Box(AbstractValue): @@ -601,7 +601,7 @@ class BoxObj(Box): def make_hashable_int(i): - from pypy.rpython.lltypesystem.ll2ctypes import NotCtypesAllocatedStructure + from rpython.rtyper.lltypesystem.ll2ctypes import NotCtypesAllocatedStructure if not we_are_translated() and isinstance(i, llmemory.AddressAsInt): # Warning: such a hash changes at the time of translation adr = heaptracker.int2adr(i) @@ -612,7 +612,7 @@ def make_hashable_int(i): return i def get_const_ptr_for_string(s): - from pypy.rpython.annlowlevel import llstr + from rpython.rtyper.annlowlevel import llstr if not we_are_translated(): try: return _const_ptr_for_string[s] @@ -625,7 +625,7 @@ def get_const_ptr_for_string(s): _const_ptr_for_string = {} def get_const_ptr_for_unicode(s): - from pypy.rpython.annlowlevel import llunicode + from rpython.rtyper.annlowlevel import llunicode if not we_are_translated(): try: return _const_ptr_for_unicode[s] @@ -756,7 +756,7 @@ class TreeLoop(object): def show(self, errmsg=None): "NOT_RPYTHON" - from pypy.jit.metainterp.graphpage import display_loops + from rpython.jit.metainterp.graphpage import display_loops display_loops([self], errmsg) def check_consistency(self): # for testing @@ -1068,7 +1068,7 @@ class Stats(object): self.view() def view(self, errmsg=None, extraprocedures=[], metainterp_sd=None): - from pypy.jit.metainterp.graphpage import display_procedures + from rpython.jit.metainterp.graphpage import display_procedures procedures = self.get_all_loops()[:] for procedure in extraprocedures: if procedure in procedures: @@ -1105,7 +1105,7 @@ class Entry(ExtRegistryEntry): def compute_result_annotation(self, s_x): # Failures here mean that 'descr' is not correctly an AbstractDescr. # Please don't check in disabling of this test! - from pypy.annotation import model as annmodel + from rpython.annotator import model as annmodel if not annmodel.s_None.contains(s_x): assert isinstance(s_x, annmodel.SomeInstance) # the following assert fails if we somehow did not manage diff --git a/pypy/jit/metainterp/inliner.py b/rpython/jit/metainterp/inliner.py similarity index 91% rename from pypy/jit/metainterp/inliner.py rename to rpython/jit/metainterp/inliner.py index e396fa83d291a1228e4c920790bc096f7fefe302..480a669f72936ee0b9b648042b0831131c04388f 100644 --- a/pypy/jit/metainterp/inliner.py +++ b/rpython/jit/metainterp/inliner.py @@ -1,5 +1,5 @@ -from pypy.jit.metainterp.history import Const -from pypy.jit.metainterp.resume import Snapshot +from rpython.jit.metainterp.history import Const +from rpython.jit.metainterp.resume import Snapshot class Inliner(object): def __init__(self, inputargs, jump_args): @@ -36,7 +36,7 @@ class Inliner(object): return newop def inline_descr_inplace(self, descr): - from pypy.jit.metainterp.compile import ResumeGuardDescr + from rpython.jit.metainterp.compile import ResumeGuardDescr if isinstance(descr, ResumeGuardDescr): descr.rd_snapshot = self.inline_snapshot(descr.rd_snapshot) diff --git a/rpython/jit/metainterp/jitdriver.py b/rpython/jit/metainterp/jitdriver.py new file mode 100644 index 0000000000000000000000000000000000000000..05c602d9138e6785d35b21181dfad74c79f528e2 --- /dev/null +++ b/rpython/jit/metainterp/jitdriver.py @@ -0,0 +1,34 @@ + + +class JitDriverStaticData(object): + """There is one instance of this class per JitDriver used in the program. + """ + # This is just a container with the following attributes (... set by): + # self.jitdriver ... rpython.jit.metainterp.warmspot + # self.portal_graph ... rpython.jit.metainterp.warmspot + # self.portal_runner_ptr ... rpython.jit.metainterp.warmspot + # self.portal_runner_adr ... rpython.jit.metainterp.warmspot + # self.portal_calldescr ... rpython.jit.metainterp.warmspot + # self.num_green_args ... rpython.jit.metainterp.warmspot + # self.num_red_args ... rpython.jit.metainterp.warmspot + # self.red_args_types ... rpython.jit.metainterp.warmspot + # self.result_type ... rpython.jit.metainterp.warmspot + # self.virtualizable_info... rpython.jit.metainterp.warmspot + # self.greenfield_info ... rpython.jit.metainterp.warmspot + # self.warmstate ... rpython.jit.metainterp.warmspot + # self.handle_jitexc_from_bh rpython.jit.metainterp.warmspot + # self.no_loop_header ... rpython.jit.metainterp.warmspot + # self.portal_finishtoken... rpython.jit.metainterp.pyjitpl + # self.index ... rpython.jit.codewriter.call + # self.mainjitcode ... rpython.jit.codewriter.call + + # These attributes are read by the backend in CALL_ASSEMBLER: + # self.assembler_helper_adr + # self.index_of_virtualizable + # self.vable_token_descr + # self.portal_calldescr + + # warmspot sets extra attributes starting with '_' for its own use. + + def _freeze_(self): + return True diff --git a/pypy/jit/metainterp/jitexc.py b/rpython/jit/metainterp/jitexc.py similarity index 79% rename from pypy/jit/metainterp/jitexc.py rename to rpython/jit/metainterp/jitexc.py index 9d7288e9e7941dd804da53ea8c2973ff53d55900..38c5d00714d7ef3371ff964a859ed7a156cbdba9 100644 --- a/pypy/jit/metainterp/jitexc.py +++ b/rpython/jit/metainterp/jitexc.py @@ -1,8 +1,8 @@ -from pypy.rpython.annlowlevel import cast_instance_to_base_ptr -from pypy.rpython.annlowlevel import cast_base_ptr_to_instance -from pypy.rpython.lltypesystem import rclass -from pypy.rpython.llinterp import LLException -from pypy.rlib.objectmodel import we_are_translated +from rpython.rtyper.annlowlevel import cast_instance_to_base_ptr +from rpython.rtyper.annlowlevel import cast_base_ptr_to_instance +from rpython.rtyper.lltypesystem import rclass +from rpython.rtyper.llinterp import LLException +from rpython.rlib.objectmodel import we_are_translated class JitException(Exception): diff --git a/pypy/jit/metainterp/jitprof.py b/rpython/jit/metainterp/jitprof.py similarity index 95% rename from pypy/jit/metainterp/jitprof.py rename to rpython/jit/metainterp/jitprof.py index 4ee541c74564711c4773f284b4a067812c025131..323fc9d3e0b6bff327da5249205d876495cea90d 100644 --- a/pypy/jit/metainterp/jitprof.py +++ b/rpython/jit/metainterp/jitprof.py @@ -3,10 +3,10 @@ """ import time -from pypy.rlib.debug import debug_print, debug_start, debug_stop -from pypy.rlib.debug import have_debug_prints -from pypy.jit.metainterp.jitexc import JitException -from pypy.rlib.jit import Counters +from rpython.rlib.debug import debug_print, debug_start, debug_stop +from rpython.rlib.debug import have_debug_prints +from rpython.jit.metainterp.jitexc import JitException +from rpython.rlib.jit import Counters JITPROF_LINES = Counters.ncounters + 1 + 1 @@ -110,7 +110,7 @@ class Profiler(BaseProfiler): return self.counters[num] def count_ops(self, opnum, kind=Counters.OPS): - from pypy.jit.metainterp.resoperation import rop + from rpython.jit.metainterp.resoperation import rop self.counters[kind] += 1 if opnum == rop.CALL and kind == Counters.RECORDED_OPS:# or opnum == rop.OOSEND: self.calls += 1 diff --git a/pypy/jit/metainterp/logger.py b/rpython/jit/metainterp/logger.py similarity index 95% rename from pypy/jit/metainterp/logger.py rename to rpython/jit/metainterp/logger.py index 84d4273908d658691ae21aae2e9aca70e6796336..92dafbc73bdc436a1ba564c77f35ce3e67a83efa 100644 --- a/pypy/jit/metainterp/logger.py +++ b/rpython/jit/metainterp/logger.py @@ -1,10 +1,10 @@ import os -from pypy.rlib.debug import have_debug_prints -from pypy.rlib.debug import debug_start, debug_stop, debug_print -from pypy.rlib.objectmodel import we_are_translated -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.metainterp.history import Const, ConstInt, Box, \ +from rpython.rlib.debug import have_debug_prints +from rpython.rlib.debug import debug_start, debug_stop, debug_print +from rpython.rlib.objectmodel import we_are_translated +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.metainterp.history import Const, ConstInt, Box, \ BoxInt, ConstFloat, BoxFloat, AbstractFailDescr, TargetToken class Logger(object): diff --git a/pypy/jit/metainterp/memmgr.py b/rpython/jit/metainterp/memmgr.py similarity index 94% rename from pypy/jit/metainterp/memmgr.py rename to rpython/jit/metainterp/memmgr.py index c98c97467c123f1e1274e4b1291f9bd6a8977d94..dabbb1f145ada1af94f6924e7a6efb734b098249 100644 --- a/pypy/jit/metainterp/memmgr.py +++ b/rpython/jit/metainterp/memmgr.py @@ -1,7 +1,7 @@ import math -from pypy.rlib.rarithmetic import r_int64 -from pypy.rlib.debug import debug_start, debug_print, debug_stop -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.rarithmetic import r_int64 +from rpython.rlib.debug import debug_start, debug_print, debug_stop +from rpython.rlib.objectmodel import we_are_translated # # Logic to decide which loops are old and not used any more. @@ -77,7 +77,7 @@ class MemoryManager(object): #print self.alive_loops.keys() if not we_are_translated() and oldtotal != newtotal: looptoken = None - from pypy.rlib import rgc + from rpython.rlib import rgc # a single one is not enough for all tests :-( rgc.collect(); rgc.collect(); rgc.collect() debug_stop("jit-mem-collect") diff --git a/pypy/jit/metainterp/optimize.py b/rpython/jit/metainterp/optimize.py similarity index 75% rename from pypy/jit/metainterp/optimize.py rename to rpython/jit/metainterp/optimize.py index a9d1b9826f7c79f106197352e7bac6fff7d10e02..98478cd28c5c4b555ef643c8c2863d9db5e05e7c 100644 --- a/pypy/jit/metainterp/optimize.py +++ b/rpython/jit/metainterp/optimize.py @@ -1,5 +1,5 @@ -from pypy.rlib.debug import debug_start, debug_stop, debug_print -from pypy.jit.metainterp.jitexc import JitException +from rpython.rlib.debug import debug_start, debug_stop, debug_print +from rpython.jit.metainterp.jitexc import JitException class InvalidLoop(JitException): """Raised when the optimize*.py detect that the loop that diff --git a/pypy/jit/metainterp/optimizeopt/__init__.py b/rpython/jit/metainterp/optimizeopt/__init__.py similarity index 70% rename from pypy/jit/metainterp/optimizeopt/__init__.py rename to rpython/jit/metainterp/optimizeopt/__init__.py index 8bb5662b95485700abb3f408f9dab16c300a4694..7246114f250b26a66e0092ea86fe02d3e29fc433 100644 --- a/pypy/jit/metainterp/optimizeopt/__init__.py +++ b/rpython/jit/metainterp/optimizeopt/__init__.py @@ -1,16 +1,16 @@ -from pypy.jit.metainterp.optimizeopt.optimizer import Optimizer -from pypy.jit.metainterp.optimizeopt.rewrite import OptRewrite -from pypy.jit.metainterp.optimizeopt.intbounds import OptIntBounds -from pypy.jit.metainterp.optimizeopt.virtualize import OptVirtualize -from pypy.jit.metainterp.optimizeopt.heap import OptHeap -from pypy.jit.metainterp.optimizeopt.vstring import OptString -from pypy.jit.metainterp.optimizeopt.unroll import optimize_unroll -from pypy.jit.metainterp.optimizeopt.simplify import OptSimplify -from pypy.jit.metainterp.optimizeopt.pure import OptPure -from pypy.jit.metainterp.optimizeopt.earlyforce import OptEarlyForce -from pypy.rlib.jit import PARAMETERS, ENABLE_ALL_OPTS -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.debug import debug_start, debug_stop, debug_print +from rpython.jit.metainterp.optimizeopt.optimizer import Optimizer +from rpython.jit.metainterp.optimizeopt.rewrite import OptRewrite +from rpython.jit.metainterp.optimizeopt.intbounds import OptIntBounds +from rpython.jit.metainterp.optimizeopt.virtualize import OptVirtualize +from rpython.jit.metainterp.optimizeopt.heap import OptHeap +from rpython.jit.metainterp.optimizeopt.vstring import OptString +from rpython.jit.metainterp.optimizeopt.unroll import optimize_unroll +from rpython.jit.metainterp.optimizeopt.simplify import OptSimplify +from rpython.jit.metainterp.optimizeopt.pure import OptPure +from rpython.jit.metainterp.optimizeopt.earlyforce import OptEarlyForce +from rpython.rlib.jit import PARAMETERS, ENABLE_ALL_OPTS +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.debug import debug_start, debug_stop, debug_print ALL_OPTS = [('intbounds', OptIntBounds), diff --git a/pypy/jit/metainterp/optimizeopt/earlyforce.py b/rpython/jit/metainterp/optimizeopt/earlyforce.py similarity index 75% rename from pypy/jit/metainterp/optimizeopt/earlyforce.py rename to rpython/jit/metainterp/optimizeopt/earlyforce.py index 67e0f1e8de7c9f4158b602a9268f51aa1e62a217..baf987f78bdf0897781d9bf70224a0b5e1d1e10a 100644 --- a/pypy/jit/metainterp/optimizeopt/earlyforce.py +++ b/rpython/jit/metainterp/optimizeopt/earlyforce.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.optimizeopt.optimizer import Optimization -from pypy.jit.metainterp.optimizeopt.vstring import VAbstractStringValue -from pypy.jit.metainterp.resoperation import rop, ResOperation +from rpython.jit.metainterp.optimizeopt.optimizer import Optimization +from rpython.jit.metainterp.optimizeopt.vstring import VAbstractStringValue +from rpython.jit.metainterp.resoperation import rop, ResOperation class OptEarlyForce(Optimization): def propagate_forward(self, op): diff --git a/pypy/jit/metainterp/optimizeopt/generalize.py b/rpython/jit/metainterp/optimizeopt/generalize.py similarity index 87% rename from pypy/jit/metainterp/optimizeopt/generalize.py rename to rpython/jit/metainterp/optimizeopt/generalize.py index 3bcc8e16fc32ba93faafbfa9ee9618665738915c..2ec10232b7a9196dfd5a43b57f899979d22476fd 100644 --- a/pypy/jit/metainterp/optimizeopt/generalize.py +++ b/rpython/jit/metainterp/optimizeopt/generalize.py @@ -1,4 +1,4 @@ -from pypy.jit.metainterp.optimizeopt.optimizer import MININT, MAXINT +from rpython.jit.metainterp.optimizeopt.optimizer import MININT, MAXINT class GeneralizationStrategy(object): def __init__(self, optimizer): diff --git a/pypy/jit/metainterp/optimizeopt/heap.py b/rpython/jit/metainterp/optimizeopt/heap.py similarity index 97% rename from pypy/jit/metainterp/optimizeopt/heap.py rename to rpython/jit/metainterp/optimizeopt/heap.py index f36d2fa1dfa78f5aa590a7a877bf417099626e1d..2373fab75fbaf1c34d80b7f1cd9c4645897c5281 100644 --- a/pypy/jit/metainterp/optimizeopt/heap.py +++ b/rpython/jit/metainterp/optimizeopt/heap.py @@ -1,11 +1,11 @@ import os -from pypy.jit.metainterp.jitexc import JitException -from pypy.jit.metainterp.optimizeopt.optimizer import Optimization, MODE_ARRAY, LEVEL_KNOWNCLASS -from pypy.jit.metainterp.history import ConstInt, Const -from pypy.jit.metainterp.optimizeopt.util import make_dispatcher_method -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.rlib.objectmodel import we_are_translated +from rpython.jit.metainterp.jitexc import JitException +from rpython.jit.metainterp.optimizeopt.optimizer import Optimization, MODE_ARRAY, LEVEL_KNOWNCLASS +from rpython.jit.metainterp.history import ConstInt, Const +from rpython.jit.metainterp.optimizeopt.util import make_dispatcher_method +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.rlib.objectmodel import we_are_translated class CachedField(object): @@ -479,7 +479,7 @@ class OptHeap(Optimization): self._remove_guard_not_invalidated = True return # not a constant at all; ignore QUASIIMMUT_FIELD # - from pypy.jit.metainterp.quasiimmut import QuasiImmutDescr + from rpython.jit.metainterp.quasiimmut import QuasiImmutDescr qmutdescr = op.getdescr() assert isinstance(qmutdescr, QuasiImmutDescr) # check that the value is still correct; it could have changed diff --git a/pypy/jit/metainterp/optimizeopt/intbounds.py b/rpython/jit/metainterp/optimizeopt/intbounds.py similarity index 97% rename from pypy/jit/metainterp/optimizeopt/intbounds.py rename to rpython/jit/metainterp/optimizeopt/intbounds.py index 5e9b052dd95982105024cde175796b3d2b31713b..8312a2a8b2a1dfc30c68f75cbee7fccad8e9691d 100644 --- a/pypy/jit/metainterp/optimizeopt/intbounds.py +++ b/rpython/jit/metainterp/optimizeopt/intbounds.py @@ -1,13 +1,13 @@ import sys -from pypy.jit.metainterp.optimizeopt.optimizer import Optimization, CONST_1, CONST_0, \ +from rpython.jit.metainterp.optimizeopt.optimizer import Optimization, CONST_1, CONST_0, \ MODE_ARRAY, MODE_STR, MODE_UNICODE -from pypy.jit.metainterp.history import ConstInt -from pypy.jit.metainterp.optimizeopt.intutils import (IntBound, IntLowerBound, +from rpython.jit.metainterp.history import ConstInt +from rpython.jit.metainterp.optimizeopt.intutils import (IntBound, IntLowerBound, IntUpperBound) -from pypy.jit.metainterp.optimizeopt.util import make_dispatcher_method -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.metainterp.optimize import InvalidLoop -from pypy.rlib.rarithmetic import LONG_BIT +from rpython.jit.metainterp.optimizeopt.util import make_dispatcher_method +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.metainterp.optimize import InvalidLoop +from rpython.rlib.rarithmetic import LONG_BIT class OptIntBounds(Optimization): diff --git a/pypy/jit/metainterp/optimizeopt/intutils.py b/rpython/jit/metainterp/optimizeopt/intutils.py similarity index 97% rename from pypy/jit/metainterp/optimizeopt/intutils.py rename to rpython/jit/metainterp/optimizeopt/intutils.py index 48c75bfcac0808a06b7df5df35b890265e04b60a..9e691b950a8d986fbd0df17fe93c938938d9d8ec 100644 --- a/pypy/jit/metainterp/optimizeopt/intutils.py +++ b/rpython/jit/metainterp/optimizeopt/intutils.py @@ -1,7 +1,7 @@ -from pypy.rlib.rarithmetic import ovfcheck, LONG_BIT, maxint, is_valid_int -from pypy.rlib.objectmodel import we_are_translated -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.jit.metainterp.history import BoxInt, ConstInt +from rpython.rlib.rarithmetic import ovfcheck, LONG_BIT, maxint, is_valid_int +from rpython.rlib.objectmodel import we_are_translated +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.jit.metainterp.history import BoxInt, ConstInt MAXINT = maxint MININT = -maxint - 1 diff --git a/pypy/jit/metainterp/optimizeopt/optimizer.py b/rpython/jit/metainterp/optimizeopt/optimizer.py similarity index 97% rename from pypy/jit/metainterp/optimizeopt/optimizer.py rename to rpython/jit/metainterp/optimizeopt/optimizer.py index d17f2df091be431c8b7d48e7048254c04b8c97da..f50f190862cb007782bb8618331b5974ae631600 100644 --- a/pypy/jit/metainterp/optimizeopt/optimizer.py +++ b/rpython/jit/metainterp/optimizeopt/optimizer.py @@ -1,15 +1,15 @@ -from pypy.jit.metainterp import jitprof, resume, compile -from pypy.jit.metainterp.executor import execute_nonspec -from pypy.jit.metainterp.history import BoxInt, BoxFloat, Const, ConstInt, REF -from pypy.jit.metainterp.optimizeopt.intutils import IntBound, IntUnbounded, \ +from rpython.jit.metainterp import jitprof, resume, compile +from rpython.jit.metainterp.executor import execute_nonspec +from rpython.jit.metainterp.history import BoxInt, BoxFloat, Const, ConstInt, REF +from rpython.jit.metainterp.optimizeopt.intutils import IntBound, IntUnbounded, \ ImmutableIntUnbounded, \ IntLowerBound, MININT, MAXINT -from pypy.jit.metainterp.optimizeopt.util import make_dispatcher_method -from pypy.jit.metainterp.resoperation import rop, ResOperation, AbstractResOp -from pypy.jit.metainterp.typesystem import llhelper, oohelper -from pypy.tool.pairtype import extendabletype -from pypy.rlib.debug import debug_print -from pypy.rlib.objectmodel import specialize +from rpython.jit.metainterp.optimizeopt.util import make_dispatcher_method +from rpython.jit.metainterp.resoperation import rop, ResOperation, AbstractResOp +from rpython.jit.metainterp.typesystem import llhelper, oohelper +from rpython.tool.pairtype import extendabletype +from rpython.rlib.debug import debug_print +from rpython.rlib.objectmodel import specialize LEVEL_UNKNOWN = '\x00' diff --git a/pypy/jit/metainterp/optimizeopt/pure.py b/rpython/jit/metainterp/optimizeopt/pure.py similarity index 95% rename from pypy/jit/metainterp/optimizeopt/pure.py rename to rpython/jit/metainterp/optimizeopt/pure.py index 99aa13211546cbb60a90ed54e403a0e65349bf63..496dba49f671e86e8eb5707c35791e1db7d8e2f9 100644 --- a/pypy/jit/metainterp/optimizeopt/pure.py +++ b/rpython/jit/metainterp/optimizeopt/pure.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.optimizeopt.optimizer import Optimization, REMOVED -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.jit.metainterp.optimizeopt.util import (make_dispatcher_method, +from rpython.jit.metainterp.optimizeopt.optimizer import Optimization, REMOVED +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.jit.metainterp.optimizeopt.util import (make_dispatcher_method, args_dict) class OptPure(Optimization): diff --git a/pypy/jit/metainterp/optimizeopt/rewrite.py b/rpython/jit/metainterp/optimizeopt/rewrite.py similarity index 96% rename from pypy/jit/metainterp/optimizeopt/rewrite.py rename to rpython/jit/metainterp/optimizeopt/rewrite.py index 3f22ceefdaaa39c57fd9cb8a6d45e6ffb55df421..0047daf9e6d8cd9c8283a2fde545b47ffb58b290 100644 --- a/pypy/jit/metainterp/optimizeopt/rewrite.py +++ b/rpython/jit/metainterp/optimizeopt/rewrite.py @@ -1,15 +1,15 @@ -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.metainterp import compile -from pypy.jit.metainterp.history import (Const, ConstInt, BoxInt, BoxFloat, +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.metainterp import compile +from rpython.jit.metainterp.history import (Const, ConstInt, BoxInt, BoxFloat, BoxPtr, make_hashable_int) -from pypy.jit.metainterp.optimize import InvalidLoop -from pypy.jit.metainterp.optimizeopt.intutils import IntBound -from pypy.jit.metainterp.optimizeopt.optimizer import (Optimization, REMOVED, +from rpython.jit.metainterp.optimize import InvalidLoop +from rpython.jit.metainterp.optimizeopt.intutils import IntBound +from rpython.jit.metainterp.optimizeopt.optimizer import (Optimization, REMOVED, CONST_0, CONST_1) -from pypy.jit.metainterp.optimizeopt.util import _findall, make_dispatcher_method -from pypy.jit.metainterp.resoperation import (opboolinvers, opboolreflex, rop, +from rpython.jit.metainterp.optimizeopt.util import _findall, make_dispatcher_method +from rpython.jit.metainterp.resoperation import (opboolinvers, opboolreflex, rop, ResOperation) -from pypy.rlib.rarithmetic import highest_bit +from rpython.rlib.rarithmetic import highest_bit class OptRewrite(Optimization): @@ -434,7 +434,7 @@ class OptRewrite(Optimization): and length and (dest_value.is_virtual() or length.getint() <= 8) and (source_value.is_virtual() or length.getint() <= 8) and len(extrainfo.write_descrs_arrays) == 1): # <-sanity check - from pypy.jit.metainterp.optimizeopt.virtualize import VArrayValue + from rpython.jit.metainterp.optimizeopt.virtualize import VArrayValue source_start = source_start_box.getint() dest_start = dest_start_box.getint() # XXX fish fish fish diff --git a/pypy/jit/metainterp/optimizeopt/simplify.py b/rpython/jit/metainterp/optimizeopt/simplify.py similarity index 87% rename from pypy/jit/metainterp/optimizeopt/simplify.py rename to rpython/jit/metainterp/optimizeopt/simplify.py index 1a7e8986d755896ab85f630797ae4b913e69da79..ce4c2598d7d27199e2e7344a9fbfce61fed76307 100644 --- a/pypy/jit/metainterp/optimizeopt/simplify.py +++ b/rpython/jit/metainterp/optimizeopt/simplify.py @@ -1,7 +1,7 @@ -from pypy.jit.metainterp.optimizeopt.optimizer import Optimization -from pypy.jit.metainterp.optimizeopt.util import make_dispatcher_method -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.metainterp.history import TargetToken, JitCellToken +from rpython.jit.metainterp.optimizeopt.optimizer import Optimization +from rpython.jit.metainterp.optimizeopt.util import make_dispatcher_method +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.metainterp.history import TargetToken, JitCellToken class OptSimplify(Optimization): def __init__(self, unroll): diff --git a/pypy/jit/tl/__init__.py b/rpython/jit/metainterp/optimizeopt/test/__init__.py similarity index 100% rename from pypy/jit/tl/__init__.py rename to rpython/jit/metainterp/optimizeopt/test/__init__.py diff --git a/pypy/jit/metainterp/optimizeopt/test/test_disable_optimizations.py b/rpython/jit/metainterp/optimizeopt/test/test_disable_optimizations.py similarity index 88% rename from pypy/jit/metainterp/optimizeopt/test/test_disable_optimizations.py rename to rpython/jit/metainterp/optimizeopt/test/test_disable_optimizations.py index aa6aa04b09e7384f34a67816f4411c1c1fbc2982..c66a9cd5eed176feb176c589ef282eeb9b3dcf48 100644 --- a/pypy/jit/metainterp/optimizeopt/test/test_disable_optimizations.py +++ b/rpython/jit/metainterp/optimizeopt/test/test_disable_optimizations.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.optimizeopt.test.test_optimizeopt import OptimizeOptTest -from pypy.jit.metainterp.optimizeopt.test.test_util import LLtypeMixin -from pypy.jit.metainterp.resoperation import rop +from rpython.jit.metainterp.optimizeopt.test.test_optimizeopt import OptimizeOptTest +from rpython.jit.metainterp.optimizeopt.test.test_util import LLtypeMixin +from rpython.jit.metainterp.resoperation import rop allopts = OptimizeOptTest.enable_opts.split(':') diff --git a/pypy/jit/metainterp/optimizeopt/test/test_multilabel.py b/rpython/jit/metainterp/optimizeopt/test/test_multilabel.py similarity index 96% rename from pypy/jit/metainterp/optimizeopt/test/test_multilabel.py rename to rpython/jit/metainterp/optimizeopt/test/test_multilabel.py index 10b59af2cca25c183b4036548e0be30bf34f3bd1..0009ab6dd39e4b25bcecd3485559f7144e22f70a 100644 --- a/pypy/jit/metainterp/optimizeopt/test/test_multilabel.py +++ b/rpython/jit/metainterp/optimizeopt/test/test_multilabel.py @@ -1,13 +1,13 @@ from __future__ import with_statement -from pypy.jit.metainterp.optimizeopt.test.test_util import ( +from rpython.jit.metainterp.optimizeopt.test.test_util import ( LLtypeMixin, BaseTest, Storage, _sortboxes, FakeDescrWithSnapshot, FakeMetaInterpStaticData) -from pypy.jit.metainterp.history import TreeLoop, JitCellToken, TargetToken -from pypy.jit.metainterp.resoperation import rop, opname, ResOperation -from pypy.jit.metainterp.optimize import InvalidLoop +from rpython.jit.metainterp.history import TreeLoop, JitCellToken, TargetToken +from rpython.jit.metainterp.resoperation import rop, opname, ResOperation +from rpython.jit.metainterp.optimize import InvalidLoop from py.test import raises -from pypy.jit.metainterp.optimizeopt.optimizer import Optimization -from pypy.jit.metainterp.optimizeopt.util import make_dispatcher_method +from rpython.jit.metainterp.optimizeopt.optimizer import Optimization +from rpython.jit.metainterp.optimizeopt.util import make_dispatcher_method class BaseTestMultiLabel(BaseTest): enable_opts = "intbounds:rewrite:virtualize:string:earlyforce:pure:heap:unroll" @@ -494,9 +494,9 @@ dispatch_opt = make_dispatcher_method(OptRenameStrlen, 'optimize_', class BaseTestOptimizerRenamingBoxes(BaseTestMultiLabel): def _do_optimize_loop(self, loop, call_pure_results): - from pypy.jit.metainterp.optimizeopt.unroll import optimize_unroll - from pypy.jit.metainterp.optimizeopt.util import args_dict - from pypy.jit.metainterp.optimizeopt.pure import OptPure + from rpython.jit.metainterp.optimizeopt.unroll import optimize_unroll + from rpython.jit.metainterp.optimizeopt.util import args_dict + from rpython.jit.metainterp.optimizeopt.pure import OptPure self.loop = loop loop.call_pure_results = args_dict() diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py b/rpython/jit/metainterp/optimizeopt/test/test_optimizebasic.py similarity index 99% rename from pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py rename to rpython/jit/metainterp/optimizeopt/test/test_optimizebasic.py index fb4a1a5c57b2b9e578043bc47b2de6b830187447..3096aa2c0d243aca9e75e8ce525b533b3a101a2f 100644 --- a/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py +++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizebasic.py @@ -1,20 +1,20 @@ import py -from pypy.rlib.objectmodel import instantiate -from pypy.jit.metainterp.optimizeopt.test.test_util import ( +from rpython.rlib.objectmodel import instantiate +from rpython.jit.metainterp.optimizeopt.test.test_util import ( LLtypeMixin, BaseTest, FakeMetaInterpStaticData, convert_old_style_to_targets) -from pypy.jit.metainterp.history import TargetToken, JitCellToken -from pypy.jit.metainterp.test.test_compile import FakeLogger -import pypy.jit.metainterp.optimizeopt.optimizer as optimizeopt -import pypy.jit.metainterp.optimizeopt.virtualize as virtualize -from pypy.jit.metainterp.optimize import InvalidLoop -from pypy.jit.metainterp.history import AbstractDescr, ConstInt, BoxInt, get_const_ptr_for_string -from pypy.jit.metainterp import executor, compile, resume, history -from pypy.jit.metainterp.resoperation import rop, opname, ResOperation -from pypy.rlib.rarithmetic import LONG_BIT +from rpython.jit.metainterp.history import TargetToken, JitCellToken +from rpython.jit.metainterp.test.test_compile import FakeLogger +import rpython.jit.metainterp.optimizeopt.optimizer as optimizeopt +import rpython.jit.metainterp.optimizeopt.virtualize as virtualize +from rpython.jit.metainterp.optimize import InvalidLoop +from rpython.jit.metainterp.history import AbstractDescr, ConstInt, BoxInt, get_const_ptr_for_string +from rpython.jit.metainterp import executor, compile, resume, history +from rpython.jit.metainterp.resoperation import rop, opname, ResOperation +from rpython.rlib.rarithmetic import LONG_BIT def test_store_final_boxes_in_guard(): - from pypy.jit.metainterp.compile import ResumeGuardDescr - from pypy.jit.metainterp.resume import tag, TAGBOX + from rpython.jit.metainterp.compile import ResumeGuardDescr + from rpython.jit.metainterp.resume import tag, TAGBOX b0 = BoxInt() b1 = BoxInt() opt = optimizeopt.Optimizer(FakeMetaInterpStaticData(LLtypeMixin.cpu), @@ -81,7 +81,7 @@ def test_reuse_vinfo(): assert vinfo3 is vinfo4 def test_descrlist_dict(): - from pypy.jit.metainterp.optimizeopt import util as optimizeutil + from rpython.jit.metainterp.optimizeopt import util as optimizeutil h1 = optimizeutil.descrlist_hash([]) h2 = optimizeutil.descrlist_hash([LLtypeMixin.valuedescr]) h3 = optimizeutil.descrlist_hash( @@ -217,9 +217,9 @@ class BaseTestOptimizeBasic(BaseTestBasic): self.optimize_loop(ops, expected) def test_constfold_all(self): - from pypy.jit.backend.llgraph.llimpl import TYPES # xxx fish - from pypy.jit.metainterp.executor import execute_nonspec - from pypy.jit.metainterp.history import BoxInt + from rpython.jit.backend.llgraph.llimpl import TYPES # xxx fish + from rpython.jit.metainterp.executor import execute_nonspec + from rpython.jit.metainterp.history import BoxInt import random for opnum in range(rop.INT_ADD, rop.SAME_AS+1): try: @@ -2490,8 +2490,8 @@ class BaseTestOptimizeBasic(BaseTestBasic): index += 1 def check_expanded_fail_descr(self, expectedtext, guard_opnum): - from pypy.jit.metainterp.test.test_resume import ResumeDataFakeReader - from pypy.jit.metainterp.test.test_resume import MyMetaInterp + from rpython.jit.metainterp.test.test_resume import ResumeDataFakeReader + from rpython.jit.metainterp.test.test_resume import MyMetaInterp guard_op, = [op for op in self.loop.operations if op.is_guard()] fail_args = guard_op.getfailargs() fdescr = guard_op.getdescr() diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py similarity index 99% rename from pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py rename to rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py index 704bba77a070bf5a7d247f5e33e3466296de047e..6c64f7c758fade1ce5817d705db265c85134ad68 100644 --- a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py +++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py @@ -1,21 +1,21 @@ import py -from pypy.rlib.objectmodel import instantiate -from pypy.jit.metainterp.optimizeopt.test.test_util import ( +from rpython.rlib.objectmodel import instantiate +from rpython.jit.metainterp.optimizeopt.test.test_util import ( LLtypeMixin, BaseTest, Storage, _sortboxes, convert_old_style_to_targets) -import pypy.jit.metainterp.optimizeopt.optimizer as optimizeopt -import pypy.jit.metainterp.optimizeopt.virtualize as virtualize -from pypy.jit.metainterp.optimizeopt import ALL_OPTS_DICT, build_opt_chain -from pypy.jit.metainterp.optimize import InvalidLoop -from pypy.jit.metainterp.history import AbstractDescr, ConstInt, BoxInt -from pypy.jit.metainterp.history import TreeLoop, JitCellToken, TargetToken -from pypy.jit.metainterp.jitprof import EmptyProfiler -from pypy.jit.metainterp import executor, compile, resume, history -from pypy.jit.metainterp.resoperation import rop, opname, ResOperation -from pypy.jit.tool.oparser import pure_parse -from pypy.jit.metainterp.optimizeopt.util import args_dict -from pypy.jit.metainterp.optimizeopt.test.test_optimizebasic import FakeMetaInterpStaticData +import rpython.jit.metainterp.optimizeopt.optimizer as optimizeopt +import rpython.jit.metainterp.optimizeopt.virtualize as virtualize +from rpython.jit.metainterp.optimizeopt import ALL_OPTS_DICT, build_opt_chain +from rpython.jit.metainterp.optimize import InvalidLoop +from rpython.jit.metainterp.history import AbstractDescr, ConstInt, BoxInt +from rpython.jit.metainterp.history import TreeLoop, JitCellToken, TargetToken +from rpython.jit.metainterp.jitprof import EmptyProfiler +from rpython.jit.metainterp import executor, compile, resume, history +from rpython.jit.metainterp.resoperation import rop, opname, ResOperation +from rpython.jit.tool.oparser import pure_parse +from rpython.jit.metainterp.optimizeopt.util import args_dict +from rpython.jit.metainterp.optimizeopt.test.test_optimizebasic import FakeMetaInterpStaticData from pypy.config.pypyoption import get_pypy_config -from pypy.jit.metainterp.optimizeopt.unroll import Inliner +from rpython.jit.metainterp.optimizeopt.unroll import Inliner def test_build_opt_chain(): def check(chain, expected_names): @@ -185,9 +185,9 @@ class OptimizeOptTest(BaseTestWithUnroll): self.optimize_loop(ops, expected) def test_constfold_all(self): - from pypy.jit.backend.llgraph.llimpl import TYPES # xxx fish - from pypy.jit.metainterp.executor import execute_nonspec - from pypy.jit.metainterp.history import BoxInt + from rpython.jit.backend.llgraph.llimpl import TYPES # xxx fish + from rpython.jit.metainterp.executor import execute_nonspec + from rpython.jit.metainterp.history import BoxInt import random for opnum in range(rop.INT_ADD, rop.SAME_AS+1): try: @@ -4398,7 +4398,7 @@ class OptimizeOptTest(BaseTestWithUnroll): self.optimize_loop(ops, expected) def test_complains_getfieldpure_setfield(self): - from pypy.jit.metainterp.optimizeopt.heap import BogusPureField + from rpython.jit.metainterp.optimizeopt.heap import BogusPureField ops = """ [p3] p1 = escape() @@ -5503,7 +5503,7 @@ class OptimizeOptTest(BaseTestWithUnroll): escape(p0) jump() """ - from pypy.rpython.lltypesystem import lltype, llmemory + from rpython.rtyper.lltypesystem import lltype, llmemory class IntObj1242(object): _TYPE = llmemory.GCREF.TO def __eq__(self, other): @@ -5560,7 +5560,7 @@ class OptimizeOptTest(BaseTestWithUnroll): escape(p0) jump() """ - from pypy.rpython.lltypesystem import lltype, llmemory + from rpython.rtyper.lltypesystem import lltype, llmemory class PtrObjSelf(object): _TYPE = llmemory.GCREF.TO def __eq__(slf, other): diff --git a/pypy/jit/metainterp/optimizeopt/test/test_util.py b/rpython/jit/metainterp/optimizeopt/test/test_util.py similarity index 93% rename from pypy/jit/metainterp/optimizeopt/test/test_util.py rename to rpython/jit/metainterp/optimizeopt/test/test_util.py index 921ab95083d24012787e255f7e98c2616cb24c5f..e40a43c0f4e81329550d8041471f3eeed0a9db43 100644 --- a/pypy/jit/metainterp/optimizeopt/test/test_util.py +++ b/rpython/jit/metainterp/optimizeopt/test/test_util.py @@ -1,26 +1,26 @@ import py, random -from pypy.rpython.lltypesystem import lltype, llmemory, rclass, rstr -from pypy.rpython.ootypesystem import ootype -from pypy.rpython.lltypesystem.rclass import OBJECT, OBJECT_VTABLE -from pypy.rpython.rclass import FieldListAccessor, IR_QUASIIMMUTABLE +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass, rstr +from rpython.rtyper.ootypesystem import ootype +from rpython.rtyper.lltypesystem.rclass import OBJECT, OBJECT_VTABLE +from rpython.rtyper.rclass import FieldListAccessor, IR_QUASIIMMUTABLE -from pypy.jit.backend.llgraph import runner -from pypy.jit.metainterp.history import (BoxInt, BoxPtr, ConstInt, ConstPtr, +from rpython.jit.backend.llgraph import runner +from rpython.jit.metainterp.history import (BoxInt, BoxPtr, ConstInt, ConstPtr, Const, TreeLoop, BoxObj, ConstObj, AbstractDescr, JitCellToken, TargetToken) -from pypy.jit.metainterp.optimizeopt.util import sort_descrs, equaloplists -from pypy.jit.metainterp.optimize import InvalidLoop -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.codewriter.heaptracker import register_known_gctype, adr2int -from pypy.jit.tool.oparser import parse, pure_parse -from pypy.jit.metainterp.quasiimmut import QuasiImmutDescr -from pypy.jit.metainterp import compile, resume, history -from pypy.jit.metainterp.jitprof import EmptyProfiler +from rpython.jit.metainterp.optimizeopt.util import sort_descrs, equaloplists +from rpython.jit.metainterp.optimize import InvalidLoop +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.codewriter.heaptracker import register_known_gctype, adr2int +from rpython.jit.tool.oparser import parse, pure_parse +from rpython.jit.metainterp.quasiimmut import QuasiImmutDescr +from rpython.jit.metainterp import compile, resume, history +from rpython.jit.metainterp.jitprof import EmptyProfiler from pypy.config.pypyoption import get_pypy_config -from pypy.jit.metainterp.resoperation import rop, opname, ResOperation -from pypy.jit.metainterp.optimizeopt.unroll import Inliner +from rpython.jit.metainterp.resoperation import rop, opname, ResOperation +from rpython.jit.metainterp.optimizeopt.unroll import Inliner def test_sort_descrs(): class PseudoDescr(AbstractDescr): @@ -240,7 +240,7 @@ class LLtypeMixin(object): pass asmdescr = LoopToken() # it can be whatever, it's not a descr though - from pypy.jit.metainterp.virtualref import VirtualRefInfo + from rpython.jit.metainterp.virtualref import VirtualRefInfo class FakeWarmRunnerDesc: pass FakeWarmRunnerDesc.cpu = cpu @@ -392,7 +392,7 @@ class BaseTest(object): return descr def assert_equal(self, optimized, expected, text_right=None): - from pypy.jit.metainterp.optimizeopt.util import equaloplists + from rpython.jit.metainterp.optimizeopt.util import equaloplists assert len(optimized.inputargs) == len(expected.inputargs) remap = {} for box1, box2 in zip(optimized.inputargs, expected.inputargs): @@ -402,8 +402,8 @@ class BaseTest(object): expected.operations, False, remap, text_right) def _do_optimize_loop(self, loop, call_pure_results): - from pypy.jit.metainterp.optimizeopt import optimize_trace - from pypy.jit.metainterp.optimizeopt.util import args_dict + from rpython.jit.metainterp.optimizeopt import optimize_trace + from rpython.jit.metainterp.optimizeopt.util import args_dict self.loop = loop loop.call_pure_results = args_dict() diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py b/rpython/jit/metainterp/optimizeopt/unroll.py similarity index 97% rename from pypy/jit/metainterp/optimizeopt/unroll.py rename to rpython/jit/metainterp/optimizeopt/unroll.py index 2f307d581db3f5f884cfc79fb60438870b3a25ae..2b0744efbac11ff53627d83704ceff4037bb8319 100644 --- a/pypy/jit/metainterp/optimizeopt/unroll.py +++ b/rpython/jit/metainterp/optimizeopt/unroll.py @@ -1,15 +1,15 @@ -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.metainterp.optimizeopt.virtualstate import VirtualStateAdder, ShortBoxes, BadVirtualState -from pypy.jit.metainterp.compile import ResumeGuardDescr -from pypy.jit.metainterp.history import TreeLoop, TargetToken, JitCellToken -from pypy.jit.metainterp.jitexc import JitException -from pypy.jit.metainterp.optimize import InvalidLoop -from pypy.rlib.debug import debug_print, debug_start, debug_stop -from pypy.jit.metainterp.optimizeopt.optimizer import * -from pypy.jit.metainterp.optimizeopt.generalize import KillHugeIntBounds -from pypy.jit.metainterp.inliner import Inliner -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.jit.metainterp.resume import Snapshot +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.metainterp.optimizeopt.virtualstate import VirtualStateAdder, ShortBoxes, BadVirtualState +from rpython.jit.metainterp.compile import ResumeGuardDescr +from rpython.jit.metainterp.history import TreeLoop, TargetToken, JitCellToken +from rpython.jit.metainterp.jitexc import JitException +from rpython.jit.metainterp.optimize import InvalidLoop +from rpython.rlib.debug import debug_print, debug_start, debug_stop +from rpython.jit.metainterp.optimizeopt.optimizer import * +from rpython.jit.metainterp.optimizeopt.generalize import KillHugeIntBounds +from rpython.jit.metainterp.inliner import Inliner +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.jit.metainterp.resume import Snapshot import sys, os # FIXME: Introduce some VirtualOptimizer super class instead diff --git a/pypy/jit/metainterp/optimizeopt/util.py b/rpython/jit/metainterp/optimizeopt/util.py similarity index 94% rename from pypy/jit/metainterp/optimizeopt/util.py rename to rpython/jit/metainterp/optimizeopt/util.py index 43504c96eba22c397f752ba753aaa884ee693875..2f16543a91fcb50908efb6ad8fa6c5e5a10f80d2 100644 --- a/pypy/jit/metainterp/optimizeopt/util.py +++ b/rpython/jit/metainterp/optimizeopt/util.py @@ -1,11 +1,11 @@ import py -from pypy.rlib.objectmodel import r_dict, compute_identity_hash -from pypy.rlib.rarithmetic import intmask -from pypy.rlib.unroll import unrolling_iterable -from pypy.jit.metainterp import resoperation -from pypy.rlib.debug import make_sure_not_resized -from pypy.jit.metainterp.resoperation import rop -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.objectmodel import r_dict, compute_identity_hash +from rpython.rlib.rarithmetic import intmask +from rpython.rlib.unroll import unrolling_iterable +from rpython.jit.metainterp import resoperation +from rpython.rlib.debug import make_sure_not_resized +from rpython.jit.metainterp.resoperation import rop +from rpython.rlib.objectmodel import we_are_translated # ____________________________________________________________ # Misc. utilities diff --git a/pypy/jit/metainterp/optimizeopt/virtualize.py b/rpython/jit/metainterp/optimizeopt/virtualize.py similarity index 97% rename from pypy/jit/metainterp/optimizeopt/virtualize.py rename to rpython/jit/metainterp/optimizeopt/virtualize.py index d0b9001e27a0c346b1201a7c98afc26c5271a0bd..6fb43bd2b4c0c719d5181f765c1a3cb9fc9139b2 100644 --- a/pypy/jit/metainterp/optimizeopt/virtualize.py +++ b/rpython/jit/metainterp/optimizeopt/virtualize.py @@ -1,12 +1,12 @@ -from pypy.jit.codewriter.heaptracker import vtable2descr -from pypy.jit.metainterp.executor import execute -from pypy.jit.metainterp.history import Const, ConstInt, BoxInt -from pypy.jit.metainterp.optimizeopt import optimizer -from pypy.jit.metainterp.optimizeopt.util import (make_dispatcher_method, +from rpython.jit.codewriter.heaptracker import vtable2descr +from rpython.jit.metainterp.executor import execute +from rpython.jit.metainterp.history import Const, ConstInt, BoxInt +from rpython.jit.metainterp.optimizeopt import optimizer +from rpython.jit.metainterp.optimizeopt.util import (make_dispatcher_method, descrlist_dict, sort_descrs) -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.rlib.objectmodel import we_are_translated -from pypy.jit.metainterp.optimizeopt.optimizer import OptValue +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.rlib.objectmodel import we_are_translated +from rpython.jit.metainterp.optimizeopt.optimizer import OptValue class AbstractVirtualValue(optimizer.OptValue): diff --git a/pypy/jit/metainterp/optimizeopt/virtualstate.py b/rpython/jit/metainterp/optimizeopt/virtualstate.py similarity index 97% rename from pypy/jit/metainterp/optimizeopt/virtualstate.py rename to rpython/jit/metainterp/optimizeopt/virtualstate.py index aa240eb0d841c1ccf7fd2a81031e4e069279209c..74d637fb5036b98b34b1d5635cf76eaa08014292 100644 --- a/pypy/jit/metainterp/optimizeopt/virtualstate.py +++ b/rpython/jit/metainterp/optimizeopt/virtualstate.py @@ -1,17 +1,17 @@ -from pypy.jit.metainterp import resume -from pypy.jit.metainterp.optimizeopt import virtualize -from pypy.jit.metainterp.optimizeopt.optimizer import LEVEL_CONSTANT, \ +from rpython.jit.metainterp import resume +from rpython.jit.metainterp.optimizeopt import virtualize +from rpython.jit.metainterp.optimizeopt.optimizer import LEVEL_CONSTANT, \ LEVEL_KNOWNCLASS, \ LEVEL_NONNULL, \ LEVEL_UNKNOWN, \ MININT, MAXINT, OptValue -from pypy.jit.metainterp.history import BoxInt, ConstInt, BoxPtr, Const -from pypy.jit.metainterp.optimize import InvalidLoop -from pypy.jit.metainterp.optimizeopt.intutils import IntBound, IntUnbounded -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.debug import debug_start, debug_stop, debug_print -from pypy.rlib.objectmodel import we_are_translated +from rpython.jit.metainterp.history import BoxInt, ConstInt, BoxPtr, Const +from rpython.jit.metainterp.optimize import InvalidLoop +from rpython.jit.metainterp.optimizeopt.intutils import IntBound, IntUnbounded +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.debug import debug_start, debug_stop, debug_print +from rpython.rlib.objectmodel import we_are_translated import os class BadVirtualState(Exception): diff --git a/pypy/jit/metainterp/optimizeopt/vstring.py b/rpython/jit/metainterp/optimizeopt/vstring.py similarity index 97% rename from pypy/jit/metainterp/optimizeopt/vstring.py rename to rpython/jit/metainterp/optimizeopt/vstring.py index 12f11d98afb30db7e31bfd405ef72c5dc950b43c..0021b5033dd159b69eb58aa6d439647ad7e9f8af 100644 --- a/pypy/jit/metainterp/optimizeopt/vstring.py +++ b/rpython/jit/metainterp/optimizeopt/vstring.py @@ -1,16 +1,16 @@ -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.jit.metainterp.history import (BoxInt, Const, ConstInt, ConstPtr, +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.jit.metainterp.history import (BoxInt, Const, ConstInt, ConstPtr, get_const_ptr_for_string, get_const_ptr_for_unicode, BoxPtr, REF, INT) -from pypy.jit.metainterp.optimizeopt import optimizer, virtualize -from pypy.jit.metainterp.optimizeopt.optimizer import CONST_0, CONST_1 -from pypy.jit.metainterp.optimizeopt.optimizer import llhelper, REMOVED -from pypy.jit.metainterp.optimizeopt.util import make_dispatcher_method -from pypy.jit.metainterp.resoperation import rop, ResOperation -from pypy.rlib.objectmodel import specialize, we_are_translated -from pypy.rlib.unroll import unrolling_iterable -from pypy.rpython import annlowlevel -from pypy.rpython.lltypesystem import lltype, rstr -from pypy.rlib.rarithmetic import is_valid_int +from rpython.jit.metainterp.optimizeopt import optimizer, virtualize +from rpython.jit.metainterp.optimizeopt.optimizer import CONST_0, CONST_1 +from rpython.jit.metainterp.optimizeopt.optimizer import llhelper, REMOVED +from rpython.jit.metainterp.optimizeopt.util import make_dispatcher_method +from rpython.jit.metainterp.resoperation import rop, ResOperation +from rpython.rlib.objectmodel import specialize, we_are_translated +from rpython.rlib.unroll import unrolling_iterable +from rpython.rtyper import annlowlevel +from rpython.rtyper.lltypesystem import lltype, rstr +from rpython.rlib.rarithmetic import is_valid_int MAX_CONST_LEN = 100 diff --git a/pypy/jit/metainterp/pyjitpl.py b/rpython/jit/metainterp/pyjitpl.py similarity index 98% rename from pypy/jit/metainterp/pyjitpl.py rename to rpython/jit/metainterp/pyjitpl.py index 93520646926a15cb06f1b8308042b88d0f989398..cbe791035fd820b72d0c898368da66f75522ed9e 100644 --- a/pypy/jit/metainterp/pyjitpl.py +++ b/rpython/jit/metainterp/pyjitpl.py @@ -1,25 +1,25 @@ import py, sys -from pypy.rpython.lltypesystem import lltype, rclass -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.unroll import unrolling_iterable -from pypy.rlib.debug import debug_start, debug_stop, debug_print -from pypy.rlib.debug import make_sure_not_resized -from pypy.rlib import nonconst, rstack - -from pypy.jit.metainterp import history, compile, resume -from pypy.jit.metainterp.history import Const, ConstInt, ConstPtr, ConstFloat -from pypy.jit.metainterp.history import Box, TargetToken -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.metainterp import executor -from pypy.jit.metainterp.logger import Logger -from pypy.jit.metainterp.jitprof import EmptyProfiler -from pypy.rlib.jit import Counters -from pypy.jit.metainterp.jitexc import JitException, get_llexception -from pypy.jit.metainterp.heapcache import HeapCache -from pypy.rlib.objectmodel import specialize -from pypy.jit.codewriter.jitcode import JitCode, SwitchDictDescr -from pypy.jit.codewriter import heaptracker -from pypy.jit.metainterp.optimizeopt.util import args_dict_box +from rpython.rtyper.lltypesystem import lltype, rclass +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.unroll import unrolling_iterable +from rpython.rlib.debug import debug_start, debug_stop, debug_print +from rpython.rlib.debug import make_sure_not_resized +from rpython.rlib import nonconst, rstack + +from rpython.jit.metainterp import history, compile, resume +from rpython.jit.metainterp.history import Const, ConstInt, ConstPtr, ConstFloat +from rpython.jit.metainterp.history import Box, TargetToken +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.metainterp import executor +from rpython.jit.metainterp.logger import Logger +from rpython.jit.metainterp.jitprof import EmptyProfiler +from rpython.rlib.jit import Counters +from rpython.jit.metainterp.jitexc import JitException, get_llexception +from rpython.jit.metainterp.heapcache import HeapCache +from rpython.rlib.objectmodel import specialize +from rpython.jit.codewriter.jitcode import JitCode, SwitchDictDescr +from rpython.jit.codewriter import heaptracker +from rpython.jit.metainterp.optimizeopt.util import args_dict_box # ____________________________________________________________ @@ -244,7 +244,7 @@ class MIFrame(object): @arguments("box", "box") def opimpl_record_known_class(self, box, clsbox): - from pypy.rpython.lltypesystem import llmemory + from rpython.rtyper.lltypesystem import llmemory if self.metainterp.heapcache.is_class_known(box): return adr = clsbox.getaddr() @@ -673,7 +673,7 @@ class MIFrame(object): @arguments("box", "descr", "descr", "orgpc") def opimpl_record_quasiimmut_field(self, box, fielddescr, mutatefielddescr, orgpc): - from pypy.jit.metainterp.quasiimmut import QuasiImmutDescr + from rpython.jit.metainterp.quasiimmut import QuasiImmutDescr cpu = self.metainterp.cpu descr = QuasiImmutDescr(cpu, box, fielddescr, mutatefielddescr) self.metainterp.history.record(rop.QUASIIMMUT_FIELD, [box], @@ -693,7 +693,7 @@ class MIFrame(object): mutatebox = self.execute_with_descr(rop.GETFIELD_GC, mutatefielddescr, box) if mutatebox.nonnull(): - from pypy.jit.metainterp.quasiimmut import do_force_quasi_immutable + from rpython.jit.metainterp.quasiimmut import do_force_quasi_immutable do_force_quasi_immutable(self.metainterp.cpu, box.getref_base(), mutatefielddescr) raise SwitchToBlackhole(Counters.ABORT_FORCE_QUASIIMMUT) @@ -1080,14 +1080,14 @@ class MIFrame(object): @arguments("box") def opimpl_debug_fatalerror(self, box): - from pypy.rpython.lltypesystem import rstr, lloperation + from rpython.rtyper.lltypesystem import rstr, lloperation msg = box.getref(lltype.Ptr(rstr.STR)) lloperation.llop.debug_fatalerror(msg) @arguments("box", "box", "box", "box", "box") def opimpl_jit_debug(self, stringbox, arg1box, arg2box, arg3box, arg4box): - from pypy.rpython.lltypesystem import rstr - from pypy.rpython.annlowlevel import hlstr + from rpython.rtyper.lltypesystem import rstr + from rpython.rtyper.annlowlevel import hlstr msg = stringbox.getref(lltype.Ptr(rstr.STR)) debug_print('jit_debug:', hlstr(msg), arg1box.getint(), arg2box.getint(), @@ -1107,11 +1107,11 @@ class MIFrame(object): self.jitcode.name, self.pc) if we_are_translated(): - from pypy.rpython.annlowlevel import llstr - from pypy.rpython.lltypesystem import lloperation + from rpython.rtyper.annlowlevel import llstr + from rpython.rtyper.lltypesystem import lloperation lloperation.llop.debug_fatalerror(lltype.Void, llstr(msg)) else: - from pypy.rlib.jit import AssertGreenFailed + from rpython.rlib.jit import AssertGreenFailed raise AssertGreenFailed(msg) opimpl_int_assert_green = _opimpl_assert_green @@ -1444,7 +1444,7 @@ class MetaInterpStaticData(object): self._addr2name_values = [value for key, value in list_of_addr2name] def finish_setup(self, codewriter, optimizer=None): - from pypy.jit.metainterp.blackhole import BlackholeInterpBuilder + from rpython.jit.metainterp.blackhole import BlackholeInterpBuilder self.blackholeinterpbuilder = BlackholeInterpBuilder(codewriter, self) # asm = codewriter.assembler @@ -1924,7 +1924,7 @@ class MetaInterp(object): # We got a SwitchToBlackhole exception. Convert the framestack into # a stack of blackhole interpreters filled with the same values, and # run it. - from pypy.jit.metainterp.blackhole import convert_and_run_from_pyjitpl + from rpython.jit.metainterp.blackhole import convert_and_run_from_pyjitpl self.aborted_tracing(stb.reason) convert_and_run_from_pyjitpl(self, stb.raising_exception) assert False # ^^^ must raise @@ -2086,7 +2086,7 @@ class MetaInterp(object): elif opnum == rop.GUARD_OVERFLOW: # no longer overflowing self.clear_exception() else: - from pypy.jit.metainterp.resoperation import opname + from rpython.jit.metainterp.resoperation import opname raise NotImplementedError(opname[opnum]) def get_procedure_token(self, greenkey, with_compiled_targets=False): @@ -2207,7 +2207,7 @@ class MetaInterp(object): def _fill_original_boxes(self, jitdriver_sd, original_boxes, num_green_args, *args): if args: - from pypy.jit.metainterp.warmstate import wrap + from rpython.jit.metainterp.warmstate import wrap box = wrap(self.cpu, args[0], num_green_args > 0) original_boxes.append(box) self._fill_original_boxes(jitdriver_sd, original_boxes, @@ -2529,9 +2529,9 @@ class MetaInterp(object): # if the codewriter didn't produce any OS_LIBFFI_CALL at all. assert self.staticdata.has_libffi_call # - from pypy.rpython.lltypesystem import llmemory - from pypy.rlib.jit_libffi import CIF_DESCRIPTION_P - from pypy.jit.backend.llsupport.ffisupport import get_arg_descr + from rpython.rtyper.lltypesystem import llmemory + from rpython.rlib.jit_libffi import CIF_DESCRIPTION_P + from rpython.jit.backend.llsupport.ffisupport import get_arg_descr # num_extra_guards = 0 while True: @@ -2622,7 +2622,7 @@ class SwitchToBlackhole(JitException): # ____________________________________________________________ def _get_opimpl_method(name, argcodes): - from pypy.jit.metainterp.blackhole import signedord + from rpython.jit.metainterp.blackhole import signedord # def handler(self, position): assert position >= 0 diff --git a/pypy/jit/metainterp/quasiimmut.py b/rpython/jit/metainterp/quasiimmut.py similarity index 93% rename from pypy/jit/metainterp/quasiimmut.py rename to rpython/jit/metainterp/quasiimmut.py index 90eba75f068a207673bfcea207598bc8e191b384..b64113d813479719b53c2458f968bc0bde1d245c 100644 --- a/pypy/jit/metainterp/quasiimmut.py +++ b/rpython/jit/metainterp/quasiimmut.py @@ -1,8 +1,8 @@ import weakref -from pypy.rpython.lltypesystem import lltype, rclass -from pypy.rpython.annlowlevel import cast_base_ptr_to_instance -from pypy.jit.metainterp.history import AbstractDescr -from pypy.rlib.objectmodel import we_are_translated +from rpython.rtyper.lltypesystem import lltype, rclass +from rpython.rtyper.annlowlevel import cast_base_ptr_to_instance +from rpython.jit.metainterp.history import AbstractDescr +from rpython.rlib.objectmodel import we_are_translated def get_mutate_field_name(fieldname): @@ -114,8 +114,8 @@ class QuasiImmutDescr(AbstractDescr): self.constantfieldbox = self.get_current_constant_fieldvalue() def get_current_constant_fieldvalue(self): - from pypy.jit.metainterp import executor - from pypy.jit.metainterp.resoperation import rop + from rpython.jit.metainterp import executor + from rpython.jit.metainterp.resoperation import rop fieldbox = executor.execute(self.cpu, None, rop.GETFIELD_GC, self.fielddescr, self.structbox) return fieldbox.constbox() diff --git a/pypy/jit/metainterp/resoperation.py b/rpython/jit/metainterp/resoperation.py similarity index 99% rename from pypy/jit/metainterp/resoperation.py rename to rpython/jit/metainterp/resoperation.py index 7edb91386825af5a70ddb292992e8e1d4be59481..20074be2dfef17f241fc88af2af5faf07f8f7c2d 100644 --- a/pypy/jit/metainterp/resoperation.py +++ b/rpython/jit/metainterp/resoperation.py @@ -1,4 +1,4 @@ -from pypy.rlib.objectmodel import we_are_translated +from rpython.rlib.objectmodel import we_are_translated def ResOperation(opnum, args, result, descr=None): cls = opclasses[opnum] @@ -205,7 +205,7 @@ class ResOpWithDescr(AbstractResOp): def _check_descr(self, descr): if not we_are_translated() and getattr(descr, 'I_am_a_descr', False): return # needed for the mock case in oparser_model - from pypy.jit.metainterp.history import check_descr + from rpython.jit.metainterp.history import check_descr check_descr(descr) diff --git a/pypy/jit/metainterp/resume.py b/rpython/jit/metainterp/resume.py similarity index 97% rename from pypy/jit/metainterp/resume.py rename to rpython/jit/metainterp/resume.py index 5e587d5757aa8361174a9ffdd0a62cf2cadb0cfc..bfa93c7c0be049b855a8c339cbdf6c23588ca7fe 100644 --- a/pypy/jit/metainterp/resume.py +++ b/rpython/jit/metainterp/resume.py @@ -1,19 +1,19 @@ import sys, os -from pypy.jit.metainterp.history import Box, Const, ConstInt, getkind -from pypy.jit.metainterp.history import BoxInt, BoxPtr, BoxFloat -from pypy.jit.metainterp.history import INT, REF, FLOAT, HOLE -from pypy.jit.metainterp.history import AbstractDescr -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.metainterp import jitprof -from pypy.jit.codewriter.effectinfo import EffectInfo -from pypy.rpython.lltypesystem import lltype, llmemory, rffi, rstr -from pypy.rpython import annlowlevel -from pypy.rlib import rarithmetic, rstack -from pypy.rlib.objectmodel import we_are_translated, specialize -from pypy.rlib.objectmodel import compute_unique_id -from pypy.rlib.debug import have_debug_prints, ll_assert -from pypy.rlib.debug import debug_start, debug_stop, debug_print -from pypy.jit.metainterp.optimize import InvalidLoop +from rpython.jit.metainterp.history import Box, Const, ConstInt, getkind +from rpython.jit.metainterp.history import BoxInt, BoxPtr, BoxFloat +from rpython.jit.metainterp.history import INT, REF, FLOAT, HOLE +from rpython.jit.metainterp.history import AbstractDescr +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.metainterp import jitprof +from rpython.jit.codewriter.effectinfo import EffectInfo +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi, rstr +from rpython.rtyper import annlowlevel +from rpython.rlib import rarithmetic, rstack +from rpython.rlib.objectmodel import we_are_translated, specialize +from rpython.rlib.objectmodel import compute_unique_id +from rpython.rlib.debug import have_debug_prints, ll_assert +from rpython.rlib.debug import debug_start, debug_stop, debug_print +from rpython.jit.metainterp.optimize import InvalidLoop # Logic to encode the chain of frames and the state of the boxes at a # guard operation, and to decode it again. This is a bit advanced, @@ -751,7 +751,7 @@ class AbstractResumeDataReader(object): def _prepare_next_section(self, info): # Use info.enumerate_vars(), normally dispatching to - # pypy.jit.codewriter.jitcode. Some tests give a different 'info'. + # rpython.jit.codewriter.jitcode. Some tests give a different 'info'. info.enumerate_vars(self._callback_i, self._callback_r, self._callback_f, @@ -1114,7 +1114,7 @@ class ResumeDataDirectReader(AbstractResumeDataReader): return vinfo.write_from_resume_data_partial(virtualizable, self, numb) def load_value_of_type(self, TYPE, tagged): - from pypy.jit.metainterp.warmstate import specialize_value + from rpython.jit.metainterp.warmstate import specialize_value kind = getkind(TYPE) if kind == 'int': x = self.decode_int(tagged) @@ -1136,7 +1136,7 @@ class ResumeDataDirectReader(AbstractResumeDataReader): self.consume_virtualref_info(vrefinfo, numb, end_vref) def allocate_with_vtable(self, known_class): - from pypy.jit.metainterp.executor import exec_new_with_vtable + from rpython.jit.metainterp.executor import exec_new_with_vtable return exec_new_with_vtable(self.cpu, known_class) def allocate_struct(self, typedescr): diff --git a/pypy/jit/tl/spli/__init__.py b/rpython/jit/metainterp/test/__init__.py similarity index 100% rename from pypy/jit/tl/spli/__init__.py rename to rpython/jit/metainterp/test/__init__.py diff --git a/pypy/jit/metainterp/test/support.py b/rpython/jit/metainterp/test/support.py similarity index 92% rename from pypy/jit/metainterp/test/support.py rename to rpython/jit/metainterp/test/support.py index 6f7339207282ad3e727c806932087af4a651b647..eae87a5a0e2a853141b9017c0bd09fbedbccc137 100644 --- a/pypy/jit/metainterp/test/support.py +++ b/rpython/jit/metainterp/test/support.py @@ -1,21 +1,21 @@ import py, sys -from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.rpython.ootypesystem import ootype -from pypy.jit.backend.llgraph import runner -from pypy.jit.metainterp.warmspot import ll_meta_interp, get_stats -from pypy.jit.metainterp.warmstate import unspecialize_value -from pypy.jit.metainterp.optimizeopt import ALL_OPTS_DICT -from pypy.jit.metainterp import pyjitpl, history -from pypy.jit.codewriter.policy import JitPolicy -from pypy.jit.codewriter import codewriter, longlong -from pypy.rlib.rfloat import isnan -from pypy.translator.backendopt.all import backend_optimizations +from rpython.rtyper.lltypesystem import lltype, llmemory +from rpython.rtyper.ootypesystem import ootype +from rpython.jit.backend.llgraph import runner +from rpython.jit.metainterp.warmspot import ll_meta_interp, get_stats +from rpython.jit.metainterp.warmstate import unspecialize_value +from rpython.jit.metainterp.optimizeopt import ALL_OPTS_DICT +from rpython.jit.metainterp import pyjitpl, history +from rpython.jit.codewriter.policy import JitPolicy +from rpython.jit.codewriter import codewriter, longlong +from rpython.rlib.rfloat import isnan +from rpython.translator.backendopt.all import backend_optimizations def _get_jitcodes(testself, CPUClass, func, values, type_system, supports_longlong=False, translationoptions={}, **kwds): - from pypy.jit.codewriter import support + from rpython.jit.codewriter import support class FakeJitCell(object): __product_token = None @@ -30,7 +30,7 @@ def _get_jitcodes(testself, CPUClass, func, values, type_system, cell.set_procedure_token(procedure_token) def helper_func(self, FUNCPTR, func): - from pypy.rpython.annlowlevel import llhelper + from rpython.rtyper.annlowlevel import llhelper return llhelper(FUNCPTR, func) def get_location_str(self, args): @@ -83,7 +83,7 @@ def _get_jitcodes(testself, CPUClass, func, values, type_system, cw.make_jitcodes(verbose=True) def _run_with_blackhole(testself, args): - from pypy.jit.metainterp.blackhole import BlackholeInterpBuilder + from rpython.jit.metainterp.blackhole import BlackholeInterpBuilder cw = testself.cw blackholeinterpbuilder = BlackholeInterpBuilder(cw) blackholeinterp = blackholeinterpbuilder.acquire_interp() diff --git a/pypy/jit/metainterp/test/test_ajit.py b/rpython/jit/metainterp/test/test_ajit.py similarity index 97% rename from pypy/jit/metainterp/test/test_ajit.py rename to rpython/jit/metainterp/test/test_ajit.py index 87ffecdf405b6b7c1cd64d6e3ab50131f074f07a..928d02a7b6498c2ff92253eb51ca5597c2dbbd63 100644 --- a/pypy/jit/metainterp/test/test_ajit.py +++ b/rpython/jit/metainterp/test/test_ajit.py @@ -4,22 +4,22 @@ import sys import py from pypy import conftest -from pypy.jit.codewriter import longlong -from pypy.jit.codewriter.policy import JitPolicy, StopAtXPolicy -from pypy.jit.metainterp import pyjitpl, history -from pypy.jit.metainterp.optimizeopt import ALL_OPTS_DICT -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin, noConst -from pypy.jit.metainterp.typesystem import LLTypeHelper, OOTypeHelper -from pypy.jit.metainterp.warmspot import get_stats -from pypy.rlib import rerased -from pypy.rlib.jit import (JitDriver, we_are_jitted, hint, dont_look_inside, +from rpython.jit.codewriter import longlong +from rpython.jit.codewriter.policy import JitPolicy, StopAtXPolicy +from rpython.jit.metainterp import pyjitpl, history +from rpython.jit.metainterp.optimizeopt import ALL_OPTS_DICT +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin, noConst +from rpython.jit.metainterp.typesystem import LLTypeHelper, OOTypeHelper +from rpython.jit.metainterp.warmspot import get_stats +from rpython.rlib import rerased +from rpython.rlib.jit import (JitDriver, we_are_jitted, hint, dont_look_inside, loop_invariant, elidable, promote, jit_debug, assert_green, AssertGreenFailed, unroll_safe, current_trace_length, look_inside_iff, isconstant, isvirtual, promote_string, set_param, record_known_class) -from pypy.rlib.longlong2float import float2longlong, longlong2float -from pypy.rlib.rarithmetic import ovfcheck, is_valid_int -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.rpython.ootypesystem import ootype +from rpython.rlib.longlong2float import float2longlong, longlong2float +from rpython.rlib.rarithmetic import ovfcheck, is_valid_int +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.rtyper.ootypesystem import ootype class BasicTests: @@ -40,7 +40,7 @@ class BasicTests: assert res == 42 def test_uint_floordiv(self): - from pypy.rlib.rarithmetic import r_uint + from rpython.rlib.rarithmetic import r_uint def f(a, b): a = r_uint(a) @@ -705,7 +705,7 @@ class BasicTests: assert res == 42 def test_r_uint(self): - from pypy.rlib.rarithmetic import r_uint + from rpython.rlib.rarithmetic import r_uint myjitdriver = JitDriver(greens = [], reds = ['y']) def f(y): y = r_uint(y) @@ -718,7 +718,7 @@ class BasicTests: assert res == 0 def test_uint_operations(self): - from pypy.rlib.rarithmetic import r_uint + from rpython.rlib.rarithmetic import r_uint def f(n): return ((r_uint(n) - 123) >> 1) <= r_uint(456) res = self.interp_operations(f, [50]) @@ -728,7 +728,7 @@ class BasicTests: int_sub=1) def test_uint_condition(self): - from pypy.rlib.rarithmetic import r_uint + from rpython.rlib.rarithmetic import r_uint def f(n): if ((r_uint(n) - 123) >> 1) <= r_uint(456): return 24 @@ -743,8 +743,8 @@ class BasicTests: def test_int_between(self): # def check(arg1, arg2, arg3, expect_result, **expect_operations): - from pypy.rpython.lltypesystem import lltype - from pypy.rpython.lltypesystem.lloperation import llop + from rpython.rtyper.lltypesystem import lltype + from rpython.rtyper.lltypesystem.lloperation import llop loc = locals().copy() exec py.code.Source(""" def f(n, m, p): @@ -1030,8 +1030,8 @@ class BasicTests: n -= 1 return n + k - from pypy.rpython.test.test_llinterp import get_interpreter, clear_tcache - from pypy.jit.metainterp.warmspot import WarmRunnerDesc + from rpython.rtyper.test.test_llinterp import get_interpreter, clear_tcache + from rpython.jit.metainterp.warmspot import WarmRunnerDesc interp, graph = get_interpreter(f, [0, 0], backendopt=False, inline_threshold=0, type_system=self.type_system) @@ -1133,7 +1133,7 @@ class BasicTests: def test_div_overflow(self): import sys - from pypy.rpython.lltypesystem.lloperation import llop + from rpython.rtyper.lltypesystem.lloperation import llop myjitdriver = JitDriver(greens = [], reds = ['x', 'y', 'res']) def f(x, y): res = 0 @@ -1227,7 +1227,7 @@ class BasicTests: self.check_operations_history(instanceof=0) def test_r_dict(self): - from pypy.rlib.objectmodel import r_dict + from rpython.rlib.objectmodel import r_dict class FooError(Exception): pass def myeq(n, m): @@ -1249,8 +1249,8 @@ class BasicTests: def test_free_object(self): import weakref - from pypy.rlib import rgc - from pypy.rpython.lltypesystem.lloperation import llop + from rpython.rlib import rgc + from rpython.rtyper.lltypesystem.lloperation import llop myjitdriver = JitDriver(greens = [], reds = ['n', 'x']) class X(object): pass @@ -1419,7 +1419,7 @@ class BasicTests: self.check_resops(call=2) def test_merge_guardclass_guardvalue(self): - from pypy.rlib.objectmodel import instantiate + from rpython.rlib.objectmodel import instantiate myjitdriver = JitDriver(greens = [], reds = ['x', 'l']) class A(object): @@ -1446,7 +1446,7 @@ class BasicTests: self.check_resops(guard_class=0, guard_value=6) def test_merge_guardnonnull_guardclass(self): - from pypy.rlib.objectmodel import instantiate + from rpython.rlib.objectmodel import instantiate myjitdriver = JitDriver(greens = [], reds = ['x', 'l']) class A(object): @@ -1476,7 +1476,7 @@ class BasicTests: def test_merge_guardnonnull_guardvalue(self): - from pypy.rlib.objectmodel import instantiate + from rpython.rlib.objectmodel import instantiate myjitdriver = JitDriver(greens = [], reds = ['x', 'l']) class A(object): @@ -1505,7 +1505,7 @@ class BasicTests: def test_merge_guardnonnull_guardvalue_2(self): - from pypy.rlib.objectmodel import instantiate + from rpython.rlib.objectmodel import instantiate myjitdriver = JitDriver(greens = [], reds = ['x', 'l']) class A(object): @@ -1534,7 +1534,7 @@ class BasicTests: def test_merge_guardnonnull_guardclass_guardvalue(self): - from pypy.rlib.objectmodel import instantiate + from rpython.rlib.objectmodel import instantiate myjitdriver = JitDriver(greens = [], reds = ['x', 'l']) class A(object): @@ -2088,7 +2088,7 @@ class BasicTests: assert 4 < res < 14 def test_compute_identity_hash(self): - from pypy.rlib.objectmodel import compute_identity_hash + from rpython.rlib.objectmodel import compute_identity_hash class A(object): pass def f(): @@ -2099,7 +2099,7 @@ class BasicTests: # a "did not crash" kind of test def test_compute_unique_id(self): - from pypy.rlib.objectmodel import compute_unique_id + from rpython.rlib.objectmodel import compute_unique_id class A(object): pass def f(): @@ -2437,7 +2437,7 @@ class BasicTests: def test_read_timestamp(self): import time - from pypy.rlib.rtimer import read_timestamp + from rpython.rlib.rtimer import read_timestamp def busy_loop(): start = time.time() while time.time() - start < 0.1: @@ -2704,8 +2704,8 @@ class BasicTests: self.check_target_token_count(5) def test_max_unroll_loops(self): - from pypy.jit.metainterp.optimize import InvalidLoop - from pypy.jit.metainterp import optimizeopt + from rpython.jit.metainterp.optimize import InvalidLoop + from rpython.jit.metainterp import optimizeopt myjitdriver = JitDriver(greens = [], reds = ['n', 'i']) # def f(n, limit): @@ -2736,8 +2736,8 @@ class BasicTests: optimizeopt.optimize_trace = old_optimize_trace def test_max_unroll_loops_retry_without_unroll(self): - from pypy.jit.metainterp.optimize import InvalidLoop - from pypy.jit.metainterp import optimizeopt + from rpython.jit.metainterp.optimize import InvalidLoop + from rpython.jit.metainterp import optimizeopt myjitdriver = JitDriver(greens = [], reds = ['n', 'i']) # def f(n, limit): @@ -3145,7 +3145,7 @@ class BaseLLtypeTests(BasicTests): assert not res def test_oops_on_nongc(self): - from pypy.rpython.lltypesystem import lltype + from rpython.rtyper.lltypesystem import lltype TP = lltype.Struct('x') def f(i1, i2): @@ -3165,7 +3165,7 @@ class BaseLLtypeTests(BasicTests): if not self.basic: py.test.skip("test written in a style that " "means it's frontend only") - from pypy.rpython.lltypesystem import lltype, llmemory, rffi + from rpython.rtyper.lltypesystem import lltype, llmemory, rffi TP = lltype.GcStruct('S1') def f(p): @@ -3230,7 +3230,7 @@ class BaseLLtypeTests(BasicTests): self.check_resops(new_with_vtable=1) def test_two_loopinvariant_arrays1(self): - from pypy.rpython.lltypesystem import lltype, llmemory, rffi + from rpython.rtyper.lltypesystem import lltype, llmemory, rffi myjitdriver = JitDriver(greens = [], reds = ['sa', 'n', 'i', 'a']) TP = lltype.GcArray(lltype.Signed) def f(n): @@ -3250,7 +3250,7 @@ class BaseLLtypeTests(BasicTests): self.check_trace_count(2) def test_two_loopinvariant_arrays2(self): - from pypy.rpython.lltypesystem import lltype, llmemory, rffi + from rpython.rtyper.lltypesystem import lltype, llmemory, rffi myjitdriver = JitDriver(greens = [], reds = ['sa', 'n', 'i', 'a']) TP = lltype.GcArray(lltype.Signed) def f(n): @@ -3273,7 +3273,7 @@ class BaseLLtypeTests(BasicTests): self.check_trace_count(2) def test_two_loopinvariant_arrays3(self): - from pypy.rpython.lltypesystem import lltype, llmemory, rffi + from rpython.rtyper.lltypesystem import lltype, llmemory, rffi myjitdriver = JitDriver(greens = [], reds = ['sa', 'n', 'i', 'a']) TP = lltype.GcArray(lltype.Signed) def f(n): @@ -3300,7 +3300,7 @@ class BaseLLtypeTests(BasicTests): class A(object): def __init__(self, a): self.a = a - from pypy.rpython.lltypesystem import lltype, llmemory, rffi + from rpython.rtyper.lltypesystem import lltype, llmemory, rffi myjitdriver = JitDriver(greens = [], reds = ['sa', 'n', 'i', 'a']) TP = lltype.GcArray(lltype.Signed) a1 = A(lltype.malloc(TP, 5)) @@ -3741,7 +3741,7 @@ class BaseLLtypeTests(BasicTests): self.check_operations_history(guard_class=0, record_known_class=1) def test_give_class_knowledge_to_tracer_explicitly(self): - from pypy.rpython.lltypesystem.lloperation import llop + from rpython.rtyper.lltypesystem.lloperation import llop class Base(object): def f(self): raise NotImplementedError @@ -3826,7 +3826,7 @@ class BaseLLtypeTests(BasicTests): assert res == 3 def test_float_bytes(self): - from pypy.rlib.rfloat import isnan + from rpython.rlib.rfloat import isnan def f(n): ll = float2longlong(n) return longlong2float(ll) @@ -3839,7 +3839,7 @@ class BaseLLtypeTests(BasicTests): class TestLLtype(BaseLLtypeTests, LLJitMixin): def test_tagged(self): - from pypy.rlib.objectmodel import UnboxedValue + from rpython.rlib.objectmodel import UnboxedValue class Base(object): __slots__ = () @@ -3951,7 +3951,7 @@ class TestLLtype(BaseLLtypeTests, LLJitMixin): # start with labels. I dont know which is better... def test_ll_arraycopy(self): - from pypy.rlib import rgc + from rpython.rlib import rgc A = lltype.GcArray(lltype.Char) a = lltype.malloc(A, 10) for i in range(10): a[i] = chr(i) diff --git a/pypy/jit/metainterp/test/test_blackhole.py b/rpython/jit/metainterp/test/test_blackhole.py similarity index 94% rename from pypy/jit/metainterp/test/test_blackhole.py rename to rpython/jit/metainterp/test/test_blackhole.py index 0cc9e7a8d321c2a16ae98210a3b881b66b463be3..5df15cbfadabaf420b90dccd56a3fe0968e3311e 100644 --- a/pypy/jit/metainterp/test/test_blackhole.py +++ b/rpython/jit/metainterp/test/test_blackhole.py @@ -1,13 +1,13 @@ import py -from pypy.rlib.jit import JitDriver -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.jit.metainterp.blackhole import BlackholeInterpBuilder -from pypy.jit.metainterp.blackhole import BlackholeInterpreter -from pypy.jit.metainterp.blackhole import convert_and_run_from_pyjitpl -from pypy.jit.metainterp import history, pyjitpl -from pypy.jit.codewriter.assembler import JitCode -from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.rpython.llinterp import LLException +from rpython.rlib.jit import JitDriver +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.jit.metainterp.blackhole import BlackholeInterpBuilder +from rpython.jit.metainterp.blackhole import BlackholeInterpreter +from rpython.jit.metainterp.blackhole import convert_and_run_from_pyjitpl +from rpython.jit.metainterp import history, pyjitpl +from rpython.jit.codewriter.assembler import JitCode +from rpython.rtyper.lltypesystem import lltype, llmemory +from rpython.rtyper.llinterp import LLException class FakeCodeWriter: diff --git a/pypy/jit/metainterp/test/test_compile.py b/rpython/jit/metainterp/test/test_compile.py similarity index 86% rename from pypy/jit/metainterp/test/test_compile.py rename to rpython/jit/metainterp/test/test_compile.py index f310a7fb1acd76517254c3c28f32f30386998b07..51f9dc6be70ed43dafa204cf6a4dc811c3c26b09 100644 --- a/pypy/jit/metainterp/test/test_compile.py +++ b/rpython/jit/metainterp/test/test_compile.py @@ -1,14 +1,14 @@ from pypy.config.pypyoption import get_pypy_config -from pypy.jit.metainterp.history import TargetToken, ConstInt, History, Stats -from pypy.jit.metainterp.history import BoxInt, INT -from pypy.jit.metainterp.compile import compile_loop -from pypy.jit.metainterp.compile import ResumeGuardDescr -from pypy.jit.metainterp.compile import ResumeGuardCountersInt -from pypy.jit.metainterp.compile import compile_tmp_callback -from pypy.jit.metainterp import jitprof, typesystem, compile -from pypy.jit.metainterp.optimizeopt.test.test_util import LLtypeMixin -from pypy.jit.tool.oparser import parse -from pypy.jit.metainterp.optimizeopt import ALL_OPTS_DICT +from rpython.jit.metainterp.history import TargetToken, ConstInt, History, Stats +from rpython.jit.metainterp.history import BoxInt, INT +from rpython.jit.metainterp.compile import compile_loop +from rpython.jit.metainterp.compile import ResumeGuardDescr +from rpython.jit.metainterp.compile import ResumeGuardCountersInt +from rpython.jit.metainterp.compile import compile_tmp_callback +from rpython.jit.metainterp import jitprof, typesystem, compile +from rpython.jit.metainterp.optimizeopt.test.test_util import LLtypeMixin +from rpython.jit.tool.oparser import parse +from rpython.jit.metainterp.optimizeopt import ALL_OPTS_DICT class FakeCPU(object): ts = typesystem.llhelper @@ -146,11 +146,11 @@ def test_resume_guard_counters(): def test_compile_tmp_callback(): - from pypy.jit.codewriter import heaptracker - from pypy.jit.backend.llgraph import runner - from pypy.rpython.lltypesystem import lltype, llmemory - from pypy.rpython.annlowlevel import llhelper - from pypy.rpython.llinterp import LLException + from rpython.jit.codewriter import heaptracker + from rpython.jit.backend.llgraph import runner + from rpython.rtyper.lltypesystem import lltype, llmemory + from rpython.rtyper.annlowlevel import llhelper + from rpython.rtyper.llinterp import LLException # cpu = runner.LLtypeCPU(None) FUNC = lltype.FuncType([lltype.Signed]*4, lltype.Signed) diff --git a/pypy/jit/metainterp/test/test_del.py b/rpython/jit/metainterp/test/test_del.py similarity index 95% rename from pypy/jit/metainterp/test/test_del.py rename to rpython/jit/metainterp/test/test_del.py index 53653cfce6a3f6fdcca34b64f2a69a5d1adc9ce9..dd6c1939b9837622a3f137c49f49035bbd873f1c 100644 --- a/pypy/jit/metainterp/test/test_del.py +++ b/rpython/jit/metainterp/test/test_del.py @@ -1,8 +1,8 @@ import py -from pypy.rlib.jit import JitDriver, dont_look_inside -from pypy.rlib.objectmodel import keepalive_until_here -from pypy.rlib import rgc -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rlib.jit import JitDriver, dont_look_inside +from rpython.rlib.objectmodel import keepalive_until_here +from rpython.rlib import rgc +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin class DelTests: diff --git a/pypy/jit/metainterp/test/test_dict.py b/rpython/jit/metainterp/test/test_dict.py similarity index 97% rename from pypy/jit/metainterp/test/test_dict.py rename to rpython/jit/metainterp/test/test_dict.py index a7444f02b41907ce8b52d7ad377ab782ed733a71..044f2e3a2b09bca24cabd37ad2e53da4dda0d28a 100644 --- a/pypy/jit/metainterp/test/test_dict.py +++ b/rpython/jit/metainterp/test/test_dict.py @@ -1,7 +1,7 @@ import py -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.rlib.jit import JitDriver -from pypy.rlib import objectmodel +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rlib.jit import JitDriver +from rpython.rlib import objectmodel class DictTests: diff --git a/pypy/jit/metainterp/test/test_exception.py b/rpython/jit/metainterp/test/test_exception.py similarity index 98% rename from pypy/jit/metainterp/test/test_exception.py rename to rpython/jit/metainterp/test/test_exception.py index c08a3478e8aea2df695cbcb618ad6a90d1e09ab5..afb62a26b40b5fd98879ff38f1cf435b620768e7 100644 --- a/pypy/jit/metainterp/test/test_exception.py +++ b/rpython/jit/metainterp/test/test_exception.py @@ -1,8 +1,8 @@ import py, sys -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.rlib.jit import JitDriver, dont_look_inside -from pypy.rlib.rarithmetic import ovfcheck, LONG_BIT, intmask -from pypy.jit.codewriter.policy import StopAtXPolicy +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rlib.jit import JitDriver, dont_look_inside +from rpython.rlib.rarithmetic import ovfcheck, LONG_BIT, intmask +from rpython.jit.codewriter.policy import StopAtXPolicy class ExceptionTests: diff --git a/pypy/jit/metainterp/test/test_executor.py b/rpython/jit/metainterp/test/test_executor.py similarity index 94% rename from pypy/jit/metainterp/test/test_executor.py rename to rpython/jit/metainterp/test/test_executor.py index f8dc57e93d308262c3c5c588ec8f81b643c1b293..c71f028d4e0cea60e8062660fae278173b4ca833 100644 --- a/pypy/jit/metainterp/test/test_executor.py +++ b/rpython/jit/metainterp/test/test_executor.py @@ -1,18 +1,18 @@ import py import sys, random -from pypy.rlib.rarithmetic import r_uint, intmask -from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.jit.metainterp.executor import execute -from pypy.jit.metainterp.executor import execute_varargs, execute_nonspec -from pypy.jit.metainterp.resoperation import rop, opboolinvers, opboolreflex, opname -from pypy.jit.metainterp.history import BoxInt, ConstInt -from pypy.jit.metainterp.history import BoxPtr, ConstPtr -from pypy.jit.metainterp.history import BoxFloat, ConstFloat -from pypy.jit.metainterp.history import AbstractDescr, Box -from pypy.jit.metainterp import history -from pypy.jit.codewriter import longlong -from pypy.jit.backend.model import AbstractCPU -from pypy.rpython.lltypesystem import llmemory, rffi +from rpython.rlib.rarithmetic import r_uint, intmask +from rpython.rtyper.lltypesystem import lltype, llmemory +from rpython.jit.metainterp.executor import execute +from rpython.jit.metainterp.executor import execute_varargs, execute_nonspec +from rpython.jit.metainterp.resoperation import rop, opboolinvers, opboolreflex, opname +from rpython.jit.metainterp.history import BoxInt, ConstInt +from rpython.jit.metainterp.history import BoxPtr, ConstPtr +from rpython.jit.metainterp.history import BoxFloat, ConstFloat +from rpython.jit.metainterp.history import AbstractDescr, Box +from rpython.jit.metainterp import history +from rpython.jit.codewriter import longlong +from rpython.jit.backend.model import AbstractCPU +from rpython.rtyper.lltypesystem import llmemory, rffi class FakeDescr(AbstractDescr): pass diff --git a/pypy/jit/metainterp/test/test_fficall.py b/rpython/jit/metainterp/test/test_fficall.py similarity index 93% rename from pypy/jit/metainterp/test/test_fficall.py rename to rpython/jit/metainterp/test/test_fficall.py index 3513e079fc96f5a7ddcc3dd268530803f98cdc5b..99c46379ea6b22d836f9c066135ce2d2ec21144e 100644 --- a/pypy/jit/metainterp/test/test_fficall.py +++ b/rpython/jit/metainterp/test/test_fficall.py @@ -1,9 +1,9 @@ import py -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.jit.metainterp.test.support import LLJitMixin -from pypy.rlib import jit -from pypy.rlib.jit_libffi import types, CIF_DESCRIPTION, FFI_TYPE_PP -from pypy.rlib.unroll import unrolling_iterable +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.jit.metainterp.test.support import LLJitMixin +from rpython.rlib import jit +from rpython.rlib.jit_libffi import types, CIF_DESCRIPTION, FFI_TYPE_PP +from rpython.rlib.unroll import unrolling_iterable def get_description(atypes, rtype): diff --git a/pypy/jit/metainterp/test/test_float.py b/rpython/jit/metainterp/test/test_float.py similarity index 92% rename from pypy/jit/metainterp/test/test_float.py rename to rpython/jit/metainterp/test/test_float.py index d06aa36ee0ca796ccf395ef3f4f0044ccd0b459c..067cd4bb13964a553aaf22331ac10dc6fb392cc2 100644 --- a/pypy/jit/metainterp/test/test_float.py +++ b/rpython/jit/metainterp/test/test_float.py @@ -1,6 +1,6 @@ import math, sys -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.rlib.rarithmetic import intmask, r_uint +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rlib.rarithmetic import intmask, r_uint class FloatTests: @@ -38,7 +38,7 @@ class FloatTests: assert res == -x def test_singlefloat(self): - from pypy.rlib.rarithmetic import r_singlefloat + from rpython.rlib.rarithmetic import r_singlefloat def f(a): a = float(r_singlefloat(a)) a *= 4.25 diff --git a/pypy/jit/metainterp/test/test_greenfield.py b/rpython/jit/metainterp/test/test_greenfield.py similarity index 93% rename from pypy/jit/metainterp/test/test_greenfield.py rename to rpython/jit/metainterp/test/test_greenfield.py index 1bba7f5fa37b1f177df1f1214b0f928f27d2f514..07185bd1388a016b695d0b60c5176dbdd952d65b 100644 --- a/pypy/jit/metainterp/test/test_greenfield.py +++ b/rpython/jit/metainterp/test/test_greenfield.py @@ -1,5 +1,5 @@ -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.rlib.jit import JitDriver +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rlib.jit import JitDriver class GreenFieldsTests: diff --git a/pypy/jit/metainterp/test/test_heapcache.py b/rpython/jit/metainterp/test/test_heapcache.py similarity index 99% rename from pypy/jit/metainterp/test/test_heapcache.py rename to rpython/jit/metainterp/test/test_heapcache.py index cc9ba5601b83920bdf6fe1cb58345f6fd9718232..8786df0e4445197fadcac55c0307a74a8c1b76f1 100644 --- a/pypy/jit/metainterp/test/test_heapcache.py +++ b/rpython/jit/metainterp/test/test_heapcache.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.heapcache import HeapCache -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.metainterp.history import ConstInt +from rpython.jit.metainterp.heapcache import HeapCache +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.metainterp.history import ConstInt box1 = "box1" box2 = "box2" diff --git a/pypy/jit/metainterp/test/test_history.py b/rpython/jit/metainterp/test/test_history.py similarity index 92% rename from pypy/jit/metainterp/test/test_history.py rename to rpython/jit/metainterp/test/test_history.py index 142737d948c4cefc3a84d8b00557509f314cb70e..c962b024b1c0d559b37de3342c89964d6938a421 100644 --- a/pypy/jit/metainterp/test/test_history.py +++ b/rpython/jit/metainterp/test/test_history.py @@ -1,5 +1,5 @@ -from pypy.jit.metainterp.history import * -from pypy.rpython.lltypesystem import lltype, llmemory, rffi +from rpython.jit.metainterp.history import * +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi def test_repr(): diff --git a/pypy/jit/metainterp/test/test_immutable.py b/rpython/jit/metainterp/test/test_immutable.py similarity index 97% rename from pypy/jit/metainterp/test/test_immutable.py rename to rpython/jit/metainterp/test/test_immutable.py index b23d0b268e208f067eba632bd3a9d6def9eab61f..4be1dd1138f1c796203cbdba916931dffb009b8d 100644 --- a/pypy/jit/metainterp/test/test_immutable.py +++ b/rpython/jit/metainterp/test/test_immutable.py @@ -1,5 +1,5 @@ -from pypy.rlib import jit -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rlib import jit +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin @jit.dont_look_inside def escape(x): @@ -90,7 +90,7 @@ class ImmutableFieldsTests: def test_raw_field_and_array(self): - from pypy.rpython.lltypesystem import lltype + from rpython.rtyper.lltypesystem import lltype X = lltype.Struct('X', ('a', lltype.Signed), ('b', lltype.Array(lltype.Signed, diff --git a/pypy/jit/metainterp/test/test_intbound.py b/rpython/jit/metainterp/test/test_intbound.py similarity index 98% rename from pypy/jit/metainterp/test/test_intbound.py rename to rpython/jit/metainterp/test/test_intbound.py index d28754600fdc04901edfca12c67e2431effc29a8..75a317c11b4155c98b7ff0baa2d3d987674c99d2 100644 --- a/pypy/jit/metainterp/test/test_intbound.py +++ b/rpython/jit/metainterp/test/test_intbound.py @@ -1,8 +1,8 @@ -from pypy.jit.metainterp.optimizeopt.intutils import IntBound, IntUpperBound, \ +from rpython.jit.metainterp.optimizeopt.intutils import IntBound, IntUpperBound, \ IntLowerBound, IntUnbounded from copy import copy import sys -from pypy.rlib.rarithmetic import LONG_BIT +from rpython.rlib.rarithmetic import LONG_BIT def bound(a,b): if a is None and b is None: diff --git a/pypy/jit/metainterp/test/test_jitdriver.py b/rpython/jit/metainterp/test/test_jitdriver.py similarity index 96% rename from pypy/jit/metainterp/test/test_jitdriver.py rename to rpython/jit/metainterp/test/test_jitdriver.py index 5405c031ebf56b03c51f88d97f9b0ea89f7c6d26..5829238baed21f74f5742f72a1f3e435d2860a69 100644 --- a/pypy/jit/metainterp/test/test_jitdriver.py +++ b/rpython/jit/metainterp/test/test_jitdriver.py @@ -1,7 +1,7 @@ """Tests for multiple JitDrivers.""" -from pypy.rlib.jit import JitDriver, unroll_safe, set_param -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.jit.metainterp.warmspot import get_stats +from rpython.rlib.jit import JitDriver, unroll_safe, set_param +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.jit.metainterp.warmspot import get_stats def getloc1(): diff --git a/pypy/jit/metainterp/test/test_jitiface.py b/rpython/jit/metainterp/test/test_jitiface.py similarity index 95% rename from pypy/jit/metainterp/test/test_jitiface.py rename to rpython/jit/metainterp/test/test_jitiface.py index c2d3a5faf250166d691e5f2394f3bb5f37c3f745..4ae489a282a58a3d97a6336275fcba2701f9b521 100644 --- a/pypy/jit/metainterp/test/test_jitiface.py +++ b/rpython/jit/metainterp/test/test_jitiface.py @@ -1,11 +1,11 @@ -from pypy.rlib.jit import JitDriver, JitHookInterface, Counters -from pypy.rlib import jit_hooks -from pypy.jit.metainterp.test.support import LLJitMixin -from pypy.jit.codewriter.policy import JitPolicy -from pypy.jit.metainterp.resoperation import rop -from pypy.rpython.annlowlevel import hlstr -from pypy.jit.metainterp.jitprof import Profiler +from rpython.rlib.jit import JitDriver, JitHookInterface, Counters +from rpython.rlib import jit_hooks +from rpython.jit.metainterp.test.support import LLJitMixin +from rpython.jit.codewriter.policy import JitPolicy +from rpython.jit.metainterp.resoperation import rop +from rpython.rtyper.annlowlevel import hlstr +from rpython.jit.metainterp.jitprof import Profiler class JitHookInterfaceTests(object): # !!!note!!! - don't subclass this from the backend. Subclass the LL diff --git a/pypy/jit/metainterp/test/test_jitprof.py b/rpython/jit/metainterp/test/test_jitprof.py similarity index 90% rename from pypy/jit/metainterp/test/test_jitprof.py rename to rpython/jit/metainterp/test/test_jitprof.py index abefc97b3b0cce6ee506c7ef51be7902fe8370b3..3bda083f159840a981f90c96ff4e6291ef6fb833 100644 --- a/pypy/jit/metainterp/test/test_jitprof.py +++ b/rpython/jit/metainterp/test/test_jitprof.py @@ -1,9 +1,9 @@ -from pypy.jit.metainterp.warmspot import ll_meta_interp -from pypy.rlib.jit import JitDriver, dont_look_inside, elidable, Counters -from pypy.jit.metainterp.test.support import LLJitMixin -from pypy.jit.metainterp import pyjitpl -from pypy.jit.metainterp.jitprof import Profiler +from rpython.jit.metainterp.warmspot import ll_meta_interp +from rpython.rlib.jit import JitDriver, dont_look_inside, elidable, Counters +from rpython.jit.metainterp.test.support import LLJitMixin +from rpython.jit.metainterp import pyjitpl +from rpython.jit.metainterp.jitprof import Profiler class FakeProfiler(Profiler): def start(self): diff --git a/pypy/jit/metainterp/test/test_list.py b/rpython/jit/metainterp/test/test_list.py similarity index 98% rename from pypy/jit/metainterp/test/test_list.py rename to rpython/jit/metainterp/test/test_list.py index cabffedf365b932168b7adc5877b799555504a49..4e5d3eed8f7f166734986917667d6017519cf8b0 100644 --- a/pypy/jit/metainterp/test/test_list.py +++ b/rpython/jit/metainterp/test/test_list.py @@ -1,7 +1,7 @@ import py -from pypy.rlib.objectmodel import newlist_hint -from pypy.rlib.jit import JitDriver, promote -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rlib.objectmodel import newlist_hint +from rpython.rlib.jit import JitDriver, promote +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin class ListTests: diff --git a/pypy/jit/metainterp/test/test_logger.py b/rpython/jit/metainterp/test/test_logger.py similarity index 94% rename from pypy/jit/metainterp/test/test_logger.py rename to rpython/jit/metainterp/test/test_logger.py index 361bfe948db9a8c28545e522f2fd395182d883c4..81a1024f3a05a8008bda3ce85ecbfa315e68f681 100644 --- a/pypy/jit/metainterp/test/test_logger.py +++ b/rpython/jit/metainterp/test/test_logger.py @@ -1,12 +1,12 @@ import sys -from pypy.rlib import debug -from pypy.jit.tool.oparser import pure_parse -from pypy.jit.metainterp import logger -from pypy.jit.metainterp.typesystem import llhelper +from rpython.rlib import debug +from rpython.jit.tool.oparser import pure_parse +from rpython.jit.metainterp import logger +from rpython.jit.metainterp.typesystem import llhelper from StringIO import StringIO -from pypy.jit.metainterp.optimizeopt.util import equaloplists -from pypy.jit.metainterp.history import AbstractDescr, JitCellToken, BasicFailDescr -from pypy.jit.backend.model import AbstractCPU +from rpython.jit.metainterp.optimizeopt.util import equaloplists +from rpython.jit.metainterp.history import AbstractDescr, JitCellToken, BasicFailDescr +from rpython.jit.backend.model import AbstractCPU class Descr(AbstractDescr): @@ -174,7 +174,7 @@ class TestLogger(object): assert not lastline.startswith("guard_true(i0, descr== 4 and sys.argv[1] == '--sub': pypy.conftest.option.__dict__.update(eval(sys.argv[3])) import py -from pypy.jit.metainterp.memmgr import MemoryManager -from pypy.jit.metainterp.test.support import LLJitMixin -from pypy.rlib.jit import JitDriver, dont_look_inside -from pypy.jit.metainterp.warmspot import get_stats -from pypy.jit.metainterp.warmstate import JitCell -from pypy.rlib import rgc +from rpython.jit.metainterp.memmgr import MemoryManager +from rpython.jit.metainterp.test.support import LLJitMixin +from rpython.rlib.jit import JitDriver, dont_look_inside +from rpython.jit.metainterp.warmspot import get_stats +from rpython.jit.metainterp.warmstate import JitCell +from rpython.rlib import rgc class FakeLoopToken: generation = 0 diff --git a/pypy/jit/metainterp/test/test_pyjitpl.py b/rpython/jit/metainterp/test/test_pyjitpl.py similarity index 89% rename from pypy/jit/metainterp/test/test_pyjitpl.py rename to rpython/jit/metainterp/test/test_pyjitpl.py index c15ea967fc3546bda62e68db87b6e08d6b44572c..821f15fcd3c680dc666b8bfe27a961566b9a7c0e 100644 --- a/pypy/jit/metainterp/test/test_pyjitpl.py +++ b/rpython/jit/metainterp/test/test_pyjitpl.py @@ -1,13 +1,13 @@ # some unit tests for the bytecode decoding -from pypy.jit.metainterp import pyjitpl -from pypy.jit.metainterp import jitprof -from pypy.jit.metainterp.history import BoxInt, ConstInt -from pypy.jit.metainterp.history import History -from pypy.jit.metainterp.resoperation import ResOperation, rop -from pypy.jit.metainterp.optimizeopt.util import equaloplists -from pypy.jit.codewriter.jitcode import JitCode +from rpython.jit.metainterp import pyjitpl +from rpython.jit.metainterp import jitprof +from rpython.jit.metainterp.history import BoxInt, ConstInt +from rpython.jit.metainterp.history import History +from rpython.jit.metainterp.resoperation import ResOperation, rop +from rpython.jit.metainterp.optimizeopt.util import equaloplists +from rpython.jit.codewriter.jitcode import JitCode def test_portal_trace_positions(): diff --git a/pypy/jit/metainterp/test/test_quasiimmut.py b/rpython/jit/metainterp/test/test_quasiimmut.py similarity index 95% rename from pypy/jit/metainterp/test/test_quasiimmut.py rename to rpython/jit/metainterp/test/test_quasiimmut.py index 4aba7a84025c2bae906d7f9bf4f242b5fbffa6c5..32faa3e29e7d3604f66e8941a750aec7a0866790 100644 --- a/pypy/jit/metainterp/test/test_quasiimmut.py +++ b/rpython/jit/metainterp/test/test_quasiimmut.py @@ -1,14 +1,14 @@ import py -from pypy.rpython.lltypesystem import lltype, llmemory, rclass -from pypy.rpython.rclass import FieldListAccessor, IR_QUASIIMMUTABLE -from pypy.jit.metainterp import typesystem -from pypy.jit.metainterp.quasiimmut import QuasiImmut -from pypy.jit.metainterp.quasiimmut import get_current_qmut_instance -from pypy.jit.metainterp.test.support import LLJitMixin -from pypy.jit.codewriter.policy import StopAtXPolicy -from pypy.rlib.jit import JitDriver, dont_look_inside, unroll_safe, promote +from rpython.rtyper.lltypesystem import lltype, llmemory, rclass +from rpython.rtyper.rclass import FieldListAccessor, IR_QUASIIMMUTABLE +from rpython.jit.metainterp import typesystem +from rpython.jit.metainterp.quasiimmut import QuasiImmut +from rpython.jit.metainterp.quasiimmut import get_current_qmut_instance +from rpython.jit.metainterp.test.support import LLJitMixin +from rpython.jit.codewriter.policy import StopAtXPolicy +from rpython.rlib.jit import JitDriver, dont_look_inside, unroll_safe, promote def test_get_current_qmut_instance(): @@ -75,7 +75,7 @@ class QuasiImmutTests(object): assert res == 700 self.check_resops(guard_not_invalidated=2, getfield_gc=0) # - from pypy.jit.metainterp.warmspot import get_stats + from rpython.jit.metainterp.warmspot import get_stats loops = get_stats().loops for loop in loops: assert len(loop.quasi_immutable_deps) == 1 @@ -104,7 +104,7 @@ class QuasiImmutTests(object): assert res == 721 self.check_resops(guard_not_invalidated=0, getfield_gc=3) # - from pypy.jit.metainterp.warmspot import get_stats + from rpython.jit.metainterp.warmspot import get_stats loops = get_stats().loops for loop in loops: assert loop.quasi_immutable_deps is None @@ -349,7 +349,7 @@ class QuasiImmutTests(object): self.check_resops(getarrayitem_gc_pure=0, guard_not_invalidated=2, getarrayitem_gc=0, getfield_gc=0) # - from pypy.jit.metainterp.warmspot import get_stats + from rpython.jit.metainterp.warmspot import get_stats loops = get_stats().loops for loop in loops: assert len(loop.quasi_immutable_deps) == 1 @@ -386,7 +386,7 @@ class QuasiImmutTests(object): self.check_resops(getarrayitem_gc_pure=0, guard_not_invalidated=2, arraylen_gc=0, getarrayitem_gc=0, getfield_gc=0) # - from pypy.jit.metainterp.warmspot import get_stats + from rpython.jit.metainterp.warmspot import get_stats loops = get_stats().loops for loop in loops: assert len(loop.quasi_immutable_deps) == 1 @@ -421,7 +421,7 @@ class QuasiImmutTests(object): self.check_resops(guard_not_invalidated=2, getfield_gc=0, getarrayitem_gc=0, getarrayitem_gc_pure=0) # - from pypy.jit.metainterp.warmspot import get_stats + from rpython.jit.metainterp.warmspot import get_stats loops = get_stats().loops for loop in loops: assert len(loop.quasi_immutable_deps) == 1 diff --git a/pypy/jit/metainterp/test/test_rawmem.py b/rpython/jit/metainterp/test/test_rawmem.py similarity index 92% rename from pypy/jit/metainterp/test/test_rawmem.py rename to rpython/jit/metainterp/test/test_rawmem.py index d243548931b9ac866a84cd15cb17cbe58cb95a67..43a73589b7bb14d10526941733f1b4599f907c12 100644 --- a/pypy/jit/metainterp/test/test_rawmem.py +++ b/rpython/jit/metainterp/test/test_rawmem.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp.test.support import LLJitMixin -from pypy.rpython.lltypesystem import lltype, rffi -from pypy.rlib.rawstorage import (alloc_raw_storage, raw_storage_setitem, +from rpython.jit.metainterp.test.support import LLJitMixin +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.rawstorage import (alloc_raw_storage, raw_storage_setitem, free_raw_storage, raw_storage_getitem) class RawMemTests(object): diff --git a/pypy/jit/metainterp/test/test_recursive.py b/rpython/jit/metainterp/test/test_recursive.py similarity index 98% rename from pypy/jit/metainterp/test/test_recursive.py rename to rpython/jit/metainterp/test/test_recursive.py index e014ca27df26c85cdeada4ffe8ff3395f9e6af40..7237b3ce3bac89dd6ddb086ef5a75d11b4270936 100644 --- a/pypy/jit/metainterp/test/test_recursive.py +++ b/rpython/jit/metainterp/test/test_recursive.py @@ -1,12 +1,12 @@ import py -from pypy.rlib.jit import JitDriver, hint, set_param -from pypy.rlib.jit import unroll_safe, dont_look_inside, promote -from pypy.rlib.objectmodel import we_are_translated -from pypy.rlib.debug import fatalerror -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.jit.codewriter.policy import StopAtXPolicy -from pypy.rpython.annlowlevel import hlstr -from pypy.jit.metainterp.warmspot import get_stats +from rpython.rlib.jit import JitDriver, hint, set_param +from rpython.rlib.jit import unroll_safe, dont_look_inside, promote +from rpython.rlib.objectmodel import we_are_translated +from rpython.rlib.debug import fatalerror +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.jit.codewriter.policy import StopAtXPolicy +from rpython.rtyper.annlowlevel import hlstr +from rpython.jit.metainterp.warmspot import get_stats class RecursiveTests: @@ -614,7 +614,7 @@ class RecursiveTests: portal(2, 5) - from pypy.jit.metainterp import compile, pyjitpl + from rpython.jit.metainterp import compile, pyjitpl pyjitpl._warmrunnerdesc = None trace = [] def my_ctc(*args): @@ -669,7 +669,7 @@ class RecursiveTests: main(2, 5) - from pypy.jit.metainterp import compile, pyjitpl + from rpython.jit.metainterp import compile, pyjitpl pyjitpl._warmrunnerdesc = None trace = [] def my_ctc(*args): @@ -797,8 +797,8 @@ class RecursiveTests: assert res == main(0) def test_directly_call_assembler_virtualizable_reset_token(self): - from pypy.rpython.lltypesystem import lltype - from pypy.rlib.debug import llinterpcall + from rpython.rtyper.lltypesystem import lltype + from rpython.rlib.debug import llinterpcall class Thing(object): def __init__(self, val): @@ -822,7 +822,7 @@ class RecursiveTests: # three levels of recursion: the vable_token of the subframe # at the level 2 is set to a non-zero value when doing the # call to the level 3 only. This used to fail when the test - # is run via pypy.jit.backend.x86.test.test_recursive. + # is run via rpython.jit.backend.x86.test.test_recursive. assert ll_subframe.vable_token == 0 def main(codeno): @@ -1193,7 +1193,7 @@ class RecursiveTests: self.meta_interp(portal, [0, 10], inline=True) def test_trace_from_start_always(self): - from pypy.rlib.nonconst import NonConstant + from rpython.rlib.nonconst import NonConstant driver = JitDriver(greens = ['c'], reds = ['i', 'v']) diff --git a/pypy/jit/metainterp/test/test_resoperation.py b/rpython/jit/metainterp/test/test_resoperation.py similarity index 95% rename from pypy/jit/metainterp/test/test_resoperation.py rename to rpython/jit/metainterp/test/test_resoperation.py index aeedbf09b05defb00d7e85e0d4e2c8704bb26bf2..07891b33f8523c0d0fe5d58e42cdb9df1f8cc951 100644 --- a/pypy/jit/metainterp/test/test_resoperation.py +++ b/rpython/jit/metainterp/test/test_resoperation.py @@ -1,6 +1,6 @@ import py -from pypy.jit.metainterp import resoperation as rop -from pypy.jit.metainterp.history import AbstractDescr +from rpython.jit.metainterp import resoperation as rop +from rpython.jit.metainterp.history import AbstractDescr def test_arity_mixins(): cases = [ diff --git a/pypy/jit/metainterp/test/test_resume.py b/rpython/jit/metainterp/test/test_resume.py similarity index 98% rename from pypy/jit/metainterp/test/test_resume.py rename to rpython/jit/metainterp/test/test_resume.py index e020be29f372a6b6d05371b05b3dd6af85325afc..9796d0e8b2d46671372cea01b125db24f7bd0011 100644 --- a/pypy/jit/metainterp/test/test_resume.py +++ b/rpython/jit/metainterp/test/test_resume.py @@ -1,15 +1,15 @@ from __future__ import with_statement import py -from pypy.rpython.lltypesystem import lltype, llmemory, rffi -from pypy.jit.metainterp.optimizeopt.optimizer import OptValue -from pypy.jit.metainterp.optimizeopt.virtualize import VirtualValue, VArrayValue -from pypy.jit.metainterp.optimizeopt.virtualize import VStructValue -from pypy.jit.metainterp.resume import * -from pypy.jit.metainterp.history import BoxInt, BoxPtr, ConstInt -from pypy.jit.metainterp.history import ConstPtr, ConstFloat -from pypy.jit.metainterp.optimizeopt.test.test_util import LLtypeMixin -from pypy.jit.metainterp import executor -from pypy.jit.codewriter import heaptracker, longlong +from rpython.rtyper.lltypesystem import lltype, llmemory, rffi +from rpython.jit.metainterp.optimizeopt.optimizer import OptValue +from rpython.jit.metainterp.optimizeopt.virtualize import VirtualValue, VArrayValue +from rpython.jit.metainterp.optimizeopt.virtualize import VStructValue +from rpython.jit.metainterp.resume import * +from rpython.jit.metainterp.history import BoxInt, BoxPtr, ConstInt +from rpython.jit.metainterp.history import ConstPtr, ConstFloat +from rpython.jit.metainterp.optimizeopt.test.test_util import LLtypeMixin +from rpython.jit.metainterp import executor +from rpython.jit.codewriter import heaptracker, longlong class Storage: rd_frame_info_list = None diff --git a/pypy/jit/metainterp/test/test_send.py b/rpython/jit/metainterp/test/test_send.py similarity index 98% rename from pypy/jit/metainterp/test/test_send.py rename to rpython/jit/metainterp/test/test_send.py index b6855c4ca1eeb025b4226025ef25de6be76c3ffa..cc82a8491da5a7b479885307697a84df515304ba 100644 --- a/pypy/jit/metainterp/test/test_send.py +++ b/rpython/jit/metainterp/test/test_send.py @@ -1,7 +1,7 @@ import py -from pypy.rlib.jit import JitDriver, promote, elidable, set_param -from pypy.jit.codewriter.policy import StopAtXPolicy -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rlib.jit import JitDriver, promote, elidable, set_param +from rpython.jit.codewriter.policy import StopAtXPolicy +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin class SendTests(object): @@ -520,7 +520,7 @@ class SendTests(object): assert res == f(60) def test_recursive_call_to_portal_from_blackhole(self): - from pypy.rpython.annlowlevel import hlstr + from rpython.rtyper.annlowlevel import hlstr myjitdriver = JitDriver(greens = ['k'], reds = ['n']) def f(n, k): diff --git a/pypy/jit/metainterp/test/test_slist.py b/rpython/jit/metainterp/test/test_slist.py similarity index 96% rename from pypy/jit/metainterp/test/test_slist.py rename to rpython/jit/metainterp/test/test_slist.py index 9f8e789af975e569f873d9a05d77e108a0554fc0..df23c94296b24e3f81dcb23f62570c7a81ffbf35 100644 --- a/pypy/jit/metainterp/test/test_slist.py +++ b/rpython/jit/metainterp/test/test_slist.py @@ -1,6 +1,6 @@ import py -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.rlib.jit import JitDriver +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rlib.jit import JitDriver class ListTests(object): diff --git a/pypy/jit/metainterp/test/test_string.py b/rpython/jit/metainterp/test/test_string.py similarity index 98% rename from pypy/jit/metainterp/test/test_string.py rename to rpython/jit/metainterp/test/test_string.py index a090bafbbdf0838e77c78ed7a8608e9a04da8430..9292badfb038d292e2d4bdb8008bb3a4550149e4 100644 --- a/pypy/jit/metainterp/test/test_string.py +++ b/rpython/jit/metainterp/test/test_string.py @@ -1,12 +1,12 @@ import py -from pypy.jit.codewriter.policy import StopAtXPolicy -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.rlib.debug import debug_print -from pypy.rlib.jit import JitDriver, dont_look_inside, we_are_jitted,\ +from rpython.jit.codewriter.policy import StopAtXPolicy +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rlib.debug import debug_print +from rpython.rlib.jit import JitDriver, dont_look_inside, we_are_jitted,\ promote_string -from pypy.rlib.rstring import StringBuilder -from pypy.rpython.ootypesystem import ootype +from rpython.rlib.rstring import StringBuilder +from rpython.rtyper.ootypesystem import ootype class StringTests: diff --git a/pypy/jit/metainterp/test/test_tl.py b/rpython/jit/metainterp/test/test_tl.py similarity index 89% rename from pypy/jit/metainterp/test/test_tl.py rename to rpython/jit/metainterp/test/test_tl.py index bb4b64454a340920e760e6419c0372f7ec64332c..5d8d2d68f6e3f517ce5202f2db83cac89fa32db1 100644 --- a/pypy/jit/metainterp/test/test_tl.py +++ b/rpython/jit/metainterp/test/test_tl.py @@ -1,12 +1,12 @@ import py -from pypy.jit.codewriter.policy import StopAtXPolicy -from pypy.jit.metainterp.test.support import OOJitMixin, LLJitMixin +from rpython.jit.codewriter.policy import StopAtXPolicy +from rpython.jit.metainterp.test.support import OOJitMixin, LLJitMixin class ToyLanguageTests: def test_tlr(self): - from pypy.jit.tl.tlr import interpret, SQUARE + from rpython.jit.tl.tlr import interpret, SQUARE codes = ["", SQUARE] def main(n, a): @@ -17,8 +17,8 @@ class ToyLanguageTests: assert res == 100 def _get_main(self): - from pypy.jit.tl.tl import interp_without_call - from pypy.jit.tl.tlopcode import compile + from rpython.jit.tl.tl import interp_without_call + from rpython.jit.tl.tlopcode import compile code = compile(''' PUSH 1 # accumulator @@ -84,8 +84,8 @@ class ToyLanguageTests: 'guard_false': 1}) def test_tl_call(self, listops=True, policy=None): - from pypy.jit.tl.tl import interp - from pypy.jit.tl.tlopcode import compile + from rpython.jit.tl.tl import interp + from rpython.jit.tl.tlopcode import compile code = compile(''' PUSHARG @@ -125,7 +125,7 @@ class ToyLanguageTests: # This forces most methods of Stack to be ignored and treated as # residual calls. It tests that the right thing occurs in this # case too. - from pypy.jit.tl.tl import Stack + from rpython.jit.tl.tl import Stack methods = [Stack.put, Stack.pick, Stack.append, diff --git a/pypy/jit/metainterp/test/test_tlc.py b/rpython/jit/metainterp/test/test_tlc.py similarity index 89% rename from pypy/jit/metainterp/test/test_tlc.py rename to rpython/jit/metainterp/test/test_tlc.py index bf080f6aace6b8e3abeb676873173ba216da47b1..4588ef9b294a06c202274a9d8913456a81ee772b 100644 --- a/pypy/jit/metainterp/test/test_tlc.py +++ b/rpython/jit/metainterp/test/test_tlc.py @@ -1,9 +1,9 @@ import py -from pypy.rpython.module.support import LLSupport +from rpython.rtyper.module.support import LLSupport -from pypy.jit.tl import tlc +from rpython.jit.tl import tlc -from pypy.jit.metainterp.test.support import OOJitMixin, LLJitMixin +from rpython.jit.metainterp.test.support import OOJitMixin, LLJitMixin class TLCTests: diff --git a/pypy/jit/metainterp/test/test_tracingopts.py b/rpython/jit/metainterp/test/test_tracingopts.py similarity index 98% rename from pypy/jit/metainterp/test/test_tracingopts.py rename to rpython/jit/metainterp/test/test_tracingopts.py index 8fd3353f239337d1743438cf5eaa590118f33784..1fb49427e85478af22cacf2c604926b30cd00d4b 100644 --- a/pypy/jit/metainterp/test/test_tracingopts.py +++ b/rpython/jit/metainterp/test/test_tracingopts.py @@ -1,9 +1,9 @@ import sys -from pypy.jit.metainterp.test.support import LLJitMixin -from pypy.rlib import jit -from pypy.rlib.rarithmetic import ovfcheck -from pypy.rlib.rstring import StringBuilder +from rpython.jit.metainterp.test.support import LLJitMixin +from rpython.rlib import jit +from rpython.rlib.rarithmetic import ovfcheck +from rpython.rlib.rstring import StringBuilder import py @@ -594,7 +594,7 @@ class TestLLtype(LLJitMixin): assert res == 12 def test_opaque_list(self): - from pypy.rlib.rerased import new_erasing_pair + from rpython.rlib.rerased import new_erasing_pair erase, unerase = new_erasing_pair("test_opaque_list") def fn(n, ca, cb): l1 = [n] diff --git a/pypy/jit/metainterp/test/test_typesystem.py b/rpython/jit/metainterp/test/test_typesystem.py similarity index 89% rename from pypy/jit/metainterp/test/test_typesystem.py rename to rpython/jit/metainterp/test/test_typesystem.py index 6c1151b792361484f46023ef718582c1ecdad65a..77d3fe6cbb94b76da2e1e54773751c25ca056038 100644 --- a/pypy/jit/metainterp/test/test_typesystem.py +++ b/rpython/jit/metainterp/test/test_typesystem.py @@ -1,6 +1,6 @@ -from pypy.jit.metainterp import typesystem -from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.rpython.ootypesystem import ootype +from rpython.jit.metainterp import typesystem +from rpython.rtyper.lltypesystem import lltype, llmemory +from rpython.rtyper.ootypesystem import ootype class TypeSystemTests(object): diff --git a/pypy/jit/metainterp/test/test_virtual.py b/rpython/jit/metainterp/test/test_virtual.py similarity index 98% rename from pypy/jit/metainterp/test/test_virtual.py rename to rpython/jit/metainterp/test/test_virtual.py index b27dfd5f000e095cfca28580e3b16a3e487146f5..5d47b0d066d38a7614ac2a63382c8816107fb1de 100644 --- a/pypy/jit/metainterp/test/test_virtual.py +++ b/rpython/jit/metainterp/test/test_virtual.py @@ -1,12 +1,12 @@ import py -from pypy.rlib.jit import JitDriver, promote, dont_look_inside -from pypy.rlib.objectmodel import compute_unique_id -from pypy.jit.codewriter.policy import StopAtXPolicy -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.rpython.lltypesystem import lltype, rclass -from pypy.rpython.lltypesystem.lloperation import llop -from pypy.rpython.ootypesystem import ootype -from pypy.jit.codewriter import heaptracker +from rpython.rlib.jit import JitDriver, promote, dont_look_inside +from rpython.rlib.objectmodel import compute_unique_id +from rpython.jit.codewriter.policy import StopAtXPolicy +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rtyper.lltypesystem import lltype, rclass +from rpython.rtyper.lltypesystem.lloperation import llop +from rpython.rtyper.ootypesystem import ootype +from rpython.jit.codewriter import heaptracker class VirtualTests: def _freeze_(self): diff --git a/pypy/jit/metainterp/test/test_virtualizable.py b/rpython/jit/metainterp/test/test_virtualizable.py similarity index 98% rename from pypy/jit/metainterp/test/test_virtualizable.py rename to rpython/jit/metainterp/test/test_virtualizable.py index 0975f8716310b6745b645b214834ed141f19ba63..b86aa50b813482b1fe43f791e58d4f6725da1412 100644 --- a/pypy/jit/metainterp/test/test_virtualizable.py +++ b/rpython/jit/metainterp/test/test_virtualizable.py @@ -1,17 +1,17 @@ import py -from pypy.rpython.extregistry import ExtRegistryEntry -from pypy.rpython.lltypesystem import lltype, lloperation, rclass, llmemory -from pypy.rpython.annlowlevel import llhelper -from pypy.rpython.rclass import IR_IMMUTABLE, IR_IMMUTABLE_ARRAY -from pypy.jit.codewriter.policy import StopAtXPolicy -from pypy.jit.codewriter import heaptracker -from pypy.rlib.jit import JitDriver, hint, dont_look_inside, promote -from pypy.rlib.rarithmetic import intmask -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin -from pypy.rpython.rclass import FieldListAccessor -from pypy.jit.metainterp.warmspot import get_stats, get_translator -from pypy.jit.metainterp import history -from pypy.jit.metainterp.optimizeopt.test.test_util import LLtypeMixin +from rpython.rtyper.extregistry import ExtRegistryEntry +from rpython.rtyper.lltypesystem import lltype, lloperation, rclass, llmemory +from rpython.rtyper.annlowlevel import llhelper +from rpython.rtyper.rclass import IR_IMMUTABLE, IR_IMMUTABLE_ARRAY +from rpython.jit.codewriter.policy import StopAtXPolicy +from rpython.jit.codewriter import heaptracker +from rpython.rlib.jit import JitDriver, hint, dont_look_inside, promote +from rpython.rlib.rarithmetic import intmask +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin +from rpython.rtyper.rclass import FieldListAccessor +from rpython.jit.metainterp.warmspot import get_stats, get_translator +from rpython.jit.metainterp import history +from rpython.jit.metainterp.optimizeopt.test.test_util import LLtypeMixin def promote_virtualizable(*args): pass @@ -20,7 +20,7 @@ class Entry(ExtRegistryEntry): _about_ = promote_virtualizable def compute_result_annotation(self, *args): - from pypy.annotation.model import lltype_to_annotation + from rpython.annotator.model import lltype_to_annotation return lltype_to_annotation(lltype.Void) def specialize_call(self, hop): @@ -1044,7 +1044,7 @@ class ImplicitVirtualizableTests: assert res == 55 self.check_simple_loop(setfield_gc=0, getfield_gc=0) - from pypy.jit.backend.test.support import BaseCompiledMixin + from rpython.jit.backend.test.support import BaseCompiledMixin if isinstance(self, BaseCompiledMixin): return @@ -1325,7 +1325,7 @@ class ImplicitVirtualizableTests: assert res == run_interp(4) def test_guard_failure_in_inlined_function(self): - from pypy.rpython.annlowlevel import hlstr + from rpython.rtyper.annlowlevel import hlstr class Frame(object): _virtualizable2_ = ['n', 'next'] diff --git a/pypy/jit/metainterp/test/test_virtualref.py b/rpython/jit/metainterp/test/test_virtualref.py similarity index 97% rename from pypy/jit/metainterp/test/test_virtualref.py rename to rpython/jit/metainterp/test/test_virtualref.py index 8bf6aa89452ed3f4bb149c21726c09a9b4463fd6..7259ba67ee43123e1ca78aeb6386a35505d3ff48 100644 --- a/pypy/jit/metainterp/test/test_virtualref.py +++ b/rpython/jit/metainterp/test/test_virtualref.py @@ -1,13 +1,13 @@ import py -from pypy.rpython.lltypesystem import lltype, llmemory, lloperation -from pypy.rpython.exceptiondata import UnknownException -from pypy.rlib.jit import JitDriver, dont_look_inside, vref_None -from pypy.rlib.jit import virtual_ref, virtual_ref_finish, InvalidVirtualRef -from pypy.rlib.jit import non_virtual_ref -from pypy.rlib.objectmodel import compute_unique_id -from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin, _get_jitcodes -from pypy.jit.metainterp.resoperation import rop -from pypy.jit.metainterp.virtualref import VirtualRefInfo +from rpython.rtyper.lltypesystem import lltype, llmemory, lloperation +from rpython.rtyper.exceptiondata import UnknownException +from rpython.rlib.jit import JitDriver, dont_look_inside, vref_None +from rpython.rlib.jit import virtual_ref, virtual_ref_finish, InvalidVirtualRef +from rpython.rlib.jit import non_virtual_ref +from rpython.rlib.objectmodel import compute_unique_id +from rpython.jit.metainterp.test.support import LLJitMixin, OOJitMixin, _get_jitcodes +from rpython.jit.metainterp.resoperation import rop +from rpython.jit.metainterp.virtualref import VirtualRefInfo debug_print = lloperation.llop.debug_print @@ -112,7 +112,7 @@ class VRefTests: bxs2[0].getref(lltype.Ptr(JIT_VIRTUAL_REF)).virtual_token = 1234567 # # try reloading from blackhole.py's point of view - from pypy.jit.metainterp.resume import ResumeDataDirectReader + from rpython.jit.metainterp.resume import ResumeDataDirectReader cpu = self.metainterp.cpu cpu.get_latest_value_count = lambda : len(guard_op.getfailargs()) cpu.get_latest_value_int = lambda i:guard_op.getfailargs()[i].getint() diff --git a/pypy/jit/metainterp/test/test_virtualstate.py b/rpython/jit/metainterp/test/test_virtualstate.py similarity index 97% rename from pypy/jit/metainterp/test/test_virtualstate.py rename to rpython/jit/metainterp/test/test_virtualstate.py index 1db6d6667ef0680c0dd8ec5ecad79cea8a0dd27f..b0a9ce5b71f9e9ba34367b04e2f13abcb7ca3547 100644 --- a/pypy/jit/metainterp/test/test_virtualstate.py +++ b/rpython/jit/metainterp/test/test_virtualstate.py @@ -1,17 +1,17 @@ from __future__ import with_statement import py -from pypy.jit.metainterp.optimize import InvalidLoop -from pypy.jit.metainterp.optimizeopt.virtualstate import VirtualStateInfo, VStructStateInfo, \ +from rpython.jit.metainterp.optimize import InvalidLoop +from rpython.jit.metainterp.optimizeopt.virtualstate import VirtualStateInfo, VStructStateInfo, \ VArrayStateInfo, NotVirtualStateInfo, VirtualState, ShortBoxes -from pypy.jit.metainterp.optimizeopt.optimizer import OptValue -from pypy.jit.metainterp.history import BoxInt, BoxFloat, BoxPtr, ConstInt, ConstPtr -from pypy.rpython.lltypesystem import lltype, llmemory -from pypy.jit.metainterp.optimizeopt.test.test_util import LLtypeMixin, BaseTest, \ +from rpython.jit.metainterp.optimizeopt.optimizer import OptValue +from rpython.jit.metainterp.history import BoxInt, BoxFloat, BoxPtr, ConstInt, ConstPtr +from rpython.rtyper.lltypesystem import lltype, llmemory +from rpython.jit.metainterp.optimizeopt.test.test_util import LLtypeMixin, BaseTest, \