diff options
author | 2023-12-14 15:21:48 +0000 | |
---|---|---|
committer | 2024-09-24 15:06:54 +0000 | |
commit | e99f7e7591e3c436d33317a7fc671e96cdf98f24 (patch) | |
tree | bd90931760b4673455626cc1e82d95002d1cde4d /compiler/optimizing/intrinsics_utils.h | |
parent | 63b8399f3f144769260d93a7a985233e5ac5b910 (diff) |
Add stack type
Add a stack type enum to allow thread stack methods to determine
which stack they should operate on. This stack type is used to
get/set the tlsPtr_.stack_<end|begin> variables. Note: these getters/
setters should always be used instead of directly using the tlsPtr_
stack variables so that both native and simulated stacks can be
maintained.
An additional constexpr is introduced: kQuickStackType which follows
the type of the stack used for executing quick code. This is used for
functions operating on the quick stack, e.g:
artThrowStackOverflowFromCode which will operate on the simulated
stack when running the simulator and the native stack when not
running the simulator.
One semantic change is also made to SetStackEndForStackOverflow by
refactoring the call to UnprotectStack out and into
SetStackEndForStackOverflow's only caller ThrowStackOverflowError.
This is done because:
- Semantically it makes sense that "SetStackEnd" should not also be
implicitly unprotecting the stack.
- It makes the function more consistent with the semantics of
ResetDefaultStackEnd.
- It simplifies making SetStackEndForStackOverflow into a template as
it can be put into thread.h with no dependency on Runtime::Current.
This patch aims to refactor thread stack code to allow for other
types of stacks (e.g: simulated) to be better supported in future.
Subsequent patches will utilise this refactor to e.g: install thread
protections on a simulated stack.
Test: ./test.py --host --target
Test: 018-stack-overflow.
Change-Id: I77c4f2a74d4226277533e1088767a1b0153c184f
Diffstat (limited to 'compiler/optimizing/intrinsics_utils.h')
0 files changed, 0 insertions, 0 deletions