[pypy-commit] pypy py3.7-call-changes: translatability

cfbolz pypy.commits at gmail.com
Fri Jan 17 08:04:42 EST 2020


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: py3.7-call-changes
Changeset: r98547:e5435b4acb17
Date: 2020-01-17 14:03 +0100
http://bitbucket.org/pypy/pypy/changeset/e5435b4acb17/

Log:	translatability

diff --git a/lib-python/3/opcode.py b/lib-python/3/opcode.py
--- a/lib-python/3/opcode.py
+++ b/lib-python/3/opcode.py
@@ -178,7 +178,6 @@
 hasnargs.append(131)
 def_op('MAKE_FUNCTION', 132)    # Number of args with default values
 def_op('BUILD_SLICE', 133)      # Number of items
-def_op('MAKE_CLOSURE', 134)
 def_op('LOAD_CLOSURE', 135)
 hasfree.append(135)
 def_op('LOAD_DEREF', 136)
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
@@ -768,9 +768,6 @@
 def _compute_BUILD_MAP_UNPACK_WITH_CALL(arg):
     return 1 - (arg & 0xFF)
 
-def _compute_MAKE_CLOSURE(arg):
-    return -2 - _num_args(arg) - ((arg >> 16) & 0xFFFF)
-
 def _compute_MAKE_FUNCTION(arg):
     return -1 - bool(arg & 0x01) - bool(arg & 0x02) - bool(arg & 0x04) - bool(arg & 0x08)
 
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
@@ -1459,6 +1459,7 @@
         else:
             keyword_names_w = []
             for kw in call.keywords:
+                assert isinstance(kw, ast.keyword)
                 assert kw.arg  # checked by self._call_has_no_star_args
                 w_name = space.newtext(kw.arg)
                 keyword_names_w.append(misc.intern_if_common_string(space, w_name))
@@ -1963,6 +1964,7 @@
             return
         # we might get away with using CALL_FUNCTION_KW if there are no **kwargs
         for kw in self.keywords:
+            assert isinstance(kw, ast.keyword)
             if kw.arg is None:
                 # we found a **kwarg, thus we're using CALL_FUNCTION_EX, we
                 # need to pack up positional arguments first
diff --git a/pypy/tool/opcode3.py b/pypy/tool/opcode3.py
--- a/pypy/tool/opcode3.py
+++ b/pypy/tool/opcode3.py
@@ -178,7 +178,6 @@
 hasnargs.append(131)
 def_op('MAKE_FUNCTION', 132)    # Number of args with default values
 def_op('BUILD_SLICE', 133)      # Number of items
-def_op('MAKE_CLOSURE', 134)
 def_op('LOAD_CLOSURE', 135)
 hasfree.append(135)
 def_op('LOAD_DEREF', 136)


More information about the pypy-commit mailing list