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:
Patrick Kim 2019-10-11 15:32:04 +09:00 committed by Hyukwoo Park
commit 03ac100d7f
17 changed files with 163 additions and 255 deletions

View file

@ -448,8 +448,11 @@ Value Script::executeModule(ExecutionState& state, Optional<Script*> referrer)
Value Script::execute(ExecutionState& state, bool isExecuteOnEvalFunction, bool inStrictMode)
{
if (UNLIKELY(isExecuted())) {
ESCARGOT_LOG_ERROR("You cannot re-execute Script object...");
RELEASE_ASSERT_NOT_REACHED();
if (!m_canExecuteAgain) {
ESCARGOT_LOG_ERROR("You cannot re-execute is type of Script object");
RELEASE_ASSERT_NOT_REACHED();
}
m_topCodeBlock = state.context()->scriptParser().initializeScript(m_sourceCode, m_src, m_moduleData).script->m_topCodeBlock;
}
if (isModule()) {