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

Side by Side Diff: runtime/vm/flow_graph_allocator.cc

Issue 10871060: Reland "Add a simple dominator based redundancy elimination" and fix a register allocation bug. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/flow_graph.h ('k') | runtime/vm/flow_graph_optimizer.h » ('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 #include "vm/flow_graph_allocator.h" 5 #include "vm/flow_graph_allocator.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/il_printer.h" 9 #include "vm/il_printer.h"
10 #include "vm/flow_graph.h" 10 #include "vm/flow_graph.h"
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 // This is an active interval. 1579 // This is an active interval.
1580 if (allocated->vreg() < 0) { 1580 if (allocated->vreg() < 0) {
1581 // This register blocked by an interval that 1581 // This register blocked by an interval that
1582 // can't be spilled. 1582 // can't be spilled.
1583 return false; 1583 return false;
1584 } 1584 }
1585 1585
1586 const UsePosition* use = 1586 const UsePosition* use =
1587 allocated->finger()->FirstRegisterBeneficialUse(unallocated->Start()); 1587 allocated->finger()->FirstRegisterBeneficialUse(unallocated->Start());
1588 1588
1589 if ((use != NULL) && ((use->pos() - start) <= 1)) { 1589 if ((use != NULL) && ((ToInstructionStart(use->pos()) - start) <= 1)) {
1590 // This register is blocked by interval that is used 1590 // This register is blocked by interval that is used
1591 // as register in the current instruction and can't 1591 // as register in the current instruction and can't
1592 // be spilled. 1592 // be spilled.
1593 return false; 1593 return false;
1594 } 1594 }
1595 1595
1596 const intptr_t use_pos = (use != NULL) ? use->pos() 1596 const intptr_t use_pos = (use != NULL) ? use->pos()
1597 : allocated->End(); 1597 : allocated->End();
1598 1598
1599 if (use_pos < free_until) free_until = use_pos; 1599 if (use_pos < free_until) free_until = use_pos;
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", 2033 OS::Print("-- [after ssa allocator] ir [%s] -------------\n",
2034 function.ToFullyQualifiedCString()); 2034 function.ToFullyQualifiedCString());
2035 FlowGraphPrinter printer(flow_graph_, true); 2035 FlowGraphPrinter printer(flow_graph_, true);
2036 printer.PrintBlocks(); 2036 printer.PrintBlocks();
2037 OS::Print("----------------------------------------------\n"); 2037 OS::Print("----------------------------------------------\n");
2038 } 2038 }
2039 } 2039 }
2040 2040
2041 2041
2042 } // namespace dart 2042 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698