Optimize runtime performance

* Optimize ObjectStructurePropertyDescriptor
* Don't initialize inline storage of VectorWithInlineStorage
* Add Object::setPrototypeForIntrinsicObjectCreation for fast initialize
* Add ArrayObject::ArrayObject(ExecutionState& state, const uint64_t& size) for fast initialize
* Store stack-limit instead of stack-base
* Reduce size of ExecutionState
* Add fast version of Object::ownPropertyKeys for optimize Object.keys
* Add ValueVectorWithInlineStorage
* Remove some compiler warnings

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
seonghyun kim 2019-11-29 20:52:30 +09:00 committed by Hyukwoo Park
commit 53906a6d81
47 changed files with 507 additions and 430 deletions

View file

@ -45,9 +45,9 @@ ScriptFunctionObject::ScriptFunctionObject(ExecutionState& state, CodeBlock* cod
initStructureAndValues(state, isConstructor, isGenerator);
if (isGenerator) {
Object::setPrototype(state, state.context()->globalObject()->generator());
Object::setPrototypeForIntrinsicObjectCreation(state, state.context()->globalObject()->generator());
} else {
Object::setPrototype(state, state.context()->globalObject()->functionPrototype());
Object::setPrototypeForIntrinsicObjectCreation(state, state.context()->globalObject()->functionPrototype());
}
}
@ -109,12 +109,11 @@ NEVER_INLINE void ScriptFunctionObject::generateByteCodeBlock(ExecutionState& st
volatile int sp;
size_t currentStackBase = (size_t)&sp;
#ifdef STACK_GROWS_DOWN
size_t stackRemainApprox = STACK_LIMIT_FROM_BASE - (state.stackBase() - currentStackBase);
size_t stackRemainApprox = currentStackBase - state.stackLimit();
#else
size_t stackRemainApprox = STACK_LIMIT_FROM_BASE - (currentStackBase - state.stackBase());
size_t stackRemainApprox = state.stackLimit() - currentStackBase;
#endif
state.context()->scriptParser().generateFunctionByteCode(state, m_codeBlock->asInterpretedCodeBlock(), stackRemainApprox);
v.pushBack(m_codeBlock);