mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
Improve script parsing performance (#23)
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
6f0ac74c75
commit
55ee12d6b0
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue