blob: 3e9718c6df36ae23e38ac236fb016942658c2bcb [file] [log] [blame]
Ben Chengba4fc8b2009-06-01 13:00:29 -07001/*
2 * Copyright (C) 2009 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
Ben Chengba4fc8b2009-06-01 13:00:29 -070017#ifndef _DALVIK_VM_COMPILERCODEGEN_H_
18#define _DALVIK_VM_COMPILERCODEGEN_H_
19
Ben Cheng4238ec22009-08-24 16:32:22 -070020#include "compiler/CompilerIR.h"
21
Ben Cheng6c10a972009-10-29 14:39:18 -070022/* Maximal number of switch cases to have inline chains */
23#define MAX_CHAINED_SWITCH_CASES 64
24
Ben Chengba4fc8b2009-06-01 13:00:29 -070025/* Work unit is architecture dependent */
Bill Buzbee716f1202009-07-23 13:22:09 -070026bool dvmCompilerDoWork(CompilerWorkOrder *work);
Ben Chengba4fc8b2009-06-01 13:00:29 -070027
28/* Lower middle-level IR to low-level IR */
29void dvmCompilerMIR2LIR(CompilationUnit *cUnit);
30
31/* Assemble LIR into machine code */
Bill Buzbee716f1202009-07-23 13:22:09 -070032void dvmCompilerAssembleLIR(CompilationUnit *cUnit, JitTranslationInfo *info);
Ben Chengba4fc8b2009-06-01 13:00:29 -070033
34/* Implemented in the codegen/<target>/ArchUtility.c */
35void dvmCompilerCodegenDump(CompilationUnit *cUnit);
36
37/* Implemented in the codegen/<target>/Assembler.c */
38void* dvmJitChain(void *tgtAddr, u4* branchAddr);
Bill Buzbee716f1202009-07-23 13:22:09 -070039u4* dvmJitUnchain(void *codeAddr);
40void dvmJitUnchainAll(void);
41
Bill Buzbee1465db52009-09-23 17:17:35 -070042/* Implemented in codegen/<target>/Ralloc.c */
43void dvmCompilerRegAlloc(CompilationUnit *cUnit);
44
45/* Implemented in codegen/<target>/Thumb<version>Util.c */
46void dvmCompilerInitializeRegAlloc(CompilationUnit *cUnit);
47
Bill Buzbee716f1202009-07-23 13:22:09 -070048/* Implemented in codegen/<target>/<target_variant>/ArchVariant.c */
Ben Cheng5d90c202009-11-22 23:31:11 -080049JitInstructionSetType dvmCompilerInstructionSet(void);
50
51/*
52 * Implemented in codegen/<target>/<target_variant>/ArchVariant.c
53 * Architecture-specific initializations and checks
54 */
55bool dvmCompilerArchVariantInit(void);
Ben Chengba4fc8b2009-06-01 13:00:29 -070056
57#endif /* _DALVIK_VM_COMPILERCODEGEN_H_ */