blob: 59ea34fb8043045330d916d19f8fe7da54a0b51e [file] [log] [blame]
Phil Wang751beff2015-08-28 15:17:15 +08001/*
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
17#ifndef ART_RUNTIME_SIMULATOR_CODE_SIMULATOR_ARM64_H_
18#define ART_RUNTIME_SIMULATOR_CODE_SIMULATOR_ARM64_H_
19
20#include "memory"
21#include "simulator/code_simulator.h"
Scott Wakeling97c72b72016-06-24 16:19:36 +010022
Artem Serovaf4e42a2016-08-08 15:11:24 +010023// TODO(VIXL): Make VIXL compile with -Wshadow.
Phil Wang751beff2015-08-28 15:17:15 +080024#pragma GCC diagnostic push
25#pragma GCC diagnostic ignored "-Wshadow"
Artem Serovaf4e42a2016-08-08 15:11:24 +010026#include "aarch64/simulator-aarch64.h"
Phil Wang751beff2015-08-28 15:17:15 +080027#pragma GCC diagnostic pop
28
29namespace art {
30namespace arm64 {
31
32class CodeSimulatorArm64 : public CodeSimulator {
33 public:
34 static CodeSimulatorArm64* CreateCodeSimulatorArm64();
35 virtual ~CodeSimulatorArm64();
36
37 void RunFrom(intptr_t code_buffer) OVERRIDE;
38
39 bool GetCReturnBool() const OVERRIDE;
40 int32_t GetCReturnInt32() const OVERRIDE;
41 int64_t GetCReturnInt64() const OVERRIDE;
42
43 private:
44 CodeSimulatorArm64();
45
Scott Wakeling97c72b72016-06-24 16:19:36 +010046 vixl::aarch64::Decoder* decoder_;
47 vixl::aarch64::Simulator* simulator_;
Phil Wang751beff2015-08-28 15:17:15 +080048
Scott Wakeling97c72b72016-06-24 16:19:36 +010049 // TODO: Enable CodeSimulatorArm64 for more host ISAs once Simulator supports them.
Phil Wang751beff2015-08-28 15:17:15 +080050 static constexpr bool kCanSimulate = (kRuntimeISA == kX86_64);
51
52 DISALLOW_COPY_AND_ASSIGN(CodeSimulatorArm64);
53};
54
55} // namespace arm64
56} // namespace art
57
58#endif // ART_RUNTIME_SIMULATOR_CODE_SIMULATOR_ARM64_H_