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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 void Debug::FloodHandlerWithOneShot() { | 1143 void Debug::FloodHandlerWithOneShot() { |
1144 // Iterate through the JavaScript stack looking for handlers. | 1144 // Iterate through the JavaScript stack looking for handlers. |
1145 StackFrame::Id id = break_frame_id(); | 1145 StackFrame::Id id = break_frame_id(); |
1146 if (id == StackFrame::NO_ID) { | 1146 if (id == StackFrame::NO_ID) { |
1147 // If there is no JavaScript stack don't do anything. | 1147 // If there is no JavaScript stack don't do anything. |
1148 return; | 1148 return; |
1149 } | 1149 } |
1150 for (JavaScriptFrameIterator it(isolate_, id); !it.done(); it.Advance()) { | 1150 for (JavaScriptFrameIterator it(isolate_, id); !it.done(); it.Advance()) { |
1151 JavaScriptFrame* frame = it.frame(); | 1151 JavaScriptFrame* frame = it.frame(); |
1152 int stack_slots = 0; // The computed stack slot count is not used. | 1152 int stack_slots = 0; // The computed stack slot count is not used. |
1153 if (frame->LookupExceptionHandlerInTable(&stack_slots) > 0) { | 1153 if (frame->LookupExceptionHandlerInTable(&stack_slots, NULL) > 0) { |
1154 // Flood the function with the catch/finally block with break points. | 1154 // Flood the function with the catch/finally block with break points. |
1155 FloodWithOneShot(Handle<JSFunction>(frame->function())); | 1155 FloodWithOneShot(Handle<JSFunction>(frame->function())); |
1156 return; | 1156 return; |
1157 } | 1157 } |
1158 } | 1158 } |
1159 } | 1159 } |
1160 | 1160 |
1161 | 1161 |
1162 void Debug::ChangeBreakOnException(ExceptionBreakType type, bool enable) { | 1162 void Debug::ChangeBreakOnException(ExceptionBreakType type, bool enable) { |
1163 if (type == BreakUncaughtException) { | 1163 if (type == BreakUncaughtException) { |
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2479 Handle<JSObject> promise) { | 2479 Handle<JSObject> promise) { |
2480 Handle<JSFunction> fun = Handle<JSFunction>::cast( | 2480 Handle<JSFunction> fun = Handle<JSFunction>::cast( |
2481 JSReceiver::GetDataProperty(isolate_->js_builtins_object(), | 2481 JSReceiver::GetDataProperty(isolate_->js_builtins_object(), |
2482 isolate_->factory()->NewStringFromStaticChars( | 2482 isolate_->factory()->NewStringFromStaticChars( |
2483 "$promiseHasUserDefinedRejectHandler"))); | 2483 "$promiseHasUserDefinedRejectHandler"))); |
2484 return Execution::Call(isolate_, fun, promise, 0, NULL); | 2484 return Execution::Call(isolate_, fun, promise, 0, NULL); |
2485 } | 2485 } |
2486 | 2486 |
2487 | 2487 |
2488 void Debug::OnException(Handle<Object> exception, Handle<Object> promise) { | 2488 void Debug::OnException(Handle<Object> exception, Handle<Object> promise) { |
| 2489 // In our prediction, try-finally is not considered to catch. |
2489 Isolate::CatchType catch_type = isolate_->PredictExceptionCatcher(); | 2490 Isolate::CatchType catch_type = isolate_->PredictExceptionCatcher(); |
2490 bool uncaught = (catch_type == Isolate::NOT_CAUGHT); | 2491 bool uncaught = (catch_type == Isolate::NOT_CAUGHT); |
2491 if (promise->IsJSObject()) { | 2492 if (promise->IsJSObject()) { |
2492 Handle<JSObject> jspromise = Handle<JSObject>::cast(promise); | 2493 Handle<JSObject> jspromise = Handle<JSObject>::cast(promise); |
2493 // Mark the promise as already having triggered a message. | 2494 // Mark the promise as already having triggered a message. |
2494 Handle<Symbol> key = isolate_->factory()->promise_debug_marker_symbol(); | 2495 Handle<Symbol> key = isolate_->factory()->promise_debug_marker_symbol(); |
2495 JSObject::SetProperty(jspromise, key, key, STRICT).Assert(); | 2496 JSObject::SetProperty(jspromise, key, key, STRICT).Assert(); |
2496 // Check whether the promise reject is considered an uncaught exception. | 2497 // Check whether the promise reject is considered an uncaught exception. |
2497 Handle<Object> has_reject_handler; | 2498 Handle<Object> has_reject_handler; |
2498 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 2499 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3362 logger_->DebugEvent("Put", message.text()); | 3363 logger_->DebugEvent("Put", message.text()); |
3363 } | 3364 } |
3364 | 3365 |
3365 | 3366 |
3366 void LockingCommandMessageQueue::Clear() { | 3367 void LockingCommandMessageQueue::Clear() { |
3367 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 3368 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
3368 queue_.Clear(); | 3369 queue_.Clear(); |
3369 } | 3370 } |
3370 | 3371 |
3371 } } // namespace v8::internal | 3372 } } // namespace v8::internal |
OLD | NEW |