OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_EXECUTION_H_ | 5 #ifndef V8_EXECUTION_H_ |
6 #define V8_EXECUTION_H_ | 6 #define V8_EXECUTION_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
10 #include "src/handles.h" | 10 #include "src/handles.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 Address address_of_jslimit() { | 193 Address address_of_jslimit() { |
194 return reinterpret_cast<Address>(&thread_local_.jslimit_); | 194 return reinterpret_cast<Address>(&thread_local_.jslimit_); |
195 } | 195 } |
196 Address address_of_real_jslimit() { | 196 Address address_of_real_jslimit() { |
197 return reinterpret_cast<Address>(&thread_local_.real_jslimit_); | 197 return reinterpret_cast<Address>(&thread_local_.real_jslimit_); |
198 } | 198 } |
199 | 199 |
200 // If the stack guard is triggered, but it is not an actual | 200 // If the stack guard is triggered, but it is not an actual |
201 // stack overflow, then handle the interruption accordingly. | 201 // stack overflow, then handle the interruption accordingly. |
202 Object* HandleInterrupts(); | 202 Object* HandleInterrupts(); |
203 | 203 void HandleGCInterrupt(); |
204 bool InterruptRequested() { return GetCurrentStackPosition() < climit(); } | |
205 | |
206 void CheckAndHandleGCInterrupt(); | |
207 | 204 |
208 private: | 205 private: |
209 StackGuard(); | 206 StackGuard(); |
210 | 207 |
211 bool CheckInterrupt(InterruptFlag flag); | 208 bool CheckInterrupt(InterruptFlag flag); |
212 void RequestInterrupt(InterruptFlag flag); | 209 void RequestInterrupt(InterruptFlag flag); |
213 void ClearInterrupt(InterruptFlag flag); | 210 void ClearInterrupt(InterruptFlag flag); |
214 bool CheckAndClearInterrupt(InterruptFlag flag); | 211 bool CheckAndClearInterrupt(InterruptFlag flag); |
215 | 212 |
216 // You should hold the ExecutionAccess lock when calling this method. | 213 // You should hold the ExecutionAccess lock when calling this method. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 friend class Isolate; | 291 friend class Isolate; |
295 friend class StackLimitCheck; | 292 friend class StackLimitCheck; |
296 friend class PostponeInterruptsScope; | 293 friend class PostponeInterruptsScope; |
297 | 294 |
298 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 295 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
299 }; | 296 }; |
300 | 297 |
301 } } // namespace v8::internal | 298 } } // namespace v8::internal |
302 | 299 |
303 #endif // V8_EXECUTION_H_ | 300 #endif // V8_EXECUTION_H_ |
OLD | NEW |