Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: src/debug.cc

Issue 8086018: Make sure heap is iteratable before iterating it. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 Deoptimizer::DeoptimizeAll(); 1771 Deoptimizer::DeoptimizeAll();
1772 1772
1773 Handle<Code> lazy_compile = 1773 Handle<Code> lazy_compile =
1774 Handle<Code>(isolate_->builtins()->builtin(Builtins::kLazyCompile)); 1774 Handle<Code>(isolate_->builtins()->builtin(Builtins::kLazyCompile));
1775 1775
1776 // Keep the list of activated functions in a handlified list as it 1776 // Keep the list of activated functions in a handlified list as it
1777 // is used both in GC and non-GC code. 1777 // is used both in GC and non-GC code.
1778 List<Handle<JSFunction> > active_functions(100); 1778 List<Handle<JSFunction> > active_functions(100);
1779 1779
1780 { 1780 {
1781 // We are going to iterate heap to find all functions without
1782 // debug break slots.
1783 isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask);
1784
1781 // Ensure no GC in this scope as we are comparing raw pointer 1785 // Ensure no GC in this scope as we are comparing raw pointer
1782 // values and performing a heap iteration. 1786 // values and performing a heap iteration.
1783 AssertNoAllocation no_allocation; 1787 AssertNoAllocation no_allocation;
1784 1788
1785 // Find all non-optimized code functions with activation frames on 1789 // Find all non-optimized code functions with activation frames on
1786 // the stack. 1790 // the stack.
1787 for (JavaScriptFrameIterator it(isolate_); !it.done(); it.Advance()) { 1791 for (JavaScriptFrameIterator it(isolate_); !it.done(); it.Advance()) {
1788 JavaScriptFrame* frame = it.frame(); 1792 JavaScriptFrame* frame = it.frame();
1789 if (frame->function()->IsJSFunction()) { 1793 if (frame->function()->IsJSFunction()) {
1790 JSFunction* function = JSFunction::cast(frame->function()); 1794 JSFunction* function = JSFunction::cast(frame->function());
(...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
3383 { 3387 {
3384 Locker locker; 3388 Locker locker;
3385 Isolate::Current()->debugger()->CallMessageDispatchHandler(); 3389 Isolate::Current()->debugger()->CallMessageDispatchHandler();
3386 } 3390 }
3387 } 3391 }
3388 } 3392 }
3389 3393
3390 #endif // ENABLE_DEBUGGER_SUPPORT 3394 #endif // ENABLE_DEBUGGER_SUPPORT
3391 3395
3392 } } // namespace v8::internal 3396 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698