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 2489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2500 isolate_->thread_local_top()->scheduled_exception_ = *scheduled_exception; | 2500 isolate_->thread_local_top()->scheduled_exception_ = *scheduled_exception; |
2501 } | 2501 } |
2502 } | 2502 } |
2503 | 2503 |
2504 | 2504 |
2505 void Debug::OnPromiseReject(Handle<JSObject> promise, Handle<Object> value) { | 2505 void Debug::OnPromiseReject(Handle<JSObject> promise, Handle<Object> value) { |
2506 if (in_debug_scope() || ignore_events()) return; | 2506 if (in_debug_scope() || ignore_events()) return; |
2507 HandleScope scope(isolate_); | 2507 HandleScope scope(isolate_); |
2508 // Check whether the promise has been marked as having triggered a message. | 2508 // Check whether the promise has been marked as having triggered a message. |
2509 Handle<Symbol> key = isolate_->factory()->promise_debug_marker_symbol(); | 2509 Handle<Symbol> key = isolate_->factory()->promise_debug_marker_symbol(); |
2510 if (JSReceiver::GetDataProperty(promise, key)->IsUndefined()) { | 2510 if (JSObject::GetDataProperty(promise, key)->IsUndefined()) { |
2511 OnException(value, promise); | 2511 OnException(value, promise); |
2512 } | 2512 } |
2513 } | 2513 } |
2514 | 2514 |
2515 | 2515 |
2516 MaybeHandle<Object> Debug::PromiseHasUserDefinedRejectHandler( | 2516 MaybeHandle<Object> Debug::PromiseHasUserDefinedRejectHandler( |
2517 Handle<JSObject> promise) { | 2517 Handle<JSObject> promise) { |
2518 Handle<JSFunction> fun = Handle<JSFunction>::cast( | 2518 Handle<JSFunction> fun = Handle<JSFunction>::cast( |
2519 JSReceiver::GetDataProperty(isolate_->js_builtins_object(), | 2519 JSObject::GetDataProperty(isolate_->js_builtins_object(), |
2520 isolate_->factory()->NewStringFromStaticChars( | 2520 isolate_->factory()->NewStringFromStaticChars( |
2521 "$promiseHasUserDefinedRejectHandler"))); | 2521 "$promiseHasUserDefinedRejectHandler"))); |
2522 return Execution::Call(isolate_, fun, promise, 0, NULL); | 2522 return Execution::Call(isolate_, fun, promise, 0, NULL); |
2523 } | 2523 } |
2524 | 2524 |
2525 | 2525 |
2526 void Debug::OnException(Handle<Object> exception, Handle<Object> promise) { | 2526 void Debug::OnException(Handle<Object> exception, Handle<Object> promise) { |
2527 Isolate::CatchType catch_type = isolate_->PredictExceptionCatcher(); | 2527 Isolate::CatchType catch_type = isolate_->PredictExceptionCatcher(); |
2528 bool uncaught = (catch_type == Isolate::NOT_CAUGHT); | 2528 bool uncaught = (catch_type == Isolate::NOT_CAUGHT); |
2529 if (promise->IsJSObject()) { | 2529 if (promise->IsJSObject()) { |
2530 Handle<JSObject> jspromise = Handle<JSObject>::cast(promise); | 2530 Handle<JSObject> jspromise = Handle<JSObject>::cast(promise); |
2531 // Mark the promise as already having triggered a message. | 2531 // Mark the promise as already having triggered a message. |
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3399 logger_->DebugEvent("Put", message.text()); | 3399 logger_->DebugEvent("Put", message.text()); |
3400 } | 3400 } |
3401 | 3401 |
3402 | 3402 |
3403 void LockingCommandMessageQueue::Clear() { | 3403 void LockingCommandMessageQueue::Clear() { |
3404 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 3404 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
3405 queue_.Clear(); | 3405 queue_.Clear(); |
3406 } | 3406 } |
3407 | 3407 |
3408 } } // namespace v8::internal | 3408 } } // namespace v8::internal |
OLD | NEW |