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 2141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2152 // by the API client thread. | 2152 // by the API client thread. |
2153 void Debug::EnqueueCommandMessage(Vector<const uint16_t> command, | 2153 void Debug::EnqueueCommandMessage(Vector<const uint16_t> command, |
2154 v8::Debug::ClientData* client_data) { | 2154 v8::Debug::ClientData* client_data) { |
2155 // Need to cast away const. | 2155 // Need to cast away const. |
2156 CommandMessage message = CommandMessage::New( | 2156 CommandMessage message = CommandMessage::New( |
2157 Vector<uint16_t>(const_cast<uint16_t*>(command.start()), | 2157 Vector<uint16_t>(const_cast<uint16_t*>(command.start()), |
2158 command.length()), | 2158 command.length()), |
2159 client_data); | 2159 client_data); |
2160 isolate_->logger()->DebugTag("Put command on command_queue."); | 2160 isolate_->logger()->DebugTag("Put command on command_queue."); |
2161 command_queue_.Put(message); | 2161 command_queue_.Put(message); |
2162 command_received_.Signal("Debug::EnqueueCommandMessage"); | 2162 command_received_.Signal(); |
2163 | 2163 |
2164 // Set the debug command break flag to have the command processed. | 2164 // Set the debug command break flag to have the command processed. |
2165 if (!in_debug_scope()) isolate_->stack_guard()->RequestDebugCommand(); | 2165 if (!in_debug_scope()) isolate_->stack_guard()->RequestDebugCommand(); |
2166 } | 2166 } |
2167 | 2167 |
2168 | 2168 |
2169 MaybeHandle<Object> Debug::Call(Handle<Object> fun, Handle<Object> data) { | 2169 MaybeHandle<Object> Debug::Call(Handle<Object> fun, Handle<Object> data) { |
2170 DebugScope debug_scope(this); | 2170 DebugScope debug_scope(this); |
2171 if (debug_scope.failed()) return isolate_->factory()->undefined_value(); | 2171 if (debug_scope.failed()) return isolate_->factory()->undefined_value(); |
2172 | 2172 |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2586 } | 2586 } |
2587 | 2587 |
2588 | 2588 |
2589 void LockingCommandMessageQueue::Clear() { | 2589 void LockingCommandMessageQueue::Clear() { |
2590 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2590 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2591 queue_.Clear(); | 2591 queue_.Clear(); |
2592 } | 2592 } |
2593 | 2593 |
2594 } // namespace internal | 2594 } // namespace internal |
2595 } // namespace v8 | 2595 } // namespace v8 |
OLD | NEW |