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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 907093002: Port flow_graph*, disassembler to ISL_Print (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
« no previous file with comments | « runtime/vm/disassembler.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_allocator.cc
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index 5613de1ec67ef7aaf2ab51ff1b18314fa56d9ab4..78f850e4d481522396654da1b6fc208d5228afb1 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -9,6 +9,7 @@
#include "vm/il_printer.h"
#include "vm/flow_graph.h"
#include "vm/flow_graph_compiler.h"
+#include "vm/log.h"
#include "vm/parser.h"
namespace dart {
@@ -448,21 +449,21 @@ void LiveRange::Print() {
return;
}
- OS::Print(" live range v%" Pd " [%" Pd ", %" Pd ") in ", vreg(),
+ ISL_Print(" live range v%" Pd " [%" Pd ", %" Pd ") in ", vreg(),
Start(),
End());
assigned_location().Print();
if (spill_slot_.HasStackIndex()) {
intptr_t stack_slot = spill_slot_.stack_index();
- OS::Print(" allocated spill slot: %" Pd "", stack_slot);
+ ISL_Print(" allocated spill slot: %" Pd "", stack_slot);
}
- OS::Print("\n");
+ ISL_Print("\n");
SafepointPosition* safepoint = first_safepoint();
while (safepoint != NULL) {
- OS::Print(" Safepoint [%" Pd "]: ", safepoint->pos());
+ ISL_Print(" Safepoint [%" Pd "]: ", safepoint->pos());
safepoint->locs()->stack_bitmap()->Print();
- OS::Print("\n");
+ ISL_Print("\n");
safepoint = safepoint->next();
}
@@ -470,16 +471,16 @@ void LiveRange::Print() {
for (UseInterval* interval = first_use_interval_;
interval != NULL;
interval = interval->next()) {
- OS::Print(" use interval [%" Pd ", %" Pd ")\n",
+ ISL_Print(" use interval [%" Pd ", %" Pd ")\n",
interval->start(),
interval->end());
while ((use_pos != NULL) && (use_pos->pos() <= interval->end())) {
- OS::Print(" use at %" Pd "", use_pos->pos());
+ ISL_Print(" use at %" Pd "", use_pos->pos());
if (use_pos->location_slot() != NULL) {
- OS::Print(" as ");
+ ISL_Print(" as ");
use_pos->location_slot()->Print();
}
- OS::Print("\n");
+ ISL_Print("\n");
use_pos = use_pos->next();
}
}
@@ -1782,7 +1783,7 @@ LiveRange* LiveRange::SplitAt(intptr_t split_pos) {
first_safepoint_after_split,
next_sibling_);
- TRACE_ALLOC(OS::Print(" split sibling [%" Pd ", %" Pd ")\n",
+ TRACE_ALLOC(ISL_Print(" split sibling [%" Pd ", %" Pd ")\n",
next_sibling_->Start(), next_sibling_->End()));
last_use_interval_ = last_before_split;
@@ -1799,7 +1800,7 @@ LiveRange* LiveRange::SplitAt(intptr_t split_pos) {
LiveRange* FlowGraphAllocator::SplitBetween(LiveRange* range,
intptr_t from,
intptr_t to) {
- TRACE_ALLOC(OS::Print("split v%" Pd " [%" Pd ", %" Pd
+ TRACE_ALLOC(ISL_Print("split v%" Pd " [%" Pd ", %" Pd
") between [%" Pd ", %" Pd ")\n",
range->vreg(), range->Start(), range->End(), from, to));
@@ -1839,7 +1840,7 @@ void FlowGraphAllocator::SpillBetween(LiveRange* range,
intptr_t from,
intptr_t to) {
ASSERT(from < to);
- TRACE_ALLOC(OS::Print("spill v%" Pd " [%" Pd ", %" Pd ") "
+ TRACE_ALLOC(ISL_Print("spill v%" Pd " [%" Pd ", %" Pd ") "
"between [%" Pd ", %" Pd ")\n",
range->vreg(), range->Start(), range->End(), from, to));
LiveRange* tail = range->SplitAt(from);
@@ -1857,7 +1858,7 @@ void FlowGraphAllocator::SpillBetween(LiveRange* range,
void FlowGraphAllocator::SpillAfter(LiveRange* range, intptr_t from) {
- TRACE_ALLOC(OS::Print("spill v%" Pd " [%" Pd ", %" Pd ") after %" Pd "\n",
+ TRACE_ALLOC(ISL_Print("spill v%" Pd " [%" Pd ", %" Pd ") after %" Pd "\n",
range->vreg(), range->Start(), range->End(), from));
// When spilling the value inside the loop check if this spill can
@@ -1871,7 +1872,7 @@ void FlowGraphAllocator::SpillAfter(LiveRange* range, intptr_t from) {
RangeHasOnlyUnconstrainedUsesInLoop(range, loop_header->loop_id())) {
ASSERT(loop_header->entry()->start_pos() <= from);
from = loop_header->entry()->start_pos();
- TRACE_ALLOC(OS::Print(" moved spill position to loop header %" Pd "\n",
+ TRACE_ALLOC(ISL_Print(" moved spill position to loop header %" Pd "\n",
from));
}
}
@@ -2103,7 +2104,7 @@ bool FlowGraphAllocator::AllocateFreeRegister(LiveRange* unallocated) {
candidate = hint.register_code();
}
- TRACE_ALLOC(OS::Print("found hint %s for v%" Pd ": free until %" Pd "\n",
+ TRACE_ALLOC(ISL_Print("found hint %s for v%" Pd ": free until %" Pd "\n",
hint.Name(),
unallocated->vreg(),
free_until));
@@ -2166,7 +2167,7 @@ bool FlowGraphAllocator::AllocateFreeRegister(LiveRange* unallocated) {
}
if (used_on_backedge[candidate]) {
- TRACE_ALLOC(OS::Print(
+ TRACE_ALLOC(ISL_Print(
"considering %s for v%" Pd ": has interference on the back edge"
" {loop [%" Pd ", %" Pd ")}\n",
MakeRegisterLocation(candidate).Name(),
@@ -2185,7 +2186,7 @@ bool FlowGraphAllocator::AllocateFreeRegister(LiveRange* unallocated) {
if (intersection >= free_until) {
candidate = reg;
free_until = intersection;
- TRACE_ALLOC(OS::Print(
+ TRACE_ALLOC(ISL_Print(
"found %s for v%" Pd " with no interference on the back edge\n",
MakeRegisterLocation(candidate).Name(),
candidate));
@@ -2195,13 +2196,13 @@ bool FlowGraphAllocator::AllocateFreeRegister(LiveRange* unallocated) {
}
}
- TRACE_ALLOC(OS::Print("assigning free register "));
+ TRACE_ALLOC(ISL_Print("assigning free register "));
TRACE_ALLOC(MakeRegisterLocation(candidate).Print());
- TRACE_ALLOC(OS::Print(" to v%" Pd "\n", unallocated->vreg()));
+ TRACE_ALLOC(ISL_Print(" to v%" Pd "\n", unallocated->vreg()));
if (free_until != kMaxPosition) {
// There was an intersection. Split unallocated.
- TRACE_ALLOC(OS::Print(" splitting at %" Pd "\n", free_until));
+ TRACE_ALLOC(ISL_Print(" splitting at %" Pd "\n", free_until));
LiveRange* tail = unallocated->SplitAt(free_until);
AddToUnallocated(tail);
}
@@ -2300,9 +2301,9 @@ void FlowGraphAllocator::AllocateAnyRegister(LiveRange* unallocated) {
ASSERT(candidate != kNoRegister);
- TRACE_ALLOC(OS::Print("assigning blocked register "));
+ TRACE_ALLOC(ISL_Print("assigning blocked register "));
TRACE_ALLOC(MakeRegisterLocation(candidate).Print());
- TRACE_ALLOC(OS::Print(" to live range v%" Pd " until %" Pd "\n",
+ TRACE_ALLOC(ISL_Print(" to live range v%" Pd " until %" Pd "\n",
unallocated->vreg(), blocked_at));
if (blocked_at < unallocated->End()) {
@@ -2467,9 +2468,9 @@ void FlowGraphAllocator::ConvertUseTo(UsePosition* use, Location loc) {
ASSERT(use->location_slot() != NULL);
Location* slot = use->location_slot();
ASSERT(slot->IsUnallocated());
- TRACE_ALLOC(OS::Print(" use at %" Pd " converted to ", use->pos()));
+ TRACE_ALLOC(ISL_Print(" use at %" Pd " converted to ", use->pos()));
TRACE_ALLOC(loc.Print());
- TRACE_ALLOC(OS::Print("\n"));
+ TRACE_ALLOC(ISL_Print("\n"));
*slot = loc;
}
@@ -2480,11 +2481,11 @@ void FlowGraphAllocator::ConvertAllUses(LiveRange* range) {
const Location loc = range->assigned_location();
ASSERT(!loc.IsInvalid());
- TRACE_ALLOC(OS::Print("range [%" Pd ", %" Pd ") "
+ TRACE_ALLOC(ISL_Print("range [%" Pd ", %" Pd ") "
"for v%" Pd " has been allocated to ",
range->Start(), range->End(), range->vreg()));
TRACE_ALLOC(loc.Print());
- TRACE_ALLOC(OS::Print(":\n"));
+ TRACE_ALLOC(ISL_Print(":\n"));
for (UsePosition* use = range->first_use(); use != NULL; use = use->next()) {
ConvertUseTo(use, loc);
@@ -2660,7 +2661,7 @@ void FlowGraphAllocator::AllocateUnallocatedRanges() {
while (!unallocated_.is_empty()) {
LiveRange* range = unallocated_.RemoveLast();
const intptr_t start = range->Start();
- TRACE_ALLOC(OS::Print("Processing live range for v%" Pd " "
+ TRACE_ALLOC(ISL_Print("Processing live range for v%" Pd " "
"starting at %" Pd "\n",
range->vreg(),
start));
@@ -2684,7 +2685,7 @@ void FlowGraphAllocator::AllocateUnallocatedRanges() {
// Finish allocation.
AdvanceActiveIntervals(kMaxPosition);
- TRACE_ALLOC(OS::Print("Allocation completed\n"));
+ TRACE_ALLOC(ISL_Print("Allocation completed\n"));
}
@@ -2703,13 +2704,13 @@ bool FlowGraphAllocator::TargetLocationIsSpillSlot(LiveRange* range,
void FlowGraphAllocator::ConnectSplitSiblings(LiveRange* parent,
BlockEntryInstr* source_block,
BlockEntryInstr* target_block) {
- TRACE_ALLOC(OS::Print("Connect v%" Pd " on the edge B%" Pd " -> B%" Pd "\n",
+ TRACE_ALLOC(ISL_Print("Connect v%" Pd " on the edge B%" Pd " -> B%" Pd "\n",
parent->vreg(),
source_block->block_id(),
target_block->block_id()));
if (parent->next_sibling() == NULL) {
// Nothing to connect. The whole range was allocated to the same location.
- TRACE_ALLOC(OS::Print("range v%" Pd " has no siblings\n", parent->vreg()));
+ TRACE_ALLOC(ISL_Print("range v%" Pd " has no siblings\n", parent->vreg()));
return;
}
@@ -2746,7 +2747,7 @@ void FlowGraphAllocator::ConnectSplitSiblings(LiveRange* parent,
range = range->next_sibling();
}
- TRACE_ALLOC(OS::Print("connecting v%" Pd " between [%" Pd ", %" Pd ") {%s} "
+ TRACE_ALLOC(ISL_Print("connecting v%" Pd " between [%" Pd ", %" Pd ") {%s} "
"to [%" Pd ", %" Pd ") {%s}\n",
parent->vreg(),
source_cover->Start(),
@@ -2783,13 +2784,13 @@ void FlowGraphAllocator::ResolveControlFlow() {
while (range->next_sibling() != NULL) {
LiveRange* sibling = range->next_sibling();
- TRACE_ALLOC(OS::Print("connecting [%" Pd ", %" Pd ") [",
+ TRACE_ALLOC(ISL_Print("connecting [%" Pd ", %" Pd ") [",
range->Start(), range->End()));
TRACE_ALLOC(range->assigned_location().Print());
- TRACE_ALLOC(OS::Print("] to [%" Pd ", %" Pd ") [",
+ TRACE_ALLOC(ISL_Print("] to [%" Pd ", %" Pd ") [",
sibling->Start(), sibling->End()));
TRACE_ALLOC(sibling->assigned_location().Print());
- TRACE_ALLOC(OS::Print("]\n"));
+ TRACE_ALLOC(ISL_Print("]\n"));
if ((range->End() == sibling->Start()) &&
!TargetLocationIsSpillSlot(range, sibling->assigned_location()) &&
!range->assigned_location().Equals(sibling->assigned_location()) &&
@@ -2920,16 +2921,16 @@ void FlowGraphAllocator::AllocateRegisters() {
if (FLAG_print_ssa_liveranges) {
const Function& function = flow_graph_.function();
- OS::Print("-- [before ssa allocator] ranges [%s] ---------\n",
+ ISL_Print("-- [before ssa allocator] ranges [%s] ---------\n",
function.ToFullyQualifiedCString());
PrintLiveRanges();
- OS::Print("----------------------------------------------\n");
+ ISL_Print("----------------------------------------------\n");
- OS::Print("-- [before ssa allocator] ir [%s] -------------\n",
+ ISL_Print("-- [before ssa allocator] ir [%s] -------------\n",
function.ToFullyQualifiedCString());
FlowGraphPrinter printer(flow_graph_, true);
printer.PrintBlocks();
- OS::Print("----------------------------------------------\n");
+ ISL_Print("----------------------------------------------\n");
}
PrepareForAllocation(Location::kRegister,
@@ -2961,16 +2962,16 @@ void FlowGraphAllocator::AllocateRegisters() {
if (FLAG_print_ssa_liveranges) {
const Function& function = flow_graph_.function();
- OS::Print("-- [after ssa allocator] ranges [%s] ---------\n",
+ ISL_Print("-- [after ssa allocator] ranges [%s] ---------\n",
function.ToFullyQualifiedCString());
PrintLiveRanges();
- OS::Print("----------------------------------------------\n");
+ ISL_Print("----------------------------------------------\n");
- OS::Print("-- [after ssa allocator] ir [%s] -------------\n",
+ ISL_Print("-- [after ssa allocator] ir [%s] -------------\n",
function.ToFullyQualifiedCString());
FlowGraphPrinter printer(flow_graph_, true);
printer.PrintBlocks();
- OS::Print("----------------------------------------------\n");
+ ISL_Print("----------------------------------------------\n");
}
}
« no previous file with comments | « runtime/vm/disassembler.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698