| OLD | NEW | 
|     1 // Copyright 2012 the V8 project authors. All rights reserved. |     1 // Copyright 2012 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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1111  |  1111  | 
|  1112   // Ignore check if break point object is not a JSObject. |  1112   // Ignore check if break point object is not a JSObject. | 
|  1113   if (!break_point_object->IsJSObject()) return true; |  1113   if (!break_point_object->IsJSObject()) return true; | 
|  1114  |  1114  | 
|  1115   // Get the function IsBreakPointTriggered (defined in debug-debugger.js). |  1115   // Get the function IsBreakPointTriggered (defined in debug-debugger.js). | 
|  1116   Handle<String> is_break_point_triggered_string = |  1116   Handle<String> is_break_point_triggered_string = | 
|  1117       factory->InternalizeOneByteString( |  1117       factory->InternalizeOneByteString( | 
|  1118           STATIC_ASCII_VECTOR("IsBreakPointTriggered")); |  1118           STATIC_ASCII_VECTOR("IsBreakPointTriggered")); | 
|  1119   Handle<GlobalObject> debug_global(debug_context()->global_object()); |  1119   Handle<GlobalObject> debug_global(debug_context()->global_object()); | 
|  1120   Handle<JSFunction> check_break_point = |  1120   Handle<JSFunction> check_break_point = | 
|  1121     Handle<JSFunction>::cast(GlobalObject::GetPropertyNoExceptionThrown( |  1121     Handle<JSFunction>::cast(Object::GetProperty( | 
|  1122         debug_global, is_break_point_triggered_string)); |  1122         debug_global, is_break_point_triggered_string).ToHandleChecked()); | 
|  1123  |  1123  | 
|  1124   // Get the break id as an object. |  1124   // Get the break id as an object. | 
|  1125   Handle<Object> break_id = factory->NewNumberFromInt(Debug::break_id()); |  1125   Handle<Object> break_id = factory->NewNumberFromInt(Debug::break_id()); | 
|  1126  |  1126  | 
|  1127   // Call HandleBreakPointx. |  1127   // Call HandleBreakPointx. | 
|  1128   bool caught_exception; |  1128   bool caught_exception; | 
|  1129   Handle<Object> argv[] = { break_id, break_point_object }; |  1129   Handle<Object> argv[] = { break_id, break_point_object }; | 
|  1130   Handle<Object> result = Execution::TryCall(check_break_point, |  1130   Handle<Object> result = Execution::TryCall(check_break_point, | 
|  1131                                              isolate_->js_builtins_object(), |  1131                                              isolate_->js_builtins_object(), | 
|  1132                                              ARRAY_SIZE(argv), |  1132                                              ARRAY_SIZE(argv), | 
| (...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2456  |  2456  | 
|  2457  |  2457  | 
|  2458 void Debug::ClearMirrorCache() { |  2458 void Debug::ClearMirrorCache() { | 
|  2459   PostponeInterruptsScope postpone(isolate_); |  2459   PostponeInterruptsScope postpone(isolate_); | 
|  2460   HandleScope scope(isolate_); |  2460   HandleScope scope(isolate_); | 
|  2461   ASSERT(isolate_->context() == *Debug::debug_context()); |  2461   ASSERT(isolate_->context() == *Debug::debug_context()); | 
|  2462  |  2462  | 
|  2463   // Clear the mirror cache. |  2463   // Clear the mirror cache. | 
|  2464   Handle<String> function_name = isolate_->factory()->InternalizeOneByteString( |  2464   Handle<String> function_name = isolate_->factory()->InternalizeOneByteString( | 
|  2465       STATIC_ASCII_VECTOR("ClearMirrorCache")); |  2465       STATIC_ASCII_VECTOR("ClearMirrorCache")); | 
|  2466   Handle<Object> fun = GlobalObject::GetPropertyNoExceptionThrown( |  2466   Handle<Object> fun = Object::GetProperty( | 
|  2467       isolate_->global_object(), function_name); |  2467       isolate_->global_object(), function_name).ToHandleChecked(); | 
|  2468   ASSERT(fun->IsJSFunction()); |  2468   ASSERT(fun->IsJSFunction()); | 
|  2469   bool caught_exception; |  2469   bool caught_exception; | 
|  2470   Execution::TryCall(Handle<JSFunction>::cast(fun), |  2470   Execution::TryCall(Handle<JSFunction>::cast(fun), | 
|  2471       Handle<JSObject>(Debug::debug_context()->global_object()), |  2471       Handle<JSObject>(Debug::debug_context()->global_object()), | 
|  2472       0, NULL, &caught_exception); |  2472       0, NULL, &caught_exception); | 
|  2473 } |  2473 } | 
|  2474  |  2474  | 
|  2475  |  2475  | 
|  2476 void Debug::CreateScriptCache() { |  2476 void Debug::CreateScriptCache() { | 
|  2477   Heap* heap = isolate_->heap(); |  2477   Heap* heap = isolate_->heap(); | 
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2593 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, |  2593 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, | 
|  2594                                       int argc, |  2594                                       int argc, | 
|  2595                                       Handle<Object> argv[], |  2595                                       Handle<Object> argv[], | 
|  2596                                       bool* caught_exception) { |  2596                                       bool* caught_exception) { | 
|  2597   ASSERT(isolate_->context() == *isolate_->debug()->debug_context()); |  2597   ASSERT(isolate_->context() == *isolate_->debug()->debug_context()); | 
|  2598  |  2598  | 
|  2599   // Create the execution state object. |  2599   // Create the execution state object. | 
|  2600   Handle<String> constructor_str = |  2600   Handle<String> constructor_str = | 
|  2601       isolate_->factory()->InternalizeUtf8String(constructor_name); |  2601       isolate_->factory()->InternalizeUtf8String(constructor_name); | 
|  2602   ASSERT(!constructor_str.is_null()); |  2602   ASSERT(!constructor_str.is_null()); | 
|  2603   Handle<Object> constructor = GlobalObject::GetPropertyNoExceptionThrown( |  2603   Handle<Object> constructor = Object::GetProperty( | 
|  2604       isolate_->global_object(), constructor_str); |  2604       isolate_->global_object(), constructor_str).ToHandleChecked(); | 
|  2605   ASSERT(constructor->IsJSFunction()); |  2605   ASSERT(constructor->IsJSFunction()); | 
|  2606   if (!constructor->IsJSFunction()) { |  2606   if (!constructor->IsJSFunction()) { | 
|  2607     *caught_exception = true; |  2607     *caught_exception = true; | 
|  2608     return isolate_->factory()->undefined_value(); |  2608     return isolate_->factory()->undefined_value(); | 
|  2609   } |  2609   } | 
|  2610   Handle<Object> js_object = Execution::TryCall( |  2610   Handle<Object> js_object = Execution::TryCall( | 
|  2611       Handle<JSFunction>::cast(constructor), |  2611       Handle<JSFunction>::cast(constructor), | 
|  2612       Handle<JSObject>(isolate_->debug()->debug_context()->global_object()), |  2612       Handle<JSObject>(isolate_->debug()->debug_context()->global_object()), | 
|  2613       argc, |  2613       argc, | 
|  2614       argv, |  2614       argv, | 
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2826  |  2826  | 
|  2827   // If debugging there might be script break points registered for this |  2827   // If debugging there might be script break points registered for this | 
|  2828   // script. Make sure that these break points are set. |  2828   // script. Make sure that these break points are set. | 
|  2829  |  2829  | 
|  2830   // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js). |  2830   // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js). | 
|  2831   Handle<String> update_script_break_points_string = |  2831   Handle<String> update_script_break_points_string = | 
|  2832       isolate_->factory()->InternalizeOneByteString( |  2832       isolate_->factory()->InternalizeOneByteString( | 
|  2833           STATIC_ASCII_VECTOR("UpdateScriptBreakPoints")); |  2833           STATIC_ASCII_VECTOR("UpdateScriptBreakPoints")); | 
|  2834   Handle<GlobalObject> debug_global(debug->debug_context()->global_object()); |  2834   Handle<GlobalObject> debug_global(debug->debug_context()->global_object()); | 
|  2835   Handle<Object> update_script_break_points = |  2835   Handle<Object> update_script_break_points = | 
|  2836       GlobalObject::GetPropertyNoExceptionThrown( |  2836       Object::GetProperty( | 
|  2837           debug_global, update_script_break_points_string); |  2837           debug_global, update_script_break_points_string).ToHandleChecked(); | 
|  2838   if (!update_script_break_points->IsJSFunction()) { |  2838   if (!update_script_break_points->IsJSFunction()) { | 
|  2839     return; |  2839     return; | 
|  2840   } |  2840   } | 
|  2841   ASSERT(update_script_break_points->IsJSFunction()); |  2841   ASSERT(update_script_break_points->IsJSFunction()); | 
|  2842  |  2842  | 
|  2843   // Wrap the script object in a proper JS object before passing it |  2843   // Wrap the script object in a proper JS object before passing it | 
|  2844   // to JavaScript. |  2844   // to JavaScript. | 
|  2845   Handle<JSValue> wrapper = GetScriptWrapper(script); |  2845   Handle<JSValue> wrapper = GetScriptWrapper(script); | 
|  2846  |  2846  | 
|  2847   // Call UpdateScriptBreakPoints expect no exceptions. |  2847   // Call UpdateScriptBreakPoints expect no exceptions. | 
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3809     { |  3809     { | 
|  3810       Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); |  3810       Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); | 
|  3811       isolate_->debugger()->CallMessageDispatchHandler(); |  3811       isolate_->debugger()->CallMessageDispatchHandler(); | 
|  3812     } |  3812     } | 
|  3813   } |  3813   } | 
|  3814 } |  3814 } | 
|  3815  |  3815  | 
|  3816 #endif  // ENABLE_DEBUGGER_SUPPORT |  3816 #endif  // ENABLE_DEBUGGER_SUPPORT | 
|  3817  |  3817  | 
|  3818 } }  // namespace v8::internal |  3818 } }  // namespace v8::internal | 
| OLD | NEW |