Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 11043016: Set previous instruction pointers when building the graph. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 ASSERT(!IsControl()); 345 ASSERT(!IsControl());
346 ASSERT(!IsPhi()); 346 ASSERT(!IsPhi());
347 ASSERT(instr == NULL || !instr->IsBlockEntry()); 347 ASSERT(instr == NULL || !instr->IsBlockEntry());
348 // TODO(fschneider): Also add Throw and ReThrow to the list of instructions 348 // TODO(fschneider): Also add Throw and ReThrow to the list of instructions
349 // that do not have a successor. Currently, the graph builder will continue 349 // that do not have a successor. Currently, the graph builder will continue
350 // to append instruction in case of a Throw inside an expression. This 350 // to append instruction in case of a Throw inside an expression. This
351 // condition should be handled in the graph builder 351 // condition should be handled in the graph builder
352 next_ = instr; 352 next_ = instr;
353 } 353 }
354 354
355 // Link together two instruction.
356 void LinkTo(Instruction* next) {
357 ASSERT(this != next);
358 this->set_next(next);
359 next->set_previous(this);
360 }
361
355 // Removed this instruction from the graph. 362 // Removed this instruction from the graph.
356 Instruction* RemoveFromGraph(bool return_previous = true); 363 Instruction* RemoveFromGraph(bool return_previous = true);
357 364
358 // Normal instructions can have 0 (inside a block) or 1 (last instruction in 365 // Normal instructions can have 0 (inside a block) or 1 (last instruction in
359 // a block) successors. Branch instruction with >1 successors override this 366 // a block) successors. Branch instruction with >1 successors override this
360 // function. 367 // function.
361 virtual intptr_t SuccessorCount() const; 368 virtual intptr_t SuccessorCount() const;
362 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; 369 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const;
363 370
364 void Goto(JoinEntryInstr* entry); 371 void Goto(JoinEntryInstr* entry);
(...skipping 3736 matching lines...) Expand 10 before | Expand all | Expand 10 after
4101 ForwardInstructionIterator* current_iterator_; 4108 ForwardInstructionIterator* current_iterator_;
4102 4109
4103 private: 4110 private:
4104 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 4111 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
4105 }; 4112 };
4106 4113
4107 4114
4108 } // namespace dart 4115 } // namespace dart
4109 4116
4110 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 4117 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698