| 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 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 Code::cast(HeapObject::FromAddress(target - Code::kHeaderSize)); | 1304 Code::cast(HeapObject::FromAddress(target - Code::kHeaderSize)); |
| 1305 return result; | 1305 return result; |
| 1306 } | 1306 } |
| 1307 | 1307 |
| 1308 | 1308 |
| 1309 bool Debug::IsDebugGlobal(GlobalObject* global) { | 1309 bool Debug::IsDebugGlobal(GlobalObject* global) { |
| 1310 return IsLoaded() && global == Debug::debug_context()->global(); | 1310 return IsLoaded() && global == Debug::debug_context()->global(); |
| 1311 } | 1311 } |
| 1312 | 1312 |
| 1313 | 1313 |
| 1314 void Debug::ClearMirrorCache() { |
| 1315 ASSERT(Top::context() == *Debug::debug_context()); |
| 1316 |
| 1317 // Clear the mirror cache. |
| 1318 Handle<String> function_name = |
| 1319 Factory::LookupSymbol(CStrVector("ClearMirrorCache")); |
| 1320 Handle<Object> fun(Top::global()->GetProperty(*function_name)); |
| 1321 ASSERT(fun->IsJSFunction()); |
| 1322 bool caught_exception; |
| 1323 Handle<Object> js_object = Execution::TryCall( |
| 1324 Handle<JSFunction>::cast(fun), |
| 1325 Handle<JSObject>(Debug::debug_context()->global()), |
| 1326 0, NULL, &caught_exception); |
| 1327 } |
| 1328 |
| 1329 |
| 1314 bool Debugger::debugger_active_ = false; | 1330 bool Debugger::debugger_active_ = false; |
| 1315 bool Debugger::compiling_natives_ = false; | 1331 bool Debugger::compiling_natives_ = false; |
| 1316 bool Debugger::is_loading_debugger_ = false; | 1332 bool Debugger::is_loading_debugger_ = false; |
| 1317 DebugMessageThread* Debugger::message_thread_ = NULL; | 1333 DebugMessageThread* Debugger::message_thread_ = NULL; |
| 1318 v8::DebugMessageHandler Debugger::debug_message_handler_ = NULL; | 1334 v8::DebugMessageHandler Debugger::debug_message_handler_ = NULL; |
| 1319 void* Debugger::debug_message_handler_data_ = NULL; | 1335 void* Debugger::debug_message_handler_data_ = NULL; |
| 1320 | 1336 |
| 1321 | 1337 |
| 1322 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, | 1338 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, |
| 1323 int argc, Object*** argv, | 1339 int argc, Object*** argv, |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1629 exec_state.location(), | 1645 exec_state.location(), |
| 1630 event_data.location(), | 1646 event_data.location(), |
| 1631 callback_data.location() }; | 1647 callback_data.location() }; |
| 1632 Handle<Object> result = Execution::TryCall(fun, Top::global(), | 1648 Handle<Object> result = Execution::TryCall(fun, Top::global(), |
| 1633 argc, argv, &caught_exception); | 1649 argc, argv, &caught_exception); |
| 1634 if (caught_exception) { | 1650 if (caught_exception) { |
| 1635 // Silently ignore exceptions from debug event listeners. | 1651 // Silently ignore exceptions from debug event listeners. |
| 1636 } | 1652 } |
| 1637 } | 1653 } |
| 1638 } | 1654 } |
| 1655 |
| 1656 // Clear the mirror cache. |
| 1657 Debug::ClearMirrorCache(); |
| 1639 } | 1658 } |
| 1640 | 1659 |
| 1641 | 1660 |
| 1642 void Debugger::SetMessageHandler(v8::DebugMessageHandler handler, void* data) { | 1661 void Debugger::SetMessageHandler(v8::DebugMessageHandler handler, void* data) { |
| 1643 debug_message_handler_ = handler; | 1662 debug_message_handler_ = handler; |
| 1644 debug_message_handler_data_ = data; | 1663 debug_message_handler_data_ = data; |
| 1645 if (!message_thread_) { | 1664 if (!message_thread_) { |
| 1646 message_thread_ = new DebugMessageThread(); | 1665 message_thread_ = new DebugMessageThread(); |
| 1647 message_thread_->Start(); | 1666 message_thread_->Start(); |
| 1648 } | 1667 } |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2001 } | 2020 } |
| 2002 | 2021 |
| 2003 | 2022 |
| 2004 void LockingMessageQueue::Clear() { | 2023 void LockingMessageQueue::Clear() { |
| 2005 ScopedLock sl(lock_); | 2024 ScopedLock sl(lock_); |
| 2006 queue_.Clear(); | 2025 queue_.Clear(); |
| 2007 } | 2026 } |
| 2008 | 2027 |
| 2009 | 2028 |
| 2010 } } // namespace v8::internal | 2029 } } // namespace v8::internal |
| OLD | NEW |