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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 // triggered. This function returns a JSArray with the break point objects | 890 // triggered. This function returns a JSArray with the break point objects |
891 // which is triggered. | 891 // which is triggered. |
892 Handle<Object> Debug::CheckBreakPoints(Handle<Object> break_point_objects) { | 892 Handle<Object> Debug::CheckBreakPoints(Handle<Object> break_point_objects) { |
893 Factory* factory = isolate_->factory(); | 893 Factory* factory = isolate_->factory(); |
894 | 894 |
895 // Count the number of break points hit. If there are multiple break points | 895 // Count the number of break points hit. If there are multiple break points |
896 // they are in a FixedArray. | 896 // they are in a FixedArray. |
897 Handle<FixedArray> break_points_hit; | 897 Handle<FixedArray> break_points_hit; |
898 int break_points_hit_count = 0; | 898 int break_points_hit_count = 0; |
899 DCHECK(!break_point_objects->IsUndefined()); | 899 DCHECK(!break_point_objects->IsUndefined()); |
900 | |
901 // Break points are checked by calling into Javascript. This could change | |
902 // the stepping state we are currently in. | |
903 PreserveDebugState state(this); | |
904 | |
905 if (break_point_objects->IsFixedArray()) { | 900 if (break_point_objects->IsFixedArray()) { |
906 Handle<FixedArray> array(FixedArray::cast(*break_point_objects)); | 901 Handle<FixedArray> array(FixedArray::cast(*break_point_objects)); |
907 break_points_hit = factory->NewFixedArray(array->length()); | 902 break_points_hit = factory->NewFixedArray(array->length()); |
908 for (int i = 0; i < array->length(); i++) { | 903 for (int i = 0; i < array->length(); i++) { |
909 Handle<Object> o(array->get(i), isolate_); | 904 Handle<Object> o(array->get(i), isolate_); |
910 if (CheckBreakPoint(o)) { | 905 if (CheckBreakPoint(o)) { |
911 break_points_hit->set(break_points_hit_count++, *o); | 906 break_points_hit->set(break_points_hit_count++, *o); |
912 } | 907 } |
913 } | 908 } |
914 } else { | 909 } else { |
(...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3405 logger_->DebugEvent("Put", message.text()); | 3400 logger_->DebugEvent("Put", message.text()); |
3406 } | 3401 } |
3407 | 3402 |
3408 | 3403 |
3409 void LockingCommandMessageQueue::Clear() { | 3404 void LockingCommandMessageQueue::Clear() { |
3410 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 3405 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
3411 queue_.Clear(); | 3406 queue_.Clear(); |
3412 } | 3407 } |
3413 | 3408 |
3414 } } // namespace v8::internal | 3409 } } // namespace v8::internal |
OLD | NEW |