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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
771 isolate->clear_pending_exception(); | 771 isolate->clear_pending_exception(); |
772 return false; | 772 return false; |
773 } | 773 } |
774 | 774 |
775 // Execute the shared function in the debugger context. | 775 // Execute the shared function in the debugger context. |
776 bool caught_exception; | 776 bool caught_exception; |
777 Handle<JSFunction> function = | 777 Handle<JSFunction> function = |
778 factory->NewFunctionFromSharedFunctionInfo(function_info, context); | 778 factory->NewFunctionFromSharedFunctionInfo(function_info, context); |
779 | 779 |
780 Handle<Object> exception = | 780 Handle<Object> exception = |
781 Execution::TryCall(function, Handle<Object>(context->global_object()), | 781 Execution::TryCall(function, |
782 0, NULL, &caught_exception); | 782 Handle<Object>(context->global_object(), isolate), |
783 0, | |
784 NULL, | |
785 &caught_exception); | |
783 | 786 |
784 // Check for caught exceptions. | 787 // Check for caught exceptions. |
785 if (caught_exception) { | 788 if (caught_exception) { |
786 ASSERT(!isolate->has_pending_exception()); | 789 ASSERT(!isolate->has_pending_exception()); |
787 MessageLocation computed_location; | 790 MessageLocation computed_location; |
788 isolate->ComputeLocation(&computed_location); | 791 isolate->ComputeLocation(&computed_location); |
789 Handle<Object> message = MessageHandler::MakeMessageObject( | 792 Handle<Object> message = MessageHandler::MakeMessageObject( |
790 "error_loading_debugger", &computed_location, | 793 "error_loading_debugger", &computed_location, |
791 Vector<Handle<Object> >::empty(), Handle<String>(), Handle<JSArray>()); | 794 Vector<Handle<Object> >::empty(), Handle<String>(), Handle<JSArray>()); |
792 ASSERT(!isolate->has_pending_exception()); | 795 ASSERT(!isolate->has_pending_exception()); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 // Use the debugger context. | 840 // Use the debugger context. |
838 SaveContext save(isolate_); | 841 SaveContext save(isolate_); |
839 isolate_->set_context(*context); | 842 isolate_->set_context(*context); |
840 | 843 |
841 // Expose the builtins object in the debugger context. | 844 // Expose the builtins object in the debugger context. |
842 Handle<String> key = isolate_->factory()->LookupOneByteSymbol( | 845 Handle<String> key = isolate_->factory()->LookupOneByteSymbol( |
843 STATIC_ASCII_VECTOR("builtins")); | 846 STATIC_ASCII_VECTOR("builtins")); |
844 Handle<GlobalObject> global = Handle<GlobalObject>(context->global_object()); | 847 Handle<GlobalObject> global = Handle<GlobalObject>(context->global_object()); |
845 RETURN_IF_EMPTY_HANDLE_VALUE( | 848 RETURN_IF_EMPTY_HANDLE_VALUE( |
846 isolate_, | 849 isolate_, |
847 JSReceiver::SetProperty(global, key, Handle<Object>(global->builtins()), | 850 JSReceiver::SetProperty(global, |
848 NONE, kNonStrictMode), | 851 key, |
852 Handle<Object>(global->builtins(), isolate_), | |
853 NONE, | |
854 kNonStrictMode), | |
849 false); | 855 false); |
850 | 856 |
851 // Compile the JavaScript for the debugger in the debugger context. | 857 // Compile the JavaScript for the debugger in the debugger context. |
852 debugger->set_compiling_natives(true); | 858 debugger->set_compiling_natives(true); |
853 bool caught_exception = | 859 bool caught_exception = |
854 !CompileDebuggerScript(Natives::GetIndex("mirror")) || | 860 !CompileDebuggerScript(Natives::GetIndex("mirror")) || |
855 !CompileDebuggerScript(Natives::GetIndex("debug")); | 861 !CompileDebuggerScript(Natives::GetIndex("debug")); |
856 | 862 |
857 if (FLAG_enable_liveedit) { | 863 if (FLAG_enable_liveedit) { |
858 caught_exception = caught_exception || | 864 caught_exception = caught_exception || |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
943 // Check whether step next reached a new statement. | 949 // Check whether step next reached a new statement. |
944 if (!StepNextContinue(&break_location_iterator, frame)) { | 950 if (!StepNextContinue(&break_location_iterator, frame)) { |
945 // Decrease steps left if performing multiple steps. | 951 // Decrease steps left if performing multiple steps. |
946 if (thread_local_.step_count_ > 0) { | 952 if (thread_local_.step_count_ > 0) { |
947 thread_local_.step_count_--; | 953 thread_local_.step_count_--; |
948 } | 954 } |
949 } | 955 } |
950 | 956 |
951 // If there is one or more real break points check whether any of these are | 957 // If there is one or more real break points check whether any of these are |
952 // triggered. | 958 // triggered. |
953 Handle<Object> break_points_hit(heap->undefined_value()); | 959 Handle<Object> break_points_hit(heap->undefined_value(), isolate_); |
954 if (break_location_iterator.HasBreakPoint()) { | 960 if (break_location_iterator.HasBreakPoint()) { |
955 Handle<Object> break_point_objects = | 961 Handle<Object> break_point_objects = |
956 Handle<Object>(break_location_iterator.BreakPointObjects()); | 962 Handle<Object>(break_location_iterator.BreakPointObjects(), isolate_); |
957 break_points_hit = CheckBreakPoints(break_point_objects); | 963 break_points_hit = CheckBreakPoints(break_point_objects); |
958 } | 964 } |
959 | 965 |
960 // If step out is active skip everything until the frame where we need to step | 966 // If step out is active skip everything until the frame where we need to step |
961 // out to is reached, unless real breakpoint is hit. | 967 // out to is reached, unless real breakpoint is hit. |
962 if (StepOutActive() && frame->fp() != step_out_fp() && | 968 if (StepOutActive() && frame->fp() != step_out_fp() && |
963 break_points_hit->IsUndefined() ) { | 969 break_points_hit->IsUndefined() ) { |
964 // Step count should always be 0 for StepOut. | 970 // Step count should always be 0 for StepOut. |
965 ASSERT(thread_local_.step_count_ == 0); | 971 ASSERT(thread_local_.step_count_ == 0); |
966 } else if (!break_points_hit->IsUndefined() || | 972 } else if (!break_points_hit->IsUndefined() || |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1064 | 1070 |
1065 // Count the number of break points hit. If there are multiple break points | 1071 // Count the number of break points hit. If there are multiple break points |
1066 // they are in a FixedArray. | 1072 // they are in a FixedArray. |
1067 Handle<FixedArray> break_points_hit; | 1073 Handle<FixedArray> break_points_hit; |
1068 int break_points_hit_count = 0; | 1074 int break_points_hit_count = 0; |
1069 ASSERT(!break_point_objects->IsUndefined()); | 1075 ASSERT(!break_point_objects->IsUndefined()); |
1070 if (break_point_objects->IsFixedArray()) { | 1076 if (break_point_objects->IsFixedArray()) { |
1071 Handle<FixedArray> array(FixedArray::cast(*break_point_objects)); | 1077 Handle<FixedArray> array(FixedArray::cast(*break_point_objects)); |
1072 break_points_hit = factory->NewFixedArray(array->length()); | 1078 break_points_hit = factory->NewFixedArray(array->length()); |
1073 for (int i = 0; i < array->length(); i++) { | 1079 for (int i = 0; i < array->length(); i++) { |
1074 Handle<Object> o(array->get(i)); | 1080 Handle<Object> o(array->get(i), isolate_); |
1075 if (CheckBreakPoint(o)) { | 1081 if (CheckBreakPoint(o)) { |
1076 break_points_hit->set(break_points_hit_count++, *o); | 1082 break_points_hit->set(break_points_hit_count++, *o); |
1077 } | 1083 } |
1078 } | 1084 } |
1079 } else { | 1085 } else { |
1080 break_points_hit = factory->NewFixedArray(1); | 1086 break_points_hit = factory->NewFixedArray(1); |
1081 if (CheckBreakPoint(break_point_objects)) { | 1087 if (CheckBreakPoint(break_point_objects)) { |
1082 break_points_hit->set(break_points_hit_count++, *break_point_objects); | 1088 break_points_hit->set(break_points_hit_count++, *break_point_objects); |
1083 } | 1089 } |
1084 } | 1090 } |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1287 BreakLocationIterator it(GetDebugInfo(shared), ALL_BREAK_LOCATIONS); | 1293 BreakLocationIterator it(GetDebugInfo(shared), ALL_BREAK_LOCATIONS); |
1288 while (!it.Done()) { | 1294 while (!it.Done()) { |
1289 it.SetOneShot(); | 1295 it.SetOneShot(); |
1290 it.Next(); | 1296 it.Next(); |
1291 } | 1297 } |
1292 } | 1298 } |
1293 | 1299 |
1294 | 1300 |
1295 void Debug::FloodBoundFunctionWithOneShot(Handle<JSFunction> function) { | 1301 void Debug::FloodBoundFunctionWithOneShot(Handle<JSFunction> function) { |
1296 Handle<FixedArray> new_bindings(function->function_bindings()); | 1302 Handle<FixedArray> new_bindings(function->function_bindings()); |
1297 Handle<Object> bindee(new_bindings->get(JSFunction::kBoundFunctionIndex)); | 1303 Handle<Object> bindee(new_bindings->get(JSFunction::kBoundFunctionIndex), |
1304 function->GetIsolate()); | |
Michael Starzinger
2013/02/25 10:50:58
Better use "isolate_" here.
Sven Panne
2013/02/25 14:44:43
Done.
| |
1298 | 1305 |
1299 if (!bindee.is_null() && bindee->IsJSFunction() && | 1306 if (!bindee.is_null() && bindee->IsJSFunction() && |
1300 !JSFunction::cast(*bindee)->IsBuiltin()) { | 1307 !JSFunction::cast(*bindee)->IsBuiltin()) { |
1301 Handle<JSFunction> bindee_function(JSFunction::cast(*bindee)); | 1308 Handle<JSFunction> bindee_function(JSFunction::cast(*bindee)); |
1302 Debug::FloodWithOneShot(bindee_function); | 1309 Debug::FloodWithOneShot(bindee_function); |
1303 } | 1310 } |
1304 } | 1311 } |
1305 | 1312 |
1306 | 1313 |
1307 void Debug::FloodHandlerWithOneShot() { | 1314 void Debug::FloodHandlerWithOneShot() { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1485 FloodWithOneShot(restarted_function); | 1492 FloodWithOneShot(restarted_function); |
1486 } else if (!call_function_stub.is_null()) { | 1493 } else if (!call_function_stub.is_null()) { |
1487 // If it's CallFunction stub ensure target function is compiled and flood | 1494 // If it's CallFunction stub ensure target function is compiled and flood |
1488 // it with one shot breakpoints. | 1495 // it with one shot breakpoints. |
1489 | 1496 |
1490 // Find out number of arguments from the stub minor key. | 1497 // Find out number of arguments from the stub minor key. |
1491 // Reverse lookup required as the minor key cannot be retrieved | 1498 // Reverse lookup required as the minor key cannot be retrieved |
1492 // from the code object. | 1499 // from the code object. |
1493 Handle<Object> obj( | 1500 Handle<Object> obj( |
1494 isolate_->heap()->code_stubs()->SlowReverseLookup( | 1501 isolate_->heap()->code_stubs()->SlowReverseLookup( |
1495 *call_function_stub)); | 1502 *call_function_stub), |
1503 isolate_); | |
1496 ASSERT(!obj.is_null()); | 1504 ASSERT(!obj.is_null()); |
1497 ASSERT(!(*obj)->IsUndefined()); | 1505 ASSERT(!(*obj)->IsUndefined()); |
1498 ASSERT(obj->IsSmi()); | 1506 ASSERT(obj->IsSmi()); |
1499 // Get the STUB key and extract major and minor key. | 1507 // Get the STUB key and extract major and minor key. |
1500 uint32_t key = Smi::cast(*obj)->value(); | 1508 uint32_t key = Smi::cast(*obj)->value(); |
1501 // Argc in the stub is the number of arguments passed - not the | 1509 // Argc in the stub is the number of arguments passed - not the |
1502 // expected arguments of the called function. | 1510 // expected arguments of the called function. |
1503 int call_function_arg_count = | 1511 int call_function_arg_count = |
1504 CallFunctionStub::ExtractArgcFromMinorKey( | 1512 CallFunctionStub::ExtractArgcFromMinorKey( |
1505 CodeStub::MinorKeyFromKey(key)); | 1513 CodeStub::MinorKeyFromKey(key)); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1658 UNREACHABLE(); | 1666 UNREACHABLE(); |
1659 return Handle<Code>::null(); | 1667 return Handle<Code>::null(); |
1660 } | 1668 } |
1661 | 1669 |
1662 | 1670 |
1663 // Simple function for returning the source positions for active break points. | 1671 // Simple function for returning the source positions for active break points. |
1664 Handle<Object> Debug::GetSourceBreakLocations( | 1672 Handle<Object> Debug::GetSourceBreakLocations( |
1665 Handle<SharedFunctionInfo> shared) { | 1673 Handle<SharedFunctionInfo> shared) { |
1666 Isolate* isolate = Isolate::Current(); | 1674 Isolate* isolate = Isolate::Current(); |
1667 Heap* heap = isolate->heap(); | 1675 Heap* heap = isolate->heap(); |
1668 if (!HasDebugInfo(shared)) return Handle<Object>(heap->undefined_value()); | 1676 if (!HasDebugInfo(shared)) { |
1677 return Handle<Object>(heap->undefined_value(), isolate); | |
1678 } | |
1669 Handle<DebugInfo> debug_info = GetDebugInfo(shared); | 1679 Handle<DebugInfo> debug_info = GetDebugInfo(shared); |
1670 if (debug_info->GetBreakPointCount() == 0) { | 1680 if (debug_info->GetBreakPointCount() == 0) { |
1671 return Handle<Object>(heap->undefined_value()); | 1681 return Handle<Object>(heap->undefined_value(), isolate); |
1672 } | 1682 } |
1673 Handle<FixedArray> locations = | 1683 Handle<FixedArray> locations = |
1674 isolate->factory()->NewFixedArray(debug_info->GetBreakPointCount()); | 1684 isolate->factory()->NewFixedArray(debug_info->GetBreakPointCount()); |
1675 int count = 0; | 1685 int count = 0; |
1676 for (int i = 0; i < debug_info->break_points()->length(); i++) { | 1686 for (int i = 0; i < debug_info->break_points()->length(); i++) { |
1677 if (!debug_info->break_points()->get(i)->IsUndefined()) { | 1687 if (!debug_info->break_points()->get(i)->IsUndefined()) { |
1678 BreakPointInfo* break_point_info = | 1688 BreakPointInfo* break_point_info = |
1679 BreakPointInfo::cast(debug_info->break_points()->get(i)); | 1689 BreakPointInfo::cast(debug_info->break_points()->get(i)); |
1680 if (break_point_info->GetBreakPointCount() > 0) { | 1690 if (break_point_info->GetBreakPointCount() > 0) { |
1681 locations->set(count++, break_point_info->statement_position()); | 1691 locations->set(count++, break_point_info->statement_position()); |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2427 | 2437 |
2428 void Debug::ClearMirrorCache() { | 2438 void Debug::ClearMirrorCache() { |
2429 PostponeInterruptsScope postpone(isolate_); | 2439 PostponeInterruptsScope postpone(isolate_); |
2430 HandleScope scope(isolate_); | 2440 HandleScope scope(isolate_); |
2431 ASSERT(isolate_->context() == *Debug::debug_context()); | 2441 ASSERT(isolate_->context() == *Debug::debug_context()); |
2432 | 2442 |
2433 // Clear the mirror cache. | 2443 // Clear the mirror cache. |
2434 Handle<String> function_name = isolate_->factory()->LookupOneByteSymbol( | 2444 Handle<String> function_name = isolate_->factory()->LookupOneByteSymbol( |
2435 STATIC_ASCII_VECTOR("ClearMirrorCache")); | 2445 STATIC_ASCII_VECTOR("ClearMirrorCache")); |
2436 Handle<Object> fun( | 2446 Handle<Object> fun( |
2437 Isolate::Current()->global_object()->GetPropertyNoExceptionThrown( | 2447 isolate_->global_object()->GetPropertyNoExceptionThrown(*function_name), |
2438 *function_name)); | 2448 isolate_); |
2439 ASSERT(fun->IsJSFunction()); | 2449 ASSERT(fun->IsJSFunction()); |
2440 bool caught_exception; | 2450 bool caught_exception; |
2441 Execution::TryCall(Handle<JSFunction>::cast(fun), | 2451 Execution::TryCall(Handle<JSFunction>::cast(fun), |
2442 Handle<JSObject>(Debug::debug_context()->global_object()), | 2452 Handle<JSObject>(Debug::debug_context()->global_object()), |
2443 0, NULL, &caught_exception); | 2453 0, NULL, &caught_exception); |
2444 } | 2454 } |
2445 | 2455 |
2446 | 2456 |
2447 void Debug::CreateScriptCache() { | 2457 void Debug::CreateScriptCache() { |
2448 Heap* heap = isolate_->heap(); | 2458 Heap* heap = isolate_->heap(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2555 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, | 2565 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, |
2556 int argc, | 2566 int argc, |
2557 Handle<Object> argv[], | 2567 Handle<Object> argv[], |
2558 bool* caught_exception) { | 2568 bool* caught_exception) { |
2559 ASSERT(isolate_->context() == *isolate_->debug()->debug_context()); | 2569 ASSERT(isolate_->context() == *isolate_->debug()->debug_context()); |
2560 | 2570 |
2561 // Create the execution state object. | 2571 // Create the execution state object. |
2562 Handle<String> constructor_str = | 2572 Handle<String> constructor_str = |
2563 isolate_->factory()->LookupUtf8Symbol(constructor_name); | 2573 isolate_->factory()->LookupUtf8Symbol(constructor_name); |
2564 Handle<Object> constructor( | 2574 Handle<Object> constructor( |
2565 isolate_->global_object()->GetPropertyNoExceptionThrown( | 2575 isolate_->global_object()->GetPropertyNoExceptionThrown(*constructor_str), |
2566 *constructor_str)); | 2576 isolate_); |
2567 ASSERT(constructor->IsJSFunction()); | 2577 ASSERT(constructor->IsJSFunction()); |
2568 if (!constructor->IsJSFunction()) { | 2578 if (!constructor->IsJSFunction()) { |
2569 *caught_exception = true; | 2579 *caught_exception = true; |
2570 return isolate_->factory()->undefined_value(); | 2580 return isolate_->factory()->undefined_value(); |
2571 } | 2581 } |
2572 Handle<Object> js_object = Execution::TryCall( | 2582 Handle<Object> js_object = Execution::TryCall( |
2573 Handle<JSFunction>::cast(constructor), | 2583 Handle<JSFunction>::cast(constructor), |
2574 Handle<JSObject>(isolate_->debug()->debug_context()->global_object()), | 2584 Handle<JSObject>(isolate_->debug()->debug_context()->global_object()), |
2575 argc, | 2585 argc, |
2576 argv, | 2586 argv, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2644 ARRAY_SIZE(argv), | 2654 ARRAY_SIZE(argv), |
2645 argv, | 2655 argv, |
2646 caught_exception); | 2656 caught_exception); |
2647 } | 2657 } |
2648 | 2658 |
2649 | 2659 |
2650 Handle<Object> Debugger::MakeScriptCollectedEvent(int id, | 2660 Handle<Object> Debugger::MakeScriptCollectedEvent(int id, |
2651 bool* caught_exception) { | 2661 bool* caught_exception) { |
2652 // Create the script collected event object. | 2662 // Create the script collected event object. |
2653 Handle<Object> exec_state = MakeExecutionState(caught_exception); | 2663 Handle<Object> exec_state = MakeExecutionState(caught_exception); |
2654 Handle<Object> id_object = Handle<Smi>(Smi::FromInt(id)); | 2664 Handle<Object> id_object = Handle<Smi>(Smi::FromInt(id), isolate_); |
2655 Handle<Object> argv[] = { exec_state, id_object }; | 2665 Handle<Object> argv[] = { exec_state, id_object }; |
2656 | 2666 |
2657 return MakeJSObject(CStrVector("MakeScriptCollectedEvent"), | 2667 return MakeJSObject(CStrVector("MakeScriptCollectedEvent"), |
2658 ARRAY_SIZE(argv), | 2668 ARRAY_SIZE(argv), |
2659 argv, | 2669 argv, |
2660 caught_exception); | 2670 caught_exception); |
2661 } | 2671 } |
2662 | 2672 |
2663 | 2673 |
2664 void Debugger::OnException(Handle<Object> exception, bool uncaught) { | 2674 void Debugger::OnException(Handle<Object> exception, bool uncaught) { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2787 if (debugger.FailedToEnter()) return; | 2797 if (debugger.FailedToEnter()) return; |
2788 | 2798 |
2789 // If debugging there might be script break points registered for this | 2799 // If debugging there might be script break points registered for this |
2790 // script. Make sure that these break points are set. | 2800 // script. Make sure that these break points are set. |
2791 | 2801 |
2792 // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js). | 2802 // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js). |
2793 Handle<String> update_script_break_points_symbol = | 2803 Handle<String> update_script_break_points_symbol = |
2794 isolate_->factory()->LookupOneByteSymbol( | 2804 isolate_->factory()->LookupOneByteSymbol( |
2795 STATIC_ASCII_VECTOR("UpdateScriptBreakPoints")); | 2805 STATIC_ASCII_VECTOR("UpdateScriptBreakPoints")); |
2796 Handle<Object> update_script_break_points = | 2806 Handle<Object> update_script_break_points = |
2797 Handle<Object>(debug->debug_context()->global_object()-> | 2807 Handle<Object>( |
2798 GetPropertyNoExceptionThrown(*update_script_break_points_symbol)); | 2808 debug->debug_context()->global_object()->GetPropertyNoExceptionThrown( |
2809 *update_script_break_points_symbol), | |
2810 isolate_); | |
2799 if (!update_script_break_points->IsJSFunction()) { | 2811 if (!update_script_break_points->IsJSFunction()) { |
2800 return; | 2812 return; |
2801 } | 2813 } |
2802 ASSERT(update_script_break_points->IsJSFunction()); | 2814 ASSERT(update_script_break_points->IsJSFunction()); |
2803 | 2815 |
2804 // Wrap the script object in a proper JS object before passing it | 2816 // Wrap the script object in a proper JS object before passing it |
2805 // to JavaScript. | 2817 // to JavaScript. |
2806 Handle<JSValue> wrapper = GetScriptWrapper(script); | 2818 Handle<JSValue> wrapper = GetScriptWrapper(script); |
2807 | 2819 |
2808 // Call UpdateScriptBreakPoints expect no exceptions. | 2820 // Call UpdateScriptBreakPoints expect no exceptions. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2938 } | 2950 } |
2939 | 2951 |
2940 | 2952 |
2941 void Debugger::CallJSEventCallback(v8::DebugEvent event, | 2953 void Debugger::CallJSEventCallback(v8::DebugEvent event, |
2942 Handle<Object> exec_state, | 2954 Handle<Object> exec_state, |
2943 Handle<Object> event_data) { | 2955 Handle<Object> event_data) { |
2944 ASSERT(event_listener_->IsJSFunction()); | 2956 ASSERT(event_listener_->IsJSFunction()); |
2945 Handle<JSFunction> fun(Handle<JSFunction>::cast(event_listener_)); | 2957 Handle<JSFunction> fun(Handle<JSFunction>::cast(event_listener_)); |
2946 | 2958 |
2947 // Invoke the JavaScript debug event listener. | 2959 // Invoke the JavaScript debug event listener. |
2948 Handle<Object> argv[] = { Handle<Object>(Smi::FromInt(event)), | 2960 Handle<Object> argv[] = { Handle<Object>(Smi::FromInt(event), |
2961 fun->GetIsolate()), | |
Michael Starzinger
2013/02/25 10:50:58
Better use "isolate_" here.
Sven Panne
2013/02/25 14:44:43
Done.
| |
2949 exec_state, | 2962 exec_state, |
2950 event_data, | 2963 event_data, |
2951 event_listener_data_ }; | 2964 event_listener_data_ }; |
2952 bool caught_exception; | 2965 bool caught_exception; |
2953 Execution::TryCall(fun, | 2966 Execution::TryCall(fun, |
2954 isolate_->global_object(), | 2967 isolate_->global_object(), |
2955 ARRAY_SIZE(argv), | 2968 ARRAY_SIZE(argv), |
2956 argv, | 2969 argv, |
2957 &caught_exception); | 2970 &caught_exception); |
2958 // Silently ignore exceptions from debug event listeners. | 2971 // Silently ignore exceptions from debug event listeners. |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3321 // Create the execution state. | 3334 // Create the execution state. |
3322 bool caught_exception = false; | 3335 bool caught_exception = false; |
3323 Handle<Object> exec_state = MakeExecutionState(&caught_exception); | 3336 Handle<Object> exec_state = MakeExecutionState(&caught_exception); |
3324 if (caught_exception) { | 3337 if (caught_exception) { |
3325 return isolate_->factory()->undefined_value(); | 3338 return isolate_->factory()->undefined_value(); |
3326 } | 3339 } |
3327 | 3340 |
3328 Handle<Object> argv[] = { exec_state, data }; | 3341 Handle<Object> argv[] = { exec_state, data }; |
3329 Handle<Object> result = Execution::Call( | 3342 Handle<Object> result = Execution::Call( |
3330 fun, | 3343 fun, |
3331 Handle<Object>(isolate_->debug()->debug_context_->global_proxy()), | 3344 Handle<Object>(isolate_->debug()->debug_context_->global_proxy(), |
3345 isolate_), | |
3332 ARRAY_SIZE(argv), | 3346 ARRAY_SIZE(argv), |
3333 argv, | 3347 argv, |
3334 pending_exception); | 3348 pending_exception); |
3335 return result; | 3349 return result; |
3336 } | 3350 } |
3337 | 3351 |
3338 | 3352 |
3339 static void StubMessageHandler2(const v8::Debug::Message& message) { | 3353 static void StubMessageHandler2(const v8::Debug::Message& message) { |
3340 // Simply ignore message. | 3354 // Simply ignore message. |
3341 } | 3355 } |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3781 { | 3795 { |
3782 Locker locker(reinterpret_cast<v8::Isolate*>(isolate)); | 3796 Locker locker(reinterpret_cast<v8::Isolate*>(isolate)); |
3783 isolate->debugger()->CallMessageDispatchHandler(); | 3797 isolate->debugger()->CallMessageDispatchHandler(); |
3784 } | 3798 } |
3785 } | 3799 } |
3786 } | 3800 } |
3787 | 3801 |
3788 #endif // ENABLE_DEBUGGER_SUPPORT | 3802 #endif // ENABLE_DEBUGGER_SUPPORT |
3789 | 3803 |
3790 } } // namespace v8::internal | 3804 } } // namespace v8::internal |
OLD | NEW |