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/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 | 972 |
973 | 973 |
974 void Isolate::RequestInterrupt(InterruptCallback callback, void* data) { | 974 void Isolate::RequestInterrupt(InterruptCallback callback, void* data) { |
975 ExecutionAccess access(this); | 975 ExecutionAccess access(this); |
976 api_interrupts_queue_.push(InterruptEntry(callback, data)); | 976 api_interrupts_queue_.push(InterruptEntry(callback, data)); |
977 stack_guard()->RequestApiInterrupt(); | 977 stack_guard()->RequestApiInterrupt(); |
978 } | 978 } |
979 | 979 |
980 | 980 |
981 void Isolate::InvokeApiInterruptCallbacks() { | 981 void Isolate::InvokeApiInterruptCallbacks() { |
| 982 RuntimeCallTimerScope runtimeTimer( |
| 983 this, &RuntimeCallStats::InvokeApiInterruptCallbacks); |
982 // Note: callback below should be called outside of execution access lock. | 984 // Note: callback below should be called outside of execution access lock. |
983 while (true) { | 985 while (true) { |
984 InterruptEntry entry; | 986 InterruptEntry entry; |
985 { | 987 { |
986 ExecutionAccess access(this); | 988 ExecutionAccess access(this); |
987 if (api_interrupts_queue_.empty()) return; | 989 if (api_interrupts_queue_.empty()) return; |
988 entry = api_interrupts_queue_.front(); | 990 entry = api_interrupts_queue_.front(); |
989 api_interrupts_queue_.pop(); | 991 api_interrupts_queue_.pop(); |
990 } | 992 } |
991 VMState<EXTERNAL> state(this); | 993 VMState<EXTERNAL> state(this); |
(...skipping 2174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3166 // Then check whether this scope intercepts. | 3168 // Then check whether this scope intercepts. |
3167 if ((flag & intercept_mask_)) { | 3169 if ((flag & intercept_mask_)) { |
3168 intercepted_flags_ |= flag; | 3170 intercepted_flags_ |= flag; |
3169 return true; | 3171 return true; |
3170 } | 3172 } |
3171 return false; | 3173 return false; |
3172 } | 3174 } |
3173 | 3175 |
3174 } // namespace internal | 3176 } // namespace internal |
3175 } // namespace v8 | 3177 } // namespace v8 |
OLD | NEW |