Chromium Code Reviews| 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" |
| 11 #include "src/utils.h" | 11 #include "src/utils.h" |
| 12 | 12 |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 // Forward declarations. | 16 // Forward declarations. |
| 17 class JSRegExp; | 17 class JSRegExp; |
| 18 | 18 |
| 19 | |
| 20 // Whether to handle a DebugBreak in a function that is not normally subject to | |
| 21 // debugging (e.g. a builtin). | |
| 22 enum BreakInNonDebuggableFlag { | |
| 23 DontBreakInNonDebuggable, | |
| 24 BreakInNonDebuggable, | |
| 25 }; | |
| 26 | |
| 27 | |
| 19 class Execution final : public AllStatic { | 28 class Execution final : public AllStatic { |
| 20 public: | 29 public: |
| 21 // Call a function, the caller supplies a receiver and an array | 30 // Call a function, the caller supplies a receiver and an array |
| 22 // of arguments. Arguments are Object* type. After function returns, | 31 // of arguments. Arguments are Object* type. After function returns, |
| 23 // pointers in 'args' might be invalid. | 32 // pointers in 'args' might be invalid. |
| 24 // | 33 // |
| 25 // *pending_exception tells whether the invoke resulted in | 34 // *pending_exception tells whether the invoke resulted in |
| 26 // a pending exception. | 35 // a pending exception. |
| 27 // | 36 // |
| 28 // When convert_receiver is set, and the receiver is not an object, | 37 // When convert_receiver is set, and the receiver is not an object, |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 } | 201 } |
| 193 Address address_of_jslimit() { | 202 Address address_of_jslimit() { |
| 194 return reinterpret_cast<Address>(&thread_local_.jslimit_); | 203 return reinterpret_cast<Address>(&thread_local_.jslimit_); |
| 195 } | 204 } |
| 196 Address address_of_real_jslimit() { | 205 Address address_of_real_jslimit() { |
| 197 return reinterpret_cast<Address>(&thread_local_.real_jslimit_); | 206 return reinterpret_cast<Address>(&thread_local_.real_jslimit_); |
| 198 } | 207 } |
| 199 | 208 |
| 200 // If the stack guard is triggered, but it is not an actual | 209 // If the stack guard is triggered, but it is not an actual |
| 201 // stack overflow, then handle the interruption accordingly. | 210 // stack overflow, then handle the interruption accordingly. |
| 202 Object* HandleInterrupts(); | 211 Object* HandleInterrupts( |
| 212 BreakInNonDebuggableFlag flag = DontBreakInNonDebuggable); | |
|
Michael Starzinger
2015/08/31 21:52:21
Hmpf! I realize that Yang suggested this approach,
| |
| 203 void HandleGCInterrupt(); | 213 void HandleGCInterrupt(); |
| 204 | 214 |
| 205 private: | 215 private: |
| 206 StackGuard(); | 216 StackGuard(); |
| 207 | 217 |
| 208 bool CheckInterrupt(InterruptFlag flag); | 218 bool CheckInterrupt(InterruptFlag flag); |
| 209 void RequestInterrupt(InterruptFlag flag); | 219 void RequestInterrupt(InterruptFlag flag); |
| 210 void ClearInterrupt(InterruptFlag flag); | 220 void ClearInterrupt(InterruptFlag flag); |
| 211 bool CheckAndClearInterrupt(InterruptFlag flag); | 221 bool CheckAndClearInterrupt(InterruptFlag flag); |
| 212 | 222 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 friend class Isolate; | 301 friend class Isolate; |
| 292 friend class StackLimitCheck; | 302 friend class StackLimitCheck; |
| 293 friend class PostponeInterruptsScope; | 303 friend class PostponeInterruptsScope; |
| 294 | 304 |
| 295 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 305 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
| 296 }; | 306 }; |
| 297 | 307 |
| 298 } } // namespace v8::internal | 308 } } // namespace v8::internal |
| 299 | 309 |
| 300 #endif // V8_EXECUTION_H_ | 310 #endif // V8_EXECUTION_H_ |
| OLD | NEW |