| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 // Slot index for the rightmost fixed parameter is -1. | 515 // Slot index for the rightmost fixed parameter is -1. |
| 516 slot_index -= flow_graph_.num_non_copied_params(); | 516 slot_index -= flow_graph_.num_non_copied_params(); |
| 517 | 517 |
| 518 range->set_assigned_location(Location::StackSlot(slot_index)); | 518 range->set_assigned_location(Location::StackSlot(slot_index)); |
| 519 range->set_spill_slot(Location::StackSlot(slot_index)); | 519 range->set_spill_slot(Location::StackSlot(slot_index)); |
| 520 if (flow_graph_.num_copied_params() > 0) { | 520 if (flow_graph_.num_copied_params() > 0) { |
| 521 ASSERT(spill_slots_.length() == slot_index); | 521 ASSERT(spill_slots_.length() == slot_index); |
| 522 spill_slots_.Add(range->End()); | 522 spill_slots_.Add(range->End()); |
| 523 quad_spill_slots_.Add(false); | 523 quad_spill_slots_.Add(false); |
| 524 } | 524 } |
| 525 AssignSafepoints(range); | |
| 526 } else { | 525 } else { |
| 527 ConstantInstr* constant = defn->AsConstant(); | 526 ConstantInstr* constant = defn->AsConstant(); |
| 528 ASSERT(constant != NULL); | 527 ASSERT(constant != NULL); |
| 529 range->set_assigned_location(Location::Constant(constant->value())); | 528 range->set_assigned_location(Location::Constant(constant->value())); |
| 530 range->set_spill_slot(Location::Constant(constant->value())); | 529 range->set_spill_slot(Location::Constant(constant->value())); |
| 531 } | 530 } |
| 531 AssignSafepoints(range); |
| 532 range->finger()->Initialize(range); | 532 range->finger()->Initialize(range); |
| 533 UsePosition* use = | 533 UsePosition* use = |
| 534 range->finger()->FirstRegisterBeneficialUse(graph_entry->start_pos()); | 534 range->finger()->FirstRegisterBeneficialUse(graph_entry->start_pos()); |
| 535 if (use != NULL) { | 535 if (use != NULL) { |
| 536 LiveRange* tail = | 536 LiveRange* tail = |
| 537 SplitBetween(range, graph_entry->start_pos(), use->pos()); | 537 SplitBetween(range, graph_entry->start_pos(), use->pos()); |
| 538 // Parameters and constants are tagged, so allocated to CPU registers. | 538 // Parameters and constants are tagged, so allocated to CPU registers. |
| 539 CompleteRange(tail, Location::kRegister); | 539 CompleteRange(tail, Location::kRegister); |
| 540 } | 540 } |
| 541 ConvertAllUses(range); | 541 ConvertAllUses(range); |
| (...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2497 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", | 2497 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", |
| 2498 function.ToFullyQualifiedCString()); | 2498 function.ToFullyQualifiedCString()); |
| 2499 FlowGraphPrinter printer(flow_graph_, true); | 2499 FlowGraphPrinter printer(flow_graph_, true); |
| 2500 printer.PrintBlocks(); | 2500 printer.PrintBlocks(); |
| 2501 OS::Print("----------------------------------------------\n"); | 2501 OS::Print("----------------------------------------------\n"); |
| 2502 } | 2502 } |
| 2503 } | 2503 } |
| 2504 | 2504 |
| 2505 | 2505 |
| 2506 } // namespace dart | 2506 } // namespace dart |
| OLD | NEW |