| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 Address address_of_jslimit() { | 188 Address address_of_jslimit() { |
| 189 return reinterpret_cast<Address>(&thread_local_.jslimit_); | 189 return reinterpret_cast<Address>(&thread_local_.jslimit_); |
| 190 } | 190 } |
| 191 Address address_of_real_jslimit() { | 191 Address address_of_real_jslimit() { |
| 192 return reinterpret_cast<Address>(&thread_local_.real_jslimit_); | 192 return reinterpret_cast<Address>(&thread_local_.real_jslimit_); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // If the stack guard is triggered, but it is not an actual | 195 // If the stack guard is triggered, but it is not an actual |
| 196 // stack overflow, then handle the interruption accordingly. | 196 // stack overflow, then handle the interruption accordingly. |
| 197 Object* HandleInterrupts(); | 197 Object* HandleInterrupts(); |
| 198 | 198 void HandleGCInterrupt(); |
| 199 bool InterruptRequested() { return GetCurrentStackPosition() < climit(); } | |
| 200 | |
| 201 void CheckAndHandleGCInterrupt(); | |
| 202 | 199 |
| 203 private: | 200 private: |
| 204 StackGuard(); | 201 StackGuard(); |
| 205 | 202 |
| 206 bool CheckInterrupt(InterruptFlag flag); | 203 bool CheckInterrupt(InterruptFlag flag); |
| 207 void RequestInterrupt(InterruptFlag flag); | 204 void RequestInterrupt(InterruptFlag flag); |
| 208 void ClearInterrupt(InterruptFlag flag); | 205 void ClearInterrupt(InterruptFlag flag); |
| 209 bool CheckAndClearInterrupt(InterruptFlag flag); | 206 bool CheckAndClearInterrupt(InterruptFlag flag); |
| 210 | 207 |
| 211 // You should hold the ExecutionAccess lock when calling this method. | 208 // You should hold the ExecutionAccess lock when calling this method. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 friend class Isolate; | 286 friend class Isolate; |
| 290 friend class StackLimitCheck; | 287 friend class StackLimitCheck; |
| 291 friend class PostponeInterruptsScope; | 288 friend class PostponeInterruptsScope; |
| 292 | 289 |
| 293 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 290 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
| 294 }; | 291 }; |
| 295 | 292 |
| 296 } } // namespace v8::internal | 293 } } // namespace v8::internal |
| 297 | 294 |
| 298 #endif // V8_EXECUTION_H_ | 295 #endif // V8_EXECUTION_H_ |
| OLD | NEW |