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 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2564 ASSERT(isolate_->context() == *isolate_->debug()->debug_context()); | 2564 ASSERT(isolate_->context() == *isolate_->debug()->debug_context()); |
2565 | 2565 |
2566 // Create the execution state object. | 2566 // Create the execution state object. |
2567 Handle<String> constructor_str = | 2567 Handle<String> constructor_str = |
2568 isolate_->factory()->InternalizeUtf8String(constructor_name); | 2568 isolate_->factory()->InternalizeUtf8String(constructor_name); |
2569 ASSERT(!constructor_str.is_null()); | 2569 ASSERT(!constructor_str.is_null()); |
2570 Handle<Object> constructor = Object::GetProperty( | 2570 Handle<Object> constructor = Object::GetProperty( |
2571 isolate_->global_object(), constructor_str).ToHandleChecked(); | 2571 isolate_->global_object(), constructor_str).ToHandleChecked(); |
2572 ASSERT(constructor->IsJSFunction()); | 2572 ASSERT(constructor->IsJSFunction()); |
2573 if (!constructor->IsJSFunction()) return MaybeHandle<Object>(); | 2573 if (!constructor->IsJSFunction()) return MaybeHandle<Object>(); |
| 2574 // We do not handle interrupts here. In particular, termination interrupts. |
| 2575 PostponeInterruptsScope no_interrupts(isolate_); |
2574 return Execution::TryCall( | 2576 return Execution::TryCall( |
2575 Handle<JSFunction>::cast(constructor), | 2577 Handle<JSFunction>::cast(constructor), |
2576 Handle<JSObject>(isolate_->debug()->debug_context()->global_object()), | 2578 Handle<JSObject>(isolate_->debug()->debug_context()->global_object()), |
2577 argc, | 2579 argc, |
2578 argv); | 2580 argv); |
2579 } | 2581 } |
2580 | 2582 |
2581 | 2583 |
2582 MaybeHandle<Object> Debug::MakeExecutionState() { | 2584 MaybeHandle<Object> Debug::MakeExecutionState() { |
2583 // Create the execution state object. | 2585 // Create the execution state object. |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2900 EnterDebugger debugger(isolate_); | 2902 EnterDebugger debugger(isolate_); |
2901 // The global handle may be destroyed soon after. Return it reboxed. | 2903 // The global handle may be destroyed soon after. Return it reboxed. |
2902 return handle(*debug_context(), isolate_); | 2904 return handle(*debug_context(), isolate_); |
2903 } | 2905 } |
2904 | 2906 |
2905 | 2907 |
2906 void Debug::NotifyMessageHandler(v8::DebugEvent event, | 2908 void Debug::NotifyMessageHandler(v8::DebugEvent event, |
2907 Handle<JSObject> exec_state, | 2909 Handle<JSObject> exec_state, |
2908 Handle<JSObject> event_data, | 2910 Handle<JSObject> event_data, |
2909 bool auto_continue) { | 2911 bool auto_continue) { |
| 2912 // Prevent other interrupts from triggering, for example API callbacks, |
| 2913 // while dispatching message handler callbacks. |
| 2914 PostponeInterruptsScope no_interrupts(isolate_); |
2910 ASSERT(is_active_); | 2915 ASSERT(is_active_); |
2911 HandleScope scope(isolate_); | 2916 HandleScope scope(isolate_); |
2912 // Process the individual events. | 2917 // Process the individual events. |
2913 bool sendEventMessage = false; | 2918 bool sendEventMessage = false; |
2914 switch (event) { | 2919 switch (event) { |
2915 case v8::Break: | 2920 case v8::Break: |
2916 case v8::BreakForCommand: | 2921 case v8::BreakForCommand: |
2917 sendEventMessage = !auto_continue; | 2922 sendEventMessage = !auto_continue; |
2918 break; | 2923 break; |
2919 case v8::Exception: | 2924 case v8::Exception: |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3462 logger_->DebugEvent("Put", message.text()); | 3467 logger_->DebugEvent("Put", message.text()); |
3463 } | 3468 } |
3464 | 3469 |
3465 | 3470 |
3466 void LockingCommandMessageQueue::Clear() { | 3471 void LockingCommandMessageQueue::Clear() { |
3467 LockGuard<Mutex> lock_guard(&mutex_); | 3472 LockGuard<Mutex> lock_guard(&mutex_); |
3468 queue_.Clear(); | 3473 queue_.Clear(); |
3469 } | 3474 } |
3470 | 3475 |
3471 } } // namespace v8::internal | 3476 } } // namespace v8::internal |
OLD | NEW |