| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1348 Handle<Object> Debugger::event_listener_ = Handle<Object>(); | 1348 Handle<Object> Debugger::event_listener_ = Handle<Object>(); |
| 1349 Handle<Object> Debugger::event_listener_data_ = Handle<Object>(); | 1349 Handle<Object> Debugger::event_listener_data_ = Handle<Object>(); |
| 1350 bool Debugger::debugger_active_ = false; | 1350 bool Debugger::debugger_active_ = false; |
| 1351 bool Debugger::compiling_natives_ = false; | 1351 bool Debugger::compiling_natives_ = false; |
| 1352 bool Debugger::is_loading_debugger_ = false; | 1352 bool Debugger::is_loading_debugger_ = false; |
| 1353 DebugMessageThread* Debugger::message_thread_ = NULL; | 1353 DebugMessageThread* Debugger::message_thread_ = NULL; |
| 1354 v8::DebugMessageHandler Debugger::message_handler_ = NULL; | 1354 v8::DebugMessageHandler Debugger::message_handler_ = NULL; |
| 1355 void* Debugger::message_handler_data_ = NULL; | 1355 void* Debugger::message_handler_data_ = NULL; |
| 1356 v8::DebugHostDispatchHandler Debugger::host_dispatch_handler_ = NULL; | 1356 v8::DebugHostDispatchHandler Debugger::host_dispatch_handler_ = NULL; |
| 1357 void* Debugger::host_dispatch_handler_data_ = NULL; | 1357 void* Debugger::host_dispatch_handler_data_ = NULL; |
| 1358 DebuggerAgent* Debugger::agent_ = NULL; |
| 1358 | 1359 |
| 1359 | 1360 |
| 1360 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, | 1361 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, |
| 1361 int argc, Object*** argv, | 1362 int argc, Object*** argv, |
| 1362 bool* caught_exception) { | 1363 bool* caught_exception) { |
| 1363 ASSERT(Top::context() == *Debug::debug_context()); | 1364 ASSERT(Top::context() == *Debug::debug_context()); |
| 1364 | 1365 |
| 1365 // Create the execution state object. | 1366 // Create the execution state object. |
| 1366 Handle<String> constructor_str = Factory::LookupSymbol(constructor_name); | 1367 Handle<String> constructor_str = Factory::LookupSymbol(constructor_name); |
| 1367 Handle<Object> constructor(Top::global()->GetProperty(*constructor_str)); | 1368 Handle<Object> constructor(Top::global()->GetProperty(*constructor_str)); |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1785 } | 1786 } |
| 1786 | 1787 |
| 1787 static const int kArgc = 2; | 1788 static const int kArgc = 2; |
| 1788 Object** argv[kArgc] = { exec_state.location(), data.location() }; | 1789 Object** argv[kArgc] = { exec_state.location(), data.location() }; |
| 1789 Handle<Object> result = Execution::Call(fun, Factory::undefined_value(), | 1790 Handle<Object> result = Execution::Call(fun, Factory::undefined_value(), |
| 1790 kArgc, argv, pending_exception); | 1791 kArgc, argv, pending_exception); |
| 1791 return result; | 1792 return result; |
| 1792 } | 1793 } |
| 1793 | 1794 |
| 1794 | 1795 |
| 1796 bool Debugger::StartAgent(int port) { |
| 1797 if (Socket::Setup()) { |
| 1798 agent_ = new DebuggerAgent(port); |
| 1799 agent_->Start(); |
| 1800 return true; |
| 1801 } |
| 1802 |
| 1803 return false; |
| 1804 } |
| 1805 |
| 1806 |
| 1795 DebugMessageThread::DebugMessageThread() | 1807 DebugMessageThread::DebugMessageThread() |
| 1796 : host_running_(true), | 1808 : host_running_(true), |
| 1797 command_queue_(kQueueInitialSize), | 1809 command_queue_(kQueueInitialSize), |
| 1798 message_queue_(kQueueInitialSize) { | 1810 message_queue_(kQueueInitialSize) { |
| 1799 command_received_ = OS::CreateSemaphore(0); | 1811 command_received_ = OS::CreateSemaphore(0); |
| 1800 message_received_ = OS::CreateSemaphore(0); | 1812 message_received_ = OS::CreateSemaphore(0); |
| 1801 } | 1813 } |
| 1802 | 1814 |
| 1803 // Does not free resources held by DebugMessageThread | 1815 // Does not free resources held by DebugMessageThread |
| 1804 // because this cannot be done thread-safely. | 1816 // because this cannot be done thread-safely. |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2107 } | 2119 } |
| 2108 | 2120 |
| 2109 | 2121 |
| 2110 void LockingMessageQueue::Clear() { | 2122 void LockingMessageQueue::Clear() { |
| 2111 ScopedLock sl(lock_); | 2123 ScopedLock sl(lock_); |
| 2112 queue_.Clear(); | 2124 queue_.Clear(); |
| 2113 } | 2125 } |
| 2114 | 2126 |
| 2115 | 2127 |
| 2116 } } // namespace v8::internal | 2128 } } // namespace v8::internal |
| OLD | NEW |