OLD | NEW |
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/debug/debug.h" | 5 #include "src/debug/debug.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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 SuppressDebug while_loading(this); | 530 SuppressDebug while_loading(this); |
531 | 531 |
532 // Disable breakpoints and interrupts while compiling and running the | 532 // Disable breakpoints and interrupts while compiling and running the |
533 // debugger scripts including the context creation code. | 533 // debugger scripts including the context creation code. |
534 DisableBreak disable(this, true); | 534 DisableBreak disable(this, true); |
535 PostponeInterruptsScope postpone(isolate_); | 535 PostponeInterruptsScope postpone(isolate_); |
536 | 536 |
537 // Create the debugger context. | 537 // Create the debugger context. |
538 HandleScope scope(isolate_); | 538 HandleScope scope(isolate_); |
539 ExtensionConfiguration no_extensions; | 539 ExtensionConfiguration no_extensions; |
| 540 // TODO(yangguo): we rely on the fact that first context snapshot is usable |
| 541 // as debug context. This dependency is gone once we remove |
| 542 // debug context completely. |
| 543 static const int kFirstContextSnapshotIndex = 0; |
540 Handle<Context> context = isolate_->bootstrapper()->CreateEnvironment( | 544 Handle<Context> context = isolate_->bootstrapper()->CreateEnvironment( |
541 MaybeHandle<JSGlobalProxy>(), v8::Local<ObjectTemplate>(), &no_extensions, | 545 MaybeHandle<JSGlobalProxy>(), v8::Local<ObjectTemplate>(), &no_extensions, |
542 DEBUG_CONTEXT); | 546 kFirstContextSnapshotIndex, DEBUG_CONTEXT); |
543 | 547 |
544 // Fail if no context could be created. | 548 // Fail if no context could be created. |
545 if (context.is_null()) return false; | 549 if (context.is_null()) return false; |
546 | 550 |
547 debug_context_ = Handle<Context>::cast( | 551 debug_context_ = Handle<Context>::cast( |
548 isolate_->global_handles()->Create(*context)); | 552 isolate_->global_handles()->Create(*context)); |
549 | 553 |
550 feature_tracker()->Track(DebugFeatureTracker::kActive); | 554 feature_tracker()->Track(DebugFeatureTracker::kActive); |
551 | 555 |
552 return true; | 556 return true; |
(...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2610 } | 2614 } |
2611 | 2615 |
2612 | 2616 |
2613 void LockingCommandMessageQueue::Clear() { | 2617 void LockingCommandMessageQueue::Clear() { |
2614 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2618 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2615 queue_.Clear(); | 2619 queue_.Clear(); |
2616 } | 2620 } |
2617 | 2621 |
2618 } // namespace internal | 2622 } // namespace internal |
2619 } // namespace v8 | 2623 } // namespace v8 |
OLD | NEW |