| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 bitmap->Set(bitmap->Length(), false); | 554 bitmap->Set(bitmap->Length(), false); |
| 555 } | 555 } |
| 556 } | 556 } |
| 557 } | 557 } |
| 558 } | 558 } |
| 559 // General purpose registers have the lowest register number at the | 559 // General purpose registers have the lowest register number at the |
| 560 // highest address (i.e., first in the stackmap). | 560 // highest address (i.e., first in the stackmap). |
| 561 for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) { | 561 for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) { |
| 562 Register reg = static_cast<Register>(i); | 562 Register reg = static_cast<Register>(i); |
| 563 if (locs->live_registers()->ContainsRegister(reg)) { | 563 if (locs->live_registers()->ContainsRegister(reg)) { |
| 564 bitmap->Set(bitmap->Length(), true); | 564 bitmap->Set(bitmap->Length(), locs->live_registers()->IsTagged(reg)); |
| 565 } | 565 } |
| 566 } | 566 } |
| 567 } | 567 } |
| 568 | 568 |
| 569 intptr_t register_bit_count = bitmap->Length() - StackSize(); | 569 intptr_t register_bit_count = bitmap->Length() - StackSize(); |
| 570 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), | 570 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), |
| 571 bitmap, | 571 bitmap, |
| 572 register_bit_count); | 572 register_bit_count); |
| 573 } | 573 } |
| 574 } | 574 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 if (loc.IsRegister()) { | 625 if (loc.IsRegister()) { |
| 626 intptr_t index = cpu_reg_slots[loc.reg()]; | 626 intptr_t index = cpu_reg_slots[loc.reg()]; |
| 627 ASSERT(index >= 0); | 627 ASSERT(index >= 0); |
| 628 it.SetCurrentLocation(Location::StackSlot(index)); | 628 it.SetCurrentLocation(Location::StackSlot(index)); |
| 629 } else if (loc.IsFpuRegister()) { | 629 } else if (loc.IsFpuRegister()) { |
| 630 intptr_t index = fpu_reg_slots[loc.fpu_reg()]; | 630 intptr_t index = fpu_reg_slots[loc.fpu_reg()]; |
| 631 ASSERT(index >= 0); | 631 ASSERT(index >= 0); |
| 632 Value* value = it.CurrentValue(); | 632 Value* value = it.CurrentValue(); |
| 633 switch (value->definition()->representation()) { | 633 switch (value->definition()->representation()) { |
| 634 case kUnboxedDouble: | 634 case kUnboxedDouble: |
| 635 case kUnboxedMint: | |
| 636 it.SetCurrentLocation(Location::DoubleStackSlot(index)); | 635 it.SetCurrentLocation(Location::DoubleStackSlot(index)); |
| 637 break; | 636 break; |
| 638 case kUnboxedFloat32x4: | 637 case kUnboxedFloat32x4: |
| 639 case kUnboxedInt32x4: | 638 case kUnboxedInt32x4: |
| 640 case kUnboxedFloat64x2: | 639 case kUnboxedFloat64x2: |
| 641 it.SetCurrentLocation(Location::QuadStackSlot(index)); | 640 it.SetCurrentLocation(Location::QuadStackSlot(index)); |
| 642 break; | 641 break; |
| 643 default: | 642 default: |
| 644 UNREACHABLE(); | 643 UNREACHABLE(); |
| 645 } | 644 } |
| 645 } else if (loc.IsPairLocation()) { |
| 646 intptr_t representation = |
| 647 it.CurrentValue()->definition()->representation(); |
| 648 ASSERT(representation == kUnboxedMint); |
| 649 PairLocation* value_pair = loc.AsPairLocation(); |
| 650 intptr_t index_lo; |
| 651 intptr_t index_hi; |
| 652 if (value_pair->At(0).IsRegister()) { |
| 653 index_lo = cpu_reg_slots[value_pair->At(0).reg()]; |
| 654 } else { |
| 655 ASSERT(value_pair->At(0).IsStackSlot()); |
| 656 index_lo = value_pair->At(0).stack_index(); |
| 657 } |
| 658 if (value_pair->At(1).IsRegister()) { |
| 659 index_hi = cpu_reg_slots[value_pair->At(1).reg()]; |
| 660 } else { |
| 661 ASSERT(value_pair->At(1).IsStackSlot()); |
| 662 index_hi = value_pair->At(1).stack_index(); |
| 663 } |
| 664 it.SetCurrentLocation(Location::Pair(Location::StackSlot(index_lo), |
| 665 Location::StackSlot(index_hi))); |
| 646 } else if (loc.IsInvalid()) { | 666 } else if (loc.IsInvalid()) { |
| 647 Definition* def = | 667 Definition* def = |
| 648 it.CurrentValue()->definition(); | 668 it.CurrentValue()->definition(); |
| 649 ASSERT(def != NULL); | 669 ASSERT(def != NULL); |
| 650 if (def->IsMaterializeObject()) { | 670 if (def->IsMaterializeObject()) { |
| 651 def->AsMaterializeObject()->RemapRegisters(fpu_reg_slots, | 671 def->AsMaterializeObject()->RemapRegisters(fpu_reg_slots, |
| 652 cpu_reg_slots); | 672 cpu_reg_slots); |
| 653 } | 673 } |
| 654 } | 674 } |
| 655 } | 675 } |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 | 1345 |
| 1326 for (int i = 0; i < len; i++) { | 1346 for (int i = 0; i < len; i++) { |
| 1327 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), | 1347 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), |
| 1328 &Function::ZoneHandle(ic_data.GetTargetAt(i)), | 1348 &Function::ZoneHandle(ic_data.GetTargetAt(i)), |
| 1329 ic_data.GetCountAt(i))); | 1349 ic_data.GetCountAt(i))); |
| 1330 } | 1350 } |
| 1331 sorted->Sort(HighestCountFirst); | 1351 sorted->Sort(HighestCountFirst); |
| 1332 } | 1352 } |
| 1333 | 1353 |
| 1334 } // namespace dart | 1354 } // namespace dart |
| OLD | NEW |