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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 HandleScope scope; | 1031 HandleScope scope; |
1032 | 1032 |
1033 // Ignore check if break point object is not a JSObject. | 1033 // Ignore check if break point object is not a JSObject. |
1034 if (!break_point_object->IsJSObject()) return true; | 1034 if (!break_point_object->IsJSObject()) return true; |
1035 | 1035 |
1036 // Get the function CheckBreakPoint (defined in debug.js). | 1036 // Get the function CheckBreakPoint (defined in debug.js). |
1037 Handle<String> is_break_point_triggered_symbol = | 1037 Handle<String> is_break_point_triggered_symbol = |
1038 Factory::LookupAsciiSymbol("IsBreakPointTriggered"); | 1038 Factory::LookupAsciiSymbol("IsBreakPointTriggered"); |
1039 Handle<JSFunction> check_break_point = | 1039 Handle<JSFunction> check_break_point = |
1040 Handle<JSFunction>(JSFunction::cast( | 1040 Handle<JSFunction>(JSFunction::cast( |
1041 debug_context()->global()->GetProperty( | 1041 debug_context()->global()->GetPropertyNoExceptionThrown( |
1042 *is_break_point_triggered_symbol))); | 1042 *is_break_point_triggered_symbol))); |
1043 | 1043 |
1044 // Get the break id as an object. | 1044 // Get the break id as an object. |
1045 Handle<Object> break_id = Factory::NewNumberFromInt(Debug::break_id()); | 1045 Handle<Object> break_id = Factory::NewNumberFromInt(Debug::break_id()); |
1046 | 1046 |
1047 // Call HandleBreakPointx. | 1047 // Call HandleBreakPointx. |
1048 bool caught_exception = false; | 1048 bool caught_exception = false; |
1049 const int argc = 2; | 1049 const int argc = 2; |
1050 Object** argv[argc] = { | 1050 Object** argv[argc] = { |
1051 break_id.location(), | 1051 break_id.location(), |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 } | 1840 } |
1841 | 1841 |
1842 | 1842 |
1843 void Debug::ClearMirrorCache() { | 1843 void Debug::ClearMirrorCache() { |
1844 HandleScope scope; | 1844 HandleScope scope; |
1845 ASSERT(Top::context() == *Debug::debug_context()); | 1845 ASSERT(Top::context() == *Debug::debug_context()); |
1846 | 1846 |
1847 // Clear the mirror cache. | 1847 // Clear the mirror cache. |
1848 Handle<String> function_name = | 1848 Handle<String> function_name = |
1849 Factory::LookupSymbol(CStrVector("ClearMirrorCache")); | 1849 Factory::LookupSymbol(CStrVector("ClearMirrorCache")); |
1850 Handle<Object> fun(Top::global()->GetProperty(*function_name)); | 1850 Handle<Object> fun(Top::global()->GetPropertyNoExceptionThrown( |
| 1851 *function_name)); |
1851 ASSERT(fun->IsJSFunction()); | 1852 ASSERT(fun->IsJSFunction()); |
1852 bool caught_exception; | 1853 bool caught_exception; |
1853 Handle<Object> js_object = Execution::TryCall( | 1854 Handle<Object> js_object = Execution::TryCall( |
1854 Handle<JSFunction>::cast(fun), | 1855 Handle<JSFunction>::cast(fun), |
1855 Handle<JSObject>(Debug::debug_context()->global()), | 1856 Handle<JSObject>(Debug::debug_context()->global()), |
1856 0, NULL, &caught_exception); | 1857 0, NULL, &caught_exception); |
1857 } | 1858 } |
1858 | 1859 |
1859 | 1860 |
1860 void Debug::CreateScriptCache() { | 1861 void Debug::CreateScriptCache() { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 LockingCommandMessageQueue Debugger::event_command_queue_(kQueueInitialSize); | 1948 LockingCommandMessageQueue Debugger::event_command_queue_(kQueueInitialSize); |
1948 | 1949 |
1949 | 1950 |
1950 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, | 1951 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, |
1951 int argc, Object*** argv, | 1952 int argc, Object*** argv, |
1952 bool* caught_exception) { | 1953 bool* caught_exception) { |
1953 ASSERT(Top::context() == *Debug::debug_context()); | 1954 ASSERT(Top::context() == *Debug::debug_context()); |
1954 | 1955 |
1955 // Create the execution state object. | 1956 // Create the execution state object. |
1956 Handle<String> constructor_str = Factory::LookupSymbol(constructor_name); | 1957 Handle<String> constructor_str = Factory::LookupSymbol(constructor_name); |
1957 Handle<Object> constructor(Top::global()->GetProperty(*constructor_str)); | 1958 Handle<Object> constructor(Top::global()->GetPropertyNoExceptionThrown( |
| 1959 *constructor_str)); |
1958 ASSERT(constructor->IsJSFunction()); | 1960 ASSERT(constructor->IsJSFunction()); |
1959 if (!constructor->IsJSFunction()) { | 1961 if (!constructor->IsJSFunction()) { |
1960 *caught_exception = true; | 1962 *caught_exception = true; |
1961 return Factory::undefined_value(); | 1963 return Factory::undefined_value(); |
1962 } | 1964 } |
1963 Handle<Object> js_object = Execution::TryCall( | 1965 Handle<Object> js_object = Execution::TryCall( |
1964 Handle<JSFunction>::cast(constructor), | 1966 Handle<JSFunction>::cast(constructor), |
1965 Handle<JSObject>(Debug::debug_context()->global()), argc, argv, | 1967 Handle<JSObject>(Debug::debug_context()->global()), argc, argv, |
1966 caught_exception); | 1968 caught_exception); |
1967 return js_object; | 1969 return js_object; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2174 EnterDebugger debugger; | 2176 EnterDebugger debugger; |
2175 if (debugger.FailedToEnter()) return; | 2177 if (debugger.FailedToEnter()) return; |
2176 | 2178 |
2177 // If debugging there might be script break points registered for this | 2179 // If debugging there might be script break points registered for this |
2178 // script. Make sure that these break points are set. | 2180 // script. Make sure that these break points are set. |
2179 | 2181 |
2180 // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js). | 2182 // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js). |
2181 Handle<String> update_script_break_points_symbol = | 2183 Handle<String> update_script_break_points_symbol = |
2182 Factory::LookupAsciiSymbol("UpdateScriptBreakPoints"); | 2184 Factory::LookupAsciiSymbol("UpdateScriptBreakPoints"); |
2183 Handle<Object> update_script_break_points = | 2185 Handle<Object> update_script_break_points = |
2184 Handle<Object>(Debug::debug_context()->global()->GetProperty( | 2186 Handle<Object>(Debug::debug_context()->global()-> |
2185 *update_script_break_points_symbol)); | 2187 GetPropertyNoExceptionThrown(*update_script_break_points_symbol)); |
2186 if (!update_script_break_points->IsJSFunction()) { | 2188 if (!update_script_break_points->IsJSFunction()) { |
2187 return; | 2189 return; |
2188 } | 2190 } |
2189 ASSERT(update_script_break_points->IsJSFunction()); | 2191 ASSERT(update_script_break_points->IsJSFunction()); |
2190 | 2192 |
2191 // Wrap the script object in a proper JS object before passing it | 2193 // Wrap the script object in a proper JS object before passing it |
2192 // to JavaScript. | 2194 // to JavaScript. |
2193 Handle<JSValue> wrapper = GetScriptWrapper(script); | 2195 Handle<JSValue> wrapper = GetScriptWrapper(script); |
2194 | 2196 |
2195 // Call UpdateScriptBreakPoints expect no exceptions. | 2197 // Call UpdateScriptBreakPoints expect no exceptions. |
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3060 { | 3062 { |
3061 Locker locker; | 3063 Locker locker; |
3062 Debugger::CallMessageDispatchHandler(); | 3064 Debugger::CallMessageDispatchHandler(); |
3063 } | 3065 } |
3064 } | 3066 } |
3065 } | 3067 } |
3066 | 3068 |
3067 #endif // ENABLE_DEBUGGER_SUPPORT | 3069 #endif // ENABLE_DEBUGGER_SUPPORT |
3068 | 3070 |
3069 } } // namespace v8::internal | 3071 } } // namespace v8::internal |
OLD | NEW |