| 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 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 thread_local_.after_break_target_ = Assembler::target_address_at(addr); | 1296 thread_local_.after_break_target_ = Assembler::target_address_at(addr); |
| 1297 } | 1297 } |
| 1298 } | 1298 } |
| 1299 | 1299 |
| 1300 | 1300 |
| 1301 bool Debug::IsDebugGlobal(GlobalObject* global) { | 1301 bool Debug::IsDebugGlobal(GlobalObject* global) { |
| 1302 return IsLoaded() && global == Debug::debug_context()->global(); | 1302 return IsLoaded() && global == Debug::debug_context()->global(); |
| 1303 } | 1303 } |
| 1304 | 1304 |
| 1305 | 1305 |
| 1306 void Debug::ClearMirrorCache() { |
| 1307 ASSERT(Top::context() == *Debug::debug_context()); |
| 1308 |
| 1309 // Clear the mirror cache. |
| 1310 Handle<String> function_name = |
| 1311 Factory::LookupSymbol(CStrVector("ClearMirrorCache")); |
| 1312 Handle<Object> fun(Top::global()->GetProperty(*function_name)); |
| 1313 ASSERT(fun->IsJSFunction()); |
| 1314 bool caught_exception; |
| 1315 Handle<Object> js_object = Execution::TryCall( |
| 1316 Handle<JSFunction>::cast(fun), |
| 1317 Handle<JSObject>(Debug::debug_context()->global()), |
| 1318 0, NULL, &caught_exception); |
| 1319 } |
| 1320 |
| 1321 |
| 1306 bool Debugger::debugger_active_ = false; | 1322 bool Debugger::debugger_active_ = false; |
| 1307 bool Debugger::compiling_natives_ = false; | 1323 bool Debugger::compiling_natives_ = false; |
| 1308 bool Debugger::is_loading_debugger_ = false; | 1324 bool Debugger::is_loading_debugger_ = false; |
| 1309 DebugMessageThread* Debugger::message_thread_ = NULL; | 1325 DebugMessageThread* Debugger::message_thread_ = NULL; |
| 1310 v8::DebugMessageHandler Debugger::debug_message_handler_ = NULL; | 1326 v8::DebugMessageHandler Debugger::debug_message_handler_ = NULL; |
| 1311 void* Debugger::debug_message_handler_data_ = NULL; | 1327 void* Debugger::debug_message_handler_data_ = NULL; |
| 1312 | 1328 |
| 1313 | 1329 |
| 1314 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, | 1330 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, |
| 1315 int argc, Object*** argv, | 1331 int argc, Object*** argv, |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 exec_state.location(), | 1637 exec_state.location(), |
| 1622 event_data.location(), | 1638 event_data.location(), |
| 1623 callback_data.location() }; | 1639 callback_data.location() }; |
| 1624 Handle<Object> result = Execution::TryCall(fun, Top::global(), | 1640 Handle<Object> result = Execution::TryCall(fun, Top::global(), |
| 1625 argc, argv, &caught_exception); | 1641 argc, argv, &caught_exception); |
| 1626 if (caught_exception) { | 1642 if (caught_exception) { |
| 1627 // Silently ignore exceptions from debug event listeners. | 1643 // Silently ignore exceptions from debug event listeners. |
| 1628 } | 1644 } |
| 1629 } | 1645 } |
| 1630 } | 1646 } |
| 1647 |
| 1648 // Clear the mirror cache. |
| 1649 Debug::ClearMirrorCache(); |
| 1631 } | 1650 } |
| 1632 | 1651 |
| 1633 | 1652 |
| 1634 void Debugger::SetMessageHandler(v8::DebugMessageHandler handler, void* data) { | 1653 void Debugger::SetMessageHandler(v8::DebugMessageHandler handler, void* data) { |
| 1635 debug_message_handler_ = handler; | 1654 debug_message_handler_ = handler; |
| 1636 debug_message_handler_data_ = data; | 1655 debug_message_handler_data_ = data; |
| 1637 if (!message_thread_) { | 1656 if (!message_thread_) { |
| 1638 message_thread_ = new DebugMessageThread(); | 1657 message_thread_ = new DebugMessageThread(); |
| 1639 message_thread_->Start(); | 1658 message_thread_->Start(); |
| 1640 } | 1659 } |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1993 } | 2012 } |
| 1994 | 2013 |
| 1995 | 2014 |
| 1996 void LockingMessageQueue::Clear() { | 2015 void LockingMessageQueue::Clear() { |
| 1997 ScopedLock sl(lock_); | 2016 ScopedLock sl(lock_); |
| 1998 queue_.Clear(); | 2017 queue_.Clear(); |
| 1999 } | 2018 } |
| 2000 | 2019 |
| 2001 | 2020 |
| 2002 } } // namespace v8::internal | 2021 } } // namespace v8::internal |
| OLD | NEW |