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

Side by Side Diff: src/debug.cc

Issue 8742020: Manually revert the effect of r9250 from the 3.6 branch (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.6/
Patch Set: Created 9 years 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 | src/version.cc » ('j') | 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 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 thread_local_.last_statement_position_ = RelocInfo::kNoPosition; 1724 thread_local_.last_statement_position_ = RelocInfo::kNoPosition;
1725 thread_local_.last_fp_ = 0; 1725 thread_local_.last_fp_ = 0;
1726 } 1726 }
1727 1727
1728 1728
1729 void Debug::PrepareForBreakPoints() { 1729 void Debug::PrepareForBreakPoints() {
1730 // If preparing for the first break point make sure to deoptimize all 1730 // If preparing for the first break point make sure to deoptimize all
1731 // functions as debugging does not work with optimized code. 1731 // functions as debugging does not work with optimized code.
1732 if (!has_break_points_) { 1732 if (!has_break_points_) {
1733 Deoptimizer::DeoptimizeAll(); 1733 Deoptimizer::DeoptimizeAll();
1734
1735 AssertNoAllocation no_allocation;
1736 Builtins* builtins = isolate_->builtins();
1737 Code* lazy_compile = builtins->builtin(Builtins::kLazyCompile);
1738
1739 // Find all non-optimized code functions with activation frames on
1740 // the stack.
1741 List<JSFunction*> active_functions(100);
1742 for (JavaScriptFrameIterator it(isolate_); !it.done(); it.Advance()) {
1743 JavaScriptFrame* frame = it.frame();
1744 if (frame->function()->IsJSFunction()) {
1745 JSFunction* function = JSFunction::cast(frame->function());
1746 if (function->code()->kind() == Code::FUNCTION)
1747 active_functions.Add(function);
1748 }
1749 }
1750 active_functions.Sort();
1751
1752 // Scan the heap for all non-optimized functions which has no
1753 // debug break slots.
1754 HeapIterator iterator;
1755 HeapObject* obj = NULL;
1756 while (((obj = iterator.next()) != NULL)) {
1757 if (obj->IsJSFunction()) {
1758 JSFunction* function = JSFunction::cast(obj);
1759 if (function->shared()->allows_lazy_compilation() &&
1760 function->shared()->script()->IsScript() &&
1761 function->code()->kind() == Code::FUNCTION &&
1762 !function->code()->has_debug_break_slots()) {
1763 bool has_activation =
1764 SortedListBSearch<JSFunction*>(active_functions, function) != -1;
1765 if (!has_activation) {
1766 function->set_code(lazy_compile);
1767 function->shared()->set_code(lazy_compile);
1768 }
1769 }
1770 }
1771 }
1772 } 1734 }
1773 } 1735 }
1774 1736
1775 1737
1776 // Ensures the debug information is present for shared. 1738 // Ensures the debug information is present for shared.
1777 bool Debug::EnsureDebugInfo(Handle<SharedFunctionInfo> shared) { 1739 bool Debug::EnsureDebugInfo(Handle<SharedFunctionInfo> shared) {
1778 // Return if we already have the debug info for shared. 1740 // Return if we already have the debug info for shared.
1779 if (HasDebugInfo(shared)) { 1741 if (HasDebugInfo(shared)) {
1780 ASSERT(shared->is_compiled()); 1742 ASSERT(shared->is_compiled());
1781 return true; 1743 return true;
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after
3224 { 3186 {
3225 Locker locker; 3187 Locker locker;
3226 Isolate::Current()->debugger()->CallMessageDispatchHandler(); 3188 Isolate::Current()->debugger()->CallMessageDispatchHandler();
3227 } 3189 }
3228 } 3190 }
3229 } 3191 }
3230 3192
3231 #endif // ENABLE_DEBUGGER_SUPPORT 3193 #endif // ENABLE_DEBUGGER_SUPPORT
3232 3194
3233 } } // namespace v8::internal 3195 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698