| 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_CODE = 1 << 9 | 48 DEOPT_MARKED_ALLOCATION_SITES = 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); |
| 178 }; | 179 }; |
| 179 | 180 |
| 180 | 181 |
| 181 class ExecutionAccess; | 182 class ExecutionAccess; |
| 182 | 183 |
| 183 | 184 |
| 184 // StackGuard contains the handling of the limits that are used to limit the | 185 // StackGuard contains the handling of the limits that are used to limit the |
| 185 // number of nested invocations of JavaScript and the stack size used in each | 186 // number of nested invocations of JavaScript and the stack size used in each |
| 186 // invocation. | 187 // invocation. |
| 187 class StackGuard { | 188 class StackGuard { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 215 void DebugBreak(); | 216 void DebugBreak(); |
| 216 bool IsDebugCommand(); | 217 bool IsDebugCommand(); |
| 217 void DebugCommand(); | 218 void DebugCommand(); |
| 218 #endif | 219 #endif |
| 219 bool IsGCRequest(); | 220 bool IsGCRequest(); |
| 220 void RequestGC(); | 221 void RequestGC(); |
| 221 bool IsInstallCodeRequest(); | 222 bool IsInstallCodeRequest(); |
| 222 void RequestInstallCode(); | 223 void RequestInstallCode(); |
| 223 bool IsFullDeopt(); | 224 bool IsFullDeopt(); |
| 224 void FullDeopt(); | 225 void FullDeopt(); |
| 225 bool IsDeoptMarkedCode(); | 226 bool IsDeoptMarkedAllocationSites(); |
| 226 void DeoptMarkedCode(); | 227 void DeoptMarkedAllocationSites(); |
| 227 void Continue(InterruptFlag after_what); | 228 void Continue(InterruptFlag after_what); |
| 228 | 229 |
| 229 void RequestInterrupt(InterruptCallback callback, void* data); | 230 void RequestInterrupt(InterruptCallback callback, void* data); |
| 230 void ClearInterrupt(); | 231 void ClearInterrupt(); |
| 231 bool IsAPIInterrupt(); | 232 bool IsAPIInterrupt(); |
| 232 void InvokeInterruptCallback(); | 233 void InvokeInterruptCallback(); |
| 233 | 234 |
| 234 // This provides an asynchronous read of the stack limits for the current | 235 // This provides an asynchronous read of the stack limits for the current |
| 235 // thread. There are no locks protecting this, but it is assumed that you | 236 // thread. There are no locks protecting this, but it is assumed that you |
| 236 // have the global V8 lock if you are using multiple V8 threads. | 237 // 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... |
| 274 inline void set_interrupt_limits(const ExecutionAccess& lock); | 275 inline void set_interrupt_limits(const ExecutionAccess& lock); |
| 275 | 276 |
| 276 // Reset limits to actual values. For example after handling interrupt. | 277 // Reset limits to actual values. For example after handling interrupt. |
| 277 // You should hold the ExecutionAccess lock when calling this method. | 278 // You should hold the ExecutionAccess lock when calling this method. |
| 278 inline void reset_limits(const ExecutionAccess& lock); | 279 inline void reset_limits(const ExecutionAccess& lock); |
| 279 | 280 |
| 280 // Enable or disable interrupts. | 281 // Enable or disable interrupts. |
| 281 void EnableInterrupts(); | 282 void EnableInterrupts(); |
| 282 void DisableInterrupts(); | 283 void DisableInterrupts(); |
| 283 | 284 |
| 284 #if V8_TARGET_ARCH_X64 | 285 #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_A64 |
| 285 static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe); | 286 static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe); |
| 286 static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8); | 287 static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8); |
| 287 #else | 288 #else |
| 288 static const uintptr_t kInterruptLimit = 0xfffffffe; | 289 static const uintptr_t kInterruptLimit = 0xfffffffe; |
| 289 static const uintptr_t kIllegalLimit = 0xfffffff8; | 290 static const uintptr_t kIllegalLimit = 0xfffffff8; |
| 290 #endif | 291 #endif |
| 291 | 292 |
| 292 class ThreadLocal { | 293 class ThreadLocal { |
| 293 public: | 294 public: |
| 294 ThreadLocal() { Clear(); } | 295 ThreadLocal() { Clear(); } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 friend class StackLimitCheck; | 331 friend class StackLimitCheck; |
| 331 friend class PostponeInterruptsScope; | 332 friend class PostponeInterruptsScope; |
| 332 | 333 |
| 333 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 334 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
| 334 }; | 335 }; |
| 335 | 336 |
| 336 | 337 |
| 337 } } // namespace v8::internal | 338 } } // namespace v8::internal |
| 338 | 339 |
| 339 #endif // V8_EXECUTION_H_ | 340 #endif // V8_EXECUTION_H_ |
| OLD | NEW |