[pypy-svn] r76146 - in pypy/branch/kill-caninline/pypy: interpreter interpreter/astcompiler interpreter/test jit/backend/x86/test module/__builtin__ module/pypyjit module/pypyjit/test rlib/test
arigo at codespeak.net
arigo at codespeak.net
Mon Jul 12 15:56:41 CEST 2010
Author: arigo
Date: Mon Jul 12 15:56:39 2010
New Revision: 76146
Removed:
pypy/branch/kill-caninline/pypy/module/pypyjit/test/test_can_inline.py
Modified:
pypy/branch/kill-caninline/pypy/interpreter/astcompiler/consts.py
pypy/branch/kill-caninline/pypy/interpreter/pycode.py
pypy/branch/kill-caninline/pypy/interpreter/test/test_code.py
pypy/branch/kill-caninline/pypy/jit/backend/x86/test/test_ztranslation.py
pypy/branch/kill-caninline/pypy/module/__builtin__/functional.py
pypy/branch/kill-caninline/pypy/module/pypyjit/interp_jit.py
pypy/branch/kill-caninline/pypy/rlib/test/test_jit.py
Log:
Kill "can_inline" in the PyPy interpreter.
Modified: pypy/branch/kill-caninline/pypy/interpreter/astcompiler/consts.py
==============================================================================
--- pypy/branch/kill-caninline/pypy/interpreter/astcompiler/consts.py (original)
+++ pypy/branch/kill-caninline/pypy/interpreter/astcompiler/consts.py Mon Jul 12 15:56:39 2010
@@ -9,7 +9,6 @@
CO_NESTED = 0x0010
CO_GENERATOR = 0x0020
CO_NOFREE = 0x0040
-CO_CONTAINSLOOP = 0x0080
CO_CONTAINSGLOBALS = 0x0800
CO_GENERATOR_ALLOWED = 0x1000
CO_FUTURE_DIVISION = 0x2000
Modified: pypy/branch/kill-caninline/pypy/interpreter/pycode.py
==============================================================================
--- pypy/branch/kill-caninline/pypy/interpreter/pycode.py (original)
+++ pypy/branch/kill-caninline/pypy/interpreter/pycode.py Mon Jul 12 15:56:39 2010
@@ -13,7 +13,7 @@
from pypy.interpreter.baseobjspace import ObjSpace, W_Root
from pypy.interpreter.astcompiler.consts import (CO_OPTIMIZED,
CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS, CO_VARKEYWORDS, CO_NESTED,
- CO_GENERATOR, CO_CONTAINSLOOP, CO_CONTAINSGLOBALS)
+ CO_GENERATOR, CO_CONTAINSGLOBALS)
from pypy.rlib.rarithmetic import intmask
from pypy.rlib.debug import make_sure_not_resized, make_sure_not_modified
from pypy.rlib import jit
@@ -133,9 +133,7 @@
while opcode == opcodedesc.EXTENDED_ARG.index:
opcode = ord(co_code[next_instr])
next_instr += 3
- if opcode == opcodedesc.JUMP_ABSOLUTE.index:
- self.co_flags |= CO_CONTAINSLOOP
- elif opcode == opcodedesc.LOAD_GLOBAL.index:
+ if opcode == opcodedesc.LOAD_GLOBAL.index:
self.co_flags |= CO_CONTAINSGLOBALS
elif opcode == opcodedesc.LOAD_NAME.index:
self.co_flags |= CO_CONTAINSGLOBALS
Modified: pypy/branch/kill-caninline/pypy/interpreter/test/test_code.py
==============================================================================
--- pypy/branch/kill-caninline/pypy/interpreter/test/test_code.py (original)
+++ pypy/branch/kill-caninline/pypy/interpreter/test/test_code.py Mon Jul 12 15:56:39 2010
@@ -184,8 +184,6 @@
# CO_NESTED
assert f(4).func_code.co_flags & 0x10
assert f.func_code.co_flags & 0x10 == 0
- # check for CO_CONTAINSLOOP
- assert not f.func_code.co_flags & 0x0080
# check for CO_CONTAINSGLOBALS
assert not f.func_code.co_flags & 0x0800
@@ -198,9 +196,6 @@
return [l for l in [1, 2, 3, 4]]
"""
- # check for CO_CONTAINSLOOP
- assert f.func_code.co_flags & 0x0080
- assert g.func_code.co_flags & 0x0080
# check for CO_CONTAINSGLOBALS
assert f.func_code.co_flags & 0x0800
assert not g.func_code.co_flags & 0x0800
Modified: pypy/branch/kill-caninline/pypy/jit/backend/x86/test/test_ztranslation.py
==============================================================================
--- pypy/branch/kill-caninline/pypy/jit/backend/x86/test/test_ztranslation.py (original)
+++ pypy/branch/kill-caninline/pypy/jit/backend/x86/test/test_ztranslation.py Mon Jul 12 15:56:39 2010
@@ -74,8 +74,7 @@
driver = JitDriver(greens = ['codeno'], reds = ['i', 'frame'],
virtualizables = ['frame'],
- get_printable_location = lambda codeno : str(codeno),
- can_inline = lambda codeno : False)
+ get_printable_location = lambda codeno: str(codeno))
class SomewhereElse(object):
pass
Modified: pypy/branch/kill-caninline/pypy/module/__builtin__/functional.py
==============================================================================
--- pypy/branch/kill-caninline/pypy/module/__builtin__/functional.py (original)
+++ pypy/branch/kill-caninline/pypy/module/__builtin__/functional.py Mon Jul 12 15:56:39 2010
@@ -221,8 +221,7 @@
from pypy.rlib.jit import JitDriver
mapjitdriver = JitDriver(greens = ['code'],
- reds = ['w_func', 'w_iter', 'result_w'],
- can_inline = lambda *args: False)
+ reds = ['w_func', 'w_iter', 'result_w'])
def map_single_user_function(code, w_func, w_iter):
result_w = []
while True:
Modified: pypy/branch/kill-caninline/pypy/module/pypyjit/interp_jit.py
==============================================================================
--- pypy/branch/kill-caninline/pypy/module/pypyjit/interp_jit.py (original)
+++ pypy/branch/kill-caninline/pypy/module/pypyjit/interp_jit.py Mon Jul 12 15:56:39 2010
@@ -9,7 +9,7 @@
import pypy.interpreter.pyopcode # for side-effects
from pypy.interpreter.error import OperationError, operationerrfmt
from pypy.interpreter.gateway import ObjSpace, Arguments
-from pypy.interpreter.pycode import PyCode, CO_CONTAINSLOOP
+from pypy.interpreter.pycode import PyCode
from pypy.interpreter.pyframe import PyFrame
from pypy.interpreter.pyopcode import ExitFrame
from opcode import opmap
@@ -24,9 +24,6 @@
JUMP_ABSOLUTE = opmap['JUMP_ABSOLUTE']
-def can_inline(next_instr, bytecode):
- return not bool(bytecode.co_flags & CO_CONTAINSLOOP)
-
def get_printable_location(next_instr, bytecode):
from pypy.tool.stdlib_opcode import opcode_method_names
name = opcode_method_names[ord(bytecode.co_code[next_instr])]
@@ -57,8 +54,7 @@
## blockstack = frame.blockstack
## return (valuestackdepth, blockstack)
-pypyjitdriver = PyPyJitDriver(can_inline = can_inline,
- get_printable_location = get_printable_location,
+pypyjitdriver = PyPyJitDriver(get_printable_location = get_printable_location,
get_jitcell_at = get_jitcell_at,
set_jitcell_at = set_jitcell_at,
confirm_enter_jit = confirm_enter_jit)
Modified: pypy/branch/kill-caninline/pypy/rlib/test/test_jit.py
==============================================================================
--- pypy/branch/kill-caninline/pypy/rlib/test/test_jit.py (original)
+++ pypy/branch/kill-caninline/pypy/rlib/test/test_jit.py Mon Jul 12 15:56:39 2010
@@ -59,11 +59,9 @@
def test_annotate_hooks(self):
- def can_inline(m): pass
def get_printable_location(m): pass
myjitdriver = JitDriver(greens=['m'], reds=['n'],
- can_inline=can_inline,
get_printable_location=get_printable_location)
def fn(n):
m = 42.5
@@ -81,9 +79,8 @@
return [v.concretetype for v in graph.getargs()]
raise Exception, 'function %r has not been annotated' % func
- can_inline_args = getargs(can_inline)
get_printable_location_args = getargs(get_printable_location)
- assert can_inline_args == get_printable_location_args == [lltype.Float]
+ assert get_printable_location_args == [lltype.Float]
def test_annotate_argumenterror(self):
myjitdriver = JitDriver(greens=['m'], reds=['n'])
More information about the Pypy-commit
mailing list