| 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/deopt_instructions.h" | 5 #include "vm/deopt_instructions.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/locations.h" | 10 #include "vm/locations.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 void DeoptContext::SetCallerFp(intptr_t caller_fp) { | 181 void DeoptContext::SetCallerFp(intptr_t caller_fp) { |
| 182 caller_fp_ = caller_fp; | 182 caller_fp_ = caller_fp; |
| 183 } | 183 } |
| 184 | 184 |
| 185 | 185 |
| 186 static bool IsObjectInstruction(DeoptInstr::Kind kind) { | 186 static bool IsObjectInstruction(DeoptInstr::Kind kind) { |
| 187 switch (kind) { | 187 switch (kind) { |
| 188 case DeoptInstr::kConstant: | 188 case DeoptInstr::kConstant: |
| 189 case DeoptInstr::kStackSlot: | 189 case DeoptInstr::kStackSlot: |
| 190 case DeoptInstr::kDoubleStackSlot: | 190 case DeoptInstr::kDoubleStackSlot: |
| 191 case DeoptInstr::kInt64StackSlot: | 191 case DeoptInstr::kMintStackSlotPair: |
| 192 case DeoptInstr::kInt64StackSlotPair: | |
| 193 case DeoptInstr::kFloat32x4StackSlot: | 192 case DeoptInstr::kFloat32x4StackSlot: |
| 194 case DeoptInstr::kInt32x4StackSlot: | 193 case DeoptInstr::kInt32x4StackSlot: |
| 195 case DeoptInstr::kFloat64x2StackSlot: | 194 case DeoptInstr::kFloat64x2StackSlot: |
| 196 case DeoptInstr::kPp: | 195 case DeoptInstr::kPp: |
| 197 case DeoptInstr::kCallerPp: | 196 case DeoptInstr::kCallerPp: |
| 198 case DeoptInstr::kMaterializedObjectRef: | 197 case DeoptInstr::kMaterializedObjectRef: |
| 199 return true; | 198 return true; |
| 200 | 199 |
| 201 case DeoptInstr::kRegister: | 200 case DeoptInstr::kRegister: |
| 202 case DeoptInstr::kFpuRegister: | 201 case DeoptInstr::kFpuRegister: |
| 203 case DeoptInstr::kInt64RegisterPair: | 202 case DeoptInstr::kMintRegisterPair: |
| 204 case DeoptInstr::kInt64StackSlotRegister: | 203 case DeoptInstr::kMintStackSlotRegister: |
| 205 case DeoptInstr::kFloat32x4FpuRegister: | 204 case DeoptInstr::kFloat32x4FpuRegister: |
| 206 case DeoptInstr::kInt32x4FpuRegister: | 205 case DeoptInstr::kInt32x4FpuRegister: |
| 207 case DeoptInstr::kFloat64x2FpuRegister: | 206 case DeoptInstr::kFloat64x2FpuRegister: |
| 208 // TODO(turnidge): Sometimes we encounter a deopt instruction | 207 // TODO(turnidge): Sometimes we encounter a deopt instruction |
| 209 // with a register source while deoptimizing frames during | 208 // with a register source while deoptimizing frames during |
| 210 // debugging but we haven't saved our register set. This | 209 // debugging but we haven't saved our register set. This |
| 211 // happens specifically when using the VMService to inspect the | 210 // happens specifically when using the VMService to inspect the |
| 212 // stack. In that case, the register values will have been | 211 // stack. In that case, the register values will have been |
| 213 // saved before the StackOverflow runtime call but we do not | 212 // saved before the StackOverflow runtime call but we do not |
| 214 // actually keep track of which registers were saved and | 213 // actually keep track of which registers were saved and |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 *source_addr, reinterpret_cast<RawDouble**>(dest_addr)); | 433 *source_addr, reinterpret_cast<RawDouble**>(dest_addr)); |
| 435 } | 434 } |
| 436 | 435 |
| 437 private: | 436 private: |
| 438 const intptr_t stack_slot_index_; // First argument is 0, always >= 0. | 437 const intptr_t stack_slot_index_; // First argument is 0, always >= 0. |
| 439 | 438 |
| 440 DISALLOW_COPY_AND_ASSIGN(DeoptDoubleStackSlotInstr); | 439 DISALLOW_COPY_AND_ASSIGN(DeoptDoubleStackSlotInstr); |
| 441 }; | 440 }; |
| 442 | 441 |
| 443 | 442 |
| 444 class DeoptInt64StackSlotInstr : public DeoptInstr { | |
| 445 public: | |
| 446 explicit DeoptInt64StackSlotInstr(intptr_t source_index) | |
| 447 : stack_slot_index_(source_index) { | |
| 448 ASSERT(stack_slot_index_ >= 0); | |
| 449 } | |
| 450 | |
| 451 virtual intptr_t source_index() const { return stack_slot_index_; } | |
| 452 virtual DeoptInstr::Kind kind() const { return kInt64StackSlot; } | |
| 453 | |
| 454 virtual const char* ToCString() const { | |
| 455 return Isolate::Current()->current_zone()->PrintToString( | |
| 456 "int64 stack slot:%" Pd "", stack_slot_index_); | |
| 457 } | |
| 458 | |
| 459 void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) { | |
| 460 intptr_t source_index = | |
| 461 deopt_context->source_frame_size() - stack_slot_index_ - 1; | |
| 462 int64_t* source_addr = reinterpret_cast<int64_t*>( | |
| 463 deopt_context->GetSourceFrameAddressAt(source_index)); | |
| 464 *reinterpret_cast<RawSmi**>(dest_addr) = Smi::New(0); | |
| 465 if (Smi::IsValid64(*source_addr)) { | |
| 466 *dest_addr = reinterpret_cast<intptr_t>( | |
| 467 Smi::New(static_cast<intptr_t>(*source_addr))); | |
| 468 } else { | |
| 469 deopt_context->DeferMintMaterialization( | |
| 470 *source_addr, reinterpret_cast<RawMint**>(dest_addr)); | |
| 471 } | |
| 472 } | |
| 473 | |
| 474 private: | |
| 475 const intptr_t stack_slot_index_; // First argument is 0, always >= 0. | |
| 476 | |
| 477 DISALLOW_COPY_AND_ASSIGN(DeoptInt64StackSlotInstr); | |
| 478 }; | |
| 479 | |
| 480 | |
| 481 class DeoptFloat32x4StackSlotInstr : public DeoptInstr { | 443 class DeoptFloat32x4StackSlotInstr : public DeoptInstr { |
| 482 public: | 444 public: |
| 483 explicit DeoptFloat32x4StackSlotInstr(intptr_t source_index) | 445 explicit DeoptFloat32x4StackSlotInstr(intptr_t source_index) |
| 484 : stack_slot_index_(source_index) { | 446 : stack_slot_index_(source_index) { |
| 485 ASSERT(stack_slot_index_ >= 0); | 447 ASSERT(stack_slot_index_ >= 0); |
| 486 } | 448 } |
| 487 | 449 |
| 488 virtual intptr_t source_index() const { return stack_slot_index_; } | 450 virtual intptr_t source_index() const { return stack_slot_index_; } |
| 489 virtual DeoptInstr::Kind kind() const { return kFloat32x4StackSlot; } | 451 virtual DeoptInstr::Kind kind() const { return kFloat32x4StackSlot; } |
| 490 | 452 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 value, reinterpret_cast<RawDouble**>(dest_addr)); | 676 value, reinterpret_cast<RawDouble**>(dest_addr)); |
| 715 } | 677 } |
| 716 | 678 |
| 717 private: | 679 private: |
| 718 const FpuRegister reg_; | 680 const FpuRegister reg_; |
| 719 | 681 |
| 720 DISALLOW_COPY_AND_ASSIGN(DeoptFpuRegisterInstr); | 682 DISALLOW_COPY_AND_ASSIGN(DeoptFpuRegisterInstr); |
| 721 }; | 683 }; |
| 722 | 684 |
| 723 | 685 |
| 724 class DeoptInt64RegisterPairInstr: public DeoptInstr { | 686 class DeoptMintRegisterPairInstr: public DeoptInstr { |
| 725 public: | 687 public: |
| 726 DeoptInt64RegisterPairInstr(intptr_t lo_reg_as_int, intptr_t hi_reg_as_int) | 688 DeoptMintRegisterPairInstr(intptr_t lo_reg_as_int, intptr_t hi_reg_as_int) |
| 727 : lo_reg_(static_cast<Register>(lo_reg_as_int)), | 689 : lo_reg_(static_cast<Register>(lo_reg_as_int)), |
| 728 hi_reg_(static_cast<Register>(hi_reg_as_int)) {} | 690 hi_reg_(static_cast<Register>(hi_reg_as_int)) {} |
| 729 | 691 |
| 730 virtual intptr_t source_index() const { | 692 virtual intptr_t source_index() const { |
| 731 return EncodeRegisters(static_cast<intptr_t>(lo_reg_), | 693 return EncodeRegisters(static_cast<intptr_t>(lo_reg_), |
| 732 static_cast<intptr_t>(hi_reg_)); | 694 static_cast<intptr_t>(hi_reg_)); |
| 733 } | 695 } |
| 734 virtual DeoptInstr::Kind kind() const { return kInt64RegisterPair; } | 696 virtual DeoptInstr::Kind kind() const { return kMintRegisterPair; } |
| 735 | 697 |
| 736 virtual const char* ToCString() const { | 698 virtual const char* ToCString() const { |
| 737 return Isolate::Current()->current_zone()->PrintToString( | 699 return Isolate::Current()->current_zone()->PrintToString( |
| 738 "int64 register pair: %s,%s", Assembler::RegisterName(hi_reg_), | 700 "int64 register pair: %s,%s", Assembler::RegisterName(hi_reg_), |
| 739 Assembler::RegisterName(lo_reg_)); | 701 Assembler::RegisterName(lo_reg_)); |
| 740 } | 702 } |
| 741 | 703 |
| 742 void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) { | 704 void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) { |
| 743 uint32_t lo_value = deopt_context->RegisterValue(lo_reg_); | 705 uint32_t lo_value = deopt_context->RegisterValue(lo_reg_); |
| 744 int32_t hi_value = deopt_context->RegisterValue(hi_reg_); | 706 int32_t hi_value = deopt_context->RegisterValue(hi_reg_); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 767 } | 729 } |
| 768 | 730 |
| 769 static intptr_t DecodeHiRegister(intptr_t v) { | 731 static intptr_t DecodeHiRegister(intptr_t v) { |
| 770 return HiRegister::decode(v); | 732 return HiRegister::decode(v); |
| 771 } | 733 } |
| 772 | 734 |
| 773 private: | 735 private: |
| 774 const Register lo_reg_; | 736 const Register lo_reg_; |
| 775 const Register hi_reg_; | 737 const Register hi_reg_; |
| 776 | 738 |
| 777 DISALLOW_COPY_AND_ASSIGN(DeoptInt64RegisterPairInstr); | 739 DISALLOW_COPY_AND_ASSIGN(DeoptMintRegisterPairInstr); |
| 778 }; | 740 }; |
| 779 | 741 |
| 780 | 742 |
| 781 class DeoptInt64StackSlotPairInstr: public DeoptInstr { | 743 class DeoptMintStackSlotPairInstr: public DeoptInstr { |
| 782 public: | 744 public: |
| 783 DeoptInt64StackSlotPairInstr(intptr_t lo_slot, intptr_t hi_slot) | 745 DeoptMintStackSlotPairInstr(intptr_t lo_slot, intptr_t hi_slot) |
| 784 : lo_slot_(static_cast<Register>(lo_slot)), | 746 : lo_slot_(static_cast<Register>(lo_slot)), |
| 785 hi_slot_(static_cast<Register>(hi_slot)) {} | 747 hi_slot_(static_cast<Register>(hi_slot)) {} |
| 786 | 748 |
| 787 virtual intptr_t source_index() const { | 749 virtual intptr_t source_index() const { |
| 788 return EncodeSlots(static_cast<intptr_t>(lo_slot_), | 750 return EncodeSlots(static_cast<intptr_t>(lo_slot_), |
| 789 static_cast<intptr_t>(hi_slot_)); | 751 static_cast<intptr_t>(hi_slot_)); |
| 790 } | 752 } |
| 791 virtual DeoptInstr::Kind kind() const { return kInt64StackSlotPair; } | 753 virtual DeoptInstr::Kind kind() const { return kMintStackSlotPair; } |
| 792 | 754 |
| 793 virtual const char* ToCString() const { | 755 virtual const char* ToCString() const { |
| 794 return Isolate::Current()->current_zone()->PrintToString( | 756 return Isolate::Current()->current_zone()->PrintToString( |
| 795 "int64 stack slots: %" Pd", %" Pd "", lo_slot_, hi_slot_); | 757 "int64 stack slots: %" Pd", %" Pd "", lo_slot_, hi_slot_); |
| 796 } | 758 } |
| 797 | 759 |
| 798 void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) { | 760 void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) { |
| 799 intptr_t lo_source_index = | 761 intptr_t lo_source_index = |
| 800 deopt_context->source_frame_size() - lo_slot_ - 1; | 762 deopt_context->source_frame_size() - lo_slot_ - 1; |
| 801 int32_t* lo_source_addr = reinterpret_cast<int32_t*>( | 763 int32_t* lo_source_addr = reinterpret_cast<int32_t*>( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 829 } | 791 } |
| 830 | 792 |
| 831 static intptr_t DecodeHiSlot(intptr_t v) { | 793 static intptr_t DecodeHiSlot(intptr_t v) { |
| 832 return HiSlot::decode(v); | 794 return HiSlot::decode(v); |
| 833 } | 795 } |
| 834 | 796 |
| 835 private: | 797 private: |
| 836 const intptr_t lo_slot_; | 798 const intptr_t lo_slot_; |
| 837 const intptr_t hi_slot_; | 799 const intptr_t hi_slot_; |
| 838 | 800 |
| 839 DISALLOW_COPY_AND_ASSIGN(DeoptInt64StackSlotPairInstr); | 801 DISALLOW_COPY_AND_ASSIGN(DeoptMintStackSlotPairInstr); |
| 840 }; | 802 }; |
| 841 | 803 |
| 842 | 804 |
| 843 class DeoptInt64StackSlotRegisterInstr : public DeoptInstr { | 805 class DeoptMintStackSlotRegisterInstr : public DeoptInstr { |
| 844 public: | 806 public: |
| 845 DeoptInt64StackSlotRegisterInstr(intptr_t source_index, | 807 DeoptMintStackSlotRegisterInstr(intptr_t source_index, |
| 846 intptr_t reg_as_int, | 808 intptr_t reg_as_int, |
| 847 bool flip) | 809 bool flip) |
| 848 : slot_(source_index), | 810 : slot_(source_index), |
| 849 reg_(static_cast<Register>(reg_as_int)), | 811 reg_(static_cast<Register>(reg_as_int)), |
| 850 flip_(flip) { | 812 flip_(flip) { |
| 851 // when flip_ is false, stack slot is low bits and reg is high bits. | 813 // when flip_ is false, stack slot is low bits and reg is high bits. |
| 852 // when flip_ is true, stack slot is high bits and reg is low bits. | 814 // when flip_ is true, stack slot is high bits and reg is low bits. |
| 853 } | 815 } |
| 854 | 816 |
| 855 virtual intptr_t source_index() const { | 817 virtual intptr_t source_index() const { |
| 856 return Encode(static_cast<intptr_t>(slot_), | 818 return Encode(static_cast<intptr_t>(slot_), |
| 857 static_cast<intptr_t>(reg_), | 819 static_cast<intptr_t>(reg_), |
| 858 flip_ ? 1 : 0); | 820 flip_ ? 1 : 0); |
| 859 } | 821 } |
| 860 virtual DeoptInstr::Kind kind() const { return kInt64StackSlotRegister; } | 822 virtual DeoptInstr::Kind kind() const { return kMintStackSlotRegister; } |
| 861 | 823 |
| 862 virtual const char* ToCString() const { | 824 virtual const char* ToCString() const { |
| 863 if (flip_) { | 825 if (flip_) { |
| 864 return Isolate::Current()->current_zone()->PrintToString( | 826 return Isolate::Current()->current_zone()->PrintToString( |
| 865 "int64 reg: %s, stack slot: %" Pd "", Assembler::RegisterName(reg_), | 827 "int64 reg: %s, stack slot: %" Pd "", Assembler::RegisterName(reg_), |
| 866 slot_); | 828 slot_); |
| 867 } else { | 829 } else { |
| 868 return Isolate::Current()->current_zone()->PrintToString( | 830 return Isolate::Current()->current_zone()->PrintToString( |
| 869 "int64 stack slot: %" Pd", reg: %s", slot_, | 831 "int64 stack slot: %" Pd", reg: %s", slot_, |
| 870 Assembler::RegisterName(reg_)); | 832 Assembler::RegisterName(reg_)); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 } | 879 } |
| 918 | 880 |
| 919 static bool DecodeFlip(intptr_t v) { | 881 static bool DecodeFlip(intptr_t v) { |
| 920 return Flip::decode(v); | 882 return Flip::decode(v); |
| 921 } | 883 } |
| 922 | 884 |
| 923 private: | 885 private: |
| 924 const intptr_t slot_; | 886 const intptr_t slot_; |
| 925 const Register reg_; | 887 const Register reg_; |
| 926 const bool flip_; | 888 const bool flip_; |
| 927 DISALLOW_COPY_AND_ASSIGN(DeoptInt64StackSlotRegisterInstr); | 889 DISALLOW_COPY_AND_ASSIGN(DeoptMintStackSlotRegisterInstr); |
| 928 }; | 890 }; |
| 929 | 891 |
| 930 | 892 |
| 931 // Deoptimization instruction moving an XMM register. | 893 // Deoptimization instruction moving an XMM register. |
| 932 class DeoptFloat32x4FpuRegisterInstr: public DeoptInstr { | 894 class DeoptFloat32x4FpuRegisterInstr: public DeoptInstr { |
| 933 public: | 895 public: |
| 934 explicit DeoptFloat32x4FpuRegisterInstr(intptr_t reg_as_int) | 896 explicit DeoptFloat32x4FpuRegisterInstr(intptr_t reg_as_int) |
| 935 : reg_(static_cast<FpuRegister>(reg_as_int)) {} | 897 : reg_(static_cast<FpuRegister>(reg_as_int)) {} |
| 936 | 898 |
| 937 virtual intptr_t source_index() const { return static_cast<intptr_t>(reg_); } | 899 virtual intptr_t source_index() const { return static_cast<intptr_t>(reg_); } |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 ASSERT(res != 0); | 1260 ASSERT(res != 0); |
| 1299 return res; | 1261 return res; |
| 1300 } | 1262 } |
| 1301 | 1263 |
| 1302 | 1264 |
| 1303 DeoptInstr* DeoptInstr::Create(intptr_t kind_as_int, intptr_t source_index) { | 1265 DeoptInstr* DeoptInstr::Create(intptr_t kind_as_int, intptr_t source_index) { |
| 1304 Kind kind = static_cast<Kind>(kind_as_int); | 1266 Kind kind = static_cast<Kind>(kind_as_int); |
| 1305 switch (kind) { | 1267 switch (kind) { |
| 1306 case kStackSlot: return new DeoptStackSlotInstr(source_index); | 1268 case kStackSlot: return new DeoptStackSlotInstr(source_index); |
| 1307 case kDoubleStackSlot: return new DeoptDoubleStackSlotInstr(source_index); | 1269 case kDoubleStackSlot: return new DeoptDoubleStackSlotInstr(source_index); |
| 1308 case kInt64StackSlot: return new DeoptInt64StackSlotInstr(source_index); | |
| 1309 case kFloat32x4StackSlot: | 1270 case kFloat32x4StackSlot: |
| 1310 return new DeoptFloat32x4StackSlotInstr(source_index); | 1271 return new DeoptFloat32x4StackSlotInstr(source_index); |
| 1311 case kFloat64x2StackSlot: | 1272 case kFloat64x2StackSlot: |
| 1312 return new DeoptFloat64x2StackSlotInstr(source_index); | 1273 return new DeoptFloat64x2StackSlotInstr(source_index); |
| 1313 case kInt32x4StackSlot: | 1274 case kInt32x4StackSlot: |
| 1314 return new DeoptInt32x4StackSlotInstr(source_index); | 1275 return new DeoptInt32x4StackSlotInstr(source_index); |
| 1315 case kRetAddress: return new DeoptRetAddressInstr(source_index); | 1276 case kRetAddress: return new DeoptRetAddressInstr(source_index); |
| 1316 case kConstant: return new DeoptConstantInstr(source_index); | 1277 case kConstant: return new DeoptConstantInstr(source_index); |
| 1317 case kRegister: return new DeoptRegisterInstr(source_index); | 1278 case kRegister: return new DeoptRegisterInstr(source_index); |
| 1318 case kFpuRegister: return new DeoptFpuRegisterInstr(source_index); | 1279 case kFpuRegister: return new DeoptFpuRegisterInstr(source_index); |
| 1319 case kInt64RegisterPair: { | 1280 case kMintRegisterPair: { |
| 1320 intptr_t lo_reg_as_int = | 1281 intptr_t lo_reg_as_int = |
| 1321 DeoptInt64RegisterPairInstr::LoRegister::decode(source_index); | 1282 DeoptMintRegisterPairInstr::LoRegister::decode(source_index); |
| 1322 intptr_t hi_reg_as_int = | 1283 intptr_t hi_reg_as_int = |
| 1323 DeoptInt64RegisterPairInstr::HiRegister::decode(source_index); | 1284 DeoptMintRegisterPairInstr::HiRegister::decode(source_index); |
| 1324 return new DeoptInt64RegisterPairInstr(lo_reg_as_int, hi_reg_as_int); | 1285 return new DeoptMintRegisterPairInstr(lo_reg_as_int, hi_reg_as_int); |
| 1325 } | 1286 } |
| 1326 case kInt64StackSlotPair: { | 1287 case kMintStackSlotPair: { |
| 1327 intptr_t lo_slot = | 1288 intptr_t lo_slot = |
| 1328 DeoptInt64StackSlotPairInstr::LoSlot::decode(source_index); | 1289 DeoptMintStackSlotPairInstr::LoSlot::decode(source_index); |
| 1329 intptr_t hi_slot = | 1290 intptr_t hi_slot = |
| 1330 DeoptInt64StackSlotPairInstr::HiSlot::decode(source_index); | 1291 DeoptMintStackSlotPairInstr::HiSlot::decode(source_index); |
| 1331 return new DeoptInt64StackSlotPairInstr(lo_slot, hi_slot); | 1292 return new DeoptMintStackSlotPairInstr(lo_slot, hi_slot); |
| 1332 } | 1293 } |
| 1333 case kInt64StackSlotRegister: { | 1294 case kMintStackSlotRegister: { |
| 1334 intptr_t slot = | 1295 intptr_t slot = |
| 1335 DeoptInt64StackSlotRegisterInstr::Slot::decode(source_index); | 1296 DeoptMintStackSlotRegisterInstr::Slot::decode(source_index); |
| 1336 intptr_t reg_as_int = | 1297 intptr_t reg_as_int = |
| 1337 DeoptInt64StackSlotRegisterInstr::Reg::decode(source_index); | 1298 DeoptMintStackSlotRegisterInstr::Reg::decode(source_index); |
| 1338 bool flip = DeoptInt64StackSlotRegisterInstr::Flip::decode(source_index); | 1299 bool flip = DeoptMintStackSlotRegisterInstr::Flip::decode(source_index); |
| 1339 return new DeoptInt64StackSlotRegisterInstr(slot, reg_as_int, flip); | 1300 return new DeoptMintStackSlotRegisterInstr(slot, reg_as_int, flip); |
| 1340 } | 1301 } |
| 1341 case kFloat32x4FpuRegister: | 1302 case kFloat32x4FpuRegister: |
| 1342 return new DeoptFloat32x4FpuRegisterInstr(source_index); | 1303 return new DeoptFloat32x4FpuRegisterInstr(source_index); |
| 1343 case kFloat64x2FpuRegister: | 1304 case kFloat64x2FpuRegister: |
| 1344 return new DeoptFloat64x2FpuRegisterInstr(source_index); | 1305 return new DeoptFloat64x2FpuRegisterInstr(source_index); |
| 1345 case kInt32x4FpuRegister: | 1306 case kInt32x4FpuRegister: |
| 1346 return new DeoptInt32x4FpuRegisterInstr(source_index); | 1307 return new DeoptInt32x4FpuRegisterInstr(source_index); |
| 1347 case kPcMarker: return new DeoptPcMarkerInstr(source_index); | 1308 case kPcMarker: return new DeoptPcMarkerInstr(source_index); |
| 1348 case kPp: return new DeoptPpInstr(source_index); | 1309 case kPp: return new DeoptPpInstr(source_index); |
| 1349 case kCallerFp: return new DeoptCallerFpInstr(); | 1310 case kCallerFp: return new DeoptCallerFpInstr(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 } else { | 1441 } else { |
| 1481 ASSERT(value->definition()->representation() == kUnboxedFloat64x2); | 1442 ASSERT(value->definition()->representation() == kUnboxedFloat64x2); |
| 1482 deopt_instr = | 1443 deopt_instr = |
| 1483 new(isolate()) DeoptFloat64x2FpuRegisterInstr(source_loc.fpu_reg()); | 1444 new(isolate()) DeoptFloat64x2FpuRegisterInstr(source_loc.fpu_reg()); |
| 1484 } | 1445 } |
| 1485 } else if (source_loc.IsStackSlot()) { | 1446 } else if (source_loc.IsStackSlot()) { |
| 1486 ASSERT(value->definition()->representation() == kTagged); | 1447 ASSERT(value->definition()->representation() == kTagged); |
| 1487 intptr_t source_index = CalculateStackIndex(source_loc); | 1448 intptr_t source_index = CalculateStackIndex(source_loc); |
| 1488 deopt_instr = new(isolate()) DeoptStackSlotInstr(source_index); | 1449 deopt_instr = new(isolate()) DeoptStackSlotInstr(source_index); |
| 1489 } else if (source_loc.IsDoubleStackSlot()) { | 1450 } else if (source_loc.IsDoubleStackSlot()) { |
| 1451 ASSERT(value->definition()->representation() == kUnboxedDouble); |
| 1490 intptr_t source_index = CalculateStackIndex(source_loc); | 1452 intptr_t source_index = CalculateStackIndex(source_loc); |
| 1491 if (value->definition()->representation() == kUnboxedDouble) { | 1453 deopt_instr = new(isolate()) DeoptDoubleStackSlotInstr(source_index); |
| 1492 deopt_instr = new(isolate()) DeoptDoubleStackSlotInstr(source_index); | |
| 1493 } else { | |
| 1494 ASSERT(value->definition()->representation() == kUnboxedMint); | |
| 1495 deopt_instr = new(isolate()) DeoptInt64StackSlotInstr(source_index); | |
| 1496 } | |
| 1497 } else if (source_loc.IsQuadStackSlot()) { | 1454 } else if (source_loc.IsQuadStackSlot()) { |
| 1498 intptr_t source_index = CalculateStackIndex(source_loc); | 1455 intptr_t source_index = CalculateStackIndex(source_loc); |
| 1499 if (value->definition()->representation() == kUnboxedFloat32x4) { | 1456 if (value->definition()->representation() == kUnboxedFloat32x4) { |
| 1500 deopt_instr = new(isolate()) DeoptFloat32x4StackSlotInstr(source_index); | 1457 deopt_instr = new(isolate()) DeoptFloat32x4StackSlotInstr(source_index); |
| 1501 } else if (value->definition()->representation() == kUnboxedInt32x4) { | 1458 } else if (value->definition()->representation() == kUnboxedInt32x4) { |
| 1502 deopt_instr = new(isolate()) DeoptInt32x4StackSlotInstr(source_index); | 1459 deopt_instr = new(isolate()) DeoptInt32x4StackSlotInstr(source_index); |
| 1503 } else { | 1460 } else { |
| 1504 ASSERT(value->definition()->representation() == kUnboxedFloat64x2); | 1461 ASSERT(value->definition()->representation() == kUnboxedFloat64x2); |
| 1505 deopt_instr = new(isolate()) DeoptFloat64x2StackSlotInstr(source_index); | 1462 deopt_instr = new(isolate()) DeoptFloat64x2StackSlotInstr(source_index); |
| 1506 } | 1463 } |
| 1507 } else if (source_loc.IsPairLocation()) { | 1464 } else if (source_loc.IsPairLocation()) { |
| 1508 ASSERT(value->definition()->representation() == kUnboxedMint); | 1465 ASSERT(value->definition()->representation() == kUnboxedMint); |
| 1509 // There are four cases to consider here: | 1466 // There are four cases to consider here: |
| 1510 // (R = Register, S = Stack slot). | 1467 // (R = Register, S = Stack slot). |
| 1511 // 1) R, R. | 1468 // 1) R, R. |
| 1512 // 2) S, S. | 1469 // 2) S, S. |
| 1513 // 3) R, S. | 1470 // 3) R, S. |
| 1514 // 4) S, R. | 1471 // 4) S, R. |
| 1515 PairLocation* pair = source_loc.AsPairLocation(); | 1472 PairLocation* pair = source_loc.AsPairLocation(); |
| 1516 if (pair->At(0).IsRegister() && pair->At(1).IsRegister()) { | 1473 if (pair->At(0).IsRegister() && pair->At(1).IsRegister()) { |
| 1517 deopt_instr = | 1474 deopt_instr = |
| 1518 new(isolate()) DeoptInt64RegisterPairInstr(pair->At(0).reg(), | 1475 new(isolate()) DeoptMintRegisterPairInstr(pair->At(0).reg(), |
| 1519 pair->At(1).reg()); | 1476 pair->At(1).reg()); |
| 1520 } else if (pair->At(0).IsStackSlot() && pair->At(1).IsStackSlot()) { | 1477 } else if (pair->At(0).IsStackSlot() && pair->At(1).IsStackSlot()) { |
| 1521 deopt_instr = new(isolate()) DeoptInt64StackSlotPairInstr( | 1478 deopt_instr = new(isolate()) DeoptMintStackSlotPairInstr( |
| 1522 CalculateStackIndex(pair->At(0)), | 1479 CalculateStackIndex(pair->At(0)), |
| 1523 CalculateStackIndex(pair->At(1))); | 1480 CalculateStackIndex(pair->At(1))); |
| 1524 } else if (pair->At(0).IsRegister() && pair->At(1).IsStackSlot()) { | 1481 } else if (pair->At(0).IsRegister() && pair->At(1).IsStackSlot()) { |
| 1525 deopt_instr = new(isolate()) DeoptInt64StackSlotRegisterInstr( | 1482 deopt_instr = new(isolate()) DeoptMintStackSlotRegisterInstr( |
| 1526 CalculateStackIndex(pair->At(1)), | 1483 CalculateStackIndex(pair->At(1)), |
| 1527 pair->At(0).reg(), | 1484 pair->At(0).reg(), |
| 1528 true); | 1485 true); |
| 1529 } else { | 1486 } else { |
| 1530 ASSERT(pair->At(0).IsStackSlot() && pair->At(1).IsRegister()); | 1487 ASSERT(pair->At(0).IsStackSlot() && pair->At(1).IsRegister()); |
| 1531 deopt_instr = new(isolate()) DeoptInt64StackSlotRegisterInstr( | 1488 deopt_instr = new(isolate()) DeoptMintStackSlotRegisterInstr( |
| 1532 CalculateStackIndex(pair->At(0)), | 1489 CalculateStackIndex(pair->At(0)), |
| 1533 pair->At(1).reg(), | 1490 pair->At(1).reg(), |
| 1534 false); | 1491 false); |
| 1535 } | 1492 } |
| 1536 } else if (source_loc.IsInvalid() && | 1493 } else if (source_loc.IsInvalid() && |
| 1537 value->definition()->IsMaterializeObject()) { | 1494 value->definition()->IsMaterializeObject()) { |
| 1538 const intptr_t index = FindMaterialization( | 1495 const intptr_t index = FindMaterialization( |
| 1539 value->definition()->AsMaterializeObject()); | 1496 value->definition()->AsMaterializeObject()); |
| 1540 ASSERT(index >= 0); | 1497 ASSERT(index >= 0); |
| 1541 deopt_instr = new(isolate()) DeoptMaterializedObjectRefInstr(index); | 1498 deopt_instr = new(isolate()) DeoptMaterializedObjectRefInstr(index); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 Smi* offset, | 1667 Smi* offset, |
| 1711 DeoptInfo* info, | 1668 DeoptInfo* info, |
| 1712 Smi* reason) { | 1669 Smi* reason) { |
| 1713 intptr_t i = index * kEntrySize; | 1670 intptr_t i = index * kEntrySize; |
| 1714 *offset ^= table.At(i); | 1671 *offset ^= table.At(i); |
| 1715 *info ^= table.At(i + 1); | 1672 *info ^= table.At(i + 1); |
| 1716 *reason ^= table.At(i + 2); | 1673 *reason ^= table.At(i + 2); |
| 1717 } | 1674 } |
| 1718 | 1675 |
| 1719 } // namespace dart | 1676 } // namespace dart |
| OLD | NEW |