-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix inline caching of object set #1322
Conversation
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
495b189
to
8fbc1e8
Compare
if (nextSize > ESCARGOT_OBJECT_STRUCTURE_ACCESS_CACHE_BUILD_MIN_SIZE) { | ||
newObjectStructure = new ObjectStructureWithMap(nameIsIndexString, hasSymbol, hasEnumerableProperty, m_properties, newItem); | ||
} else if (nextSize > ESCARGOT_OBJECT_STRUCTURE_TRANSITION_MODE_MAX_SIZE || nameIsIndexString) { | ||
// ObjectStructureWithTransition cannot directly convert to ObjectStructureWithMap by just adding one property | ||
ASSERT(nextSize < ESCARGOT_OBJECT_STRUCTURE_ACCESS_CACHE_BUILD_MIN_SIZE); | ||
if (nextSize > ESCARGOT_OBJECT_STRUCTURE_TRANSITION_MODE_MAX_SIZE || nameIsIndexString) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ObjectStructureWithTransition
cannot directly convert to ObjectStructureWithMap by just adding one property,
So I removed it.
// finally, insert a valid new cache item at the end | ||
// because an exception could occur ahead which makes insertion of cache item invalid | ||
if (inlineCache->m_cache.size() > SetObjectInlineCacheData::MaxCacheCount) { | ||
for (size_t i = inlineCache->m_cache.size() - 1; i > 0; i--) { | ||
inlineCache->m_cache[i] = inlineCache->m_cache[i - 1]; | ||
} | ||
} else { | ||
inlineCache->m_cache.insert(0, SetObjectInlineCacheData()); | ||
block->m_inlineCacheDataSize += sizeof(SetObjectInlineCacheData); | ||
currentCodeSizeTotal += sizeof(SetObjectInlineCacheData); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a new cache item at the end of setObjectPreComputedCaseOperationSlowCase
operation because exceptions could arise in the middle of its execution, which may lead to insertion of an imperfact cache item.
* fix inline caching to insert a new cache item after validation * refactor set inline caching method Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
No description provided.