OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 // Flag used to set the interrupt causes. | 37 // Flag used to set the interrupt causes. |
38 enum InterruptFlag { | 38 enum InterruptFlag { |
39 INTERRUPT = 1 << 0, | 39 INTERRUPT = 1 << 0, |
40 DEBUGBREAK = 1 << 1, | 40 DEBUGBREAK = 1 << 1, |
41 DEBUGCOMMAND = 1 << 2, | 41 DEBUGCOMMAND = 1 << 2, |
42 PREEMPT = 1 << 3, | 42 PREEMPT = 1 << 3, |
43 TERMINATE = 1 << 4, | 43 TERMINATE = 1 << 4, |
44 GC_REQUEST = 1 << 5, | 44 GC_REQUEST = 1 << 5, |
45 FULL_DEOPT = 1 << 6, | 45 FULL_DEOPT = 1 << 6, |
46 INSTALL_CODE = 1 << 7, | 46 INSTALL_CODE = 1 << 7 |
47 API_INTERRUPT = 1 << 8 | |
48 }; | 47 }; |
49 | 48 |
50 | 49 |
51 class Isolate; | 50 class Isolate; |
52 | 51 |
53 | 52 |
54 class Execution : public AllStatic { | 53 class Execution : public AllStatic { |
55 public: | 54 public: |
56 // Call a function, the caller supplies a receiver and an array | 55 // Call a function, the caller supplies a receiver and an array |
57 // of arguments. Arguments are Object* type. After function returns, | 56 // of arguments. Arguments are Object* type. After function returns, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 void DebugCommand(); | 215 void DebugCommand(); |
217 #endif | 216 #endif |
218 bool IsGCRequest(); | 217 bool IsGCRequest(); |
219 void RequestGC(); | 218 void RequestGC(); |
220 bool IsInstallCodeRequest(); | 219 bool IsInstallCodeRequest(); |
221 void RequestInstallCode(); | 220 void RequestInstallCode(); |
222 bool IsFullDeopt(); | 221 bool IsFullDeopt(); |
223 void FullDeopt(); | 222 void FullDeopt(); |
224 void Continue(InterruptFlag after_what); | 223 void Continue(InterruptFlag after_what); |
225 | 224 |
226 void RequestInterrupt(InterruptCallback callback, void* data); | |
227 void ClearInterrupt(); | |
228 bool IsAPIInterrupt(); | |
229 void InvokeInterruptCallback(); | |
230 | |
231 // This provides an asynchronous read of the stack limits for the current | 225 // This provides an asynchronous read of the stack limits for the current |
232 // thread. There are no locks protecting this, but it is assumed that you | 226 // thread. There are no locks protecting this, but it is assumed that you |
233 // have the global V8 lock if you are using multiple V8 threads. | 227 // have the global V8 lock if you are using multiple V8 threads. |
234 uintptr_t climit() { | 228 uintptr_t climit() { |
235 return thread_local_.climit_; | 229 return thread_local_.climit_; |
236 } | 230 } |
237 uintptr_t real_climit() { | 231 uintptr_t real_climit() { |
238 return thread_local_.real_climit_; | 232 return thread_local_.real_climit_; |
239 } | 233 } |
240 uintptr_t jslimit() { | 234 uintptr_t jslimit() { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // fail. Both the generated code and the runtime system check against the | 300 // fail. Both the generated code and the runtime system check against the |
307 // one without the real_ prefix. | 301 // one without the real_ prefix. |
308 uintptr_t real_jslimit_; // Actual JavaScript stack limit set for the VM. | 302 uintptr_t real_jslimit_; // Actual JavaScript stack limit set for the VM. |
309 uintptr_t jslimit_; | 303 uintptr_t jslimit_; |
310 uintptr_t real_climit_; // Actual C++ stack limit set for the VM. | 304 uintptr_t real_climit_; // Actual C++ stack limit set for the VM. |
311 uintptr_t climit_; | 305 uintptr_t climit_; |
312 | 306 |
313 int nesting_; | 307 int nesting_; |
314 int postpone_interrupts_nesting_; | 308 int postpone_interrupts_nesting_; |
315 int interrupt_flags_; | 309 int interrupt_flags_; |
316 | |
317 InterruptCallback interrupt_callback_; | |
318 void* interrupt_callback_data_; | |
319 }; | 310 }; |
320 | 311 |
321 // TODO(isolates): Technically this could be calculated directly from a | 312 // TODO(isolates): Technically this could be calculated directly from a |
322 // pointer to StackGuard. | 313 // pointer to StackGuard. |
323 Isolate* isolate_; | 314 Isolate* isolate_; |
324 ThreadLocal thread_local_; | 315 ThreadLocal thread_local_; |
325 | 316 |
326 friend class Isolate; | 317 friend class Isolate; |
327 friend class StackLimitCheck; | 318 friend class StackLimitCheck; |
328 friend class PostponeInterruptsScope; | 319 friend class PostponeInterruptsScope; |
329 | 320 |
330 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 321 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
331 }; | 322 }; |
332 | 323 |
333 | 324 |
334 } } // namespace v8::internal | 325 } } // namespace v8::internal |
335 | 326 |
336 #endif // V8_EXECUTION_H_ | 327 #endif // V8_EXECUTION_H_ |
OLD | NEW |