OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 3215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3227 // pending exception as clearing the mirror cache calls back into | 3227 // pending exception as clearing the mirror cache calls back into |
3228 // JavaScript. This can happen if the v8::Debug::Call is used in which | 3228 // JavaScript. This can happen if the v8::Debug::Call is used in which |
3229 // case the exception should end up in the calling code. | 3229 // case the exception should end up in the calling code. |
3230 if (!isolate_->has_pending_exception()) { | 3230 if (!isolate_->has_pending_exception()) { |
3231 // Try to avoid any pending debug break breaking in the clear mirror | 3231 // Try to avoid any pending debug break breaking in the clear mirror |
3232 // cache JavaScript code. | 3232 // cache JavaScript code. |
3233 if (isolate_->stack_guard()->IsDebugBreak()) { | 3233 if (isolate_->stack_guard()->IsDebugBreak()) { |
3234 debug->set_interrupts_pending(DEBUGBREAK); | 3234 debug->set_interrupts_pending(DEBUGBREAK); |
3235 isolate_->stack_guard()->Continue(DEBUGBREAK); | 3235 isolate_->stack_guard()->Continue(DEBUGBREAK); |
3236 } | 3236 } |
| 3237 // If there is a pending termination request, we don't want to deal |
| 3238 // with that now, either. |
| 3239 if (isolate_->stack_guard()->IsTerminateExecution()) { |
| 3240 debug->set_interrupts_pending(TERMINATE); |
| 3241 isolate_->stack_guard()->Continue(TERMINATE); |
| 3242 } |
3237 debug->ClearMirrorCache(); | 3243 debug->ClearMirrorCache(); |
3238 } | 3244 } |
3239 | 3245 |
3240 // Request preemption and debug break when leaving the last debugger entry | 3246 // Request preemption and debug break when leaving the last debugger entry |
3241 // if any of these where recorded while debugging. | 3247 // if any of these where recorded while debugging. |
3242 if (debug->is_interrupt_pending(PREEMPT)) { | 3248 if (debug->is_interrupt_pending(PREEMPT)) { |
3243 // This re-scheduling of preemption is to avoid starvation in some | 3249 // This re-scheduling of preemption is to avoid starvation in some |
3244 // debugging scenarios. | 3250 // debugging scenarios. |
3245 debug->clear_interrupt_pending(PREEMPT); | 3251 debug->clear_interrupt_pending(PREEMPT); |
3246 isolate_->stack_guard()->Preempt(); | 3252 isolate_->stack_guard()->Preempt(); |
3247 } | 3253 } |
3248 if (debug->is_interrupt_pending(DEBUGBREAK)) { | 3254 if (debug->is_interrupt_pending(DEBUGBREAK)) { |
3249 debug->clear_interrupt_pending(DEBUGBREAK); | 3255 debug->clear_interrupt_pending(DEBUGBREAK); |
3250 isolate_->stack_guard()->DebugBreak(); | 3256 isolate_->stack_guard()->DebugBreak(); |
3251 } | 3257 } |
| 3258 if (debug->is_interrupt_pending(TERMINATE)) { |
| 3259 debug->clear_interrupt_pending(TERMINATE); |
| 3260 isolate_->stack_guard()->TerminateExecution(); |
| 3261 } |
3252 | 3262 |
3253 // If there are commands in the queue when leaving the debugger request | 3263 // If there are commands in the queue when leaving the debugger request |
3254 // that these commands are processed. | 3264 // that these commands are processed. |
3255 if (isolate_->debugger()->HasCommands()) { | 3265 if (isolate_->debugger()->HasCommands()) { |
3256 isolate_->stack_guard()->DebugCommand(); | 3266 isolate_->stack_guard()->DebugCommand(); |
3257 } | 3267 } |
3258 | 3268 |
3259 // If leaving the debugger with the debugger no longer active unload it. | 3269 // If leaving the debugger with the debugger no longer active unload it. |
3260 if (!isolate_->debugger()->IsDebuggerActive()) { | 3270 if (!isolate_->debugger()->IsDebuggerActive()) { |
3261 isolate_->debugger()->UnloadDebugger(); | 3271 isolate_->debugger()->UnloadDebugger(); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3562 { | 3572 { |
3563 Locker locker; | 3573 Locker locker; |
3564 Isolate::Current()->debugger()->CallMessageDispatchHandler(); | 3574 Isolate::Current()->debugger()->CallMessageDispatchHandler(); |
3565 } | 3575 } |
3566 } | 3576 } |
3567 } | 3577 } |
3568 | 3578 |
3569 #endif // ENABLE_DEBUGGER_SUPPORT | 3579 #endif // ENABLE_DEBUGGER_SUPPORT |
3570 | 3580 |
3571 } } // namespace v8::internal | 3581 } } // namespace v8::internal |
OLD | NEW |