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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 void DeoptInfoBuilder::AddCopy(const Location& from_loc, | 693 void DeoptInfoBuilder::AddCopy(const Location& from_loc, |
694 const Value& from_value, | 694 const Value& from_value, |
695 const intptr_t to_index) { | 695 const intptr_t to_index) { |
696 DeoptInstr* deopt_instr = NULL; | 696 DeoptInstr* deopt_instr = NULL; |
697 if (from_loc.IsConstant()) { | 697 if (from_loc.IsConstant()) { |
698 intptr_t object_table_index = FindOrAddObjectInTable(from_loc.constant()); | 698 intptr_t object_table_index = FindOrAddObjectInTable(from_loc.constant()); |
699 deopt_instr = new DeoptConstantInstr(object_table_index); | 699 deopt_instr = new DeoptConstantInstr(object_table_index); |
700 } else if (from_loc.IsRegister()) { | 700 } else if (from_loc.IsRegister()) { |
701 deopt_instr = new DeoptRegisterInstr(from_loc.reg()); | 701 deopt_instr = new DeoptRegisterInstr(from_loc.reg()); |
702 } else if (from_loc.IsFpuRegister()) { | 702 } else if (from_loc.IsFpuRegister()) { |
703 if (from_loc.representation() == Location::kDouble) { | 703 if (from_loc.representation() == kUnboxedDouble) { |
704 deopt_instr = new DeoptFpuRegisterInstr(from_loc.fpu_reg()); | 704 deopt_instr = new DeoptFpuRegisterInstr(from_loc.fpu_reg()); |
705 } else { | 705 } else { |
706 ASSERT(from_loc.representation() == Location::kMint); | 706 ASSERT(from_loc.representation() == kUnboxedMint); |
707 deopt_instr = new DeoptInt64FpuRegisterInstr(from_loc.fpu_reg()); | 707 deopt_instr = new DeoptInt64FpuRegisterInstr(from_loc.fpu_reg()); |
708 } | 708 } |
709 } else if (from_loc.IsStackSlot()) { | 709 } else if (from_loc.IsStackSlot()) { |
710 intptr_t from_index = (from_loc.stack_index() < 0) ? | 710 intptr_t from_index = (from_loc.stack_index() < 0) ? |
711 from_loc.stack_index() + num_args_ : | 711 from_loc.stack_index() + num_args_ : |
712 from_loc.stack_index() + num_args_ - kFirstLocalSlotIndex + 1; | 712 from_loc.stack_index() + num_args_ - kFirstLocalSlotIndex + 1; |
713 deopt_instr = new DeoptStackSlotInstr(from_index); | 713 deopt_instr = new DeoptStackSlotInstr(from_index); |
714 } else if (from_loc.IsDoubleStackSlot()) { | 714 } else if (from_loc.IsDoubleStackSlot()) { |
715 intptr_t from_index = (from_loc.stack_index() < 0) ? | 715 intptr_t from_index = (from_loc.stack_index() < 0) ? |
716 from_loc.stack_index() + num_args_ : | 716 from_loc.stack_index() + num_args_ : |
717 from_loc.stack_index() + num_args_ - kFirstLocalSlotIndex + 1; | 717 from_loc.stack_index() + num_args_ - kFirstLocalSlotIndex + 1; |
718 if (from_loc.representation() == Location::kDouble) { | 718 if (from_loc.representation() == kUnboxedDouble) { |
719 deopt_instr = new DeoptDoubleStackSlotInstr(from_index); | 719 deopt_instr = new DeoptDoubleStackSlotInstr(from_index); |
720 } else { | 720 } else { |
721 ASSERT(from_loc.representation() == Location::kMint); | 721 ASSERT(from_loc.representation() == kUnboxedMint); |
722 deopt_instr = new DeoptInt64StackSlotInstr(from_index); | 722 deopt_instr = new DeoptInt64StackSlotInstr(from_index); |
723 } | 723 } |
724 } else { | 724 } else { |
725 UNREACHABLE(); | 725 UNREACHABLE(); |
726 } | 726 } |
727 ASSERT(to_index == instructions_.length()); | 727 ASSERT(to_index == instructions_.length()); |
728 instructions_.Add(deopt_instr); | 728 instructions_.Add(deopt_instr); |
729 } | 729 } |
730 | 730 |
731 | 731 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 Smi* offset, | 814 Smi* offset, |
815 DeoptInfo* info, | 815 DeoptInfo* info, |
816 Smi* reason) { | 816 Smi* reason) { |
817 intptr_t i = index * kEntrySize; | 817 intptr_t i = index * kEntrySize; |
818 *offset ^= table.At(i); | 818 *offset ^= table.At(i); |
819 *info ^= table.At(i + 1); | 819 *info ^= table.At(i + 1); |
820 *reason ^= table.At(i + 2); | 820 *reason ^= table.At(i + 2); |
821 } | 821 } |
822 | 822 |
823 } // namespace dart | 823 } // namespace dart |
OLD | NEW |