| 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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 bool caught_exception = false; | 654 bool caught_exception = false; |
| 655 Handle<JSFunction> function = | 655 Handle<JSFunction> function = |
| 656 Factory::NewFunctionFromBoilerplate(boilerplate, context); | 656 Factory::NewFunctionFromBoilerplate(boilerplate, context); |
| 657 Handle<Object> result = | 657 Handle<Object> result = |
| 658 Execution::TryCall(function, Handle<Object>(context->global()), | 658 Execution::TryCall(function, Handle<Object>(context->global()), |
| 659 0, NULL, &caught_exception); | 659 0, NULL, &caught_exception); |
| 660 | 660 |
| 661 // Check for caught exceptions. | 661 // Check for caught exceptions. |
| 662 if (caught_exception) { | 662 if (caught_exception) { |
| 663 Handle<Object> message = MessageHandler::MakeMessageObject( | 663 Handle<Object> message = MessageHandler::MakeMessageObject( |
| 664 "error_loading_debugger", NULL, HandleVector<Object>(&result, 1), | 664 "error_loading_debugger", NULL, Vector<Handle<Object> >::empty(), |
| 665 Handle<String>()); | 665 Handle<String>()); |
| 666 MessageHandler::ReportMessage(NULL, message); | 666 MessageHandler::ReportMessage(NULL, message); |
| 667 return false; | 667 return false; |
| 668 } | 668 } |
| 669 | 669 |
| 670 // Mark this script as native and return successfully. | 670 // Mark this script as native and return successfully. |
| 671 Handle<Script> script(Script::cast(function->shared()->script())); | 671 Handle<Script> script(Script::cast(function->shared()->script())); |
| 672 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); | 672 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); |
| 673 return true; | 673 return true; |
| 674 } | 674 } |
| (...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 Handle<JSFunction> fun(Handle<JSFunction>::cast(event_listener_)); | 1994 Handle<JSFunction> fun(Handle<JSFunction>::cast(event_listener_)); |
| 1995 | 1995 |
| 1996 // Invoke the JavaScript debug event listener. | 1996 // Invoke the JavaScript debug event listener. |
| 1997 const int argc = 4; | 1997 const int argc = 4; |
| 1998 Object** argv[argc] = { Handle<Object>(Smi::FromInt(event)).location(), | 1998 Object** argv[argc] = { Handle<Object>(Smi::FromInt(event)).location(), |
| 1999 exec_state.location(), | 1999 exec_state.location(), |
| 2000 Handle<Object>::cast(event_data).location(), | 2000 Handle<Object>::cast(event_data).location(), |
| 2001 event_listener_data_.location() }; | 2001 event_listener_data_.location() }; |
| 2002 Handle<Object> result = Execution::TryCall(fun, Top::global(), | 2002 Handle<Object> result = Execution::TryCall(fun, Top::global(), |
| 2003 argc, argv, &caught_exception); | 2003 argc, argv, &caught_exception); |
| 2004 if (caught_exception) { | 2004 // Silently ignore exceptions from debug event listeners. |
| 2005 // Silently ignore exceptions from debug event listeners. | |
| 2006 } | |
| 2007 } | 2005 } |
| 2008 } | 2006 } |
| 2009 } | 2007 } |
| 2010 | 2008 |
| 2011 | 2009 |
| 2012 void Debugger::UnloadDebugger() { | 2010 void Debugger::UnloadDebugger() { |
| 2013 // Make sure that there are no breakpoints left. | 2011 // Make sure that there are no breakpoints left. |
| 2014 Debug::ClearAllBreakPoints(); | 2012 Debug::ClearAllBreakPoints(); |
| 2015 | 2013 |
| 2016 // Unload the debugger if feasible. | 2014 // Unload the debugger if feasible. |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2565 | 2563 |
| 2566 | 2564 |
| 2567 void LockingCommandMessageQueue::Clear() { | 2565 void LockingCommandMessageQueue::Clear() { |
| 2568 ScopedLock sl(lock_); | 2566 ScopedLock sl(lock_); |
| 2569 queue_.Clear(); | 2567 queue_.Clear(); |
| 2570 } | 2568 } |
| 2571 | 2569 |
| 2572 #endif // ENABLE_DEBUGGER_SUPPORT | 2570 #endif // ENABLE_DEBUGGER_SUPPORT |
| 2573 | 2571 |
| 2574 } } // namespace v8::internal | 2572 } } // namespace v8::internal |
| OLD | NEW |