| 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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 private: | 820 private: |
| 821 const DeoptInstr* instruction_; // Instruction that was written. | 821 const DeoptInstr* instruction_; // Instruction that was written. |
| 822 const intptr_t info_number_; // Index of the deopt info it was written to. | 822 const intptr_t info_number_; // Index of the deopt info it was written to. |
| 823 | 823 |
| 824 GrowableArray<TrieNode*> children_; | 824 GrowableArray<TrieNode*> children_; |
| 825 }; | 825 }; |
| 826 | 826 |
| 827 | 827 |
| 828 DeoptInfoBuilder::DeoptInfoBuilder(const intptr_t num_args) | 828 DeoptInfoBuilder::DeoptInfoBuilder(const intptr_t num_args) |
| 829 : instructions_(), | 829 : instructions_(), |
| 830 object_table_(GrowableObjectArray::Handle(GrowableObjectArray::New())), | 830 object_table_(GrowableObjectArray::Handle( |
| 831 GrowableObjectArray::New(Heap::kOld))), |
| 831 num_args_(num_args), | 832 num_args_(num_args), |
| 832 trie_root_(new TrieNode()), | 833 trie_root_(new TrieNode()), |
| 833 current_info_number_(0), | 834 current_info_number_(0), |
| 834 frame_start_(-1), | 835 frame_start_(-1), |
| 835 materializations_() { | 836 materializations_() { |
| 836 } | 837 } |
| 837 | 838 |
| 838 | 839 |
| 839 intptr_t DeoptInfoBuilder::FindOrAddObjectInTable(const Object& obj) const { | 840 intptr_t DeoptInfoBuilder::FindOrAddObjectInTable(const Object& obj) const { |
| 840 for (intptr_t i = 0; i < object_table_.Length(); i++) { | 841 for (intptr_t i = 0; i < object_table_.Length(); i++) { |
| 841 if (object_table_.At(i) == obj.raw()) { | 842 if (object_table_.At(i) == obj.raw()) { |
| 842 return i; | 843 return i; |
| 843 } | 844 } |
| 844 } | 845 } |
| 845 // Add object. | 846 // Add object. |
| 846 const intptr_t result = object_table_.Length(); | 847 const intptr_t result = object_table_.Length(); |
| 847 object_table_.Add(obj); | 848 object_table_.Add(obj, Heap::kOld); |
| 848 return result; | 849 return result; |
| 849 } | 850 } |
| 850 | 851 |
| 851 | 852 |
| 852 intptr_t DeoptInfoBuilder::CalculateStackIndex(const Location& from_loc) const { | 853 intptr_t DeoptInfoBuilder::CalculateStackIndex(const Location& from_loc) const { |
| 853 return from_loc.stack_index() < 0 ? | 854 return from_loc.stack_index() < 0 ? |
| 854 from_loc.stack_index() + num_args_ : | 855 from_loc.stack_index() + num_args_ : |
| 855 from_loc.stack_index() + num_args_ + kDartFrameFixedSize; | 856 from_loc.stack_index() + num_args_ + kDartFrameFixedSize; |
| 856 } | 857 } |
| 857 | 858 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 Smi* offset, | 1099 Smi* offset, |
| 1099 DeoptInfo* info, | 1100 DeoptInfo* info, |
| 1100 Smi* reason) { | 1101 Smi* reason) { |
| 1101 intptr_t i = index * kEntrySize; | 1102 intptr_t i = index * kEntrySize; |
| 1102 *offset ^= table.At(i); | 1103 *offset ^= table.At(i); |
| 1103 *info ^= table.At(i + 1); | 1104 *info ^= table.At(i + 1); |
| 1104 *reason ^= table.At(i + 2); | 1105 *reason ^= table.At(i + 2); |
| 1105 } | 1106 } |
| 1106 | 1107 |
| 1107 } // namespace dart | 1108 } // namespace dart |
| OLD | NEW |