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

Unified Diff: vm/intermediate_language.cc

Issue 10407031: Add IR printing into a supplied buffer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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
« vm/intermediate_language.h ('K') | « vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/intermediate_language.cc
===================================================================
--- vm/intermediate_language.cc (revision 7699)
+++ vm/intermediate_language.cc (working copy)
@@ -5,6 +5,7 @@
#include "vm/intermediate_language.h"
#include "vm/bit_vector.h"
+#include "vm/flow_graph_builder.h"
#include "vm/object.h"
#include "vm/os.h"
#include "vm/scopes.h"
@@ -170,11 +171,14 @@
// ==== Postorder graph traversal.
void GraphEntryInstr::DiscoverBlocks(
BlockEntryInstr* current_block,
- GrowableArray<BlockEntryInstr*>* preorder,
- GrowableArray<BlockEntryInstr*>* postorder,
+ FlowGraphBuilder* builder,
GrowableArray<intptr_t>* parent,
GrowableArray<BitVector*>* assigned_vars,
intptr_t variable_count) {
+ GrowableArray<BlockEntryInstr*>* preorder =
+ builder->preorder_block_entries();
+ GrowableArray<BlockEntryInstr*>* postorder =
+ builder->postorder_block_entries();
// We only visit this block once, first of all blocks.
ASSERT(preorder_number() == -1);
ASSERT(current_block == NULL);
@@ -194,11 +198,11 @@
// enter the function at the first successor in reverse postorder, so we
// must visit the normal entry last.
for (intptr_t i = catch_entries_.length() - 1; i >= 0; --i) {
- catch_entries_[i]->DiscoverBlocks(this, preorder, postorder, parent,
- assigned_vars, variable_count);
+ catch_entries_[i]->DiscoverBlocks(
+ this, builder, parent, assigned_vars, variable_count);
}
- normal_entry_->DiscoverBlocks(this, preorder, postorder, parent,
- assigned_vars, variable_count);
+ normal_entry_->DiscoverBlocks(
+ this, builder, parent, assigned_vars, variable_count);
// Assign postorder number.
set_postorder_number(postorder->length());
@@ -209,11 +213,14 @@
// Base class implementation used for JoinEntry and TargetEntry.
void BlockEntryInstr::DiscoverBlocks(
BlockEntryInstr* current_block,
- GrowableArray<BlockEntryInstr*>* preorder,
- GrowableArray<BlockEntryInstr*>* postorder,
+ FlowGraphBuilder* builder,
GrowableArray<intptr_t>* parent,
GrowableArray<BitVector*>* assigned_vars,
intptr_t variable_count) {
+ GrowableArray<BlockEntryInstr*>* preorder =
+ builder->preorder_block_entries();
+ GrowableArray<BlockEntryInstr*>* postorder =
+ builder->postorder_block_entries();
// We have already visited the graph entry, so we can assume current_block
// is non-null and preorder array is non-empty.
ASSERT(current_block != NULL);
@@ -258,8 +265,7 @@
}
}
if (next != NULL) {
- next->DiscoverBlocks(this, preorder, postorder, parent, assigned_vars,
- variable_count);
+ next->DiscoverBlocks(this, builder, parent, assigned_vars, variable_count);
}
// 6. Assign postorder number and add the block entry to the list.
@@ -270,8 +276,7 @@
void BranchInstr::DiscoverBlocks(
BlockEntryInstr* current_block,
- GrowableArray<BlockEntryInstr*>* preorder,
- GrowableArray<BlockEntryInstr*>* postorder,
+ FlowGraphBuilder* builder,
GrowableArray<intptr_t>* parent,
GrowableArray<BitVector*>* assigned_vars,
intptr_t variable_count) {
@@ -281,10 +286,10 @@
// nonoptimizing compiler.
ASSERT(true_successor_ != NULL);
ASSERT(false_successor_ != NULL);
- false_successor_->DiscoverBlocks(current_block, preorder, postorder, parent,
- assigned_vars, variable_count);
- true_successor_->DiscoverBlocks(current_block, preorder, postorder, parent,
- assigned_vars, variable_count);
+ false_successor_->DiscoverBlocks(
+ current_block, builder, parent, assigned_vars, variable_count);
+ true_successor_->DiscoverBlocks(
+ current_block, builder, parent, assigned_vars, variable_count);
}
« vm/intermediate_language.h ('K') | « vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698