diff options
author | 2015-07-10 18:27:47 -0700 | |
---|---|---|
committer | 2015-07-17 17:38:46 -0700 | |
commit | 7617abdb402fd0419daa3eefb2ad059ccbb8b6db (patch) | |
tree | 85ca02f6446cd50523156ea916d5524eaf3bf2dc /build | |
parent | 479ebe076561e4a48129ab0c78cf8ca93c44baf6 (diff) |
runtime: Add -Xverify:softfail and ART_TEST_INTERPRETER_ACCESS_CHECKS
Use ART_TEST_INTERPRETER_ACCESS_CHECKS=true to run all the tests through
the interpreter with access checks enabled. The normal interpreter tests
do not currently enable access checks, which means that a large part of
the interpreter codebase is untested.
The verifier will force every class into a soft fail mode if
-Xverify:softfail is used, thereby ensuring that if used along with the
interpreter (-Xint) that the interpret is always in access checks mode.
This is used alongside with --compile-filter=verify-at-runtime to
prevent the AOT compiler from putting down any code.
Change-Id: I35a10ed8c43d76fa96133cf01fdad497da387200
Diffstat (limited to 'build')
-rw-r--r-- | build/Android.common_test.mk | 1 | ||||
-rw-r--r-- | build/Android.oat.mk | 26 |
2 files changed, 20 insertions, 7 deletions
diff --git a/build/Android.common_test.mk b/build/Android.common_test.mk index 45b649047f..2f43f5f809 100644 --- a/build/Android.common_test.mk +++ b/build/Android.common_test.mk @@ -45,6 +45,7 @@ ART_TEST_DEFAULT_COMPILER ?= true # Do you want interpreter tests run? ART_TEST_INTERPRETER ?= $(ART_TEST_FULL) +ART_TEST_INTERPRETER_ACCESS_CHECKS ?= $(ART_TEST_FULL) # Do you want JIT tests run? ART_TEST_JIT ?= $(ART_TEST_FULL) diff --git a/build/Android.oat.mk b/build/Android.oat.mk index 728469c2c4..c70e12deec 100644 --- a/build/Android.oat.mk +++ b/build/Android.oat.mk @@ -31,7 +31,7 @@ ifeq ($($(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES),) endif # Use dex2oat debug version for better error reporting -# $(1): compiler - default, optimizing, jit or interpreter. +# $(1): compiler - default, optimizing, jit, interpreter or interpreter-access-checks. # $(2): pic/no-pic # $(3): 2ND_ or undefined, 2ND_ for 32-bit host builds. # $(4): wrapper, e.g., valgrind. @@ -64,12 +64,16 @@ define create-core-oat-host-rules core_compile_options += --compiler-filter=interpret-only core_infix := -interpreter endif + ifeq ($(1),interpreter-access-checks) + core_compile_options += --compiler-filter=verify-at-runtime --runtime-arg -Xverify:softfail + core_infix := -interpreter-access-checks + endif ifeq ($(1),default) # Default has no infix, no compile options. endif - ifneq ($(filter-out default interpreter jit optimizing,$(1)),) + ifneq ($(filter-out default interpreter interpreter-access-checks jit optimizing,$(1)),) #Technically this test is not precise, but hopefully good enough. - $$(error found $(1) expected default, interpreter, jit or optimizing) + $$(error found $(1) expected default, interpreter, interpreter-access-checks, jit or optimizing) endif ifeq ($(2),pic) @@ -127,7 +131,7 @@ $$(core_oat_name): $$(core_image_name) core_pic_infix := endef # create-core-oat-host-rules -# $(1): compiler - default, optimizing, jit or interpreter. +# $(1): compiler - default, optimizing, jit, interpreter or interpreter-access-checks. # $(2): wrapper. # $(3): dex2oat suffix. define create-core-oat-host-rule-combination @@ -143,12 +147,14 @@ endef $(eval $(call create-core-oat-host-rule-combination,default,,)) $(eval $(call create-core-oat-host-rule-combination,optimizing,,)) $(eval $(call create-core-oat-host-rule-combination,interpreter,,)) +$(eval $(call create-core-oat-host-rule-combination,interpreter-access-checks,,)) valgrindHOST_CORE_IMG_OUTS := valgrindHOST_CORE_OAT_OUTS := $(eval $(call create-core-oat-host-rule-combination,default,valgrind,32)) $(eval $(call create-core-oat-host-rule-combination,optimizing,valgrind,32)) $(eval $(call create-core-oat-host-rule-combination,interpreter,valgrind,32)) +$(eval $(call create-core-oat-host-rule-combination,interpreter-access-checks,valgrind,32)) valgrind-test-art-host-dex2oat-host: $(valgrindHOST_CORE_IMG_OUTS) @@ -178,12 +184,16 @@ define create-core-oat-target-rules core_compile_options += --compiler-filter=interpret-only core_infix := -interpreter endif + ifeq ($(1),interpreter-access-checks) + core_compile_options += --compiler-filter=verify-at-runtime --runtime-arg -Xverify:softfail + core_infix := -interpreter-access-checks + endif ifeq ($(1),default) # Default has no infix, no compile options. endif - ifneq ($(filter-out default interpreter jit optimizing,$(1)),) + ifneq ($(filter-out default interpreter interpreter-access-checks jit optimizing,$(1)),) # Technically this test is not precise, but hopefully good enough. - $$(error found $(1) expected default, interpreter, jit or optimizing) + $$(error found $(1) expected default, interpreter, interpreter-access-checks, jit or optimizing) endif ifeq ($(2),pic) @@ -246,7 +256,7 @@ $$(core_oat_name): $$(core_image_name) core_pic_infix := endef # create-core-oat-target-rules -# $(1): compiler - default, optimizing, jit or interpreter. +# $(1): compiler - default, optimizing, jit, interpreter or interpreter-access-checks. # $(2): wrapper. # $(3): dex2oat suffix. define create-core-oat-target-rule-combination @@ -262,12 +272,14 @@ endef $(eval $(call create-core-oat-target-rule-combination,default,,)) $(eval $(call create-core-oat-target-rule-combination,optimizing,,)) $(eval $(call create-core-oat-target-rule-combination,interpreter,,)) +$(eval $(call create-core-oat-target-rule-combination,interpreter-access-checks,,)) valgrindTARGET_CORE_IMG_OUTS := valgrindTARGET_CORE_OAT_OUTS := $(eval $(call create-core-oat-target-rule-combination,default,valgrind,32)) $(eval $(call create-core-oat-target-rule-combination,optimizing,valgrind,32)) $(eval $(call create-core-oat-target-rule-combination,interpreter,valgrind,32)) +$(eval $(call create-core-oat-target-rule-combination,interpreter-access-checks,valgrind,32)) valgrind-test-art-host-dex2oat-target: $(valgrindTARGET_CORE_IMG_OUTS) |