diff --git a/ecmascript/interpreter/interpreter-inl.h b/ecmascript/interpreter/interpreter-inl.h index 9a738af112c7cc5f80d5c93367ea90743bae0499..37e468bbcd20a941938f684e22755e115d183cc1 100644 --- a/ecmascript/interpreter/interpreter-inl.h +++ b/ecmascript/interpreter/interpreter-inl.h @@ -381,7 +381,8 @@ JSTaggedValue EcmaInterpreter::ExecuteNative(EcmaRuntimeCallInfo *info) JSTaggedType *sp = const_cast(thread->GetCurrentSPFrame()); int32_t actualNumArgs = info->GetArgsNumber(); JSTaggedType *newSp = sp - INTERPRETER_ENTRY_FRAME_STATE_SIZE - 1 - actualNumArgs - RESERVED_CALL_ARGCOUNT; - if (thread->DoStackOverflowCheck(newSp) || thread->HasPendingException()) { + if (thread->DoStackOverflowCheck(newSp - actualNumArgs - RESERVED_CALL_ARGCOUNT) || + thread->HasPendingException()) { return JSTaggedValue::Undefined(); } for (int i = actualNumArgs - 1; i >= 0; i--) { @@ -442,7 +443,8 @@ JSTaggedValue EcmaInterpreter::Execute(EcmaRuntimeCallInfo *info) int32_t actualNumArgs = info->GetArgsNumber(); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) newSp = newSp - INTERPRETER_ENTRY_FRAME_STATE_SIZE - 1 - actualNumArgs - RESERVED_CALL_ARGCOUNT; - if (thread->DoStackOverflowCheck(newSp) || thread->HasPendingException()) { + if (thread->DoStackOverflowCheck(newSp - actualNumArgs - RESERVED_CALL_ARGCOUNT) || + thread->HasPendingException()) { return JSTaggedValue::Undefined(); } diff --git a/ecmascript/interpreter/interpreter_assembly.cpp b/ecmascript/interpreter/interpreter_assembly.cpp index 4cfec84368de996eb3c05edcc8b556b070521f4d..a108034c1baf8366595347913c99f762321674e4 100644 --- a/ecmascript/interpreter/interpreter_assembly.cpp +++ b/ecmascript/interpreter/interpreter_assembly.cpp @@ -455,7 +455,8 @@ JSTaggedValue InterpreterAssembly::ExecuteNative(EcmaRuntimeCallInfo *info) JSTaggedType *sp = const_cast(thread->GetCurrentSPFrame()); int32_t actualNumArgs = info->GetArgsNumber(); JSTaggedType *newSp = sp - INTERPRETER_ENTRY_FRAME_STATE_SIZE - 1 - actualNumArgs - RESERVED_CALL_ARGCOUNT; - if (thread->DoStackOverflowCheck(newSp) || thread->HasPendingException()) { + if (thread->DoStackOverflowCheck(newSp - actualNumArgs - RESERVED_CALL_ARGCOUNT) || + thread->HasPendingException()) { return JSTaggedValue::Undefined(); } for (int i = actualNumArgs - 1; i >= 0; i--) { @@ -515,7 +516,8 @@ JSTaggedValue InterpreterAssembly::Execute(EcmaRuntimeCallInfo *info) int32_t actualNumArgs = info->GetArgsNumber(); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) newSp = newSp - INTERPRETER_ENTRY_FRAME_STATE_SIZE - 1 - actualNumArgs - RESERVED_CALL_ARGCOUNT; - if (thread->DoStackOverflowCheck(newSp) || thread->HasPendingException()) { + if (thread->DoStackOverflowCheck(newSp - actualNumArgs - RESERVED_CALL_ARGCOUNT) || + thread->HasPendingException()) { return JSTaggedValue::Undefined(); } diff --git a/ecmascript/js_thread.h b/ecmascript/js_thread.h index 9dd82ba83418383304dbf5ed74be04024e247d28..a9dbd11931516242acfd28757443e1a0360600d6 100644 --- a/ecmascript/js_thread.h +++ b/ecmascript/js_thread.h @@ -471,7 +471,7 @@ private: void DumpStack() DUMP_API_ATTR; - static constexpr uint32_t MAX_STACK_SIZE = 128 * 1024; + static constexpr uint32_t MAX_STACK_SIZE = 512 * 1024; static const uint32_t NODE_BLOCK_SIZE_LOG2 = 10; static const uint32_t NODE_BLOCK_SIZE = 1U << NODE_BLOCK_SIZE_LOG2; static constexpr int32_t MIN_HANDLE_STORAGE_SIZE = 2;