1. add CodeBlock::m_hasArgumentsBindingInParameterOrChildFD for boost FunctionObject::call performance

- hasArgumentsBindingInParameterOrChildFD is computed every function calling before
2. computing ExtendedNodeLOC bug with global CodeBlock when source code has comment at the front
3. add default object structor for arguments object
4. implement Object::getIndexedProperty, Object::setIndexedProperty
5. use SmallValueVector in Env record instead of ValueVector

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
seonghyun kim 2017-02-06 20:43:52 +09:00 committed by Young-il Choi
commit e305e378cb
22 changed files with 264 additions and 112 deletions

View file

@ -18,7 +18,7 @@ CodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context* ctx, String
CodeBlock* codeBlock;
if (parentCodeBlock == nullptr) {
// globalBlock
codeBlock = new CodeBlock(ctx, script, source, scopeCtx->m_isStrict, scopeCtx->m_locStart, scopeCtx->m_names,
codeBlock = new CodeBlock(ctx, script, source, scopeCtx->m_isStrict, ExtendedNodeLOC(1, 1, 0), scopeCtx->m_names,
(CodeBlock::CodeBlockInitFlag)((scopeCtx->m_hasEval ? CodeBlock::CodeBlockHasEval : 0)
| (scopeCtx->m_hasWith ? CodeBlock::CodeBlockHasWith : 0)
| (scopeCtx->m_hasCatch ? CodeBlock::CodeBlockHasCatch : 0)
@ -90,6 +90,21 @@ CodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context* ctx, String
}
}
}
for (size_t i = 0; i < b->functionParameters().size(); i++) {
if (UNLIKELY(b->functionParameters()[i] == arguments)) {
b->m_hasArgumentsBindingInParameterOrChildFD = true;
break;
}
}
for (size_t i = 0; i < b->childBlocks().size(); i++) {
CodeBlock* cb = b->childBlocks()[i];
if (cb->isFunctionDeclaration() && cb->functionName() == arguments) {
b->m_hasArgumentsBindingInParameterOrChildFD = true;
break;
}
}
}
} else if (!codeBlock->hasName(uname)) {
CodeBlock* c = codeBlock->parentCodeBlock();