From 0133d96be397ab725813880c47b09973bd867787 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Fri, 27 Jun 2014 12:10:43 +0000 Subject: [PATCH] Remove script collected debug event. R=yurys@chromium.org Review URL: https://codereview.chromium.org/358873005 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22063 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8-debug.h | 5 +- src/compiler.cc | 1 + src/d8.js | 4 -- src/debug-debugger.js | 28 +-------- src/debug.cc | 57 +----------------- src/debug.h | 10 --- src/heap.cc | 1 - test/cctest/test-debug.cc | 114 ----------------------------------- test/mjsunit/regress/regress-2336.js | 53 ---------------- tools/generate-runtime-tests.py | 2 +- 10 files changed, 8 insertions(+), 267 deletions(-) delete mode 100644 test/mjsunit/regress/regress-2336.js diff --git a/include/v8-debug.h b/include/v8-debug.h index 7d74d37..90d8544 100644 --- a/include/v8-debug.h +++ b/include/v8-debug.h @@ -19,9 +19,8 @@ enum DebugEvent { NewFunction = 3, BeforeCompile = 4, AfterCompile = 5, - ScriptCollected = 6, - CompileError = 7, - BreakForCommand = 8 + CompileError = 6, + BreakForCommand = 7 }; diff --git a/src/compiler.cc b/src/compiler.cc index 9ae887e..6b2fba4 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -454,6 +454,7 @@ OptimizedCompileJob::Status OptimizedCompileJob::GenerateCode() { ASSERT(last_status() == SUCCEEDED); ASSERT(!info()->HasAbortedDueToDependencyChange()); DisallowCodeDependencyChange no_dependency_change; + DisallowJavascriptExecution no_js(isolate()); { // Scope for timer. Timer timer(this, &time_taken_to_codegen_); ASSERT(chunk_ != NULL); diff --git a/src/d8.js b/src/d8.js index 3f7832d..10546c2 100644 --- a/src/d8.js +++ b/src/d8.js @@ -208,10 +208,6 @@ function DebugEventDetails(response) { details.text = result; break; - case 'scriptCollected': - details.text = result; - break; - default: details.text = 'Unknown debug event ' + response.event(); } diff --git a/src/debug-debugger.js b/src/debug-debugger.js index 6cd1baa..5de8292 100644 --- a/src/debug-debugger.js +++ b/src/debug-debugger.js @@ -19,8 +19,7 @@ Debug.DebugEvent = { Break: 1, NewFunction: 3, BeforeCompile: 4, AfterCompile: 5, - ScriptCollected: 6, - CompileError: 7 }; + CompileError: 6 }; // Types of exceptions that can be broken upon. Debug.ExceptionBreak = { Caught : 0, @@ -1183,31 +1182,6 @@ CompileEvent.prototype.toJSONProtocol = function() { }; -function MakeScriptCollectedEvent(id) { - return new ScriptCollectedEvent(id); -} - - -function ScriptCollectedEvent(id) { - this.id_ = id; -} - - -ScriptCollectedEvent.prototype.id = function() { - return this.id_; -}; - - -ScriptCollectedEvent.prototype.toJSONProtocol = function() { - var o = new ProtocolMessage(); - o.running = true; - o.event = "scriptCollected"; - o.body = {}; - o.body.script = { id: this.id() }; - return o.toJSONProtocol(); -}; - - function MakeScriptObject_(script, include_source) { var o = { id: script.id(), name: script.name(), diff --git a/src/debug.cc b/src/debug.cc index fa5318b..d99e6f5 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -592,8 +592,7 @@ int Debug::ArchiveSpacePerThread() { ScriptCache::ScriptCache(Isolate* isolate) : HashMap(HashMap::PointersMatch), - isolate_(isolate), - collected_scripts_(10) { + isolate_(isolate) { Heap* heap = isolate_->heap(); HandleScope scope(isolate_); @@ -651,15 +650,6 @@ Handle ScriptCache::GetScripts() { } -void ScriptCache::ProcessCollectedScripts() { - Debug* debug = isolate_->debug(); - for (int i = 0; i < collected_scripts_.length(); i++) { - debug->OnScriptCollected(collected_scripts_[i]); - } - collected_scripts_.Clear(); -} - - void ScriptCache::Clear() { // Iterate the script cache to get rid of all the weak handles. for (HashMap::Entry* entry = Start(); entry != NULL; entry = Next(entry)) { @@ -688,7 +678,6 @@ void ScriptCache::HandleWeakScript( HashMap::Entry* entry = script_cache->Lookup(key, hash, false); Object** location = reinterpret_cast(entry->value); script_cache->Remove(key, hash); - script_cache->collected_scripts_.Add(id); // Clear the weak handle. GlobalHandles::Destroy(location); @@ -2500,14 +2489,6 @@ void Debug::RecordEvalCaller(Handle