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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
6 | 6 |
7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
8 | 8 |
9 #include "vm/cha.h" | 9 #include "vm/cha.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 bitmap->Set(bitmap->Length(), false); | 560 bitmap->Set(bitmap->Length(), false); |
561 } | 561 } |
562 } | 562 } |
563 } | 563 } |
564 } | 564 } |
565 // General purpose registers have the lowest register number at the | 565 // General purpose registers have the lowest register number at the |
566 // highest address (i.e., first in the stackmap). | 566 // highest address (i.e., first in the stackmap). |
567 for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) { | 567 for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) { |
568 Register reg = static_cast<Register>(i); | 568 Register reg = static_cast<Register>(i); |
569 if (locs->live_registers()->ContainsRegister(reg)) { | 569 if (locs->live_registers()->ContainsRegister(reg)) { |
570 bitmap->Set(bitmap->Length(), true); | 570 bitmap->Set(bitmap->Length(), locs->live_registers()->IsTagged(reg)); |
571 } | 571 } |
572 } | 572 } |
573 } | 573 } |
574 | 574 |
575 intptr_t register_bit_count = bitmap->Length() - StackSize(); | 575 intptr_t register_bit_count = bitmap->Length() - StackSize(); |
576 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), | 576 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), |
577 bitmap, | 577 bitmap, |
578 register_bit_count); | 578 register_bit_count); |
579 } | 579 } |
580 } | 580 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 if (loc.IsRegister()) { | 631 if (loc.IsRegister()) { |
632 intptr_t index = cpu_reg_slots[loc.reg()]; | 632 intptr_t index = cpu_reg_slots[loc.reg()]; |
633 ASSERT(index >= 0); | 633 ASSERT(index >= 0); |
634 it.SetCurrentLocation(Location::StackSlot(index)); | 634 it.SetCurrentLocation(Location::StackSlot(index)); |
635 } else if (loc.IsFpuRegister()) { | 635 } else if (loc.IsFpuRegister()) { |
636 intptr_t index = fpu_reg_slots[loc.fpu_reg()]; | 636 intptr_t index = fpu_reg_slots[loc.fpu_reg()]; |
637 ASSERT(index >= 0); | 637 ASSERT(index >= 0); |
638 Value* value = it.CurrentValue(); | 638 Value* value = it.CurrentValue(); |
639 switch (value->definition()->representation()) { | 639 switch (value->definition()->representation()) { |
640 case kUnboxedDouble: | 640 case kUnboxedDouble: |
641 case kUnboxedMint: | |
642 it.SetCurrentLocation(Location::DoubleStackSlot(index)); | 641 it.SetCurrentLocation(Location::DoubleStackSlot(index)); |
643 break; | 642 break; |
644 case kUnboxedFloat32x4: | 643 case kUnboxedFloat32x4: |
645 case kUnboxedInt32x4: | 644 case kUnboxedInt32x4: |
646 case kUnboxedFloat64x2: | 645 case kUnboxedFloat64x2: |
647 it.SetCurrentLocation(Location::QuadStackSlot(index)); | 646 it.SetCurrentLocation(Location::QuadStackSlot(index)); |
648 break; | 647 break; |
649 default: | 648 default: |
650 UNREACHABLE(); | 649 UNREACHABLE(); |
651 } | 650 } |
| 651 } else if (loc.IsPairLocation()) { |
| 652 intptr_t representation = |
| 653 it.CurrentValue()->definition()->representation(); |
| 654 ASSERT(representation == kUnboxedMint); |
| 655 PairLocation* value_pair = loc.AsPairLocation(); |
| 656 intptr_t index_lo; |
| 657 intptr_t index_hi; |
| 658 if (value_pair->At(0).IsRegister()) { |
| 659 index_lo = cpu_reg_slots[value_pair->At(0).reg()]; |
| 660 } else { |
| 661 ASSERT(value_pair->At(0).IsStackSlot()); |
| 662 index_lo = value_pair->At(0).stack_index(); |
| 663 } |
| 664 if (value_pair->At(1).IsRegister()) { |
| 665 index_hi = cpu_reg_slots[value_pair->At(1).reg()]; |
| 666 } else { |
| 667 ASSERT(value_pair->At(1).IsStackSlot()); |
| 668 index_hi = value_pair->At(1).stack_index(); |
| 669 } |
| 670 it.SetCurrentLocation(Location::Pair(Location::StackSlot(index_lo), |
| 671 Location::StackSlot(index_hi))); |
652 } else if (loc.IsInvalid()) { | 672 } else if (loc.IsInvalid()) { |
653 Definition* def = | 673 Definition* def = |
654 it.CurrentValue()->definition(); | 674 it.CurrentValue()->definition(); |
655 ASSERT(def != NULL); | 675 ASSERT(def != NULL); |
656 if (def->IsMaterializeObject()) { | 676 if (def->IsMaterializeObject()) { |
657 def->AsMaterializeObject()->RemapRegisters(fpu_reg_slots, | 677 def->AsMaterializeObject()->RemapRegisters(fpu_reg_slots, |
658 cpu_reg_slots); | 678 cpu_reg_slots); |
659 } | 679 } |
660 } | 680 } |
661 } | 681 } |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 | 1351 |
1332 for (int i = 0; i < len; i++) { | 1352 for (int i = 0; i < len; i++) { |
1333 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), | 1353 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), |
1334 &Function::ZoneHandle(ic_data.GetTargetAt(i)), | 1354 &Function::ZoneHandle(ic_data.GetTargetAt(i)), |
1335 ic_data.GetCountAt(i))); | 1355 ic_data.GetCountAt(i))); |
1336 } | 1356 } |
1337 sorted->Sort(HighestCountFirst); | 1357 sorted->Sort(HighestCountFirst); |
1338 } | 1358 } |
1339 | 1359 |
1340 } // namespace dart | 1360 } // namespace dart |
OLD | NEW |