-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce ExecutionState size and compute stacklimit correctly #1275
Conversation
…th rareData) * This path reduce gc_malloc count for try-catch, with, generator, async function Signed-off-by: Seonghyun Kim <[email protected]>
20b18aa
to
16ffd24
Compare
9f802bf
to
82eb49d
Compare
src/runtime/ThreadLocal.cpp
Outdated
stackEndAddress = (char*)stackStartAddress + stackSize; | ||
#endif | ||
#endif | ||
stackSize = std::min(stackSize, (size_t)STACK_USAGE_LIMIT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that stackSize = std::min(stackSize, (size_t)STACK_USAGE_LIMIT);
is not used afterward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops my mistake
|
||
#ifdef STACK_GROWS_DOWN | ||
UNUSED_VARIABLE(stackEndAddress); | ||
g_stackLimit = reinterpret_cast<size_t>(stackStartAddress) + STACK_FREESPACE_FROM_LIMIT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This limit means that we only use STACK_FREESPACE_FROM_LIMIT
size for stack which is 256 KB,
Am I correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If real stack size is 8MB, we will use (8MB-STACK_FREESPACE_FROM_LIMIT).
remained space used by computing loc when stackoverflow is occured
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see!
context->m_needsExtendedExecutionState = true; | ||
} else { | ||
index = context->getRegister(); | ||
codeBlock->pushCode(LoadLiteral(ByteCodeLOC(m_loc.index), index, Value()), context, this->m_loc.index); | ||
codeBlock->pushCode(ReturnFunctionSlowCase(ByteCodeLOC(m_loc.index), index), context, this->m_loc.index); | ||
context->m_needsExtendedExecutionState = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this marking in return statement also necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReturnFunctionSlowCase opcode may needs ControlFlowRecord
* Compute stack limit correctly through pthread API or Windows internal API * Store stack limit in TLS(or global) not a VMInstance or ExecutionState Signed-off-by: Seonghyun Kim <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.