mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
Optmize ByteCodeInterpreter::setObjectPreComputedCaseOperationCacheMiss function (#333)
we can avoid searching propery name on ObjectStructure Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
2a54ab5e02
commit
4de5ab5d2e
1 changed files with 8 additions and 3 deletions
|
|
@ -1888,12 +1888,17 @@ NEVER_INLINE void ByteCodeInterpreter::setObjectPreComputedCaseOperationCacheMis
|
|||
|
||||
obj->setOwnPropertyThrowsExceptionWhenStrictMode(state, idx, value, willBeObject);
|
||||
// Don't update the inline cache if the property is removed by a setter function.
|
||||
if (UNLIKELY(obj->structure()->findProperty(state, name) == SIZE_MAX)) {
|
||||
/* example code
|
||||
var o = { set foo (a) { var a = delete o.foo } };
|
||||
o.foo = 0;
|
||||
*/
|
||||
if (UNLIKELY(idx >= obj->structure()->propertyCount())) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto desc = obj->structure()->readProperty(state, idx).m_descriptor;
|
||||
if (desc.isPlainDataProperty() && desc.isWritable()) {
|
||||
const auto& propertyData = obj->structure()->readProperty(state, idx);
|
||||
const auto& desc = propertyData.m_descriptor;
|
||||
if (propertyData.m_propertyName == name && desc.isPlainDataProperty() && desc.isWritable()) {
|
||||
inlineCache.m_cachedIndex = idx;
|
||||
inlineCache.m_cachedhiddenClassChain.push_back(newItem);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue