From: mstarzinger@chromium.org Date: Mon, 3 Sep 2012 14:23:00 +0000 (+0000) Subject: Fix FindSharedFunctionInfoInScript to not optimize. X-Git-Tag: upstream/4.7.83~16059 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74aa15bfa0dba720e6af92434bdd45e23efb0159;p=platform%2Fupstream%2Fv8.git Fix FindSharedFunctionInfoInScript to not optimize. This prevents a corner case in FindSharedFunctionInfoInScript that would cause functions to be optimized because an intermittent GC would clear the flag indicating whether breakpoints are present. Above method was also moved into the Debug class because it is only used by the debugger. R=verwaest@chromium.org Review URL: https://chromiumcodereview.appspot.com/10914065 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12428 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/compiler.cc b/src/compiler.cc index 6153f3a..e4a30db 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -936,7 +936,7 @@ Handle Compiler::BuildFunctionInfo(FunctionLiteral* literal, // If the debugger requests compilation for break points, we cannot be // aggressive about lazy compilation, because it might trigger compilation // of functions without an outer context when setting a breakpoint through - // Runtime::FindSharedFunctionInfoInScript. + // Debug::FindSharedFunctionInfoInScript. bool allow_lazy_without_ctx = literal->AllowsLazyCompilationWithoutContext(); bool allow_lazy = literal->AllowsLazyCompilation() && !LiveEditFunctionTracker::IsActive(info.isolate()) && diff --git a/src/debug.cc b/src/debug.cc index c70b834..4ebdd88 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -698,7 +698,7 @@ void Debug::HandleWeakDebugInfo(v8::Persistent obj, void* data) { // We need to clear all breakpoints associated with the function to restore // original code and avoid patching the code twice later because // the function will live in the heap until next gc, and can be found by - // Runtime::FindSharedFunctionInfoInScript. + // Debug::FindSharedFunctionInfoInScript. BreakLocationIterator it(node->debug_info(), ALL_BREAK_LOCATIONS); it.ClearAllDebugBreak(); debug->RemoveDebugInfo(node->debug_info()); @@ -1172,11 +1172,10 @@ bool Debug::SetBreakPointForScript(Handle