mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
Improve accessing TypedArray Performance
Add Object::getIndexedPropertyValue method for achive that the function removes redundant creation of ObjectGetResult. And Improve TypedArray object reading performance through better implementation Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
467ca4708f
commit
71a6afeaae
9 changed files with 90 additions and 27 deletions
|
|
@ -114,6 +114,18 @@ ObjectGetResult StringObject::getIndexedProperty(ExecutionState& state, const Va
|
|||
return get(state, ObjectPropertyName(state, property), receiver);
|
||||
}
|
||||
|
||||
Value StringObject::getIndexedPropertyValue(ExecutionState& state, const Value& property, const Value& receiver)
|
||||
{
|
||||
size_t idx = property.tryToUseAsIndexProperty(state);
|
||||
if (idx != Value::InvalidIndexPropertyValue) {
|
||||
size_t strLen = m_primitiveValue->length();
|
||||
if (LIKELY(idx < strLen)) {
|
||||
return state.context()->staticStrings().charCodeToString(m_primitiveValue->charAt(idx));
|
||||
}
|
||||
}
|
||||
return get(state, ObjectPropertyName(state, property), receiver).value(state, receiver);
|
||||
}
|
||||
|
||||
ObjectHasPropertyResult StringObject::hasIndexedProperty(ExecutionState& state, const Value& propertyName)
|
||||
{
|
||||
size_t idx = propertyName.tryToUseAsIndexProperty(state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue