blob: fdcb55557af33c339a8d7cf29736aa482a32ab49 [file] [log] [blame]
buzbee67bf8852011-08-17 17:51:35 -07001/*
2 * Copyright (C) 2011 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_SRC_COMPILER_COMPILERCODEGEN_H_
18#define ART_SRC_COMPILER_COMPILERCODEGEN_H_
19
20#include "../CompilerIR.h"
21
Elliott Hughes11d1b0c2012-01-23 16:57:47 -080022namespace art {
23
buzbeea2ebdd72012-03-04 14:57:06 -080024LIR* rawLIR(CompilationUnit* cUnit, int dalvikOffset, int opcode, int op0 = 0,
25 int op1 = 0, int op2 = 0, int op3 = 0, LIR* target = NULL);
26
buzbee67bf8852011-08-17 17:51:35 -070027/* Lower middle-level IR to low-level IR for the whole method */
28void oatMethodMIR2LIR(CompilationUnit* cUnit);
29
30/* Assemble LIR into machine code */
31void oatAssembleLIR(CompilationUnit* cUnit);
buzbeee3acd072012-02-25 17:03:10 -080032AssemblerStatus oatAssembleInstructions(CompilationUnit* cUnit,
33 intptr_t startAddr);
34void oatAssignOffsets(CompilationUnit* cUnit);
35int oatAssignInsnOffsets(CompilationUnit* cUnit);
buzbee67bf8852011-08-17 17:51:35 -070036
37/* Implemented in the codegen/<target>/ArchUtility.c */
38void oatCodegenDump(CompilationUnit* cUnit);
buzbee67bc2362011-10-11 18:08:40 -070039void oatDumpPromotionMap(CompilationUnit* cUnit);
40void oatDumpFullPromotionMap(CompilationUnit* cUnit);
buzbee5de34942012-03-01 14:51:57 -080041std::string buildInsnString(const char* fmt, LIR* lir,
42 unsigned char* baseAddr);
43
buzbee67bf8852011-08-17 17:51:35 -070044
45/* Implemented in codegen/<target>/Ralloc.c */
46void oatSimpleRegAlloc(CompilationUnit* cUnit);
47
48/* Implemented in codegen/<target>/Thumb<version>Util.c */
49void oatInitializeRegAlloc(CompilationUnit* cUnit);
50
51/* Implemented in codegen/<target>/<target_variant>/ArchVariant.c */
52OatInstructionSetType oatInstructionSet(void);
53
54/*
55 * Implemented in codegen/<target>/<target_variant>/ArchVariant.c
56 * Architecture-specific initializations and checks
57 */
58bool oatArchVariantInit(void);
59
60/* Implemented in codegen/<target>/<target_variant>/ArchVariant.c */
61int oatTargetOptHint(int key);
62
63/* Implemented in codegen/<target>/<target_variant>/ArchVariant.c */
64void oatGenMemBarrier(CompilationUnit* cUnit, int barrierKind);
65
Elliott Hughes11d1b0c2012-01-23 16:57:47 -080066} // namespace art
67
buzbee67bf8852011-08-17 17:51:35 -070068#endif // ART_SRC_COMPILER_COMPILERCODEGEN_H_