From 8ae463d736c1a85d66babf2593fd4397162a80f0 Mon Sep 17 00:00:00 2001 From: yangguo Date: Thu, 2 Feb 2017 06:22:15 -0800 Subject: [PATCH] [debugger] remove mirror cache and v8::Debug::GetMirror. R=jgruber@chromium.org BUG=v8:5530 Review-Url: https://codereview.chromium.org/2670823002 Cr-Commit-Position: refs/heads/master@{#42893} --- include/v8-debug.h | 7 -- src/api.cc | 20 ---- src/debug/debug.cc | 15 --- src/debug/debug.h | 3 - src/debug/debug.js | 7 -- src/debug/mirrors.js | 122 ++--------------------- src/inspector/debugger-script.js | 9 +- src/inspector/debugger_script_externs.js | 7 +- test/cctest/test-debug.cc | 2 +- test/mjsunit/regress/regress-618608.js | 36 ------- 10 files changed, 12 insertions(+), 216 deletions(-) diff --git a/include/v8-debug.h b/include/v8-debug.h index bd8568072e..797d23314e 100644 --- a/include/v8-debug.h +++ b/include/v8-debug.h @@ -194,13 +194,6 @@ class V8_EXPORT Debug { v8::Local fun, Local data = Local()); - /** - * Returns a mirror object for the given object. - */ - V8_DEPRECATED("No longer supported", - static MaybeLocal GetMirror(Local context, - v8::Local obj)); - // This is now a no-op. V8_DEPRECATED("No longer supported", static void ProcessDebugMessages(Isolate* isolate)); diff --git a/src/api.cc b/src/api.cc index 7c81839ae7..8dd84c9055 100644 --- a/src/api.cc +++ b/src/api.cc @@ -8925,26 +8925,6 @@ MaybeLocal Debug::Call(Local context, } -MaybeLocal Debug::GetMirror(Local context, - v8::Local obj) { - PREPARE_FOR_EXECUTION(context, Debug, GetMirror, Value); - i::Debug* isolate_debug = isolate->debug(); - has_pending_exception = !isolate_debug->Load(); - RETURN_ON_FAILED_EXECUTION(Value); - i::Handle debug(isolate_debug->debug_context()->global_object()); - auto name = isolate->factory()->NewStringFromStaticChars("MakeMirror"); - auto fun_obj = i::JSReceiver::GetProperty(debug, name).ToHandleChecked(); - auto v8_fun = Utils::CallableToLocal(i::Handle::cast(fun_obj)); - const int kArgc = 1; - v8::Local argv[kArgc] = {obj}; - Local result; - has_pending_exception = - !v8_fun->Call(context, Utils::ToLocal(debug), kArgc, argv) - .ToLocal(&result); - RETURN_ON_FAILED_EXECUTION(Value); - RETURN_ESCAPED(result); -} - void Debug::ProcessDebugMessages(Isolate* isolate) {} Local Debug::GetDebugContext(Isolate* isolate) { diff --git a/src/debug/debug.cc b/src/debug/debug.cc index b701cb0c5d..b732303fc8 100644 --- a/src/debug/debug.cc +++ b/src/debug/debug.cc @@ -1599,13 +1599,6 @@ bool Debug::IsDebugGlobal(JSGlobalObject* global) { } -void Debug::ClearMirrorCache() { - PostponeInterruptsScope postpone(isolate_); - HandleScope scope(isolate_); - CallFunction("ClearMirrorCache", 0, NULL); -} - - Handle Debug::GetLoadedScripts() { isolate_->heap()->CollectAllGarbage(Heap::kFinalizeIncrementalMarkingMask, GarbageCollectionReason::kDebugger); @@ -2314,14 +2307,6 @@ DebugScope::DebugScope(Debug* debug) DebugScope::~DebugScope() { - if (!failed_ && prev_ == NULL) { - // Clear mirror cache when leaving the debugger. Skip this if there is a - // pending exception as clearing the mirror cache calls back into - // JavaScript. This can happen if the v8::Debug::Call is used in which - // case the exception should end up in the calling code. - if (!isolate()->has_pending_exception()) debug_->ClearMirrorCache(); - } - // Leaving this debugger entry. base::NoBarrier_Store(&debug_->thread_local_.current_debug_scope_, reinterpret_cast(prev_)); diff --git a/src/debug/debug.h b/src/debug/debug.h index 7af4502f8b..802e630e13 100644 --- a/src/debug/debug.h +++ b/src/debug/debug.h @@ -501,9 +501,6 @@ class Debug { MUST_USE_RESULT MaybeHandle MakeAsyncTaskEvent(Handle type, Handle id); - // Mirror cache handling. - void ClearMirrorCache(); - void ProcessCompileEvent(v8::DebugEvent event, Handle