OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 namespace v8 { | 31 namespace v8 { |
32 namespace internal { | 32 namespace internal { |
33 | 33 |
34 | 34 |
35 // Flag used to set the interrupt causes. | 35 // Flag used to set the interrupt causes. |
36 enum InterruptFlag { | 36 enum InterruptFlag { |
37 INTERRUPT = 1 << 0, | 37 INTERRUPT = 1 << 0, |
38 DEBUGBREAK = 1 << 1, | 38 DEBUGBREAK = 1 << 1, |
39 DEBUGCOMMAND = 1 << 2, | 39 DEBUGCOMMAND = 1 << 2, |
40 PREEMPT = 1 << 3 | 40 PREEMPT = 1 << 3, |
| 41 TERMINATE = 1 << 4 |
41 }; | 42 }; |
42 | 43 |
43 class Execution : public AllStatic { | 44 class Execution : public AllStatic { |
44 public: | 45 public: |
45 // Call a function, the caller supplies a receiver and an array | 46 // Call a function, the caller supplies a receiver and an array |
46 // of arguments. Arguments are Object* type. After function returns, | 47 // of arguments. Arguments are Object* type. After function returns, |
47 // pointers in 'args' might be invalid. | 48 // pointers in 'args' might be invalid. |
48 // | 49 // |
49 // *pending_exception tells whether the invoke resulted in | 50 // *pending_exception tells whether the invoke resulted in |
50 // a pending exception. | 51 // a pending exception. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // Threading support. | 158 // Threading support. |
158 static char* ArchiveStackGuard(char* to); | 159 static char* ArchiveStackGuard(char* to); |
159 static char* RestoreStackGuard(char* from); | 160 static char* RestoreStackGuard(char* from); |
160 static int ArchiveSpacePerThread(); | 161 static int ArchiveSpacePerThread(); |
161 | 162 |
162 static bool IsStackOverflow(); | 163 static bool IsStackOverflow(); |
163 static bool IsPreempted(); | 164 static bool IsPreempted(); |
164 static void Preempt(); | 165 static void Preempt(); |
165 static bool IsInterrupted(); | 166 static bool IsInterrupted(); |
166 static void Interrupt(); | 167 static void Interrupt(); |
| 168 static bool IsTerminateExecution(); |
| 169 static void TerminateExecution(); |
| 170 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 171 static bool IsDebugBreak(); |
| 172 static void DebugBreak(); |
| 173 static bool IsDebugCommand(); |
| 174 static void DebugCommand(); |
| 175 #endif |
167 static void Continue(InterruptFlag after_what); | 176 static void Continue(InterruptFlag after_what); |
168 #ifdef ENABLE_DEBUGGER_SUPPORT | |
169 static void DebugBreak(); | |
170 static void DebugCommand(); | |
171 static bool IsDebugBreak(); | |
172 static bool IsDebugCommand(); | |
173 #endif | |
174 | 177 |
175 private: | 178 private: |
176 // You should hold the ExecutionAccess lock when calling this method. | 179 // You should hold the ExecutionAccess lock when calling this method. |
177 static bool IsSet(const ExecutionAccess& lock); | 180 static bool IsSet(const ExecutionAccess& lock); |
178 | 181 |
179 // This provides an asynchronous read of the stack limit for the current | 182 // This provides an asynchronous read of the stack limit for the current |
180 // thread. There are no locks protecting this, but it is assumed that you | 183 // thread. There are no locks protecting this, but it is assumed that you |
181 // have the global V8 lock if you are using multiple V8 threads. | 184 // have the global V8 lock if you are using multiple V8 threads. |
182 static uintptr_t climit() { | 185 static uintptr_t climit() { |
183 return thread_local_.climit_; | 186 return thread_local_.climit_; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 v8::Handle<v8::String> name); | 283 v8::Handle<v8::String> name); |
281 static v8::Handle<v8::Value> GC(const v8::Arguments& args); | 284 static v8::Handle<v8::Value> GC(const v8::Arguments& args); |
282 private: | 285 private: |
283 static const char* kSource; | 286 static const char* kSource; |
284 }; | 287 }; |
285 | 288 |
286 | 289 |
287 } } // namespace v8::internal | 290 } } // namespace v8::internal |
288 | 291 |
289 #endif // V8_EXECUTION_H_ | 292 #endif // V8_EXECUTION_H_ |
OLD | NEW |