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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 thread_local_.break_id_ = 0; | 556 thread_local_.break_id_ = 0; |
557 thread_local_.break_frame_id_ = StackFrame::NO_ID; | 557 thread_local_.break_frame_id_ = StackFrame::NO_ID; |
558 thread_local_.last_step_action_ = StepNone; | 558 thread_local_.last_step_action_ = StepNone; |
559 thread_local_.last_statement_position_ = RelocInfo::kNoPosition; | 559 thread_local_.last_statement_position_ = RelocInfo::kNoPosition; |
560 thread_local_.step_count_ = 0; | 560 thread_local_.step_count_ = 0; |
561 thread_local_.last_fp_ = 0; | 561 thread_local_.last_fp_ = 0; |
562 thread_local_.queued_step_count_ = 0; | 562 thread_local_.queued_step_count_ = 0; |
563 thread_local_.step_into_fp_ = 0; | 563 thread_local_.step_into_fp_ = 0; |
564 thread_local_.step_out_fp_ = 0; | 564 thread_local_.step_out_fp_ = 0; |
565 // TODO(isolates): frames_are_dropped_? | 565 // TODO(isolates): frames_are_dropped_? |
566 thread_local_.current_debug_scope_ = NULL; | 566 base::NoBarrier_Store(&thread_local_.current_debug_scope_, |
| 567 static_cast<base::AtomicWord>(NULL)); |
567 thread_local_.restarter_frame_function_pointer_ = NULL; | 568 thread_local_.restarter_frame_function_pointer_ = NULL; |
568 } | 569 } |
569 | 570 |
570 | 571 |
571 char* Debug::ArchiveDebug(char* storage) { | 572 char* Debug::ArchiveDebug(char* storage) { |
572 char* to = storage; | 573 char* to = storage; |
573 MemCopy(to, reinterpret_cast<char*>(&thread_local_), sizeof(ThreadLocal)); | 574 MemCopy(to, reinterpret_cast<char*>(&thread_local_), sizeof(ThreadLocal)); |
574 ThreadInit(); | 575 ThreadInit(); |
575 return storage + ArchiveSpacePerThread(); | 576 return storage + ArchiveSpacePerThread(); |
576 } | 577 } |
(...skipping 2505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3082 } | 3083 } |
3083 | 3084 |
3084 | 3085 |
3085 DebugScope::DebugScope(Debug* debug) | 3086 DebugScope::DebugScope(Debug* debug) |
3086 : debug_(debug), | 3087 : debug_(debug), |
3087 prev_(debug->debugger_entry()), | 3088 prev_(debug->debugger_entry()), |
3088 save_(debug_->isolate_), | 3089 save_(debug_->isolate_), |
3089 no_termination_exceptons_(debug_->isolate_, | 3090 no_termination_exceptons_(debug_->isolate_, |
3090 StackGuard::TERMINATE_EXECUTION) { | 3091 StackGuard::TERMINATE_EXECUTION) { |
3091 // Link recursive debugger entry. | 3092 // Link recursive debugger entry. |
3092 debug_->thread_local_.current_debug_scope_ = this; | 3093 base::NoBarrier_Store(&debug_->thread_local_.current_debug_scope_, |
| 3094 reinterpret_cast<base::AtomicWord>(this)); |
3093 | 3095 |
3094 // Store the previous break id and frame id. | 3096 // Store the previous break id and frame id. |
3095 break_id_ = debug_->break_id(); | 3097 break_id_ = debug_->break_id(); |
3096 break_frame_id_ = debug_->break_frame_id(); | 3098 break_frame_id_ = debug_->break_frame_id(); |
3097 | 3099 |
3098 // Create the new break info. If there is no JavaScript frames there is no | 3100 // Create the new break info. If there is no JavaScript frames there is no |
3099 // break frame id. | 3101 // break frame id. |
3100 JavaScriptFrameIterator it(isolate()); | 3102 JavaScriptFrameIterator it(isolate()); |
3101 bool has_js_frames = !it.done(); | 3103 bool has_js_frames = !it.done(); |
3102 debug_->thread_local_.break_frame_id_ = has_js_frames ? it.frame()->id() | 3104 debug_->thread_local_.break_frame_id_ = has_js_frames ? it.frame()->id() |
(...skipping 16 matching lines...) Expand all Loading... |
3119 // JavaScript. This can happen if the v8::Debug::Call is used in which | 3121 // JavaScript. This can happen if the v8::Debug::Call is used in which |
3120 // case the exception should end up in the calling code. | 3122 // case the exception should end up in the calling code. |
3121 if (!isolate()->has_pending_exception()) debug_->ClearMirrorCache(); | 3123 if (!isolate()->has_pending_exception()) debug_->ClearMirrorCache(); |
3122 | 3124 |
3123 // If there are commands in the queue when leaving the debugger request | 3125 // If there are commands in the queue when leaving the debugger request |
3124 // that these commands are processed. | 3126 // that these commands are processed. |
3125 if (debug_->has_commands()) isolate()->stack_guard()->RequestDebugCommand(); | 3127 if (debug_->has_commands()) isolate()->stack_guard()->RequestDebugCommand(); |
3126 } | 3128 } |
3127 | 3129 |
3128 // Leaving this debugger entry. | 3130 // Leaving this debugger entry. |
3129 debug_->thread_local_.current_debug_scope_ = prev_; | 3131 base::NoBarrier_Store(&debug_->thread_local_.current_debug_scope_, |
| 3132 reinterpret_cast<base::AtomicWord>(prev_)); |
3130 | 3133 |
3131 // Restore to the previous break state. | 3134 // Restore to the previous break state. |
3132 debug_->thread_local_.break_frame_id_ = break_frame_id_; | 3135 debug_->thread_local_.break_frame_id_ = break_frame_id_; |
3133 debug_->thread_local_.break_id_ = break_id_; | 3136 debug_->thread_local_.break_id_ = break_id_; |
3134 | 3137 |
3135 debug_->UpdateState(); | 3138 debug_->UpdateState(); |
3136 } | 3139 } |
3137 | 3140 |
3138 | 3141 |
3139 MessageImpl MessageImpl::NewEvent(DebugEvent event, | 3142 MessageImpl MessageImpl::NewEvent(DebugEvent event, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3382 logger_->DebugEvent("Put", message.text()); | 3385 logger_->DebugEvent("Put", message.text()); |
3383 } | 3386 } |
3384 | 3387 |
3385 | 3388 |
3386 void LockingCommandMessageQueue::Clear() { | 3389 void LockingCommandMessageQueue::Clear() { |
3387 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 3390 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
3388 queue_.Clear(); | 3391 queue_.Clear(); |
3389 } | 3392 } |
3390 | 3393 |
3391 } } // namespace v8::internal | 3394 } } // namespace v8::internal |
OLD | NEW |