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 "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "platform/address_sanitizer.h" | 9 #include "platform/address_sanitizer.h" |
10 | 10 |
(...skipping 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2573 if (class_table.HasValidClassAt(i)) { | 2573 if (class_table.HasValidClassAt(i)) { |
2574 cls = class_table.At(i); | 2574 cls = class_table.At(i); |
2575 // If the class is not finalized, e.g. if it hasn't been parsed | 2575 // If the class is not finalized, e.g. if it hasn't been parsed |
2576 // yet entirely, we can ignore it. If it contains a function with | 2576 // yet entirely, we can ignore it. If it contains a function with |
2577 // an unresolved breakpoint, we will detect it if and when the | 2577 // an unresolved breakpoint, we will detect it if and when the |
2578 // function gets compiled. | 2578 // function gets compiled. |
2579 if (!cls.is_finalized()) { | 2579 if (!cls.is_finalized()) { |
2580 continue; | 2580 continue; |
2581 } | 2581 } |
2582 // Note: we need to check the functions of this class even if | 2582 // Note: we need to check the functions of this class even if |
2583 // the class is defined in a differenct 'script'. There could | 2583 // the class is defined in a different 'script'. There could |
2584 // be mixin functions from the given script in this class. | 2584 // be mixin functions from the given script in this class. |
2585 functions = cls.functions(); | 2585 functions = cls.functions(); |
2586 if (!functions.IsNull()) { | 2586 if (!functions.IsNull()) { |
2587 const intptr_t num_functions = functions.Length(); | 2587 const intptr_t num_functions = functions.Length(); |
2588 for (intptr_t pos = 0; pos < num_functions; pos++) { | 2588 for (intptr_t pos = 0; pos < num_functions; pos++) { |
2589 function ^= functions.At(pos); | 2589 function ^= functions.At(pos); |
2590 ASSERT(!function.IsNull()); | 2590 ASSERT(!function.IsNull()); |
2591 // Check token position first to avoid unnecessary calls | 2591 // Check token position first to avoid unnecessary calls |
2592 // to script() which allocates handles. | 2592 // to script() which allocates handles. |
2593 if ((function.token_pos() == start_pos) && | 2593 if ((function.token_pos() == start_pos) && |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2641 } | 2641 } |
2642 } | 2642 } |
2643 | 2643 |
2644 const ClassTable& class_table = *isolate_->class_table(); | 2644 const ClassTable& class_table = *isolate_->class_table(); |
2645 const intptr_t num_classes = class_table.NumCids(); | 2645 const intptr_t num_classes = class_table.NumCids(); |
2646 for (intptr_t i = 1; i < num_classes; i++) { | 2646 for (intptr_t i = 1; i < num_classes; i++) { |
2647 if (class_table.HasValidClassAt(i)) { | 2647 if (class_table.HasValidClassAt(i)) { |
2648 cls = class_table.At(i); | 2648 cls = class_table.At(i); |
2649 // Note: if this class has been parsed and finalized already, | 2649 // Note: if this class has been parsed and finalized already, |
2650 // we need to check the functions of this class even if | 2650 // we need to check the functions of this class even if |
2651 // it is defined in a differenct 'script'. There could | 2651 // it is defined in a different 'script'. There could |
2652 // be mixin functions from the given script in this class. | 2652 // be mixin functions from the given script in this class. |
2653 // However, if this class is not parsed yet (not finalized), | 2653 // However, if this class is not parsed yet (not finalized), |
2654 // we can ignore it and avoid the side effect of parsing it. | 2654 // we can ignore it and avoid the side effect of parsing it. |
2655 if ((cls.script() != script.raw()) && !cls.is_finalized()) { | 2655 if ((cls.script() != script.raw()) && !cls.is_finalized()) { |
2656 continue; | 2656 continue; |
2657 } | 2657 } |
2658 // Parse class definition if not done yet. | 2658 // Parse class definition if not done yet. |
2659 error = cls.EnsureIsFinalized(Thread::Current()); | 2659 error = cls.EnsureIsFinalized(Thread::Current()); |
2660 if (!error.IsNull()) { | 2660 if (!error.IsNull()) { |
2661 // Ignore functions in this class. | 2661 // Ignore functions in this class. |
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4367 | 4367 |
4368 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 4368 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
4369 ASSERT(bpt->next() == NULL); | 4369 ASSERT(bpt->next() == NULL); |
4370 bpt->set_next(code_breakpoints_); | 4370 bpt->set_next(code_breakpoints_); |
4371 code_breakpoints_ = bpt; | 4371 code_breakpoints_ = bpt; |
4372 } | 4372 } |
4373 | 4373 |
4374 #endif // !PRODUCT | 4374 #endif // !PRODUCT |
4375 | 4375 |
4376 } // namespace dart | 4376 } // namespace dart |
OLD | NEW |