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

Side by Side Diff: src/debug.cc

Issue 307383002: Add option to disable MirrorCache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 6 years, 6 months 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/mirror-debugger.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2441 matching lines...) Expand 10 before | Expand all | Expand 10 after
2452 2452
2453 bool Debug::IsDebugGlobal(GlobalObject* global) { 2453 bool Debug::IsDebugGlobal(GlobalObject* global) {
2454 return is_loaded() && global == debug_context()->global_object(); 2454 return is_loaded() && global == debug_context()->global_object();
2455 } 2455 }
2456 2456
2457 2457
2458 void Debug::ClearMirrorCache() { 2458 void Debug::ClearMirrorCache() {
2459 PostponeInterruptsScope postpone(isolate_); 2459 PostponeInterruptsScope postpone(isolate_);
2460 HandleScope scope(isolate_); 2460 HandleScope scope(isolate_);
2461 ASSERT(isolate_->context() == *Debug::debug_context()); 2461 ASSERT(isolate_->context() == *Debug::debug_context());
2462 2462 Factory* factory = isolate_->factory();
2463 // Clear the mirror cache. 2463 JSObject::SetProperty(isolate_->global_object(),
2464 Handle<Object> fun = Object::GetProperty( 2464 factory->NewStringFromAsciiChecked("next_handle_"),
2465 isolate_, 2465 handle(Smi::FromInt(0), isolate_),
2466 isolate_->global_object(), 2466 NONE,
2467 "ClearMirrorCache").ToHandleChecked(); 2467 SLOPPY);
2468 ASSERT(fun->IsJSFunction()); 2468 JSObject::SetProperty(isolate_->global_object(),
2469 Execution::TryCall(Handle<JSFunction>::cast(fun), 2469 factory->NewStringFromAsciiChecked("mirror_cache_"),
2470 Handle<JSObject>(Debug::debug_context()->global_object()), 2470 factory->NewJSArray(0, FAST_ELEMENTS),
2471 0, 2471 NONE,
2472 NULL); 2472 SLOPPY);
2473 } 2473 }
2474 2474
2475 2475
2476 Handle<FixedArray> Debug::GetLoadedScripts() { 2476 Handle<FixedArray> Debug::GetLoadedScripts() {
2477 // Create and fill the script cache when the loaded scripts is requested for 2477 // Create and fill the script cache when the loaded scripts is requested for
2478 // the first time. 2478 // the first time.
2479 if (script_cache_ == NULL) script_cache_ = new ScriptCache(isolate_); 2479 if (script_cache_ == NULL) script_cache_ = new ScriptCache(isolate_);
2480 2480
2481 // Perform GC to get unreferenced scripts evicted from the cache before 2481 // Perform GC to get unreferenced scripts evicted from the cache before
2482 // returning the content. 2482 // returning the content.
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
3411 logger_->DebugEvent("Put", message.text()); 3411 logger_->DebugEvent("Put", message.text());
3412 } 3412 }
3413 3413
3414 3414
3415 void LockingCommandMessageQueue::Clear() { 3415 void LockingCommandMessageQueue::Clear() {
3416 LockGuard<Mutex> lock_guard(&mutex_); 3416 LockGuard<Mutex> lock_guard(&mutex_);
3417 queue_.Clear(); 3417 queue_.Clear();
3418 } 3418 }
3419 3419
3420 } } // namespace v8::internal 3420 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mirror-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698