blob: 767897c8b4bcfce43dad0b99986f1eb57990399a [file] [log] [blame]
Shih-wei Liaod1fec812012-02-13 09:51:10 -08001/*
2 * Copyright (C) 2012 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#include "method_compiler.h"
18
Logan Chienfca7e872011-12-20 20:08:22 +080019#include "backend_types.h"
Shih-wei Liaod1fec812012-02-13 09:51:10 -080020#include "compiler.h"
21#include "ir_builder.h"
22#include "logging.h"
23#include "object.h"
24#include "object_utils.h"
25#include "stl_util.h"
26
27#include <iomanip>
28
29#include <llvm/Analysis/Verifier.h>
30#include <llvm/Function.h>
31
Logan Chien83426162011-12-09 09:29:50 +080032namespace art {
33namespace compiler_llvm {
Shih-wei Liaod1fec812012-02-13 09:51:10 -080034
35
Logan Chien83426162011-12-09 09:29:50 +080036MethodCompiler::MethodCompiler(InstructionSet insn_set,
37 Compiler* compiler,
38 ClassLinker* class_linker,
39 ClassLoader const* class_loader,
40 DexFile const* dex_file,
41 DexCache* dex_cache,
42 DexFile::CodeItem const* code_item,
Shih-wei Liaod1fec812012-02-13 09:51:10 -080043 uint32_t method_idx,
44 uint32_t access_flags)
45: insn_set_(insn_set),
46 compiler_(compiler), compiler_llvm_(compiler->GetCompilerLLVM()),
47 class_linker_(class_linker), class_loader_(class_loader),
48 dex_file_(dex_file), dex_cache_(dex_cache), code_item_(code_item),
49 method_(dex_cache->GetResolvedMethod(method_idx)),
50 method_helper_(method_), method_idx_(method_idx),
51 access_flags_(access_flags), module_(compiler_llvm_->GetModule()),
52 context_(compiler_llvm_->GetLLVMContext()),
53 irb_(*compiler_llvm_->GetIRBuilder()), func_(NULL) {
54}
55
56
57MethodCompiler::~MethodCompiler() {
58}
59
60
61void MethodCompiler::EmitPrologue() {
Logan Chien83426162011-12-09 09:29:50 +080062 // UNIMPLEMENTED(WARNING);
Shih-wei Liaod1fec812012-02-13 09:51:10 -080063}
64
65
Logan Chien83426162011-12-09 09:29:50 +080066void MethodCompiler::EmitInstructions() {
67 // UNIMPLEMENTED(WARNING);
Shih-wei Liaod1fec812012-02-13 09:51:10 -080068}
69
70
Logan Chien83426162011-12-09 09:29:50 +080071void MethodCompiler::EmitInstruction(uint32_t dex_pc,
72 Instruction const* insn) {
73 // UNIMPLEMENTED(WARNING);
Shih-wei Liaod1fec812012-02-13 09:51:10 -080074}
75
76
Logan Chien83426162011-12-09 09:29:50 +080077CompiledMethod *MethodCompiler::Compile() {
78 // UNIMPLEMENTED(WARNING);
79 return new CompiledMethod(insn_set_, NULL);
Shih-wei Liaod1fec812012-02-13 09:51:10 -080080}
Logan Chien83426162011-12-09 09:29:50 +080081
82
83} // namespace compiler_llvm
84} // namespace art