Revert "Introduce support for hardware simulators, starting with ARM64"
This reverts commit c2e1a5edc438274159c6ef8e65455ac73723a8f1.
This breaks the build for x86_64 targets. This is because on target the libvixl is not included as a
library for the libart.so target build. The build of non-x86_64 targets only works because the
compilers removes the dead-code that contains the libvixl symbols.
Bug: 23321940
Change-Id: I39e93ff05b887665c47fb0986867f1d13ca65b9b
diff --git a/runtime/Android.mk b/runtime/Android.mk
index 254c08c..8f70d30 100644
--- a/runtime/Android.mk
+++ b/runtime/Android.mk
@@ -196,8 +196,6 @@
arch/x86/instruction_set_features_x86.cc \
arch/x86/registers_x86.cc \
arch/x86_64/registers_x86_64.cc \
- simulator/code_simulator.cc \
- simulator/code_simulator_arm64.cc \
entrypoints/entrypoint_utils.cc \
entrypoints/interpreter/interpreter_entrypoints.cc \
entrypoints/jni/jni_entrypoints.cc \
@@ -496,11 +494,11 @@
LOCAL_SHARED_LIBRARIES += libcutils
else # host
ifeq ($$(art_static_or_shared),static)
- LOCAL_STATIC_LIBRARIES += libziparchive-host libz libvixl
+ LOCAL_STATIC_LIBRARIES += libziparchive-host libz
# For ashmem_create_region.
LOCAL_STATIC_LIBRARIES += libcutils
else
- LOCAL_SHARED_LIBRARIES += libziparchive-host libz-host libvixl
+ LOCAL_SHARED_LIBRARIES += libziparchive-host libz-host
# For ashmem_create_region.
LOCAL_SHARED_LIBRARIES += libcutils
endif
diff --git a/runtime/simulator/code_simulator.cc b/runtime/simulator/code_simulator.cc
deleted file mode 100644
index 5023e48..0000000
--- a/runtime/simulator/code_simulator.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "simulator/code_simulator.h"
-#include "simulator/code_simulator_arm64.h"
-
-namespace art {
-
-CodeSimulator* CodeSimulator::CreateCodeSimulator(InstructionSet target_isa) {
- DCHECK(CanSimulate(target_isa));
- switch (target_isa) {
- case kArm64:
- return new arm64::CodeSimulatorArm64();
- default:
- UNREACHABLE();
- }
-}
-
-bool CodeSimulator::CanSimulate(InstructionSet target_isa) {
- switch (target_isa) {
- case kArm64:
- return arm64::CodeSimulatorArm64::CanSimulateArm64();
- default:
- // No simulator support for target.
- return false;
- }
-}
-
-} // namespace art
diff --git a/runtime/simulator/code_simulator.h b/runtime/simulator/code_simulator.h
deleted file mode 100644
index fe24c95..0000000
--- a/runtime/simulator/code_simulator.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_RUNTIME_SIMULATOR_CODE_SIMULATOR_H_
-#define ART_RUNTIME_SIMULATOR_CODE_SIMULATOR_H_
-
-#include "arch/instruction_set.h"
-
-namespace art {
-
-class CodeSimulator {
- public:
- virtual ~CodeSimulator() {}
- static CodeSimulator* CreateCodeSimulator(InstructionSet target_isa);
- static bool CanSimulate(InstructionSet target_isa);
-
- virtual void RunFrom(intptr_t code_buffer) = 0;
-
- // Get return value according to C ABI.
- virtual bool GetCReturnBool() = 0;
- virtual int32_t GetCReturnInt32() = 0;
- virtual int64_t GetCReturnInt64() = 0;
-};
-
-} // namespace art
-
-#endif // ART_RUNTIME_SIMULATOR_CODE_SIMULATOR_H_
diff --git a/runtime/simulator/code_simulator_arm64.cc b/runtime/simulator/code_simulator_arm64.cc
deleted file mode 100644
index 3472e80..0000000
--- a/runtime/simulator/code_simulator_arm64.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "simulator/code_simulator_arm64.h"
-
-namespace art {
-namespace arm64 {
-
-// VIXL has not been tested on 32bit arches, so vixl::Simulator is not always
-// available. To avoid linker error on these arches, an early return is added in
-// each of the following methods, when vixl::Simulator is not available.
-// TODO: when vixl::Simulator is always available, remove the early returns.
-
-CodeSimulatorArm64::CodeSimulatorArm64()
- : decoder_(nullptr), simulator_(nullptr) {
- DCHECK(kCanSimulate);
- if (!kCanSimulate) {
- return;
- }
- decoder_ = new vixl::Decoder();
- simulator_ = new vixl::Simulator(decoder_);
-}
-
-CodeSimulatorArm64::~CodeSimulatorArm64() {
- if (!kCanSimulate) {
- return;
- }
- delete simulator_;
- delete decoder_;
-}
-
-void CodeSimulatorArm64::RunFrom(intptr_t code_buffer) {
- if (!kCanSimulate) {
- return;
- }
- simulator_->RunFrom(reinterpret_cast<const vixl::Instruction*>(code_buffer));
-}
-
-bool CodeSimulatorArm64::GetCReturnBool() {
- DCHECK(kCanSimulate);
- return simulator_->wreg(0);
-}
-
-int32_t CodeSimulatorArm64::GetCReturnInt32() {
- DCHECK(kCanSimulate);
- return simulator_->wreg(0);
-}
-
-int64_t CodeSimulatorArm64::GetCReturnInt64() {
- DCHECK(kCanSimulate);
- return simulator_->xreg(0);
-}
-
-} // namespace arm64
-} // namespace art
diff --git a/runtime/simulator/code_simulator_arm64.h b/runtime/simulator/code_simulator_arm64.h
deleted file mode 100644
index 5898fda..0000000
--- a/runtime/simulator/code_simulator_arm64.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_RUNTIME_SIMULATOR_CODE_SIMULATOR_ARM64_H_
-#define ART_RUNTIME_SIMULATOR_CODE_SIMULATOR_ARM64_H_
-
-#include "memory"
-#include "simulator/code_simulator.h"
-// TODO: make vixl clean wrt -Wshadow.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunknown-pragmas"
-#pragma GCC diagnostic ignored "-Wshadow"
-#pragma GCC diagnostic ignored "-Wmissing-noreturn"
-#include "vixl/a64/simulator-a64.h"
-#pragma GCC diagnostic pop
-
-namespace art {
-namespace arm64 {
-
-class CodeSimulatorArm64 : public CodeSimulator {
- public:
- CodeSimulatorArm64();
- virtual ~CodeSimulatorArm64();
-
- static constexpr bool CanSimulateArm64() {
- return kCanSimulate;
- }
-
- void RunFrom(intptr_t code_buffer) OVERRIDE;
-
- bool GetCReturnBool() OVERRIDE;
- int32_t GetCReturnInt32() OVERRIDE;
- int64_t GetCReturnInt64() OVERRIDE;
-
- private:
- vixl::Decoder* decoder_;
- vixl::Simulator* simulator_;
-
- // TODO: Enable CodeSimulatorArm64 for more host ISAs once vixl::Simulator supports
- // them.
- static constexpr bool kCanSimulate = (kRuntimeISA == kX86_64);
-};
-
-} // namespace arm64
-} // namespace art
-
-#endif // ART_RUNTIME_SIMULATOR_CODE_SIMULATOR_ARM64_H_