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:
seonghyun kim 2017-01-25 19:15:05 +09:00
commit ca93d380e1
7 changed files with 222 additions and 179 deletions

View file

@ -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;
}