1. implement stack limit in Function::call

2. implement stack limit in escprima
3. replace RELEASE_ASSERT_NOT_REACHED() with throwing parse error in esprima
4. impement size limit of String
5. expose config parameters in Escargot.h

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
seonghyun kim 2017-02-22 15:58:45 +09:00
commit f44a2a00a2
27 changed files with 180 additions and 73 deletions

View file

@ -43,7 +43,7 @@ Value Script::execute(ExecutionState& state, bool isEvalMode, bool needNewEnv, b
ExecutionContext ec(state.context(), prevEc, env, m_topCodeBlock->isStrict());
Value resultValue;
Value thisValue(state.context()->globalObject());
ExecutionState newState(state.context(), &ec, &resultValue);
ExecutionState newState(&state, &ec, &resultValue);
Value* registerFile = (Value*)alloca((m_topCodeBlock->byteCodeBlock()->m_requiredRegisterFileSizeInValueSize + 1) * sizeof(Value));
Value* stackStorage = registerFile + m_topCodeBlock->byteCodeBlock()->m_requiredRegisterFileSizeInValueSize;
@ -108,7 +108,7 @@ Value Script::executeLocal(ExecutionState& state, Value thisValue, bool isEvalMo
ExecutionContext ec(state.context(), state.executionContext(), newEnvironment, m_topCodeBlock->isStrict());
Value resultValue;
ExecutionState newState(state.context(), &ec, &resultValue);
ExecutionState newState(&state, &ec, &resultValue);
size_t stackStorageSize = m_topCodeBlock->identifierOnStackCount();
Value* registerFile = ALLOCA((m_topCodeBlock->byteCodeBlock()->m_requiredRegisterFileSizeInValueSize + stackStorageSize) * sizeof(Value), Value, state);