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

@@ -192,8 +192,11 @@ class Scanner2(scan.Scanner):
opname = '%s_%d' % (opname, oparg)
if op != self.opc.BUILD_SLICE:
customize[opname] = oparg
elif self.is_pypy and opname in ('CALL_METHOD', 'JUMP_IF_NOT_DEBUG'):
customize[opname] = oparg
elif self.is_pypy and opname in ('LOOKUP_METHOD', 'JUMP_IF_NOT_DEBUG'):
# The value in the dict is used in rule uniquness key.
# These ops need only be done once. Hence we use arbitrary constant
# 0.
customize[opname] = 0
elif op == self.opc.JUMP_ABSOLUTE:
target = self.get_target(offset)
if target < offset: