| 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/handles.h" | 8 #include "src/handles.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 | 12 |
| 13 class Execution V8_FINAL : public AllStatic { | 13 class Execution FINAL : public AllStatic { |
| 14 public: | 14 public: |
| 15 // Call a function, the caller supplies a receiver and an array | 15 // Call a function, the caller supplies a receiver and an array |
| 16 // of arguments. Arguments are Object* type. After function returns, | 16 // of arguments. Arguments are Object* type. After function returns, |
| 17 // pointers in 'args' might be invalid. | 17 // pointers in 'args' might be invalid. |
| 18 // | 18 // |
| 19 // *pending_exception tells whether the invoke resulted in | 19 // *pending_exception tells whether the invoke resulted in |
| 20 // a pending exception. | 20 // a pending exception. |
| 21 // | 21 // |
| 22 // When convert_receiver is set, and the receiver is not an object, | 22 // When convert_receiver is set, and the receiver is not an object, |
| 23 // and the function called is not in strict mode, receiver is converted to | 23 // and the function called is not in strict mode, receiver is converted to |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 | 123 |
| 124 class ExecutionAccess; | 124 class ExecutionAccess; |
| 125 class PostponeInterruptsScope; | 125 class PostponeInterruptsScope; |
| 126 | 126 |
| 127 | 127 |
| 128 // StackGuard contains the handling of the limits that are used to limit the | 128 // StackGuard contains the handling of the limits that are used to limit the |
| 129 // number of nested invocations of JavaScript and the stack size used in each | 129 // number of nested invocations of JavaScript and the stack size used in each |
| 130 // invocation. | 130 // invocation. |
| 131 class StackGuard V8_FINAL { | 131 class StackGuard FINAL { |
| 132 public: | 132 public: |
| 133 // Pass the address beyond which the stack should not grow. The stack | 133 // Pass the address beyond which the stack should not grow. The stack |
| 134 // is assumed to grow downwards. | 134 // is assumed to grow downwards. |
| 135 void SetStackLimit(uintptr_t limit); | 135 void SetStackLimit(uintptr_t limit); |
| 136 | 136 |
| 137 // Threading support. | 137 // Threading support. |
| 138 char* ArchiveStackGuard(char* to); | 138 char* ArchiveStackGuard(char* to); |
| 139 char* RestoreStackGuard(char* from); | 139 char* RestoreStackGuard(char* from); |
| 140 static int ArchiveSpacePerThread() { return sizeof(ThreadLocal); } | 140 static int ArchiveSpacePerThread() { return sizeof(ThreadLocal); } |
| 141 void FreeThreadResources(); | 141 void FreeThreadResources(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe); | 226 static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe); |
| 227 static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8); | 227 static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8); |
| 228 #else | 228 #else |
| 229 static const uintptr_t kInterruptLimit = 0xfffffffe; | 229 static const uintptr_t kInterruptLimit = 0xfffffffe; |
| 230 static const uintptr_t kIllegalLimit = 0xfffffff8; | 230 static const uintptr_t kIllegalLimit = 0xfffffff8; |
| 231 #endif | 231 #endif |
| 232 | 232 |
| 233 void PushPostponeInterruptsScope(PostponeInterruptsScope* scope); | 233 void PushPostponeInterruptsScope(PostponeInterruptsScope* scope); |
| 234 void PopPostponeInterruptsScope(); | 234 void PopPostponeInterruptsScope(); |
| 235 | 235 |
| 236 class ThreadLocal V8_FINAL { | 236 class ThreadLocal FINAL { |
| 237 public: | 237 public: |
| 238 ThreadLocal() { Clear(); } | 238 ThreadLocal() { Clear(); } |
| 239 // You should hold the ExecutionAccess lock when you call Initialize or | 239 // You should hold the ExecutionAccess lock when you call Initialize or |
| 240 // Clear. | 240 // Clear. |
| 241 void Clear(); | 241 void Clear(); |
| 242 | 242 |
| 243 // Returns true if the heap's stack limits should be set, false if not. | 243 // Returns true if the heap's stack limits should be set, false if not. |
| 244 bool Initialize(Isolate* isolate); | 244 bool Initialize(Isolate* isolate); |
| 245 | 245 |
| 246 // The stack limit is split into a JavaScript and a C++ stack limit. These | 246 // The stack limit is split into a JavaScript and a C++ stack limit. These |
| (...skipping 22 matching lines...) Expand all Loading... |
| 269 friend class Isolate; | 269 friend class Isolate; |
| 270 friend class StackLimitCheck; | 270 friend class StackLimitCheck; |
| 271 friend class PostponeInterruptsScope; | 271 friend class PostponeInterruptsScope; |
| 272 | 272 |
| 273 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 273 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
| 274 }; | 274 }; |
| 275 | 275 |
| 276 } } // namespace v8::internal | 276 } } // namespace v8::internal |
| 277 | 277 |
| 278 #endif // V8_EXECUTION_H_ | 278 #endif // V8_EXECUTION_H_ |
| OLD | NEW |