Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: src/debug.cc

Issue 12300018: Made Isolate a mandatory parameter for everything Handle-related. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed CreateCode calls. Be nicer to MIPS. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/contexts.cc ('k') | src/deoptimizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
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
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 isolate_);
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
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
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
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
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
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
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
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), isolate_),
2949 exec_state, 2961 exec_state,
2950 event_data, 2962 event_data,
2951 event_listener_data_ }; 2963 event_listener_data_ };
2952 bool caught_exception; 2964 bool caught_exception;
2953 Execution::TryCall(fun, 2965 Execution::TryCall(fun,
2954 isolate_->global_object(), 2966 isolate_->global_object(),
2955 ARRAY_SIZE(argv), 2967 ARRAY_SIZE(argv),
2956 argv, 2968 argv,
2957 &caught_exception); 2969 &caught_exception);
2958 // Silently ignore exceptions from debug event listeners. 2970 // Silently ignore exceptions from debug event listeners.
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
3321 // Create the execution state. 3333 // Create the execution state.
3322 bool caught_exception = false; 3334 bool caught_exception = false;
3323 Handle<Object> exec_state = MakeExecutionState(&caught_exception); 3335 Handle<Object> exec_state = MakeExecutionState(&caught_exception);
3324 if (caught_exception) { 3336 if (caught_exception) {
3325 return isolate_->factory()->undefined_value(); 3337 return isolate_->factory()->undefined_value();
3326 } 3338 }
3327 3339
3328 Handle<Object> argv[] = { exec_state, data }; 3340 Handle<Object> argv[] = { exec_state, data };
3329 Handle<Object> result = Execution::Call( 3341 Handle<Object> result = Execution::Call(
3330 fun, 3342 fun,
3331 Handle<Object>(isolate_->debug()->debug_context_->global_proxy()), 3343 Handle<Object>(isolate_->debug()->debug_context_->global_proxy(),
3344 isolate_),
3332 ARRAY_SIZE(argv), 3345 ARRAY_SIZE(argv),
3333 argv, 3346 argv,
3334 pending_exception); 3347 pending_exception);
3335 return result; 3348 return result;
3336 } 3349 }
3337 3350
3338 3351
3339 static void StubMessageHandler2(const v8::Debug::Message& message) { 3352 static void StubMessageHandler2(const v8::Debug::Message& message) {
3340 // Simply ignore message. 3353 // Simply ignore message.
3341 } 3354 }
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
3781 { 3794 {
3782 Locker locker(reinterpret_cast<v8::Isolate*>(isolate)); 3795 Locker locker(reinterpret_cast<v8::Isolate*>(isolate));
3783 isolate->debugger()->CallMessageDispatchHandler(); 3796 isolate->debugger()->CallMessageDispatchHandler();
3784 } 3797 }
3785 } 3798 }
3786 } 3799 }
3787 3800
3788 #endif // ENABLE_DEBUGGER_SUPPORT 3801 #endif // ENABLE_DEBUGGER_SUPPORT
3789 3802
3790 } } // namespace v8::internal 3803 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/contexts.cc ('k') | src/deoptimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698