mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Revise function call processes (#347)
* Revise [[call]], [[construct]] as described in spec
* Remove m_homeObject in FunctionObject.
* Implement ScriptClass{Constructor, Method}FunctionObject
this subclass is used for saving [[homeObject]] and implement [[call]], [[consturct]]
* Add more(NewTargetBinder, ReturnValueBinder) into FunctionObjectProcessCallGenerator
* Remove feCounter in ByteCodeGenerationProcess. in ES6, function expression order & evaluation order can differ
* Add CallSuper ByteCode for interpret `super()` in class constructor
* Remove isOngoingSuperCall in ExecutionState
* Remove BuiltinFunctionObject. that was unnecessary
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
467841c5df
commit
43f442c560
71 changed files with 1371 additions and 948 deletions
|
|
@ -72,7 +72,6 @@ InterpretedCodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context*
|
|||
}
|
||||
|
||||
AtomicString arguments = ctx->staticStrings().arguments;
|
||||
AtomicString stringThis = ctx->staticStrings().stringThis;
|
||||
|
||||
for (size_t i = 0; i < scopeCtx->m_childBlockScopes.size(); i++) {
|
||||
for (size_t j = 0; j < scopeCtx->m_childBlockScopes[i]->m_usingNames.size(); j++) {
|
||||
|
|
@ -100,14 +99,6 @@ InterpretedCodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context*
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if (uname == stringThis) {
|
||||
ASSERT(codeBlock->isArrowFunctionExpression());
|
||||
if (!codeBlock->parentCodeBlock()->isGlobalScopeCodeBlock()) {
|
||||
codeBlock->parentCodeBlock()->captureThis();
|
||||
codeBlock->setNeedToLoadThisValue();
|
||||
codeBlock->markHeapAllocatedEnvironmentFromHere();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
bool usingNameIsResolvedOnCompileTime = false;
|
||||
|
|
@ -196,6 +187,8 @@ void ScriptParser::generateProgramCodeBlock(ExecutionState& state, StringView sc
|
|||
programNode->scopeContext()->m_hasYield = parentCodeBlock->hasYield();
|
||||
programNode->scopeContext()->m_isClassConstructor = parentCodeBlock->isClassConstructor();
|
||||
programNode->scopeContext()->m_isDerivedClassConstructor = parentCodeBlock->isDerivedClassConstructor();
|
||||
programNode->scopeContext()->m_isClassMethod = parentCodeBlock->isClassMethod();
|
||||
programNode->scopeContext()->m_isClassStaticMethod = parentCodeBlock->isClassStaticMethod();
|
||||
topCodeBlock = generateCodeBlockTreeFromASTWalker(m_context, scriptSource, script, programNode->scopeContext(), parentCodeBlock, isEvalMode, isEvalCodeInFunction);
|
||||
} else {
|
||||
topCodeBlock = generateCodeBlockTreeFromAST(m_context, scriptSource, script, programNode.get(), isEvalMode, isEvalCodeInFunction);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue