| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #include "api.h" | 7 #include "api.h" |
| 8 #include "arguments.h" | 8 #include "arguments.h" |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
| (...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2534 | 2534 |
| 2535 MaybeHandle<Object> Debug::MakeJSObject(const char* constructor_name, | 2535 MaybeHandle<Object> Debug::MakeJSObject(const char* constructor_name, |
| 2536 int argc, | 2536 int argc, |
| 2537 Handle<Object> argv[]) { | 2537 Handle<Object> argv[]) { |
| 2538 ASSERT(isolate_->context() == *debug_context()); | 2538 ASSERT(isolate_->context() == *debug_context()); |
| 2539 // Create the execution state object. | 2539 // Create the execution state object. |
| 2540 Handle<Object> constructor = Object::GetProperty( | 2540 Handle<Object> constructor = Object::GetProperty( |
| 2541 isolate_, isolate_->global_object(), constructor_name).ToHandleChecked(); | 2541 isolate_, isolate_->global_object(), constructor_name).ToHandleChecked(); |
| 2542 ASSERT(constructor->IsJSFunction()); | 2542 ASSERT(constructor->IsJSFunction()); |
| 2543 if (!constructor->IsJSFunction()) return MaybeHandle<Object>(); | 2543 if (!constructor->IsJSFunction()) return MaybeHandle<Object>(); |
| 2544 // We do not handle interrupts here. In particular, termination interrupts. |
| 2545 PostponeInterruptsScope no_interrupts(isolate_); |
| 2544 return Execution::TryCall(Handle<JSFunction>::cast(constructor), | 2546 return Execution::TryCall(Handle<JSFunction>::cast(constructor), |
| 2545 Handle<JSObject>(debug_context()->global_object()), | 2547 Handle<JSObject>(debug_context()->global_object()), |
| 2546 argc, | 2548 argc, |
| 2547 argv); | 2549 argv); |
| 2548 } | 2550 } |
| 2549 | 2551 |
| 2550 | 2552 |
| 2551 MaybeHandle<Object> Debug::MakeExecutionState() { | 2553 MaybeHandle<Object> Debug::MakeExecutionState() { |
| 2552 // Create the execution state object. | 2554 // Create the execution state object. |
| 2553 Handle<Object> argv[] = { isolate_->factory()->NewNumberFromInt(break_id()) }; | 2555 Handle<Object> argv[] = { isolate_->factory()->NewNumberFromInt(break_id()) }; |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2845 EnterDebugger debugger(isolate_); | 2847 EnterDebugger debugger(isolate_); |
| 2846 // The global handle may be destroyed soon after. Return it reboxed. | 2848 // The global handle may be destroyed soon after. Return it reboxed. |
| 2847 return handle(*debug_context(), isolate_); | 2849 return handle(*debug_context(), isolate_); |
| 2848 } | 2850 } |
| 2849 | 2851 |
| 2850 | 2852 |
| 2851 void Debug::NotifyMessageHandler(v8::DebugEvent event, | 2853 void Debug::NotifyMessageHandler(v8::DebugEvent event, |
| 2852 Handle<JSObject> exec_state, | 2854 Handle<JSObject> exec_state, |
| 2853 Handle<JSObject> event_data, | 2855 Handle<JSObject> event_data, |
| 2854 bool auto_continue) { | 2856 bool auto_continue) { |
| 2857 // Prevent other interrupts from triggering, for example API callbacks, |
| 2858 // while dispatching message handler callbacks. |
| 2859 PostponeInterruptsScope no_interrupts(isolate_); |
| 2855 ASSERT(is_active_); | 2860 ASSERT(is_active_); |
| 2856 HandleScope scope(isolate_); | 2861 HandleScope scope(isolate_); |
| 2857 // Process the individual events. | 2862 // Process the individual events. |
| 2858 bool sendEventMessage = false; | 2863 bool sendEventMessage = false; |
| 2859 switch (event) { | 2864 switch (event) { |
| 2860 case v8::Break: | 2865 case v8::Break: |
| 2861 case v8::BreakForCommand: | 2866 case v8::BreakForCommand: |
| 2862 sendEventMessage = !auto_continue; | 2867 sendEventMessage = !auto_continue; |
| 2863 break; | 2868 break; |
| 2864 case v8::Exception: | 2869 case v8::Exception: |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3451 logger_->DebugEvent("Put", message.text()); | 3456 logger_->DebugEvent("Put", message.text()); |
| 3452 } | 3457 } |
| 3453 | 3458 |
| 3454 | 3459 |
| 3455 void LockingCommandMessageQueue::Clear() { | 3460 void LockingCommandMessageQueue::Clear() { |
| 3456 LockGuard<Mutex> lock_guard(&mutex_); | 3461 LockGuard<Mutex> lock_guard(&mutex_); |
| 3457 queue_.Clear(); | 3462 queue_.Clear(); |
| 3458 } | 3463 } |
| 3459 | 3464 |
| 3460 } } // namespace v8::internal | 3465 } } // namespace v8::internal |
| OLD | NEW |