Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 1 | /* |
| 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 | #ifndef ART_COMPILER_OPTIMIZING_NODES_H_ |
| 18 | #define ART_COMPILER_OPTIMIZING_NODES_H_ |
| 19 | |
| 20 | #include "utils/allocation.h" |
Nicolas Geoffray | 0e33643 | 2014-02-26 18:24:38 +0000 | [diff] [blame] | 21 | #include "utils/arena_bit_vector.h" |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 22 | #include "utils/growable_array.h" |
| 23 | |
| 24 | namespace art { |
| 25 | |
| 26 | class HBasicBlock; |
| 27 | class HInstruction; |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 28 | class HIntConstant; |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 29 | class HGraphVisitor; |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 30 | class LocationSummary; |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 31 | |
| 32 | static const int kDefaultNumberOfBlocks = 8; |
| 33 | static const int kDefaultNumberOfSuccessors = 2; |
| 34 | static const int kDefaultNumberOfPredecessors = 2; |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 35 | static const int kDefaultNumberOfBackEdges = 1; |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 36 | |
| 37 | // Control-flow graph of a method. Contains a list of basic blocks. |
| 38 | class HGraph : public ArenaObject { |
| 39 | public: |
| 40 | explicit HGraph(ArenaAllocator* arena) |
| 41 | : arena_(arena), |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 42 | blocks_(arena, kDefaultNumberOfBlocks), |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 43 | dominator_order_(arena, kDefaultNumberOfBlocks), |
Nicolas Geoffray | 4a34a42 | 2014-04-03 10:38:37 +0100 | [diff] [blame] | 44 | maximum_number_of_out_vregs_(0), |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 45 | current_instruction_id_(0) { } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 46 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 47 | ArenaAllocator* GetArena() const { return arena_; } |
| 48 | const GrowableArray<HBasicBlock*>* GetBlocks() const { return &blocks_; } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 49 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 50 | HBasicBlock* GetEntryBlock() const { return entry_block_; } |
| 51 | HBasicBlock* GetExitBlock() const { return exit_block_; } |
Nicolas Geoffray | d4dd255 | 2014-02-28 10:23:58 +0000 | [diff] [blame] | 52 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 53 | void SetEntryBlock(HBasicBlock* block) { entry_block_ = block; } |
| 54 | void SetExitBlock(HBasicBlock* block) { exit_block_ = block; } |
Nicolas Geoffray | d4dd255 | 2014-02-28 10:23:58 +0000 | [diff] [blame] | 55 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 56 | void AddBlock(HBasicBlock* block); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 57 | void BuildDominatorTree(); |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 58 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 59 | int GetNextInstructionId() { |
| 60 | return current_instruction_id_++; |
| 61 | } |
| 62 | |
Nicolas Geoffray | 4a34a42 | 2014-04-03 10:38:37 +0100 | [diff] [blame] | 63 | uint16_t GetMaximumNumberOfOutVRegs() const { |
| 64 | return maximum_number_of_out_vregs_; |
| 65 | } |
| 66 | |
| 67 | void UpdateMaximumNumberOfOutVRegs(uint16_t new_value) { |
| 68 | maximum_number_of_out_vregs_ = std::max(new_value, maximum_number_of_out_vregs_); |
| 69 | } |
| 70 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 71 | private: |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 72 | HBasicBlock* FindCommonDominator(HBasicBlock* first, HBasicBlock* second) const; |
| 73 | void VisitBlockForDominatorTree(HBasicBlock* block, |
| 74 | HBasicBlock* predecessor, |
| 75 | GrowableArray<size_t>* visits); |
| 76 | void FindBackEdges(ArenaBitVector* visited) const; |
| 77 | void VisitBlockForBackEdges(HBasicBlock* block, |
| 78 | ArenaBitVector* visited, |
| 79 | ArenaBitVector* visiting) const; |
| 80 | void RemoveDeadBlocks(const ArenaBitVector& visited) const; |
| 81 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 82 | ArenaAllocator* const arena_; |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 83 | |
| 84 | // List of blocks in insertion order. |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 85 | GrowableArray<HBasicBlock*> blocks_; |
| 86 | |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 87 | // List of blocks to perform a pre-order dominator tree traversal. |
| 88 | GrowableArray<HBasicBlock*> dominator_order_; |
| 89 | |
Nicolas Geoffray | d4dd255 | 2014-02-28 10:23:58 +0000 | [diff] [blame] | 90 | HBasicBlock* entry_block_; |
| 91 | HBasicBlock* exit_block_; |
| 92 | |
Nicolas Geoffray | 4a34a42 | 2014-04-03 10:38:37 +0100 | [diff] [blame] | 93 | // The maximum number of arguments passed to a HInvoke in this graph. |
| 94 | uint16_t maximum_number_of_out_vregs_; |
| 95 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 96 | // The current id to assign to a newly added instruction. See HInstruction.id_. |
| 97 | int current_instruction_id_; |
| 98 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 99 | DISALLOW_COPY_AND_ASSIGN(HGraph); |
| 100 | }; |
| 101 | |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 102 | class HLoopInformation : public ArenaObject { |
| 103 | public: |
| 104 | HLoopInformation(HBasicBlock* header, HGraph* graph) |
| 105 | : header_(header), |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 106 | back_edges_(graph->GetArena(), kDefaultNumberOfBackEdges) { } |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 107 | |
| 108 | void AddBackEdge(HBasicBlock* back_edge) { |
| 109 | back_edges_.Add(back_edge); |
| 110 | } |
| 111 | |
| 112 | int NumberOfBackEdges() const { |
| 113 | return back_edges_.Size(); |
| 114 | } |
| 115 | |
| 116 | private: |
| 117 | HBasicBlock* header_; |
| 118 | GrowableArray<HBasicBlock*> back_edges_; |
| 119 | |
| 120 | DISALLOW_COPY_AND_ASSIGN(HLoopInformation); |
| 121 | }; |
| 122 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 123 | // A block in a method. Contains the list of instructions represented |
| 124 | // as a double linked list. Each block knows its predecessors and |
| 125 | // successors. |
| 126 | class HBasicBlock : public ArenaObject { |
| 127 | public: |
| 128 | explicit HBasicBlock(HGraph* graph) |
| 129 | : graph_(graph), |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 130 | predecessors_(graph->GetArena(), kDefaultNumberOfPredecessors), |
| 131 | successors_(graph->GetArena(), kDefaultNumberOfSuccessors), |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 132 | first_instruction_(nullptr), |
| 133 | last_instruction_(nullptr), |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 134 | loop_information_(nullptr), |
| 135 | dominator_(nullptr), |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 136 | block_id_(-1) { } |
| 137 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 138 | const GrowableArray<HBasicBlock*>* GetPredecessors() const { |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 139 | return &predecessors_; |
| 140 | } |
| 141 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 142 | const GrowableArray<HBasicBlock*>* GetSuccessors() const { |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 143 | return &successors_; |
| 144 | } |
| 145 | |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 146 | void AddBackEdge(HBasicBlock* back_edge) { |
| 147 | if (loop_information_ == nullptr) { |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 148 | loop_information_ = new (graph_->GetArena()) HLoopInformation(this, graph_); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 149 | } |
| 150 | loop_information_->AddBackEdge(back_edge); |
| 151 | } |
| 152 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 153 | HGraph* GetGraph() const { return graph_; } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 154 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 155 | int GetBlockId() const { return block_id_; } |
| 156 | void SetBlockId(int id) { block_id_ = id; } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 157 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 158 | HBasicBlock* GetDominator() const { return dominator_; } |
| 159 | void SetDominator(HBasicBlock* dominator) { dominator_ = dominator; } |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 160 | |
| 161 | int NumberOfBackEdges() const { |
| 162 | return loop_information_ == nullptr |
| 163 | ? 0 |
| 164 | : loop_information_->NumberOfBackEdges(); |
| 165 | } |
| 166 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 167 | HInstruction* GetFirstInstruction() const { return first_instruction_; } |
| 168 | HInstruction* GetLastInstruction() const { return last_instruction_; } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 169 | |
| 170 | void AddSuccessor(HBasicBlock* block) { |
| 171 | successors_.Add(block); |
| 172 | block->predecessors_.Add(this); |
| 173 | } |
| 174 | |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 175 | void RemovePredecessor(HBasicBlock* block) { |
| 176 | predecessors_.Delete(block); |
| 177 | } |
| 178 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 179 | void AddInstruction(HInstruction* instruction); |
| 180 | |
| 181 | private: |
| 182 | HGraph* const graph_; |
| 183 | GrowableArray<HBasicBlock*> predecessors_; |
| 184 | GrowableArray<HBasicBlock*> successors_; |
| 185 | HInstruction* first_instruction_; |
| 186 | HInstruction* last_instruction_; |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 187 | HLoopInformation* loop_information_; |
| 188 | HBasicBlock* dominator_; |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 189 | int block_id_; |
| 190 | |
| 191 | DISALLOW_COPY_AND_ASSIGN(HBasicBlock); |
| 192 | }; |
| 193 | |
| 194 | #define FOR_EACH_INSTRUCTION(M) \ |
Nicolas Geoffray | d8ee737 | 2014-03-28 15:43:40 +0000 | [diff] [blame] | 195 | M(Add) \ |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 196 | M(Equal) \ |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 197 | M(Exit) \ |
| 198 | M(Goto) \ |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 199 | M(If) \ |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 200 | M(IntConstant) \ |
Nicolas Geoffray | 8ccc3f5 | 2014-03-19 10:34:11 +0000 | [diff] [blame] | 201 | M(InvokeStatic) \ |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 202 | M(LoadLocal) \ |
| 203 | M(Local) \ |
Nicolas Geoffray | 4a34a42 | 2014-04-03 10:38:37 +0100 | [diff] [blame] | 204 | M(PushArgument) \ |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 205 | M(Return) \ |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 206 | M(ReturnVoid) \ |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 207 | M(StoreLocal) \ |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 208 | |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 209 | #define FORWARD_DECLARATION(type) class H##type; |
| 210 | FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) |
| 211 | #undef FORWARD_DECLARATION |
| 212 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 213 | #define DECLARE_INSTRUCTION(type) \ |
| 214 | virtual void Accept(HGraphVisitor* visitor); \ |
| 215 | virtual const char* DebugName() const { return #type; } \ |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 216 | virtual H##type* As##type() { return this; } \ |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 217 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 218 | class HUseListNode : public ArenaObject { |
| 219 | public: |
| 220 | HUseListNode(HInstruction* instruction, HUseListNode* tail) |
| 221 | : instruction_(instruction), tail_(tail) { } |
| 222 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 223 | HUseListNode* GetTail() const { return tail_; } |
| 224 | HInstruction* GetInstruction() const { return instruction_; } |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 225 | |
| 226 | private: |
| 227 | HInstruction* const instruction_; |
| 228 | HUseListNode* const tail_; |
| 229 | |
| 230 | DISALLOW_COPY_AND_ASSIGN(HUseListNode); |
| 231 | }; |
| 232 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 233 | class HInstruction : public ArenaObject { |
| 234 | public: |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 235 | HInstruction() |
| 236 | : previous_(nullptr), |
| 237 | next_(nullptr), |
| 238 | block_(nullptr), |
| 239 | id_(-1), |
| 240 | uses_(nullptr), |
| 241 | locations_(nullptr) { } |
| 242 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 243 | virtual ~HInstruction() { } |
| 244 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 245 | HInstruction* GetNext() const { return next_; } |
| 246 | HInstruction* GetPrevious() const { return previous_; } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 247 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 248 | HBasicBlock* GetBlock() const { return block_; } |
| 249 | void SetBlock(HBasicBlock* block) { block_ = block; } |
Nicolas Geoffray | d4dd255 | 2014-02-28 10:23:58 +0000 | [diff] [blame] | 250 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 251 | virtual intptr_t InputCount() const = 0; |
| 252 | virtual HInstruction* InputAt(intptr_t i) const = 0; |
| 253 | |
| 254 | virtual void Accept(HGraphVisitor* visitor) = 0; |
| 255 | virtual const char* DebugName() const = 0; |
| 256 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 257 | void AddUse(HInstruction* user) { |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 258 | uses_ = new (block_->GetGraph()->GetArena()) HUseListNode(user, uses_); |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 259 | } |
| 260 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 261 | HUseListNode* GetUses() const { return uses_; } |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 262 | |
| 263 | bool HasUses() const { return uses_ != nullptr; } |
| 264 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 265 | int GetId() const { return id_; } |
| 266 | void SetId(int id) { id_ = id; } |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 267 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 268 | LocationSummary* GetLocations() const { return locations_; } |
| 269 | void SetLocations(LocationSummary* locations) { locations_ = locations; } |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 270 | |
| 271 | #define INSTRUCTION_TYPE_CHECK(type) \ |
| 272 | virtual H##type* As##type() { return nullptr; } |
| 273 | |
| 274 | FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK) |
| 275 | #undef INSTRUCTION_TYPE_CHECK |
| 276 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 277 | private: |
| 278 | HInstruction* previous_; |
| 279 | HInstruction* next_; |
Nicolas Geoffray | d4dd255 | 2014-02-28 10:23:58 +0000 | [diff] [blame] | 280 | HBasicBlock* block_; |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 281 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 282 | // An instruction gets an id when it is added to the graph. |
| 283 | // It reflects creation order. A negative id means the instruction |
| 284 | // has not beed added to the graph. |
| 285 | int id_; |
| 286 | |
| 287 | HUseListNode* uses_; |
| 288 | |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 289 | // Set by the code generator. |
| 290 | LocationSummary* locations_; |
| 291 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 292 | friend class HBasicBlock; |
| 293 | |
| 294 | DISALLOW_COPY_AND_ASSIGN(HInstruction); |
| 295 | }; |
| 296 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 297 | class HUseIterator : public ValueObject { |
| 298 | public: |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 299 | explicit HUseIterator(HInstruction* instruction) : current_(instruction->GetUses()) { } |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 300 | |
| 301 | bool Done() const { return current_ == nullptr; } |
| 302 | |
| 303 | void Advance() { |
| 304 | DCHECK(!Done()); |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 305 | current_ = current_->GetTail(); |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | HInstruction* Current() const { |
| 309 | DCHECK(!Done()); |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 310 | return current_->GetInstruction(); |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | private: |
| 314 | HUseListNode* current_; |
| 315 | |
| 316 | friend class HValue; |
| 317 | }; |
| 318 | |
| 319 | class HInputIterator : public ValueObject { |
| 320 | public: |
| 321 | explicit HInputIterator(HInstruction* instruction) : instruction_(instruction), index_(0) { } |
| 322 | |
| 323 | bool Done() const { return index_ == instruction_->InputCount(); } |
| 324 | HInstruction* Current() const { return instruction_->InputAt(index_); } |
| 325 | void Advance() { index_++; } |
| 326 | |
| 327 | private: |
| 328 | HInstruction* instruction_; |
| 329 | int index_; |
| 330 | |
| 331 | DISALLOW_COPY_AND_ASSIGN(HInputIterator); |
| 332 | }; |
| 333 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 334 | class HInstructionIterator : public ValueObject { |
| 335 | public: |
| 336 | explicit HInstructionIterator(HBasicBlock* block) |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 337 | : instruction_(block->GetFirstInstruction()) { |
| 338 | next_ = Done() ? nullptr : instruction_->GetNext(); |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 339 | } |
| 340 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 341 | bool Done() const { return instruction_ == nullptr; } |
| 342 | HInstruction* Current() const { return instruction_; } |
| 343 | void Advance() { |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 344 | instruction_ = next_; |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 345 | next_ = Done() ? nullptr : instruction_->GetNext(); |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 346 | } |
| 347 | |
| 348 | private: |
| 349 | HInstruction* instruction_; |
| 350 | HInstruction* next_; |
| 351 | }; |
| 352 | |
| 353 | // An embedded container with N elements of type T. Used (with partial |
| 354 | // specialization for N=0) because embedded arrays cannot have size 0. |
| 355 | template<typename T, intptr_t N> |
| 356 | class EmbeddedArray { |
| 357 | public: |
| 358 | EmbeddedArray() : elements_() { } |
| 359 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 360 | intptr_t GetLength() const { return N; } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 361 | |
| 362 | const T& operator[](intptr_t i) const { |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 363 | DCHECK_LT(i, GetLength()); |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 364 | return elements_[i]; |
| 365 | } |
| 366 | |
| 367 | T& operator[](intptr_t i) { |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 368 | DCHECK_LT(i, GetLength()); |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 369 | return elements_[i]; |
| 370 | } |
| 371 | |
| 372 | const T& At(intptr_t i) const { |
| 373 | return (*this)[i]; |
| 374 | } |
| 375 | |
| 376 | void SetAt(intptr_t i, const T& val) { |
| 377 | (*this)[i] = val; |
| 378 | } |
| 379 | |
| 380 | private: |
| 381 | T elements_[N]; |
| 382 | }; |
| 383 | |
| 384 | template<typename T> |
| 385 | class EmbeddedArray<T, 0> { |
| 386 | public: |
| 387 | intptr_t length() const { return 0; } |
| 388 | const T& operator[](intptr_t i) const { |
| 389 | LOG(FATAL) << "Unreachable"; |
| 390 | static T sentinel = 0; |
| 391 | return sentinel; |
| 392 | } |
| 393 | T& operator[](intptr_t i) { |
| 394 | LOG(FATAL) << "Unreachable"; |
| 395 | static T sentinel = 0; |
| 396 | return sentinel; |
| 397 | } |
| 398 | }; |
| 399 | |
| 400 | template<intptr_t N> |
| 401 | class HTemplateInstruction: public HInstruction { |
| 402 | public: |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 403 | HTemplateInstruction<N>() : inputs_() { } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 404 | virtual ~HTemplateInstruction() { } |
| 405 | |
| 406 | virtual intptr_t InputCount() const { return N; } |
| 407 | virtual HInstruction* InputAt(intptr_t i) const { return inputs_[i]; } |
| 408 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 409 | protected: |
| 410 | void SetRawInputAt(intptr_t i, HInstruction* instruction) { |
| 411 | inputs_[i] = instruction; |
| 412 | } |
| 413 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 414 | private: |
| 415 | EmbeddedArray<HInstruction*, N> inputs_; |
| 416 | }; |
| 417 | |
| 418 | // Represents dex's RETURN_VOID opcode. A HReturnVoid is a control flow |
| 419 | // instruction that branches to the exit block. |
| 420 | class HReturnVoid : public HTemplateInstruction<0> { |
| 421 | public: |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 422 | HReturnVoid() { } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 423 | |
| 424 | DECLARE_INSTRUCTION(ReturnVoid) |
| 425 | |
| 426 | private: |
| 427 | DISALLOW_COPY_AND_ASSIGN(HReturnVoid); |
| 428 | }; |
| 429 | |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 430 | // Represents dex's RETURN opcodes. A HReturn is a control flow |
| 431 | // instruction that branches to the exit block. |
| 432 | class HReturn : public HTemplateInstruction<1> { |
| 433 | public: |
| 434 | explicit HReturn(HInstruction* value) { |
| 435 | SetRawInputAt(0, value); |
| 436 | } |
| 437 | |
| 438 | DECLARE_INSTRUCTION(Return) |
| 439 | |
| 440 | private: |
| 441 | DISALLOW_COPY_AND_ASSIGN(HReturn); |
| 442 | }; |
| 443 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 444 | // The exit instruction is the only instruction of the exit block. |
| 445 | // Instructions aborting the method (HTrow and HReturn) must branch to the |
| 446 | // exit block. |
| 447 | class HExit : public HTemplateInstruction<0> { |
| 448 | public: |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 449 | HExit() { } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 450 | |
| 451 | DECLARE_INSTRUCTION(Exit) |
| 452 | |
| 453 | private: |
| 454 | DISALLOW_COPY_AND_ASSIGN(HExit); |
| 455 | }; |
| 456 | |
| 457 | // Jumps from one block to another. |
| 458 | class HGoto : public HTemplateInstruction<0> { |
| 459 | public: |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 460 | HGoto() { } |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 461 | |
Nicolas Geoffray | d4dd255 | 2014-02-28 10:23:58 +0000 | [diff] [blame] | 462 | HBasicBlock* GetSuccessor() const { |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 463 | return GetBlock()->GetSuccessors()->Get(0); |
Nicolas Geoffray | d4dd255 | 2014-02-28 10:23:58 +0000 | [diff] [blame] | 464 | } |
| 465 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 466 | DECLARE_INSTRUCTION(Goto) |
| 467 | |
| 468 | private: |
| 469 | DISALLOW_COPY_AND_ASSIGN(HGoto); |
| 470 | }; |
| 471 | |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 472 | // Conditional branch. A block ending with an HIf instruction must have |
| 473 | // two successors. |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 474 | class HIf : public HTemplateInstruction<1> { |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 475 | public: |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 476 | explicit HIf(HInstruction* input) { |
| 477 | SetRawInputAt(0, input); |
| 478 | } |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 479 | |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 480 | HBasicBlock* IfTrueSuccessor() const { |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 481 | return GetBlock()->GetSuccessors()->Get(0); |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 482 | } |
| 483 | |
| 484 | HBasicBlock* IfFalseSuccessor() const { |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 485 | return GetBlock()->GetSuccessors()->Get(1); |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 486 | } |
| 487 | |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 488 | DECLARE_INSTRUCTION(If) |
| 489 | |
| 490 | private: |
| 491 | DISALLOW_COPY_AND_ASSIGN(HIf); |
| 492 | }; |
| 493 | |
Nicolas Geoffray | d8ee737 | 2014-03-28 15:43:40 +0000 | [diff] [blame] | 494 | class HBinaryOperation : public HTemplateInstruction<2> { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 495 | public: |
Nicolas Geoffray | d8ee737 | 2014-03-28 15:43:40 +0000 | [diff] [blame] | 496 | HBinaryOperation(Primitive::Type result_type, |
| 497 | HInstruction* left, |
| 498 | HInstruction* right) : result_type_(result_type) { |
| 499 | SetRawInputAt(0, left); |
| 500 | SetRawInputAt(1, right); |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 501 | } |
| 502 | |
Nicolas Geoffray | d8ee737 | 2014-03-28 15:43:40 +0000 | [diff] [blame] | 503 | HInstruction* GetLeft() const { return InputAt(0); } |
| 504 | HInstruction* GetRight() const { return InputAt(1); } |
| 505 | Primitive::Type GetResultType() const { return result_type_; } |
| 506 | |
| 507 | virtual bool IsCommutative() { return false; } |
| 508 | |
| 509 | private: |
| 510 | const Primitive::Type result_type_; |
| 511 | |
| 512 | DISALLOW_COPY_AND_ASSIGN(HBinaryOperation); |
| 513 | }; |
| 514 | |
| 515 | |
| 516 | // Instruction to check if two inputs are equal to each other. |
| 517 | class HEqual : public HBinaryOperation { |
| 518 | public: |
| 519 | HEqual(HInstruction* first, HInstruction* second) |
| 520 | : HBinaryOperation(Primitive::kPrimBoolean, first, second) {} |
| 521 | |
| 522 | virtual bool IsCommutative() { return true; } |
| 523 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 524 | DECLARE_INSTRUCTION(Equal) |
| 525 | |
| 526 | private: |
| 527 | DISALLOW_COPY_AND_ASSIGN(HEqual); |
| 528 | }; |
| 529 | |
| 530 | // A local in the graph. Corresponds to a Dex register. |
| 531 | class HLocal : public HTemplateInstruction<0> { |
| 532 | public: |
| 533 | explicit HLocal(uint16_t reg_number) : reg_number_(reg_number) { } |
| 534 | |
| 535 | DECLARE_INSTRUCTION(Local) |
| 536 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 537 | uint16_t GetRegNumber() const { return reg_number_; } |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 538 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 539 | private: |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 540 | // The Dex register number. |
| 541 | const uint16_t reg_number_; |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 542 | |
| 543 | DISALLOW_COPY_AND_ASSIGN(HLocal); |
| 544 | }; |
| 545 | |
| 546 | // Load a given local. The local is an input of this instruction. |
| 547 | class HLoadLocal : public HTemplateInstruction<1> { |
| 548 | public: |
| 549 | explicit HLoadLocal(HLocal* local) { |
| 550 | SetRawInputAt(0, local); |
| 551 | } |
| 552 | |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 553 | HLocal* GetLocal() const { return reinterpret_cast<HLocal*>(InputAt(0)); } |
| 554 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 555 | DECLARE_INSTRUCTION(LoadLocal) |
| 556 | |
| 557 | private: |
| 558 | DISALLOW_COPY_AND_ASSIGN(HLoadLocal); |
| 559 | }; |
| 560 | |
| 561 | // Store a value in a given local. This instruction has two inputs: the value |
| 562 | // and the local. |
| 563 | class HStoreLocal : public HTemplateInstruction<2> { |
| 564 | public: |
| 565 | HStoreLocal(HLocal* local, HInstruction* value) { |
| 566 | SetRawInputAt(0, local); |
| 567 | SetRawInputAt(1, value); |
| 568 | } |
| 569 | |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 570 | HLocal* GetLocal() const { return reinterpret_cast<HLocal*>(InputAt(0)); } |
| 571 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 572 | DECLARE_INSTRUCTION(StoreLocal) |
| 573 | |
| 574 | private: |
| 575 | DISALLOW_COPY_AND_ASSIGN(HStoreLocal); |
| 576 | }; |
| 577 | |
| 578 | // Constants of the type int. Those can be from Dex instructions, or |
| 579 | // synthesized (for example with the if-eqz instruction). |
| 580 | class HIntConstant : public HTemplateInstruction<0> { |
| 581 | public: |
| 582 | explicit HIntConstant(int32_t value) : value_(value) { } |
| 583 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 584 | int32_t GetValue() const { return value_; } |
Nicolas Geoffray | bab4ed7 | 2014-03-11 17:53:17 +0000 | [diff] [blame] | 585 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 586 | DECLARE_INSTRUCTION(IntConstant) |
| 587 | |
| 588 | private: |
| 589 | const int32_t value_; |
| 590 | |
| 591 | DISALLOW_COPY_AND_ASSIGN(HIntConstant); |
| 592 | }; |
| 593 | |
Nicolas Geoffray | 8ccc3f5 | 2014-03-19 10:34:11 +0000 | [diff] [blame] | 594 | class HInvoke : public HInstruction { |
| 595 | public: |
| 596 | HInvoke(ArenaAllocator* arena, uint32_t number_of_arguments, int32_t dex_pc) |
| 597 | : inputs_(arena, number_of_arguments), |
| 598 | dex_pc_(dex_pc) { |
| 599 | inputs_.SetSize(number_of_arguments); |
| 600 | } |
| 601 | |
| 602 | virtual intptr_t InputCount() const { return inputs_.Size(); } |
| 603 | virtual HInstruction* InputAt(intptr_t i) const { return inputs_.Get(i); } |
| 604 | |
Nicolas Geoffray | 4a34a42 | 2014-04-03 10:38:37 +0100 | [diff] [blame] | 605 | void SetArgumentAt(size_t index, HInstruction* argument) { |
| 606 | inputs_.Put(index, argument); |
| 607 | } |
| 608 | |
Nicolas Geoffray | 8ccc3f5 | 2014-03-19 10:34:11 +0000 | [diff] [blame] | 609 | int32_t GetDexPc() const { return dex_pc_; } |
| 610 | |
| 611 | protected: |
| 612 | GrowableArray<HInstruction*> inputs_; |
| 613 | const int32_t dex_pc_; |
| 614 | |
| 615 | private: |
| 616 | DISALLOW_COPY_AND_ASSIGN(HInvoke); |
| 617 | }; |
| 618 | |
| 619 | class HInvokeStatic : public HInvoke { |
| 620 | public: |
Nicolas Geoffray | 4a34a42 | 2014-04-03 10:38:37 +0100 | [diff] [blame] | 621 | HInvokeStatic(ArenaAllocator* arena, |
| 622 | uint32_t number_of_arguments, |
| 623 | int32_t dex_pc, |
| 624 | int32_t index_in_dex_cache) |
| 625 | : HInvoke(arena, number_of_arguments, dex_pc), index_in_dex_cache_(index_in_dex_cache) {} |
Nicolas Geoffray | 8ccc3f5 | 2014-03-19 10:34:11 +0000 | [diff] [blame] | 626 | |
| 627 | uint32_t GetIndexInDexCache() const { return index_in_dex_cache_; } |
| 628 | |
| 629 | DECLARE_INSTRUCTION(InvokeStatic) |
| 630 | |
| 631 | private: |
Nicolas Geoffray | 4a34a42 | 2014-04-03 10:38:37 +0100 | [diff] [blame] | 632 | const uint32_t index_in_dex_cache_; |
Nicolas Geoffray | 8ccc3f5 | 2014-03-19 10:34:11 +0000 | [diff] [blame] | 633 | |
| 634 | DISALLOW_COPY_AND_ASSIGN(HInvokeStatic); |
| 635 | }; |
| 636 | |
Nicolas Geoffray | 4a34a42 | 2014-04-03 10:38:37 +0100 | [diff] [blame] | 637 | // HPushArgument nodes are inserted after the evaluation of an argument |
| 638 | // of a call. Their mere purpose is to ease the code generator's work. |
| 639 | class HPushArgument : public HTemplateInstruction<1> { |
| 640 | public: |
| 641 | HPushArgument(HInstruction* argument, uint8_t argument_index) : argument_index_(argument_index) { |
| 642 | SetRawInputAt(0, argument); |
| 643 | } |
| 644 | |
| 645 | uint8_t GetArgumentIndex() const { return argument_index_; } |
| 646 | |
| 647 | DECLARE_INSTRUCTION(PushArgument) |
| 648 | |
| 649 | private: |
| 650 | const uint8_t argument_index_; |
| 651 | |
| 652 | DISALLOW_COPY_AND_ASSIGN(HPushArgument); |
| 653 | }; |
| 654 | |
Nicolas Geoffray | d8ee737 | 2014-03-28 15:43:40 +0000 | [diff] [blame] | 655 | class HAdd : public HBinaryOperation { |
| 656 | public: |
| 657 | HAdd(Primitive::Type result_type, HInstruction* left, HInstruction* right) |
| 658 | : HBinaryOperation(result_type, left, right) {} |
| 659 | |
| 660 | virtual bool IsCommutative() { return true; } |
| 661 | |
| 662 | DECLARE_INSTRUCTION(Add); |
| 663 | |
| 664 | private: |
| 665 | DISALLOW_COPY_AND_ASSIGN(HAdd); |
| 666 | }; |
| 667 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 668 | class HGraphVisitor : public ValueObject { |
| 669 | public: |
| 670 | explicit HGraphVisitor(HGraph* graph) : graph_(graph) { } |
| 671 | virtual ~HGraphVisitor() { } |
| 672 | |
| 673 | virtual void VisitInstruction(HInstruction* instruction) { } |
| 674 | virtual void VisitBasicBlock(HBasicBlock* block); |
| 675 | |
| 676 | void VisitInsertionOrder(); |
| 677 | |
Nicolas Geoffray | 787c307 | 2014-03-17 10:20:19 +0000 | [diff] [blame] | 678 | HGraph* GetGraph() const { return graph_; } |
Nicolas Geoffray | d4dd255 | 2014-02-28 10:23:58 +0000 | [diff] [blame] | 679 | |
Nicolas Geoffray | 818f210 | 2014-02-18 16:43:35 +0000 | [diff] [blame] | 680 | // Visit functions for instruction classes. |
| 681 | #define DECLARE_VISIT_INSTRUCTION(name) \ |
| 682 | virtual void Visit##name(H##name* instr) { VisitInstruction(instr); } |
| 683 | |
| 684 | FOR_EACH_INSTRUCTION(DECLARE_VISIT_INSTRUCTION) |
| 685 | |
| 686 | #undef DECLARE_VISIT_INSTRUCTION |
| 687 | |
| 688 | private: |
| 689 | HGraph* graph_; |
| 690 | |
| 691 | DISALLOW_COPY_AND_ASSIGN(HGraphVisitor); |
| 692 | }; |
| 693 | |
| 694 | } // namespace art |
| 695 | |
| 696 | #endif // ART_COMPILER_OPTIMIZING_NODES_H_ |