summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
author Chris Jones <christopher.jones@arm.com> 2024-01-05 16:30:58 +0000
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-02-19 03:02:56 -0800
commit0e8091312485670e84ee17daf25256e5836112b0 (patch)
tree37e94c4a289fe9d9296d1e1d57854f824b7e9fdb /build
parent0c35b6b7b0f9cd98220f0b291071733e44c97a54 (diff)
[Sim] Add a restricted mode setup
This CL introduces a special ART setup for all modes (host, target), which is going to be a base for VIXL Simulator Stage 1 setup. This setup can be enabled by exporting ART_USE_RESTRICTED_MODE=true to the environment before building ART. The setup limits ART by doing the following: - Limits the GC to only non-concurent Mark&Sweep. - Turns off the Nterp (so only switch C++ intepreter to be used). - Turns off the JNI compiler (GenericJNITrampoline to be used). - Rejects the compilation of all method (except for the allow list). - Turns off compilation and support of intrinsics. - Turns off implicit null checks. - Turns off implicit suspend checks. - Turns off introspection entrypoints. - Turns off special behavior for critical native methods. - Turns off compiler CHECKER tool. With these limitations it will be easier to start off an initial Simulator Stage 1 setup. As the limitations are set for all the modes, it will be easy to compare/debug the workflow for the simulator mode and to compare it to host and target runs. The CL also adds sections in knownfailures.json for tests that fail in this special setup. Also cleanup some read barrier entrypoint declarations in entrypoints_init_arm64.cc to match the definitions in quick_entrypoints_arm64.S and slightly refactor Runtime::Init to stay below the 500 line limit. Author: Artem Serov <artem.serov@linaro.org> Artem Serov <artem.serov@arm.com> Chris Jones <christopher.jones@arm.com> Test: export ART_USE_RESTRICTED_MODE=true test.py --host --target Change-Id: I87319cf339646dc13b9086b00af08882b01603c8
Diffstat (limited to 'build')
-rw-r--r--build/Android.common_build.mk5
-rw-r--r--build/art.go11
2 files changed, 15 insertions, 1 deletions
diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk
index f5a95fa0cf..ad551a13e9 100644
--- a/build/Android.common_build.mk
+++ b/build/Android.common_build.mk
@@ -46,8 +46,13 @@ ifeq ($(ART_BUILD_HOST_DEBUG),false)
$(info Disabling ART_BUILD_HOST_DEBUG)
endif
+ifeq ($(ART_USE_RESTRICTED_MODE),true)
+# TODO(Simulator): Support read barriers.
+ART_USE_READ_BARRIER := false
+else
# Enable the read barrier by default.
ART_USE_READ_BARRIER ?= true
+endif
ART_CPP_EXTENSION := .cc
diff --git a/build/art.go b/build/art.go
index 3aaa3eee21..c4df20d3d7 100644
--- a/build/art.go
+++ b/build/art.go
@@ -44,6 +44,14 @@ func globalFlags(ctx android.LoadHookContext) ([]string, []string) {
tlab = true
}
+ if ctx.Config().IsEnvTrue("ART_USE_RESTRICTED_MODE") {
+ cflags = append(cflags, "-DART_USE_RESTRICTED_MODE=1")
+ asflags = append(asflags, "-DART_USE_RESTRICTED_MODE=1")
+
+ // TODO(Simulator): Support other GC types.
+ gcType = "MS"
+ }
+
cflags = append(cflags, "-DART_DEFAULT_GC_TYPE_IS_"+gcType)
if ctx.Config().IsEnvTrue("ART_HEAP_POISONING") {
@@ -56,7 +64,8 @@ func globalFlags(ctx android.LoadHookContext) ([]string, []string) {
// TODO: deprecate and then eventually remove ART_USE_GENERATIONAL_CC in favor of
// ART_USE_GENERATIONAL_GC
- if !ctx.Config().IsEnvFalse("ART_USE_READ_BARRIER") && ctx.Config().ArtUseReadBarrier() {
+ if !ctx.Config().IsEnvFalse("ART_USE_READ_BARRIER") && ctx.Config().ArtUseReadBarrier() &&
+ !ctx.Config().IsEnvTrue("ART_USE_RESTRICTED_MODE") {
// Used to change the read barrier type. Valid values are BAKER, TABLELOOKUP.
// The default is BAKER.
barrierType := ctx.Config().GetenvWithDefault("ART_READ_BARRIER_TYPE", "BAKER")