Handle PyPy CALL_METHOD op more correctly

Start testing pypy2.7 and 3.2 bytecodes
This commit is contained in:
rocky
2016-07-25 13:05:54 -04:00
parent 7e1aa6a34d
commit a3e10db8dc
17 changed files with 70 additions and 29 deletions

View File

@@ -89,13 +89,15 @@ class Scanner3(scan.Scanner):
# Opcodes that take a variable number of arguments
# (expr's)
self.varargs = frozenset([self.opc.BUILD_LIST,
self.opc.BUILD_TUPLE,
self.opc.BUILD_SET,
self.opc.BUILD_SLICE,
self.opc.BUILD_MAP,
self.opc.UNPACK_SEQUENCE,
self.opc.RAISE_VARARGS])
varargs_ops = set([
self.opc.BUILD_LIST, self.opc.BUILD_TUPLE,
self.opc.BUILD_SET, self.opc.BUILD_SLICE,
self.opc.BUILD_MAP, self.opc.UNPACK_SEQUENCE,
self.opc.RAISE_VARARGS])
if is_pypy:
varargs_ops.add(self.opc.CALL_METHOD)
self.varargs_ops = frozenset(varargs_ops)
# Not really a set, but still clasification-like
self.statement_opcode_sequences = [
@@ -234,7 +236,7 @@ class Scanner3(scan.Scanner):
)
)
continue
elif op in self.varargs:
elif op in self.varargs_ops:
pos_args = inst.argval
opname = '%s_%d' % (opname, pos_args)
elif self.is_pypy and opname in ('CALL_METHOD', 'JUMP_IF_NOT_DEBUG'):