mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
1. optimze write, read global object in interpreter
2. optimze write, read object in interpreter Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
015c2bd0b5
commit
adc1b3cea1
11 changed files with 126 additions and 57 deletions
|
|
@ -186,6 +186,29 @@ bool ArrayObject::setArrayLength(ExecutionState& state, const uint64_t& newLengt
|
|||
}
|
||||
}
|
||||
|
||||
ObjectGetResult ArrayObject::getFastModeValue(ExecutionState& state, const ObjectPropertyName& P)
|
||||
{
|
||||
if (LIKELY(isFastModeArray())) {
|
||||
uint64_t idx;
|
||||
if (LIKELY(P.isUIntType())) {
|
||||
idx = P.uintValue();
|
||||
} else {
|
||||
idx = P.string(state)->tryToUseAsArrayIndex();
|
||||
}
|
||||
if (LIKELY(idx != Value::InvalidArrayIndexValue)) {
|
||||
ASSERT(m_fastModeData.size() == getArrayLength(state));
|
||||
if (LIKELY(idx < m_fastModeData.size())) {
|
||||
Value v = m_fastModeData[idx];
|
||||
if (LIKELY(!v.isEmpty())) {
|
||||
return ObjectGetResult(v, true, true, true);
|
||||
}
|
||||
return ObjectGetResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
return ObjectGetResult();
|
||||
}
|
||||
|
||||
bool ArrayObject::setFastModeValue(ExecutionState& state, const ObjectPropertyName& P, const ObjectPropertyDescriptor& desc)
|
||||
{
|
||||
if (LIKELY(isFastModeArray())) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue