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

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

Issue 10447133: FlowGraphCompiler is not a visitor any longer. Start consolidating shared code between the x64 and … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
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 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 virtual void DiscoverBlocks( 1595 virtual void DiscoverBlocks(
1596 BlockEntryInstr* current_block, 1596 BlockEntryInstr* current_block,
1597 GrowableArray<BlockEntryInstr*>* preorder, 1597 GrowableArray<BlockEntryInstr*>* preorder,
1598 GrowableArray<BlockEntryInstr*>* postorder, 1598 GrowableArray<BlockEntryInstr*>* postorder,
1599 GrowableArray<intptr_t>* parent, 1599 GrowableArray<intptr_t>* parent,
1600 GrowableArray<BitVector*>* assigned_vars, 1600 GrowableArray<BitVector*>* assigned_vars,
1601 intptr_t variable_count); 1601 intptr_t variable_count);
1602 1602
1603 void AddCatchEntry(TargetEntryInstr* entry) { catch_entries_.Add(entry); } 1603 void AddCatchEntry(TargetEntryInstr* entry) { catch_entries_.Add(entry); }
1604 1604
1605 virtual void EmitNativeCode(FlowGraphCompiler* compiler);
1606
1605 private: 1607 private:
1606 TargetEntryInstr* normal_entry_; 1608 TargetEntryInstr* normal_entry_;
1607 GrowableArray<TargetEntryInstr*> catch_entries_; 1609 GrowableArray<TargetEntryInstr*> catch_entries_;
1608 1610
1609 DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr); 1611 DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr);
1610 }; 1612 };
1611 1613
1612 1614
1613 class JoinEntryInstr : public BlockEntryInstr { 1615 class JoinEntryInstr : public BlockEntryInstr {
1614 public: 1616 public:
(...skipping 13 matching lines...) Expand all
1628 } 1630 }
1629 1631
1630 virtual Instruction* StraightLineSuccessor() const { 1632 virtual Instruction* StraightLineSuccessor() const {
1631 return successor_; 1633 return successor_;
1632 } 1634 }
1633 virtual void SetSuccessor(Instruction* instr) { 1635 virtual void SetSuccessor(Instruction* instr) {
1634 ASSERT(successor_ == NULL); 1636 ASSERT(successor_ == NULL);
1635 successor_ = instr; 1637 successor_ = instr;
1636 } 1638 }
1637 1639
1640 virtual void EmitNativeCode(FlowGraphCompiler* compiler);
1641
1638 private: 1642 private:
1639 ZoneGrowableArray<BlockEntryInstr*> predecessors_; 1643 ZoneGrowableArray<BlockEntryInstr*> predecessors_;
1640 Instruction* successor_; 1644 Instruction* successor_;
1641 1645
1642 DISALLOW_COPY_AND_ASSIGN(JoinEntryInstr); 1646 DISALLOW_COPY_AND_ASSIGN(JoinEntryInstr);
1643 }; 1647 };
1644 1648
1645 1649
1646 class TargetEntryInstr : public BlockEntryInstr { 1650 class TargetEntryInstr : public BlockEntryInstr {
1647 public: 1651 public:
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 1686
1683 bool HasTryIndex() const { 1687 bool HasTryIndex() const {
1684 return try_index_ != CatchClauseNode::kInvalidTryIndex; 1688 return try_index_ != CatchClauseNode::kInvalidTryIndex;
1685 } 1689 }
1686 1690
1687 intptr_t try_index() const { 1691 intptr_t try_index() const {
1688 ASSERT(HasTryIndex()); 1692 ASSERT(HasTryIndex());
1689 return try_index_; 1693 return try_index_;
1690 } 1694 }
1691 1695
1696 virtual void EmitNativeCode(FlowGraphCompiler* compiler);
1697
1692 private: 1698 private:
1693 BlockEntryInstr* predecessor_; 1699 BlockEntryInstr* predecessor_;
1694 Instruction* successor_; 1700 Instruction* successor_;
1695 const intptr_t try_index_; 1701 const intptr_t try_index_;
1696 1702
1697 DISALLOW_COPY_AND_ASSIGN(TargetEntryInstr); 1703 DISALLOW_COPY_AND_ASSIGN(TargetEntryInstr);
1698 }; 1704 };
1699 1705
1700 1706
1701 class DoInstr : public Instruction { 1707 class DoInstr : public Instruction {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1965 #define DECLARE_VISIT_INSTRUCTION(ShortName) \ 1971 #define DECLARE_VISIT_INSTRUCTION(ShortName) \
1966 virtual void Visit##ShortName(ShortName##Instr* instr) { } 1972 virtual void Visit##ShortName(ShortName##Instr* instr) { }
1967 1973
1968 FOR_EACH_COMPUTATION(DECLARE_VISIT_COMPUTATION) 1974 FOR_EACH_COMPUTATION(DECLARE_VISIT_COMPUTATION)
1969 FOR_EACH_INSTRUCTION(DECLARE_VISIT_INSTRUCTION) 1975 FOR_EACH_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
1970 1976
1971 #undef DECLARE_VISIT_COMPUTATION 1977 #undef DECLARE_VISIT_COMPUTATION
1972 #undef DECLARE_VISIT_INSTRUCTION 1978 #undef DECLARE_VISIT_INSTRUCTION
1973 1979
1974 protected: 1980 protected:
1975 // Map a block number in a forward iteration into the block number in the
1976 // corresponding reverse iteration. Used to obtain an index into
1977 // block_order for reverse iterations.
1978 intptr_t reverse_index(intptr_t index) const {
1979 return block_order_.length() - index - 1;
1980 }
1981
1982 const GrowableArray<BlockEntryInstr*>& block_order_; 1981 const GrowableArray<BlockEntryInstr*>& block_order_;
1983 1982
1984 private: 1983 private:
1985 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 1984 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
1986 }; 1985 };
1987 1986
1988 1987
1989 } // namespace dart 1988 } // namespace dart
1990 1989
1991 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 1990 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698