OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 thread_local_.last_fp_ = 0; | 1726 thread_local_.last_fp_ = 0; |
1727 } | 1727 } |
1728 | 1728 |
1729 | 1729 |
1730 void Debug::PrepareForBreakPoints() { | 1730 void Debug::PrepareForBreakPoints() { |
1731 // If preparing for the first break point make sure to deoptimize all | 1731 // If preparing for the first break point make sure to deoptimize all |
1732 // functions as debugging does not work with optimized code. | 1732 // functions as debugging does not work with optimized code. |
1733 if (!has_break_points_) { | 1733 if (!has_break_points_) { |
1734 Deoptimizer::DeoptimizeAll(); | 1734 Deoptimizer::DeoptimizeAll(); |
1735 | 1735 |
| 1736 // We are going to iterate heap to find all functions without |
| 1737 // debug break slots. |
| 1738 isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
| 1739 |
1736 AssertNoAllocation no_allocation; | 1740 AssertNoAllocation no_allocation; |
1737 Builtins* builtins = isolate_->builtins(); | 1741 Builtins* builtins = isolate_->builtins(); |
1738 Code* lazy_compile = builtins->builtin(Builtins::kLazyCompile); | 1742 Code* lazy_compile = builtins->builtin(Builtins::kLazyCompile); |
1739 | 1743 |
1740 // Find all non-optimized code functions with activation frames on | 1744 // Find all non-optimized code functions with activation frames on |
1741 // the stack. | 1745 // the stack. |
1742 List<JSFunction*> active_functions(100); | 1746 List<JSFunction*> active_functions(100); |
1743 for (JavaScriptFrameIterator it(isolate_); !it.done(); it.Advance()) { | 1747 for (JavaScriptFrameIterator it(isolate_); !it.done(); it.Advance()) { |
1744 JavaScriptFrame* frame = it.frame(); | 1748 JavaScriptFrame* frame = it.frame(); |
1745 if (frame->function()->IsJSFunction()) { | 1749 if (frame->function()->IsJSFunction()) { |
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3228 { | 3232 { |
3229 Locker locker; | 3233 Locker locker; |
3230 Isolate::Current()->debugger()->CallMessageDispatchHandler(); | 3234 Isolate::Current()->debugger()->CallMessageDispatchHandler(); |
3231 } | 3235 } |
3232 } | 3236 } |
3233 } | 3237 } |
3234 | 3238 |
3235 #endif // ENABLE_DEBUGGER_SUPPORT | 3239 #endif // ENABLE_DEBUGGER_SUPPORT |
3236 | 3240 |
3237 } } // namespace v8::internal | 3241 } } // namespace v8::internal |
OLD | NEW |