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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2498 | 2498 |
2499 MaybeHandle<Object> Debug::MakeAsyncTaskEvent(Handle<JSObject> task_event) { | 2499 MaybeHandle<Object> Debug::MakeAsyncTaskEvent(Handle<JSObject> task_event) { |
2500 // Create the async task event object. | 2500 // Create the async task event object. |
2501 Handle<Object> argv[] = { task_event }; | 2501 Handle<Object> argv[] = { task_event }; |
2502 return MakeJSObject("MakeAsyncTaskEvent", arraysize(argv), argv); | 2502 return MakeJSObject("MakeAsyncTaskEvent", arraysize(argv), argv); |
2503 } | 2503 } |
2504 | 2504 |
2505 | 2505 |
2506 void Debug::OnThrow(Handle<Object> exception, bool uncaught) { | 2506 void Debug::OnThrow(Handle<Object> exception, bool uncaught) { |
2507 if (in_debug_scope() || ignore_events()) return; | 2507 if (in_debug_scope() || ignore_events()) return; |
2508 // Temporarily clear any scheduled_exception to allow evaluating | |
2509 // JavaScript from the debug event handler. | |
2508 HandleScope scope(isolate_); | 2510 HandleScope scope(isolate_); |
2511 Object* scheduled_exception = isolate_->scheduled_exception(); | |
Yang
2014/09/11 07:26:05
I just realized that this is not GC-safe. You have
aandrey
2014/09/11 08:20:24
But isolate_->thread_local_top()->scheduled_except
Yang
2014/09/11 08:26:21
Also, this getter asserts that we have a scheduled
aandrey
2014/09/11 08:47:22
Done.
| |
2512 isolate_->clear_scheduled_exception(); | |
2509 OnException(exception, uncaught, isolate_->GetPromiseOnStackOnThrow()); | 2513 OnException(exception, uncaught, isolate_->GetPromiseOnStackOnThrow()); |
2514 isolate_->thread_local_top()->scheduled_exception_ = scheduled_exception; | |
2510 } | 2515 } |
2511 | 2516 |
2512 | 2517 |
2513 void Debug::OnPromiseReject(Handle<JSObject> promise, Handle<Object> value) { | 2518 void Debug::OnPromiseReject(Handle<JSObject> promise, Handle<Object> value) { |
2514 if (in_debug_scope() || ignore_events()) return; | 2519 if (in_debug_scope() || ignore_events()) return; |
2515 HandleScope scope(isolate_); | 2520 HandleScope scope(isolate_); |
2516 OnException(value, false, promise); | 2521 OnException(value, false, promise); |
2517 } | 2522 } |
2518 | 2523 |
2519 | 2524 |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3362 logger_->DebugEvent("Put", message.text()); | 3367 logger_->DebugEvent("Put", message.text()); |
3363 } | 3368 } |
3364 | 3369 |
3365 | 3370 |
3366 void LockingCommandMessageQueue::Clear() { | 3371 void LockingCommandMessageQueue::Clear() { |
3367 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 3372 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
3368 queue_.Clear(); | 3373 queue_.Clear(); |
3369 } | 3374 } |
3370 | 3375 |
3371 } } // namespace v8::internal | 3376 } } // namespace v8::internal |
OLD | NEW |