[pypy-commit] pypy s390x-backend: removed the function field _arguments_, a new function rebuilds the information needed for the auto encoding test
plan_rich
pypy.commits at gmail.com
Tue Mar 1 09:03:37 EST 2016
Author: Richard Plangger <planrichi at gmail.com>
Branch: s390x-backend
Changeset: r82636:a5e2222f58cc
Date: 2016-03-01 15:02 +0100
http://bitbucket.org/pypy/pypy/changeset/a5e2222f58cc/
Log: removed the function field _arguments_, a new function rebuilds the
information needed for the auto encoding test
diff --git a/rpython/jit/backend/zarch/instruction_builder.py b/rpython/jit/backend/zarch/instruction_builder.py
--- a/rpython/jit/backend/zarch/instruction_builder.py
+++ b/rpython/jit/backend/zarch/instruction_builder.py
@@ -585,6 +585,21 @@
def is_branch_relative(name):
return name.startswith('BR') or name.endswith('J')
+def get_arg_types_of(mnemonic):
+ """ NOT_RPYTHON """
+ params = all_mnemonic_codes[mnemonic.split("_")[0]]
+ if len(params) == 2:
+ argtypes = None
+ (instrtype, args) = params
+ else:
+ (instrtype, args, argtypes) = params
+ builder = globals()['build_' + instrtype]
+ if argtypes:
+ func = builder(mnemonic, args, argtypes)
+ else:
+ func = builder(mnemonic, args)
+ return func._arguments_
+
def build_instr_codes(clazz):
for mnemonic, params in all_mnemonic_codes.items():
argtypes = None
diff --git a/rpython/jit/backend/zarch/test/test_auto_encoding.py b/rpython/jit/backend/zarch/test/test_auto_encoding.py
--- a/rpython/jit/backend/zarch/test/test_auto_encoding.py
+++ b/rpython/jit/backend/zarch/test/test_auto_encoding.py
@@ -167,9 +167,8 @@
methname = '?'
def get_func_arg_types(self, methodname):
- from rpython.jit.backend.zarch.codebuilder import AbstractZARCHBuilder
- func = getattr(AbstractZARCHBuilder, methodname)
- return func._arguments_
+ from rpython.jit.backend.zarch.instruction_builder import get_arg_types_of
+ return get_arg_types_of(methodname)
def operand_combinations(self, methodname, modes, arguments):
mapping = {
More information about the pypy-commit
mailing list