blob: 356e909467c2194f1b1a0e33850ec4d8c0252db6 [file] [log] [blame]
Nicolas Geoffrayd4dd2552014-02-28 10:23:58 +00001/*
2 * Copyright (C) 2014 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 "code_generator_arm.h"
18#include "utils/assembler.h"
19#include "utils/arm/assembler_arm.h"
20
21#define __ reinterpret_cast<ArmAssembler*>(assembler())->
22
23namespace art {
24namespace arm {
25
26void CodeGeneratorARM::GenerateFrameEntry() {
27 RegList registers = (1 << LR) | (1 << FP);
28 __ PushList(registers);
29}
30
31void CodeGeneratorARM::GenerateFrameExit() {
32 RegList registers = (1 << PC) | (1 << FP);
33 __ PopList(registers);
34}
35
36void CodeGeneratorARM::Bind(Label* label) {
37 __ Bind(label);
38}
39
40void CodeGeneratorARM::VisitGoto(HGoto* got) {
41 HBasicBlock* successor = got->GetSuccessor();
42 if (graph()->exit_block() == successor) {
43 GenerateFrameExit();
44 } else if (!GoesToNextBlock(got)) {
45 __ b(GetLabelOf(successor));
46 }
47}
48
49void CodeGeneratorARM::VisitExit(HExit* exit) {
50 if (kIsDebugBuild) {
51 __ Comment("Unreachable");
52 __ bkpt(0);
53 }
54}
55
56void CodeGeneratorARM::VisitIf(HIf* if_instr) {
57 LOG(FATAL) << "UNIMPLEMENTED";
58}
59
Nicolas Geoffray3ff386a2014-03-04 14:46:47 +000060void CodeGeneratorARM::VisitEqual(HEqual* equal) {
61 LOG(FATAL) << "UNIMPLEMENTED";
62}
63
64void CodeGeneratorARM::VisitLocal(HLocal* local) {
65 LOG(FATAL) << "UNIMPLEMENTED";
66}
67
68void CodeGeneratorARM::VisitLoadLocal(HLoadLocal* local) {
69 LOG(FATAL) << "UNIMPLEMENTED";
70}
71
72void CodeGeneratorARM::VisitStoreLocal(HStoreLocal* local) {
73 LOG(FATAL) << "UNIMPLEMENTED";
74}
75
76void CodeGeneratorARM::VisitIntConstant(HIntConstant* constant) {
77 LOG(FATAL) << "UNIMPLEMENTED";
78}
79
Nicolas Geoffrayd4dd2552014-02-28 10:23:58 +000080void CodeGeneratorARM::VisitReturnVoid(HReturnVoid* ret) {
81 GenerateFrameExit();
82}
83
84} // namespace arm
85} // namespace art