1 /*
2  * Copyright (C) 2020 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_INTERPRETER_MTERP_NTERP_H_
18 #define ART_RUNTIME_INTERPRETER_MTERP_NTERP_H_
19 
20 #include "base/array_ref.h"
21 #include "base/globals.h"
22 #include "base/macros.h"
23 
24 extern "C" void* artNterpAsmInstructionStart[];
25 extern "C" void* artNterpAsmInstructionEnd[];
26 
27 namespace art HIDDEN {
28 
29 class ArtMethod;
30 
31 namespace interpreter {
32 
33 void CheckNterpAsmConstants();
34 bool IsNterpSupported();
35 bool CanRuntimeUseNterp();
36 const void* GetNterpEntryPoint();
37 const void* GetNterpWithClinitEntryPoint();
38 ArrayRef<const uint8_t> NterpWithClinitImpl();
39 ArrayRef<const uint8_t> NterpImpl();
40 
41 constexpr uint16_t kNterpHotnessValue = 0;
42 
43 // The maximum we allow an nterp frame to be.
44 constexpr size_t kNterpMaxFrame = 3 * KB;
45 
46 // The maximum size for each nterp opcode handler.
47 constexpr size_t kNterpHandlerSize = 128;
48 
49 }  // namespace interpreter
50 }  // namespace art
51 
52 #endif  // ART_RUNTIME_INTERPRETER_MTERP_NTERP_H_
53