OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |