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

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

Issue 10704119: Use the instruction iterator rather than an explicit loop in more places. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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/il_printer.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 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 class FlowGraphBuilder; 1699 class FlowGraphBuilder;
1700 class Environment; 1700 class Environment;
1701 1701
1702 #define FORWARD_DECLARATION(type) class type##Instr; 1702 #define FORWARD_DECLARATION(type) class type##Instr;
1703 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) 1703 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION)
1704 #undef FORWARD_DECLARATION 1704 #undef FORWARD_DECLARATION
1705 1705
1706 1706
1707 // Functions required in all concrete instruction classes. 1707 // Functions required in all concrete instruction classes.
1708 #define DECLARE_INSTRUCTION(type) \ 1708 #define DECLARE_INSTRUCTION(type) \
1709 virtual Instruction* Accept(FlowGraphVisitor* visitor); \ 1709 virtual void Accept(FlowGraphVisitor* visitor); \
1710 virtual bool Is##type() const { return true; } \ 1710 virtual bool Is##type() const { return true; } \
1711 virtual type##Instr* As##type() { return this; } \ 1711 virtual type##Instr* As##type() { return this; } \
1712 virtual intptr_t InputCount() const; \ 1712 virtual intptr_t InputCount() const; \
1713 virtual Value* InputAt(intptr_t i) const; \ 1713 virtual Value* InputAt(intptr_t i) const; \
1714 virtual void SetInputAt(intptr_t i, Value* value); \ 1714 virtual void SetInputAt(intptr_t i, Value* value); \
1715 virtual const char* DebugName() const { return #type; } \ 1715 virtual const char* DebugName() const { return #type; } \
1716 virtual void PrintTo(BufferFormatter* f) const; \ 1716 virtual void PrintTo(BufferFormatter* f) const; \
1717 virtual void PrintToVisualizer(BufferFormatter* f) const; 1717 virtual void PrintToVisualizer(BufferFormatter* f) const;
1718 1718
1719 1719
(...skipping 21 matching lines...) Expand all
1741 return IsBlockEntry() ? reinterpret_cast<BlockEntryInstr*>(this) : NULL; 1741 return IsBlockEntry() ? reinterpret_cast<BlockEntryInstr*>(this) : NULL;
1742 } 1742 }
1743 virtual bool IsDefinition() const { return false; } 1743 virtual bool IsDefinition() const { return false; }
1744 virtual Definition* AsDefinition() { return NULL; } 1744 virtual Definition* AsDefinition() { return NULL; }
1745 1745
1746 virtual intptr_t InputCount() const = 0; 1746 virtual intptr_t InputCount() const = 0;
1747 virtual Value* InputAt(intptr_t i) const = 0; 1747 virtual Value* InputAt(intptr_t i) const = 0;
1748 virtual void SetInputAt(intptr_t i, Value* value) = 0; 1748 virtual void SetInputAt(intptr_t i, Value* value) = 0;
1749 1749
1750 // Visiting support. 1750 // Visiting support.
1751 virtual Instruction* Accept(FlowGraphVisitor* visitor) = 0; 1751 virtual void Accept(FlowGraphVisitor* visitor) = 0;
1752 1752
1753 Instruction* previous() const { return previous_; } 1753 Instruction* previous() const { return previous_; }
1754 void set_previous(Instruction* instr) { 1754 void set_previous(Instruction* instr) {
1755 ASSERT(!IsBlockEntry()); 1755 ASSERT(!IsBlockEntry());
1756 previous_ = instr; 1756 previous_ = instr;
1757 } 1757 }
1758 1758
1759 Instruction* next() const { return next_; } 1759 Instruction* next() const { return next_; }
1760 void set_next(Instruction* instr) { 1760 void set_next(Instruction* instr) {
1761 ASSERT(!IsGraphEntry()); 1761 ASSERT(!IsGraphEntry());
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
2435 const GrowableArray<BlockEntryInstr*>& block_order_; 2435 const GrowableArray<BlockEntryInstr*>& block_order_;
2436 2436
2437 private: 2437 private:
2438 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 2438 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
2439 }; 2439 };
2440 2440
2441 2441
2442 } // namespace dart 2442 } // namespace dart
2443 2443
2444 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 2444 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698