Author: Alexander Hesse <[email protected]>
Branch: split-rpython
Changeset: r59705:4f3d2f54abd4
Date: 2013-01-04 16:41 +0100
http://bitbucket.org/pypy/pypy/changeset/4f3d2f54abd4/
Log: Moved pypy.tool.error, pypy.tool.leakfinder, pypy.tool.logparser,
pypy.tool.progressbar and pypy.tool.stdlib_opcode to rpython
diff --git a/pypy/interpreter/astcompiler/assemble.py
b/pypy/interpreter/astcompiler/assemble.py
--- a/pypy/interpreter/astcompiler/assemble.py
+++ b/pypy/interpreter/astcompiler/assemble.py
@@ -4,7 +4,7 @@
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 rpython.rlib.objectmodel import we_are_translated
diff --git a/pypy/interpreter/astcompiler/codegen.py
b/pypy/interpreter/astcompiler/codegen.py
--- a/pypy/interpreter/astcompiler/codegen.py
+++ b/pypy/interpreter/astcompiler/codegen.py
@@ -10,7 +10,7 @@
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/optimize.py
b/pypy/interpreter/astcompiler/optimize.py
--- a/pypy/interpreter/astcompiler/optimize.py
+++ b/pypy/interpreter/astcompiler/optimize.py
@@ -2,7 +2,7 @@
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 rpython.rlib.unroll import unrolling_iterable
from rpython.rlib.runicode import MAXUNICODE
diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py
b/pypy/interpreter/astcompiler/test/test_compiler.py
--- a/pypy/interpreter/astcompiler/test/test_compiler.py
+++ b/pypy/interpreter/astcompiler/test/test_compiler.py
@@ -4,7 +4,7 @@
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/pycode.py b/pypy/interpreter/pycode.py
--- a/pypy/interpreter/pycode.py
+++ b/pypy/interpreter/pycode.py
@@ -17,7 +17,7 @@
from rpython.rlib.debug import make_sure_not_resized
from rpython.rlib import jit
from rpython.rlib.objectmodel import compute_hash
-from pypy.tool.stdlib_opcode import opcodedesc, HAVE_ARGUMENT
+from rpython.tool.stdlib_opcode import opcodedesc, HAVE_ARGUMENT
class BytecodeCorruption(Exception):
diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py
--- a/pypy/interpreter/pyframe.py
+++ b/pypy/interpreter/pyframe.py
@@ -12,8 +12,8 @@
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 pypy.tool import stdlib_opcode
-from pypy.tool.stdlib_opcode import host_bytecode_spec
+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
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -15,7 +15,7 @@
from rpython.rlib.rarithmetic import r_uint, intmask
from rpython.rlib.unroll import unrolling_iterable
from rpython.rlib.debug import check_nonneg
-from pypy.tool.stdlib_opcode import (bytecode_spec,
+from rpython.tool.stdlib_opcode import (bytecode_spec,
unrolling_all_opcode_descs)
def unaryoperation(operationname):
diff --git a/pypy/module/_continuation/interp_pickle.py
b/pypy/module/_continuation/interp_pickle.py
--- a/pypy/module/_continuation/interp_pickle.py
+++ b/pypy/module/_continuation/interp_pickle.py
@@ -1,4 +1,4 @@
-from pypy.tool import stdlib_opcode as pythonopcode
+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
diff --git a/pypy/module/cpyext/test/test_cpyext.py
b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -17,7 +17,7 @@
from pypy.module.cpyext.pyobject import Py_DecRef, InvalidPointerException
from rpython.translator.goal import autopath
from rpython.tool.identity_dict import identity_dict
-from pypy.tool import leakfinder
+from rpython.tool import leakfinder
@api.cpython_api([], api.PyObject)
def PyPy_Crash1(space):
diff --git a/pypy/module/cpyext/test/test_pystate.py
b/pypy/module/cpyext/test/test_pystate.py
--- a/pypy/module/cpyext/test/test_pystate.py
+++ b/pypy/module/cpyext/test/test_pystate.py
@@ -6,7 +6,7 @@
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/pypyjit/interp_jit.py
b/pypy/module/pypyjit/interp_jit.py
--- a/pypy/module/pypyjit/interp_jit.py
+++ b/pypy/module/pypyjit/interp_jit.py
@@ -27,7 +27,7 @@
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/test_pypy_c/test_00_model.py
b/pypy/module/pypyjit/test_pypy_c/test_00_model.py
--- a/pypy/module/pypyjit/test_pypy_c/test_00_model.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_00_model.py
@@ -5,7 +5,7 @@
import py
from lib_pypy import disassembler
from rpython.tool.udir import udir
-from pypy.tool import logparser
+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,
diff --git a/pypy/module/sys/vm.py b/pypy/module/sys/vm.py
--- a/pypy/module/sys/vm.py
+++ b/pypy/module/sys/vm.py
@@ -106,7 +106,7 @@
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:
diff --git a/pypy/tool/jitlogparser/parser.py b/pypy/tool/jitlogparser/parser.py
--- a/pypy/tool/jitlogparser/parser.py
+++ b/pypy/tool/jitlogparser/parser.py
@@ -2,7 +2,7 @@
from rpython.jit.metainterp.resoperation import opname
from rpython.jit.tool.oparser import OpParser
-from pypy.tool.logparser import parse_log_file, extract_category
+from rpython.tool.logparser import parse_log_file, extract_category
from copy import copy
def parse_code_data(arg):
diff --git a/pypy/tool/pydis.py b/pypy/tool/pydis.py
--- a/pypy/tool/pydis.py
+++ b/pypy/tool/pydis.py
@@ -8,8 +8,8 @@
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/plugins.py b/pypy/tool/pytest/plugins.py
--- 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/test/test_error.py b/pypy/tool/test/test_error.py
--- a/pypy/tool/test/test_error.py
+++ b/pypy/tool/test/test_error.py
@@ -3,7 +3,7 @@
"""
from rpython.translator.translator import TranslationContext
-from pypy.tool.error import AnnotatorError
+from rpython.tool.error import AnnotatorError
from rpython.annotator.model import UnionError
import py
diff --git a/pypy/tool/test/test_leakfinder.py
b/pypy/tool/test/test_leakfinder.py
--- 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
--- a/pypy/tool/test/test_logparser.py
+++ b/pypy/tool/test/test_logparser.py
@@ -1,5 +1,5 @@
from rpython.tool.udir import udir
-from pypy.tool.logparser import *
+from rpython.tool.logparser import *
globalpath = udir.join('test_logparser.log')
diff --git a/rpython/annotator/annrpython.py b/rpython/annotator/annrpython.py
--- a/rpython/annotator/annrpython.py
+++ b/rpython/annotator/annrpython.py
@@ -3,7 +3,7 @@
import types
from rpython.tool.ansi_print import ansi_log
from rpython.tool.pairtype import pair
-from pypy.tool.error import (format_blocked_annotation_error,
+from rpython.tool.error import (format_blocked_annotation_error,
AnnotatorError, gather_error, ErrorWrapper)
from rpython.flowspace.model import (Variable, Constant, FunctionGraph,
c_last_exception, checkgraph)
diff --git a/rpython/annotator/binaryop.py b/rpython/annotator/binaryop.py
--- a/rpython/annotator/binaryop.py
+++ b/rpython/annotator/binaryop.py
@@ -22,7 +22,7 @@
from rpython.annotator.bookkeeper import getbookkeeper
from rpython.flowspace.model import Variable, Constant
from rpython.rlib import rarithmetic
-from pypy.tool.error import AnnotatorError
+from rpython.tool.error import AnnotatorError
# convenience only!
def immutablevalue(x):
diff --git a/rpython/annotator/builtin.py b/rpython/annotator/builtin.py
--- a/rpython/annotator/builtin.py
+++ b/rpython/annotator/builtin.py
@@ -16,7 +16,7 @@
from rpython.annotator.bookkeeper import getbookkeeper
from rpython.annotator import description
from rpython.flowspace.model import Constant
-from pypy.tool.error import AnnotatorError
+from rpython.tool.error import AnnotatorError
import rpython.rlib.rarithmetic
import rpython.rlib.objectmodel
diff --git a/rpython/annotator/unaryop.py b/rpython/annotator/unaryop.py
--- a/rpython/annotator/unaryop.py
+++ b/rpython/annotator/unaryop.py
@@ -17,7 +17,7 @@
from rpython.annotator import builtin
from rpython.annotator.binaryop import _clone ## XXX where to put this?
from rpython.rtyper import extregistry
-from pypy.tool.error import AnnotatorError
+from rpython.tool.error import AnnotatorError
# convenience only!
def immutablevalue(x):
diff --git a/rpython/flowspace/bytecode.py b/rpython/flowspace/bytecode.py
--- a/rpython/flowspace/bytecode.py
+++ b/rpython/flowspace/bytecode.py
@@ -1,7 +1,7 @@
"""
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 rpython.flowspace.argument import Signature
from rpython.flowspace.flowcontext import BytecodeCorruption
diff --git a/rpython/flowspace/flowcontext.py b/rpython/flowspace/flowcontext.py
--- a/rpython/flowspace/flowcontext.py
+++ b/rpython/flowspace/flowcontext.py
@@ -5,8 +5,8 @@
import sys
import collections
-from pypy.tool.error import source_lines
-from pypy.tool.stdlib_opcode import host_bytecode_spec
+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)
diff --git a/rpython/flowspace/test/test_objspace.py
b/rpython/flowspace/test/test_objspace.py
--- a/rpython/flowspace/test/test_objspace.py
+++ b/rpython/flowspace/test/test_objspace.py
@@ -8,7 +8,7 @@
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
diff --git a/rpython/jit/backend/x86/test/test_runner.py
b/rpython/jit/backend/x86/test/test_runner.py
--- a/rpython/jit/backend/x86/test/test_runner.py
+++ b/rpython/jit/backend/x86/test/test_runner.py
@@ -522,7 +522,7 @@
self.cpu.setup_once()
def test_debugger_on(self):
- from pypy.tool.logparser import parse_log_file, extract_category
+ from rpython.tool.logparser import parse_log_file, extract_category
from rpython.rlib import debug
targettoken, preambletoken = TargetToken(), TargetToken()
diff --git a/rpython/jit/backend/x86/tool/viewcode.py
b/rpython/jit/backend/x86/tool/viewcode.py
--- a/rpython/jit/backend/x86/tool/viewcode.py
+++ b/rpython/jit/backend/x86/tool/viewcode.py
@@ -434,7 +434,7 @@
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/rpython/jit/tl/spli/interpreter.py
b/rpython/jit/tl/spli/interpreter.py
--- a/rpython/jit/tl/spli/interpreter.py
+++ b/rpython/jit/tl/spli/interpreter.py
@@ -1,5 +1,5 @@
import os
-from pypy.tool import stdlib_opcode
+from rpython.tool import stdlib_opcode
from rpython.jit.tl.spli import objects, pycode
from rpython.rlib.unroll import unrolling_iterable
from rpython.rlib.jit import JitDriver, promote, dont_look_inside
diff --git a/rpython/jit/tool/findadrinlog.py b/rpython/jit/tool/findadrinlog.py
--- a/rpython/jit/tool/findadrinlog.py
+++ b/rpython/jit/tool/findadrinlog.py
@@ -1,6 +1,6 @@
import autopath
import sys, re
-from pypy.tool import logparser
+from rpython.tool import logparser
# fflush(pypy_debug_file)
diff --git a/rpython/jit/tool/loopviewer.py b/rpython/jit/tool/loopviewer.py
--- a/rpython/jit/tool/loopviewer.py
+++ b/rpython/jit/tool/loopviewer.py
@@ -8,7 +8,7 @@
import sys
import optparse
from pprint import pprint
-from pypy.tool import logparser
+from rpython.tool import logparser
from rpython.jit.tool.oparser import parse
from rpython.jit.metainterp.history import ConstInt
from rpython.rtyper.lltypesystem import llmemory, lltype
diff --git a/rpython/jit/tool/showstats.py b/rpython/jit/tool/showstats.py
--- a/rpython/jit/tool/showstats.py
+++ b/rpython/jit/tool/showstats.py
@@ -3,7 +3,7 @@
import autopath
import sys, py
-from pypy.tool import logparser
+from rpython.tool import logparser
from rpython.jit.tool.oparser import parse
from rpython.jit.metainterp.resoperation import rop
from rpython.rtyper.lltypesystem import lltype, llmemory
diff --git a/rpython/jit/tool/test/test_jitoutput.py
b/rpython/jit/tool/test/test_jitoutput.py
--- a/rpython/jit/tool/test/test_jitoutput.py
+++ b/rpython/jit/tool/test/test_jitoutput.py
@@ -5,7 +5,7 @@
from rpython.jit.backend.llgraph import runner
from rpython.jit.metainterp.jitprof import Profiler, JITPROF_LINES
from rpython.jit.tool.jitoutput import parse_prof
-from pypy.tool.logparser import parse_log, extract_category
+from rpython.tool.logparser import parse_log, extract_category
def test_really_run():
""" This test checks whether output of jitprof did not change.
diff --git a/rpython/jit/tool/traceviewer.py b/rpython/jit/tool/traceviewer.py
--- a/rpython/jit/tool/traceviewer.py
+++ b/rpython/jit/tool/traceviewer.py
@@ -11,8 +11,8 @@
import autopath
from rpython.translator.tool.graphpage import GraphPage
from rpython.translator.tool.make_dot import DotGen
-from pypy.tool import logparser
-from pypy.tool import progressbar
+from rpython.tool import logparser
+from rpython.tool import progressbar
class SubPage(GraphPage):
def compute(self, graph):
diff --git a/rpython/rtyper/lltypesystem/lltype.py
b/rpython/rtyper/lltypesystem/lltype.py
--- a/rpython/rtyper/lltypesystem/lltype.py
+++ b/rpython/rtyper/lltypesystem/lltype.py
@@ -3,7 +3,7 @@
base_int, normalizedinttype, longlongmask,
longlonglongmask)
from rpython.rlib.objectmodel import Symbolic
from rpython.tool.identity_dict import identity_dict
-from pypy.tool import leakfinder
+from rpython.tool import leakfinder
from types import NoneType
from rpython.rlib.rarithmetic import maxint, is_valid_int, is_emulated_long
import weakref
diff --git a/rpython/rtyper/lltypesystem/test/test_lltype.py
b/rpython/rtyper/lltypesystem/test/test_lltype.py
--- a/rpython/rtyper/lltypesystem/test/test_lltype.py
+++ b/rpython/rtyper/lltypesystem/test/test_lltype.py
@@ -3,7 +3,7 @@
from rpython.rtyper.lltypesystem.lltype import *
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.tool.identity_dict import identity_dict
-from pypy.tool import leakfinder
+from rpython.tool import leakfinder
def isweak(p, T):
try:
diff --git a/rpython/rtyper/ootypesystem/test/test_oortype.py
b/rpython/rtyper/ootypesystem/test/test_oortype.py
--- a/rpython/rtyper/ootypesystem/test/test_oortype.py
+++ b/rpython/rtyper/ootypesystem/test/test_oortype.py
@@ -9,7 +9,7 @@
from rpython.translator.translator import TranslationContext, graphof
from rpython.rtyper.test.test_llinterp import interpret
from rpython.rlib.objectmodel import r_dict
-from pypy.tool.error import AnnotatorError
+from rpython.tool.error import AnnotatorError
from rpython.rtyper.ootypesystem import ooregistry # side effects
def gengraph(f, args=[], viewBefore=False, viewAfter=False, mangle=True):
diff --git a/rpython/rtyper/test/test_llinterp.py
b/rpython/rtyper/test/test_llinterp.py
--- a/rpython/rtyper/test/test_llinterp.py
+++ b/rpython/rtyper/test/test_llinterp.py
@@ -11,7 +11,7 @@
from rpython.annotator import model as annmodel
from rpython.annotator.model import lltype_to_annotation
from rpython.rlib.rarithmetic import r_uint, ovfcheck
-from pypy.tool import leakfinder
+from rpython.tool import leakfinder
from pypy import conftest
diff --git a/pypy/tool/error.py b/rpython/tool/error.py
rename from pypy/tool/error.py
rename to rpython/tool/error.py
diff --git a/pypy/tool/leakfinder.py b/rpython/tool/leakfinder.py
rename from pypy/tool/leakfinder.py
rename to rpython/tool/leakfinder.py
diff --git a/pypy/tool/logparser.py b/rpython/tool/logparser.py
rename from pypy/tool/logparser.py
rename to rpython/tool/logparser.py
--- a/pypy/tool/logparser.py
+++ b/rpython/tool/logparser.py
@@ -10,7 +10,7 @@
import autopath
import sys, re
from rpython.rlib.debug import DebugLog
-from pypy.tool import progressbar
+from rpython.tool import progressbar
def parse_log_file(filename, verbose=True):
f = open(filename, 'r')
diff --git a/pypy/tool/progressbar.py b/rpython/tool/progressbar.py
rename from pypy/tool/progressbar.py
rename to rpython/tool/progressbar.py
diff --git a/pypy/tool/stdlib_opcode.py b/rpython/tool/stdlib_opcode.py
rename from pypy/tool/stdlib_opcode.py
rename to rpython/tool/stdlib_opcode.py
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit