X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fv8%2Fsrc%2Fdebug.cc;h=6ee52fabe480de167a82d486f9ca90aecac4d948;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=f0e77968eb48fb6135ff9a8636a4dac6adbd18ad;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/v8/src/debug.cc b/src/v8/src/debug.cc index f0e7796..6ee52fa 100644 --- a/src/v8/src/debug.cc +++ b/src/v8/src/debug.cc @@ -40,6 +40,7 @@ Debug::Debug(Isolate* isolate) live_edit_enabled_(true), // TODO(yangguo): set to false by default. has_break_points_(false), break_disabled_(false), + in_debug_event_listener_(false), break_on_exception_(false), break_on_uncaught_exception_(false), script_cache_(NULL), @@ -563,7 +564,8 @@ void Debug::ThreadInit() { thread_local_.step_into_fp_ = 0; thread_local_.step_out_fp_ = 0; // TODO(isolates): frames_are_dropped_? - thread_local_.current_debug_scope_ = NULL; + base::NoBarrier_Store(&thread_local_.current_debug_scope_, + static_cast(NULL)); thread_local_.restarter_frame_function_pointer_ = NULL; } @@ -593,10 +595,7 @@ ScriptCache::ScriptCache(Isolate* isolate) : HashMap(HashMap::PointersMatch), Heap* heap = isolate_->heap(); HandleScope scope(isolate_); - // Perform two GCs to get rid of all unreferenced scripts. The first GC gets - // rid of all the cached script wrappers and the second gets rid of the - // scripts which are no longer referenced. - heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, "ScriptCache"); + // Perform a GC to get rid of all unreferenced scripts. heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, "ScriptCache"); // Scan heap for Script objects. @@ -693,13 +692,7 @@ void Debug::HandleWeakDebugInfo( Debug* debug = reinterpret_cast(data.GetIsolate())->debug(); DebugInfoListNode* node = reinterpret_cast(data.GetParameter()); - // 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 - // Debug::FindSharedFunctionInfoInScript. - BreakLocationIterator it(node->debug_info(), ALL_BREAK_LOCATIONS); - it.ClearAllDebugBreak(); - debug->RemoveDebugInfo(node->debug_info()); + debug->RemoveDebugInfo(node->debug_info().location()); #ifdef DEBUG for (DebugInfoListNode* n = debug->debug_info_list_; n != NULL; @@ -715,8 +708,8 @@ DebugInfoListNode::DebugInfoListNode(DebugInfo* debug_info): next_(NULL) { GlobalHandles* global_handles = debug_info->GetIsolate()->global_handles(); debug_info_ = Handle::cast(global_handles->Create(debug_info)); GlobalHandles::MakeWeak(reinterpret_cast(debug_info_.location()), - this, - Debug::HandleWeakDebugInfo); + this, Debug::HandleWeakDebugInfo, + GlobalHandles::Phantom); } @@ -872,7 +865,7 @@ void Debug::Break(Arguments args, JavaScriptFrame* frame) { LiveEdit::InitializeThreadLocal(this); // Just continue if breaks are disabled or debugger cannot be loaded. - if (break_disabled_) return; + if (break_disabled()) return; // Enter the debugger. DebugScope debug_scope(this); @@ -1095,7 +1088,7 @@ bool Debug::SetBreakPoint(Handle function, it.FindBreakLocationFromPosition(*source_position, STATEMENT_ALIGNED); it.SetBreakPoint(break_point_object); - *source_position = it.position(); + *source_position = it.statement_position(); // At least one active break point now. return debug_info->GetBreakPointCount() > 0; @@ -1139,7 +1132,10 @@ bool Debug::SetBreakPointForScript(Handle