Remove c++ try-catch statement in interpreter function. (#387)

* separate ByteCodeGenerator::m_tryStatementCount into multiple items for implementing es6 generator

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
Patrick Kim 2019-08-23 16:55:34 +09:00 committed by Hyukwoo Park
commit 66bd235740
30 changed files with 1466 additions and 1376 deletions

View file

@ -176,13 +176,15 @@ Value Script::executeLocal(ExecutionState& state, Value thisValue, InterpretedCo
}
}
if (fnRecord->hasBinding(newState, arguments).m_index == SIZE_MAX && state.callee()->isScriptFunctionObject()) {
FunctionObject* callee = state.resolveCallee();
if (fnRecord->hasBinding(newState, arguments).m_index == SIZE_MAX && callee->isScriptFunctionObject()) {
// FIXME check if formal parameters does not contain a rest parameter, any binding patterns, or any initializers.
bool isMapped = !state.callee()->codeBlock()->hasArgumentInitializers() && !inStrict;
state.callee()->asScriptFunctionObject()->generateArgumentsObject(newState, state.argc(), state.argv(), fnRecord, nullptr, isMapped);
bool isMapped = !callee->codeBlock()->hasArgumentInitializers() && !inStrict;
callee->asScriptFunctionObject()->generateArgumentsObject(newState, state.argc(), state.argv(), fnRecord, nullptr, isMapped);
}
}
newState.ensureRareData()->m_codeBlock = m_topCodeBlock;
Value resultValue = ByteCodeInterpreter::interpret(newState, m_topCodeBlock->byteCodeBlock(), 0, registerFile);
clearStack<512>();