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 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 }; | 120 }; |
121 | 121 |
122 | 122 |
123 class ExecutionAccess; | 123 class ExecutionAccess; |
124 class PostponeInterruptsScope; | 124 class PostponeInterruptsScope; |
125 | 125 |
126 | 126 |
127 // StackGuard contains the handling of the limits that are used to limit the | 127 // StackGuard contains the handling of the limits that are used to limit the |
128 // number of nested invocations of JavaScript and the stack size used in each | 128 // number of nested invocations of JavaScript and the stack size used in each |
129 // invocation. | 129 // invocation. |
130 class StackGuard FINAL { | 130 class StackGuard final { |
131 public: | 131 public: |
132 // Pass the address beyond which the stack should not grow. The stack | 132 // Pass the address beyond which the stack should not grow. The stack |
133 // is assumed to grow downwards. | 133 // is assumed to grow downwards. |
134 void SetStackLimit(uintptr_t limit); | 134 void SetStackLimit(uintptr_t limit); |
135 | 135 |
136 // Threading support. | 136 // Threading support. |
137 char* ArchiveStackGuard(char* to); | 137 char* ArchiveStackGuard(char* to); |
138 char* RestoreStackGuard(char* from); | 138 char* RestoreStackGuard(char* from); |
139 static int ArchiveSpacePerThread() { return sizeof(ThreadLocal); } | 139 static int ArchiveSpacePerThread() { return sizeof(ThreadLocal); } |
140 void FreeThreadResources(); | 140 void FreeThreadResources(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe); | 225 static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe); |
226 static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8); | 226 static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8); |
227 #else | 227 #else |
228 static const uintptr_t kInterruptLimit = 0xfffffffe; | 228 static const uintptr_t kInterruptLimit = 0xfffffffe; |
229 static const uintptr_t kIllegalLimit = 0xfffffff8; | 229 static const uintptr_t kIllegalLimit = 0xfffffff8; |
230 #endif | 230 #endif |
231 | 231 |
232 void PushPostponeInterruptsScope(PostponeInterruptsScope* scope); | 232 void PushPostponeInterruptsScope(PostponeInterruptsScope* scope); |
233 void PopPostponeInterruptsScope(); | 233 void PopPostponeInterruptsScope(); |
234 | 234 |
235 class ThreadLocal FINAL { | 235 class ThreadLocal final { |
236 public: | 236 public: |
237 ThreadLocal() { Clear(); } | 237 ThreadLocal() { Clear(); } |
238 // You should hold the ExecutionAccess lock when you call Initialize or | 238 // You should hold the ExecutionAccess lock when you call Initialize or |
239 // Clear. | 239 // Clear. |
240 void Clear(); | 240 void Clear(); |
241 | 241 |
242 // Returns true if the heap's stack limits should be set, false if not. | 242 // Returns true if the heap's stack limits should be set, false if not. |
243 bool Initialize(Isolate* isolate); | 243 bool Initialize(Isolate* isolate); |
244 | 244 |
245 // The stack limit is split into a JavaScript and a C++ stack limit. These | 245 // The stack limit is split into a JavaScript and a C++ stack limit. These |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 friend class Isolate; | 286 friend class Isolate; |
287 friend class StackLimitCheck; | 287 friend class StackLimitCheck; |
288 friend class PostponeInterruptsScope; | 288 friend class PostponeInterruptsScope; |
289 | 289 |
290 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 290 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
291 }; | 291 }; |
292 | 292 |
293 } } // namespace v8::internal | 293 } } // namespace v8::internal |
294 | 294 |
295 #endif // V8_EXECUTION_H_ | 295 #endif // V8_EXECUTION_H_ |
OLD | NEW |