Improve script parsing performance (#23)

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
김승현/Web Platform Lab(S/W센터)/Engineer/삼성전자 2017-10-24 15:09:40 +09:00 committed by 최영일/Web Platform Lab(S/W센터)/Principal Engineer/삼성전자
commit 55ee12d6b0

View file

@ -176,6 +176,10 @@ ScriptParser::ScriptParserResult ScriptParser::parse(StringView scriptSource, St
{
Script* script = nullptr;
ScriptParseError* error = nullptr;
int orgFreeSpaceDivisor = GC_get_free_space_divisor();
GC_set_free_space_divisor(1);
try {
ProgramNode* program = esprima::parseProgram(m_context, scriptSource, nullptr, strictFromOutside, stackSizeRemain);
@ -260,6 +264,8 @@ ScriptParser::ScriptParserResult ScriptParser::parse(StringView scriptSource, St
delete orgError;
}
GC_set_free_space_divisor(orgFreeSpaceDivisor);
ScriptParser::ScriptParserResult result(script, error);
return result;
}