Change the meaning of --interpreter option in testing scripts.
Previously --interpreter used to run the tests on the slow C++
switch-interpreter (the analogue of -Xint option to dalvikvm). Now it
runs the tests on the fast assembly interpreter, Nterp (the analogue of
-Xusefit:false option to dalvikvm).
--interp-ac can stil be used to run tests on the switch interpreter.
Bug: 271573990
Test: `art/test.py --host -r 001-HelloWorld` with the following
modifications that ensure ART runs in the intended mode:
- no modifications: 10/10 tests pass
- deliberaly break Nterp: 2/10 tests pass (only --interp-ac ones)
- deliberately break JIT: 8/10 tests pass (only --jit tests fail)
Change-Id: If2ec1df96b65c7e2dd7e81dff3ee0378bde62751
diff --git a/test/default_run.py b/test/default_run.py
index 7e28dfc..6fcaa16 100755
--- a/test/default_run.py
+++ b/test/default_run.py
@@ -73,6 +73,7 @@
argp.add_argument("--image", default=True, action=opt_bool)
argp.add_argument("--instruction-set-features", default="")
argp.add_argument("--interpreter", action="store_true")
+ argp.add_argument("--switch-interpreter", action="store_true")
argp.add_argument("--invoke-with", default=[], action="append")
argp.add_argument("--jit", action="store_true")
argp.add_argument("--jvm", action="store_true")
@@ -277,6 +278,7 @@
USE_EXTRACTED_ZIPAPEX = (args.runtime_extracted_zipapex != "")
EXTRACTED_ZIPAPEX_LOC = args.runtime_extracted_zipapex
INTERPRETER = args.interpreter
+ SWITCH_INTERPRETER = args.switch_interpreter
JIT = args.jit
INVOKE_WITH = " ".join(args.invoke_with)
USE_JVMTI = args.jvmti
@@ -655,15 +657,20 @@
GDB = "gdb"
GDB_ARGS += f" -d '{ANDROID_BUILD_TOP}' --args {DALVIKVM}"
- if INTERPRETER:
+ if SWITCH_INTERPRETER:
+ # run on the slow switch-interpreter enabled with -Xint
INT_OPTS += " -Xint"
+ if INTERPRETER:
+ # run on Nterp the fast interpreter, not the slow switch-interpreter enabled with -Xint
+ INT_OPTS += " -Xusejit:false"
+
if JIT:
INT_OPTS += " -Xusejit:true"
else:
INT_OPTS += " -Xusejit:false"
- if INTERPRETER or JIT:
+ if INTERPRETER or SWITCH_INTERPRETER or JIT:
if VERIFY == "y":
INT_OPTS += " -Xcompiler-option --compiler-filter=verify"
COMPILE_FLAGS += " --compiler-filter=verify"
diff --git a/test/run-test b/test/run-test
index 2760db9..9565ebb 100755
--- a/test/run-test
+++ b/test/run-test
@@ -409,6 +409,9 @@
elif arg == "--interpreter":
run_args += ["--interpreter"]
shift()
+ elif arg == "--switch-interpreter":
+ run_args += ["--switch-interpreter"]
+ shift()
elif arg == "--jit":
run_args += ["--jit"]
shift()
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py
index 247a6aa..6a348dc 100755
--- a/test/testrunner/testrunner.py
+++ b/test/testrunner/testrunner.py
@@ -535,7 +535,7 @@
elif compiler == 'interpreter':
args_test += ['--interpreter']
elif compiler == 'interp-ac':
- args_test += ['--interpreter', '--verify-soft-fail']
+ args_test += ['--switch-interpreter', '--verify-soft-fail']
elif compiler == 'jit':
args_test += ['--jit']
elif compiler == 'jit-on-first-use':