| Index: src/execution.h
|
| diff --git a/src/execution.h b/src/execution.h
|
| index 4cdfd2be6a1391ff2c6ecd8de32804bf516b91b1..36b74e70722da6647b050a85112341d5fcb3aa60 100644
|
| --- a/src/execution.h
|
| +++ b/src/execution.h
|
| @@ -159,6 +159,7 @@ class StackGuard BASE_EMBEDDED {
|
| static char* ArchiveStackGuard(char* to);
|
| static char* RestoreStackGuard(char* from);
|
| static int ArchiveSpacePerThread();
|
| + static void InitThread(const ExecutionAccess& lock);
|
|
|
| static bool IsStackOverflow();
|
| static bool IsPreempted();
|
| @@ -190,11 +191,26 @@ class StackGuard BASE_EMBEDDED {
|
| return thread_local_.climit_;
|
| }
|
|
|
| - // You should hold the ExecutionAccess lock when calling this method.
|
| - static void set_limits(uintptr_t value, const ExecutionAccess& lock) {
|
| - Heap::SetStackLimit(value);
|
| - thread_local_.jslimit_ = value;
|
| - thread_local_.climit_ = value;
|
| + // Sets the JavaScript and C stack limits, and updates the stack
|
| + // limit in the heap. You should hold the ExecutionAccess lock when
|
| + // calling this method.
|
| + static void set_limits(uintptr_t jslimit, uintptr_t climit,
|
| + const ExecutionAccess& lock) {
|
| + Heap::SetStackLimit(jslimit);
|
| + thread_local_.jslimit_ = jslimit;
|
| + thread_local_.climit_ = climit;
|
| + }
|
| +
|
| + // You should hold the ExecutionAccess lock when calling this
|
| + // method.
|
| + static void set_illegal_limit(const ExecutionAccess& lock) {
|
| + set_limits(kIllegalLimit, kIllegalLimit, lock);
|
| + }
|
| +
|
| + // You should hold the ExecutionAccess lock when calling this
|
| + // method.
|
| + static void set_interrupt_limit(const ExecutionAccess& lock) {
|
| + set_limits(kInterruptLimit, kInterruptLimit, lock);
|
| }
|
|
|
| // Reset limits to initial values. For example after handling interrupt.
|
| @@ -202,11 +218,10 @@ class StackGuard BASE_EMBEDDED {
|
| static void reset_limits(const ExecutionAccess& lock) {
|
| if (thread_local_.nesting_ == 0) {
|
| // No limits have been set yet.
|
| - set_limits(kIllegalLimit, lock);
|
| + set_illegal_limit(lock);
|
| } else {
|
| - thread_local_.jslimit_ = thread_local_.initial_jslimit_;
|
| - Heap::SetStackLimit(thread_local_.jslimit_);
|
| - thread_local_.climit_ = thread_local_.initial_climit_;
|
| + set_limits(thread_local_.initial_jslimit_, thread_local_.initial_climit_,
|
| + lock);
|
| }
|
| }
|
|
|
|
|