PyPy support

* Use proper PYPY 32 opcodes
* handle opcodes LOOKUP_METHOD and CALL_METHOD
* Administrative stuff for PyPy
This commit is contained in:
rocky
2016-07-24 18:54:51 -04:00
parent 808e468e5e
commit 1c50e34c30
12 changed files with 68 additions and 36 deletions

View File

@@ -1802,13 +1802,18 @@ class SourceWalker(GenericASTTraversal, object):
def customize(self, customize):
"""
Special handling for opcodes that take a variable number
Special handling for opcodes, such as those that take a variable number
of arguments -- we add a new entry for each in TABLE_R.
"""
for k, v in list(customize.items()):
if k in TABLE_R:
continue
op = k[ :k.rfind('_') ]
if k == 'CALL_METHOD':
# This happens in PyPy only
TABLE_R[k] = ('%c(%P)', 0, (1, -1, ', ', 100))
if op == 'CALL_FUNCTION':
TABLE_R[k] = ('%c(%P)', 0, (1, -1, ', ', 100))
elif op in ('CALL_FUNCTION_VAR',