mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Optmize escargot (#454)
* Don't allocate new StringView on parser if possible * Store esprima::Context::firstCoverInitializedNameError as pointer. it can reduce copy cost on esprima::*CoverGrammar * Make Script as reexcutable if possible * Don't save parsed source codes - Remove SourceStringView - When create AtomicString from StringView, we should make new string data instead of reference StringView * Reduce size of StringBufferAccessData * Fix crash in toString of FunctionObject. Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
44e90a6b91
commit
03ac100d7f
17 changed files with 163 additions and 255 deletions
|
|
@ -206,11 +206,10 @@ ScriptParser::InitializeScriptResult ScriptParser::initializeScript(StringView s
|
|||
|
||||
// Parsing
|
||||
try {
|
||||
m_context->vmInstance()->m_parsedSourceCodes.push_back(scriptSource.string());
|
||||
InterpretedCodeBlock* topCodeBlock = nullptr;
|
||||
RefPtr<ProgramNode> programNode = esprima::parseProgram(m_context, scriptSource, isModule, strictFromOutside, inWith, stackSizeRemain, allowSC, allowSP);
|
||||
|
||||
Script* script = new Script(fileName, new StringView(scriptSource), programNode->moduleData());
|
||||
Script* script = new Script(fileName, new StringView(scriptSource), programNode->moduleData(), !parentCodeBlock);
|
||||
if (parentCodeBlock) {
|
||||
programNode->scopeContext()->m_hasEval = parentCodeBlock->hasEval();
|
||||
programNode->scopeContext()->m_hasWith = parentCodeBlock->hasWith();
|
||||
|
|
@ -249,7 +248,6 @@ ScriptParser::InitializeScriptResult ScriptParser::initializeScript(StringView s
|
|||
return result;
|
||||
|
||||
} catch (esprima::Error& orgError) {
|
||||
m_context->vmInstance()->m_parsedSourceCodes.pop_back();
|
||||
GC_enable();
|
||||
|
||||
ScriptParser::InitializeScriptResult result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue