-
Notifications
You must be signed in to change notification settings - Fork 651
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Outline StackOverflowGuard::isStackOverflowingSlowPath
Summary: The slowpath should be defined out of line. Reviewed By: avp Differential Revision: D66546965 fbshipit-source-id: 218d907cd8259bbdf4772ff2f000ea87afb6d5e7
- Loading branch information
1 parent
b275bde
commit 68529da
Showing
3 changed files
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "hermes/Support/StackOverflowGuard.h" | ||
#include "hermes/Support/OSCompat.h" | ||
|
||
namespace hermes { | ||
|
||
#ifdef HERMES_CHECK_NATIVE_STACK | ||
|
||
bool StackOverflowGuard::isStackOverflowingSlowPath() { | ||
auto [highPtr, size] = oscompat::thread_stack_bounds(nativeStackGap); | ||
nativeStackHigh = (const char *)highPtr; | ||
nativeStackSize = size; | ||
return LLVM_UNLIKELY( | ||
(uintptr_t)nativeStackHigh - (uintptr_t)__builtin_frame_address(0) > | ||
nativeStackSize); | ||
} | ||
|
||
#endif | ||
|
||
} // namespace hermes |