Binding function object in interpreter and compute required stack size early

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
Seonghyun Kim 2022-03-21 17:01:59 +09:00 committed by Hyukwoo Park
commit ebf4756480
15 changed files with 105 additions and 56 deletions

View file

@ -61,13 +61,13 @@ protected:
ByteCodeBlock* blk = codeBlock->byteCodeBlock();
Context* ctx = codeBlock->context();
const size_t registerSize = blk->m_requiredRegisterFileSizeInValueSize;
const size_t registerSize = blk->m_requiredGeneralRegisterSizeInValueSize;
#if !defined(NDEBUG)
const size_t stackStorageSize = codeBlock->totalStackAllocatedVariableSize();
const size_t literalStorageSize = blk->m_numeralLiteralData.size();
ASSERT(codeBlock->isStrict() == isStrict);
ASSERT(blk->m_requiredRegisterFileSizeInValueSize + stackStorageSize + literalStorageSize <= registerFileSize);
ASSERT(blk->m_requiredGeneralRegisterSizeInValueSize + stackStorageSize + literalStorageSize <= registerFileSize);
#endif
// prepare env, ec
@ -95,9 +95,6 @@ protected:
}
}
// binding function name
stackStorage[1] = this;
if (shouldClearStack) {
const Value returnValue = ByteCodeInterpreter::interpret(&newState, blk, 0, registerFile);
clearStack<512>();