Phil Wang | 751beff | 2015-08-28 15:17:15 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Andreas Gampe | 71da487 | 2017-07-26 10:02:07 -0700 | [diff] [blame] | 17 | #ifndef ART_SIMULATOR_CODE_SIMULATOR_ARM64_H_ |
| 18 | #define ART_SIMULATOR_CODE_SIMULATOR_ARM64_H_ |
Phil Wang | 751beff | 2015-08-28 15:17:15 +0800 | [diff] [blame] | 19 | |
| 20 | #include "memory" |
Scott Wakeling | 97c72b7 | 2016-06-24 16:19:36 +0100 | [diff] [blame] | 21 | |
Artem Serov | af4e42a | 2016-08-08 15:11:24 +0100 | [diff] [blame] | 22 | // TODO(VIXL): Make VIXL compile with -Wshadow. |
Phil Wang | 751beff | 2015-08-28 15:17:15 +0800 | [diff] [blame] | 23 | #pragma GCC diagnostic push |
| 24 | #pragma GCC diagnostic ignored "-Wshadow" |
Artem Serov | af4e42a | 2016-08-08 15:11:24 +0100 | [diff] [blame] | 25 | #include "aarch64/simulator-aarch64.h" |
Phil Wang | 751beff | 2015-08-28 15:17:15 +0800 | [diff] [blame] | 26 | #pragma GCC diagnostic pop |
| 27 | |
Vladimir Marko | 33bff25 | 2017-11-01 14:35:42 +0000 | [diff] [blame] | 28 | #include "arch/instruction_set.h" |
Andreas Gampe | 71da487 | 2017-07-26 10:02:07 -0700 | [diff] [blame] | 29 | #include "code_simulator.h" |
| 30 | |
Phil Wang | 751beff | 2015-08-28 15:17:15 +0800 | [diff] [blame] | 31 | namespace art { |
| 32 | namespace arm64 { |
| 33 | |
| 34 | class CodeSimulatorArm64 : public CodeSimulator { |
| 35 | public: |
| 36 | static CodeSimulatorArm64* CreateCodeSimulatorArm64(); |
| 37 | virtual ~CodeSimulatorArm64(); |
| 38 | |
Roland Levillain | bbc6e7e | 2018-08-24 16:58:47 +0100 | [diff] [blame] | 39 | void RunFrom(intptr_t code_buffer) override; |
Phil Wang | 751beff | 2015-08-28 15:17:15 +0800 | [diff] [blame] | 40 | |
Roland Levillain | bbc6e7e | 2018-08-24 16:58:47 +0100 | [diff] [blame] | 41 | bool GetCReturnBool() const override; |
| 42 | int32_t GetCReturnInt32() const override; |
| 43 | int64_t GetCReturnInt64() const override; |
Phil Wang | 751beff | 2015-08-28 15:17:15 +0800 | [diff] [blame] | 44 | |
| 45 | private: |
| 46 | CodeSimulatorArm64(); |
| 47 | |
Scott Wakeling | 97c72b7 | 2016-06-24 16:19:36 +0100 | [diff] [blame] | 48 | vixl::aarch64::Decoder* decoder_; |
Ulyana Trafimovich | 3060bb9 | 2020-07-16 14:17:11 +0000 | [diff] [blame^] | 49 | vixl::aarch64::Simulator* simulator_; |
Phil Wang | 751beff | 2015-08-28 15:17:15 +0800 | [diff] [blame] | 50 | |
Scott Wakeling | 97c72b7 | 2016-06-24 16:19:36 +0100 | [diff] [blame] | 51 | // TODO: Enable CodeSimulatorArm64 for more host ISAs once Simulator supports them. |
Vladimir Marko | 33bff25 | 2017-11-01 14:35:42 +0000 | [diff] [blame] | 52 | static constexpr bool kCanSimulate = (kRuntimeISA == InstructionSet::kX86_64); |
Phil Wang | 751beff | 2015-08-28 15:17:15 +0800 | [diff] [blame] | 53 | |
| 54 | DISALLOW_COPY_AND_ASSIGN(CodeSimulatorArm64); |
| 55 | }; |
| 56 | |
| 57 | } // namespace arm64 |
| 58 | } // namespace art |
| 59 | |
Andreas Gampe | 71da487 | 2017-07-26 10:02:07 -0700 | [diff] [blame] | 60 | #endif // ART_SIMULATOR_CODE_SIMULATOR_ARM64_H_ |