mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
1. reduce stack usage of ByteCodeInterpreter
2. remove memset warning from fillStack Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
7dfad6182e
commit
ca93d380e1
7 changed files with 222 additions and 179 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include "runtime/EnvironmentRecord.h"
|
||||
#include "runtime/ErrorObject.h"
|
||||
#include "runtime/SandBox.h"
|
||||
#include "util/Util.h"
|
||||
|
||||
namespace Escargot {
|
||||
|
||||
|
|
@ -44,7 +45,8 @@ Value Script::execute(ExecutionState& state, bool isEvalMode, bool needNewEnv, b
|
|||
ExecutionState newState(state.context(), &ec, &resultValue);
|
||||
|
||||
Value* registerFile = (Value*)alloca(m_topCodeBlock->byteCodeBlock()->m_requiredRegisterFileSizeInValueSize * sizeof(Value));
|
||||
ByteCodeInterpreter::interpret(newState, m_topCodeBlock, m_topCodeBlock->byteCodeBlock(), 0, registerFile, nullptr);
|
||||
clearStack<512>();
|
||||
ByteCodeInterpreter::interpret(newState, m_topCodeBlock->byteCodeBlock(), 0, registerFile, nullptr);
|
||||
|
||||
return resultValue;
|
||||
}
|
||||
|
|
@ -112,7 +114,8 @@ Value Script::executeLocal(ExecutionState& state, bool isEvalMode, bool needNewR
|
|||
}
|
||||
|
||||
Value* registerFile = (Value*)alloca(m_topCodeBlock->byteCodeBlock()->m_requiredRegisterFileSizeInValueSize * sizeof(Value));
|
||||
ByteCodeInterpreter::interpret(newState, m_topCodeBlock, m_topCodeBlock->byteCodeBlock(), 0, registerFile, stackStorage);
|
||||
clearStack<512>();
|
||||
ByteCodeInterpreter::interpret(newState, m_topCodeBlock->byteCodeBlock(), 0, registerFile, stackStorage);
|
||||
|
||||
return resultValue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue