| 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 27 matching lines...) Expand all Loading... |
| 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, | 47 API_INTERRUPT = 1 << 8, |
| 48 DEOPT_MARKED_ALLOCATION_SITES = 1 << 9 | 48 DEOPT_MARKED_CODE = 1 << 9 |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 | 51 |
| 52 class Isolate; | 52 class Isolate; |
| 53 | 53 |
| 54 | 54 |
| 55 class Execution : public AllStatic { | 55 class Execution : public AllStatic { |
| 56 public: | 56 public: |
| 57 // Call a function, the caller supplies a receiver and an array | 57 // Call a function, the caller supplies a receiver and an array |
| 58 // of arguments. Arguments are Object* type. After function returns, | 58 // of arguments. Arguments are Object* type. After function returns, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 // Get a function delegate (or undefined) for the given non-function | 169 // Get a function delegate (or undefined) for the given non-function |
| 170 // object. Used for support calling objects as constructors. | 170 // object. Used for support calling objects as constructors. |
| 171 static Handle<Object> GetConstructorDelegate(Isolate* isolate, | 171 static Handle<Object> GetConstructorDelegate(Isolate* isolate, |
| 172 Handle<Object> object); | 172 Handle<Object> object); |
| 173 static Handle<Object> TryGetConstructorDelegate(Isolate* isolate, | 173 static Handle<Object> TryGetConstructorDelegate(Isolate* isolate, |
| 174 Handle<Object> object, | 174 Handle<Object> object, |
| 175 bool* has_pending_exception); | 175 bool* has_pending_exception); |
| 176 | 176 |
| 177 static void RunMicrotasks(Isolate* isolate); | 177 static void RunMicrotasks(Isolate* isolate); |
| 178 static void EnqueueMicrotask(Isolate* isolate, Handle<Object> microtask); | |
| 179 }; | 178 }; |
| 180 | 179 |
| 181 | 180 |
| 182 class ExecutionAccess; | 181 class ExecutionAccess; |
| 183 | 182 |
| 184 | 183 |
| 185 // StackGuard contains the handling of the limits that are used to limit the | 184 // StackGuard contains the handling of the limits that are used to limit the |
| 186 // number of nested invocations of JavaScript and the stack size used in each | 185 // number of nested invocations of JavaScript and the stack size used in each |
| 187 // invocation. | 186 // invocation. |
| 188 class StackGuard { | 187 class StackGuard { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 216 void DebugBreak(); | 215 void DebugBreak(); |
| 217 bool IsDebugCommand(); | 216 bool IsDebugCommand(); |
| 218 void DebugCommand(); | 217 void DebugCommand(); |
| 219 #endif | 218 #endif |
| 220 bool IsGCRequest(); | 219 bool IsGCRequest(); |
| 221 void RequestGC(); | 220 void RequestGC(); |
| 222 bool IsInstallCodeRequest(); | 221 bool IsInstallCodeRequest(); |
| 223 void RequestInstallCode(); | 222 void RequestInstallCode(); |
| 224 bool IsFullDeopt(); | 223 bool IsFullDeopt(); |
| 225 void FullDeopt(); | 224 void FullDeopt(); |
| 226 bool IsDeoptMarkedAllocationSites(); | 225 bool IsDeoptMarkedCode(); |
| 227 void DeoptMarkedAllocationSites(); | 226 void DeoptMarkedCode(); |
| 228 void Continue(InterruptFlag after_what); | 227 void Continue(InterruptFlag after_what); |
| 229 | 228 |
| 230 void RequestInterrupt(InterruptCallback callback, void* data); | 229 void RequestInterrupt(InterruptCallback callback, void* data); |
| 231 void ClearInterrupt(); | 230 void ClearInterrupt(); |
| 232 bool IsAPIInterrupt(); | 231 bool IsAPIInterrupt(); |
| 233 void InvokeInterruptCallback(); | 232 void InvokeInterruptCallback(); |
| 234 | 233 |
| 235 // This provides an asynchronous read of the stack limits for the current | 234 // This provides an asynchronous read of the stack limits for the current |
| 236 // thread. There are no locks protecting this, but it is assumed that you | 235 // thread. There are no locks protecting this, but it is assumed that you |
| 237 // have the global V8 lock if you are using multiple V8 threads. | 236 // have the global V8 lock if you are using multiple V8 threads. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 inline void set_interrupt_limits(const ExecutionAccess& lock); | 274 inline void set_interrupt_limits(const ExecutionAccess& lock); |
| 276 | 275 |
| 277 // Reset limits to actual values. For example after handling interrupt. | 276 // Reset limits to actual values. For example after handling interrupt. |
| 278 // You should hold the ExecutionAccess lock when calling this method. | 277 // You should hold the ExecutionAccess lock when calling this method. |
| 279 inline void reset_limits(const ExecutionAccess& lock); | 278 inline void reset_limits(const ExecutionAccess& lock); |
| 280 | 279 |
| 281 // Enable or disable interrupts. | 280 // Enable or disable interrupts. |
| 282 void EnableInterrupts(); | 281 void EnableInterrupts(); |
| 283 void DisableInterrupts(); | 282 void DisableInterrupts(); |
| 284 | 283 |
| 285 #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_A64 | 284 #if V8_TARGET_ARCH_X64 |
| 286 static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe); | 285 static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe); |
| 287 static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8); | 286 static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8); |
| 288 #else | 287 #else |
| 289 static const uintptr_t kInterruptLimit = 0xfffffffe; | 288 static const uintptr_t kInterruptLimit = 0xfffffffe; |
| 290 static const uintptr_t kIllegalLimit = 0xfffffff8; | 289 static const uintptr_t kIllegalLimit = 0xfffffff8; |
| 291 #endif | 290 #endif |
| 292 | 291 |
| 293 class ThreadLocal { | 292 class ThreadLocal { |
| 294 public: | 293 public: |
| 295 ThreadLocal() { Clear(); } | 294 ThreadLocal() { Clear(); } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 friend class StackLimitCheck; | 330 friend class StackLimitCheck; |
| 332 friend class PostponeInterruptsScope; | 331 friend class PostponeInterruptsScope; |
| 333 | 332 |
| 334 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 333 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
| 335 }; | 334 }; |
| 336 | 335 |
| 337 | 336 |
| 338 } } // namespace v8::internal | 337 } } // namespace v8::internal |
| 339 | 338 |
| 340 #endif // V8_EXECUTION_H_ | 339 #endif // V8_EXECUTION_H_ |
| OLD | NEW |