Optimize ScriptParser more (#70)

* Diet ScannerResult
* Use SourceStringView if possible for reducing memory usage

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
김승현/Tizen Platform Lab(SR)/Engineer/삼성전자 2018-05-04 13:44:02 +09:00 committed by 최영일/Tizen Platform Lab(SR)/Principal Engineer/삼성전자
commit ef57dc3400
13 changed files with 399 additions and 117 deletions

View file

@ -20,6 +20,7 @@
#include "Escargot.h"
#include "ScriptParser.h"
#include "runtime/Context.h"
#include "runtime/VMInstance.h"
#include "interpreter/ByteCode.h"
#include "parser/esprima_cpp/esprima.h"
#include "parser/ScriptParser.h"
@ -186,6 +187,7 @@ ScriptParser::ScriptParserResult ScriptParser::parse(StringView scriptSource, St
// GC_set_free_space_divisor(1);
try {
m_context->vmInstance()->m_parsedSourceCodes.push_back(scriptSource.string());
RefPtr<ProgramNode> program = esprima::parseProgram(m_context, scriptSource, nullptr, strictFromOutside, stackSizeRemain);
script = new Script(fileName, new StringView(scriptSource));