| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/debugger.h" | 5 #include "vm/debugger.h" |
| 6 | 6 |
| 7 #include "vm/code_generator.h" | 7 #include "vm/code_generator.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 ASSERT(!func.HasOptimizedCode()); | 827 ASSERT(!func.HasOptimizedCode()); |
| 828 Code& code = Code::Handle(func.unoptimized_code()); | 828 Code& code = Code::Handle(func.unoptimized_code()); |
| 829 ASSERT(!code.IsNull()); | 829 ASSERT(!code.IsNull()); |
| 830 PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors()); | 830 PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors()); |
| 831 // We attempt to find the PC descriptor that is closest to the | 831 // We attempt to find the PC descriptor that is closest to the |
| 832 // beginning of the token range, in terms of native code address. If we | 832 // beginning of the token range, in terms of native code address. If we |
| 833 // don't find a PC descriptor within the given range, we pick the | 833 // don't find a PC descriptor within the given range, we pick the |
| 834 // nearest one to the beginning of the range, in terms of token position. | 834 // nearest one to the beginning of the range, in terms of token position. |
| 835 intptr_t best_fit_index = -1; | 835 intptr_t best_fit_index = -1; |
| 836 intptr_t best_fit = INT_MAX; | 836 intptr_t best_fit = INT_MAX; |
| 837 uword lowest_pc = INT_MAX; | 837 uword lowest_pc = kUwordMax; |
| 838 intptr_t lowest_pc_index = -1; | 838 intptr_t lowest_pc_index = -1; |
| 839 for (int i = 0; i < desc.Length(); i++) { | 839 for (int i = 0; i < desc.Length(); i++) { |
| 840 intptr_t desc_token_pos = desc.TokenIndex(i); | 840 intptr_t desc_token_pos = desc.TokenIndex(i); |
| 841 if (desc_token_pos < first_token_pos) { | 841 if (desc_token_pos < first_token_pos) { |
| 842 continue; | 842 continue; |
| 843 } | 843 } |
| 844 PcDescriptors::Kind kind = desc.DescriptorKind(i); | 844 PcDescriptors::Kind kind = desc.DescriptorKind(i); |
| 845 if ((kind == PcDescriptors::kIcCall) || | 845 if ((kind == PcDescriptors::kIcCall) || |
| 846 (kind == PcDescriptors::kFuncCall) || | 846 (kind == PcDescriptors::kFuncCall) || |
| 847 (kind == PcDescriptors::kReturn)) { | 847 (kind == PcDescriptors::kReturn)) { |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1548 } | 1548 } |
| 1549 | 1549 |
| 1550 | 1550 |
| 1551 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 1551 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 1552 ASSERT(bpt->next() == NULL); | 1552 ASSERT(bpt->next() == NULL); |
| 1553 bpt->set_next(code_breakpoints_); | 1553 bpt->set_next(code_breakpoints_); |
| 1554 code_breakpoints_ = bpt; | 1554 code_breakpoints_ = bpt; |
| 1555 } | 1555 } |
| 1556 | 1556 |
| 1557 } // namespace dart | 1557 } // namespace dart |
| OLD | NEW |