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/debug/debug.h" | 5 #include "src/debug/debug.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 | 61 |
62 BreakLocation::BreakLocation(Handle<DebugInfo> debug_info, DebugBreakType type, | 62 BreakLocation::BreakLocation(Handle<DebugInfo> debug_info, DebugBreakType type, |
63 int code_offset, int position, | 63 int code_offset, int position, |
64 int statement_position) | 64 int statement_position) |
65 : debug_info_(debug_info), | 65 : debug_info_(debug_info), |
66 code_offset_(code_offset), | 66 code_offset_(code_offset), |
67 type_(type), | 67 type_(type), |
68 position_(position), | 68 position_(position), |
69 statement_position_(statement_position) { | 69 statement_position_(statement_position) { |
70 #ifdef DEBUG | |
71 if (type == DEBUG_BREAK_SLOT_AT_RETURN) { | 70 if (type == DEBUG_BREAK_SLOT_AT_RETURN) { |
72 int return_position = 0; | 71 int return_position = 0; |
73 SharedFunctionInfo* shared = debug_info->shared(); | 72 SharedFunctionInfo* shared = debug_info->shared(); |
74 if (shared->HasSourceCode()) { | 73 if (shared->HasSourceCode()) { |
75 return_position = | 74 return_position = |
76 std::max(shared->end_position() - shared->start_position() - 1, 0); | 75 std::max(shared->end_position() - shared->start_position() - 1, 0); |
77 } | 76 } |
78 CHECK_EQ(return_position, position); | 77 // TODO(yangguo): find out why return position is wrong for liveedit. |
79 CHECK_EQ(return_position, statement_position); | 78 position_ = return_position; |
| 79 statement_position = return_position; |
80 } | 80 } |
81 #endif // DEBUG | |
82 } | 81 } |
83 | 82 |
84 BreakLocation::Iterator* BreakLocation::GetIterator( | 83 BreakLocation::Iterator* BreakLocation::GetIterator( |
85 Handle<DebugInfo> debug_info, BreakLocatorType type) { | 84 Handle<DebugInfo> debug_info, BreakLocatorType type) { |
86 if (debug_info->abstract_code()->IsBytecodeArray()) { | 85 if (debug_info->abstract_code()->IsBytecodeArray()) { |
87 return new BytecodeArrayIterator(debug_info, type); | 86 return new BytecodeArrayIterator(debug_info, type); |
88 } else { | 87 } else { |
89 return new CodeIterator(debug_info, type); | 88 return new CodeIterator(debug_info, type); |
90 } | 89 } |
91 } | 90 } |
(...skipping 2491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2583 } | 2582 } |
2584 | 2583 |
2585 | 2584 |
2586 void LockingCommandMessageQueue::Clear() { | 2585 void LockingCommandMessageQueue::Clear() { |
2587 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2586 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2588 queue_.Clear(); | 2587 queue_.Clear(); |
2589 } | 2588 } |
2590 | 2589 |
2591 } // namespace internal | 2590 } // namespace internal |
2592 } // namespace v8 | 2591 } // namespace v8 |
OLD | NEW |