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

Unified Diff: runtime/vm/intermediate_language.h

Issue 11953076: Move code around in preparation for better inlining. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 0cc2633f3bf3187fd94068fd62c2e0a66490c06b..c00b43c111fe0801ff20959f46b2d576f700260e 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -754,6 +754,11 @@ class BlockEntryInstr : public Instruction {
return const_cast<BlockEntryInstr*>(this);
}
+ // Helper to mutate the graph during inlining. This block should be
+ // replaced with new_block as a predecessor of all of this block's
+ // successors.
+ void ReplaceAsPredecessorWith(BlockEntryInstr* new_block);
+
protected:
BlockEntryInstr(intptr_t block_id, intptr_t try_index)
: block_id_(block_id),
@@ -924,7 +929,10 @@ class JoinEntryInstr : public BlockEntryInstr {
virtual void PrintTo(BufferFormatter* f) const;
private:
- friend class FlowGraph; // Access to predecessors_ when inlining.
+ // Classes that have access to predecessors_ when inlining.
+ friend class BlockEntryInstr;
+ friend class ValueInliningContext;
+
virtual void ClearPredecessors() { predecessors_.Clear(); }
virtual void AddPredecessor(BlockEntryInstr* predecessor);
@@ -1003,7 +1011,8 @@ class TargetEntryInstr : public BlockEntryInstr {
virtual void PrintTo(BufferFormatter* f) const;
private:
- friend class FlowGraph; // Access to predecessor_ when inlining.
+ friend class BlockEntryInstr; // Access to predecessor_ when inlining.
+
virtual void ClearPredecessors() { predecessor_ = NULL; }
virtual void AddPredecessor(BlockEntryInstr* predecessor) {
ASSERT(predecessor_ == NULL);

Powered by Google App Engine
This is Rietveld 408576698