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/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
10 #include "src/handles.h" | 10 #include "src/handles.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 // StackGuard contains the handling of the limits that are used to limit the | 130 // StackGuard contains the handling of the limits that are used to limit the |
131 // number of nested invocations of JavaScript and the stack size used in each | 131 // number of nested invocations of JavaScript and the stack size used in each |
132 // invocation. | 132 // invocation. |
133 class StackGuard final { | 133 class StackGuard final { |
134 public: | 134 public: |
135 // Pass the address beyond which the stack should not grow. The stack | 135 // Pass the address beyond which the stack should not grow. The stack |
136 // is assumed to grow downwards. | 136 // is assumed to grow downwards. |
137 void SetStackLimit(uintptr_t limit); | 137 void SetStackLimit(uintptr_t limit); |
138 | 138 |
| 139 // The simulator uses a separate JS stack. Limits on the JS stack might have |
| 140 // to be adjusted in order to reflect overflows of the C stack, because we |
| 141 // cannot rely on the interleaving of frames on the simulator. |
| 142 void AdjustStackLimitForSimulator(); |
| 143 |
139 // Threading support. | 144 // Threading support. |
140 char* ArchiveStackGuard(char* to); | 145 char* ArchiveStackGuard(char* to); |
141 char* RestoreStackGuard(char* from); | 146 char* RestoreStackGuard(char* from); |
142 static int ArchiveSpacePerThread() { return sizeof(ThreadLocal); } | 147 static int ArchiveSpacePerThread() { return sizeof(ThreadLocal); } |
143 void FreeThreadResources(); | 148 void FreeThreadResources(); |
144 // Sets up the default stack guard for this thread if it has not | 149 // Sets up the default stack guard for this thread if it has not |
145 // already been set up. | 150 // already been set up. |
146 void InitThread(const ExecutionAccess& lock); | 151 void InitThread(const ExecutionAccess& lock); |
147 // Clears the stack guard for this thread so it does not look as if | 152 // Clears the stack guard for this thread so it does not look as if |
148 // it has been set up. | 153 // it has been set up. |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 friend class Isolate; | 294 friend class Isolate; |
290 friend class StackLimitCheck; | 295 friend class StackLimitCheck; |
291 friend class PostponeInterruptsScope; | 296 friend class PostponeInterruptsScope; |
292 | 297 |
293 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 298 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
294 }; | 299 }; |
295 | 300 |
296 } } // namespace v8::internal | 301 } } // namespace v8::internal |
297 | 302 |
298 #endif // V8_EXECUTION_H_ | 303 #endif // V8_EXECUTION_H_ |
OLD | NEW |