mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
1. diet native getter, setter on Object
2. diet ByteCode 3. use get, setIndexedProperty in ByteCodeInterpreter 4. implement get, setIndexedProperty for typed array 5. move implemention of CallNativeFunctionOpcode to FunctionObject::call 6. remove m_contentLength, m_has8BitContent in RopeString 7. optimize ByteCodeInterpreter::getObjectPrecomputedCaseOperation, setObjectPrecomputedCaseOperation 8. diet Arguments object Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
e305e378cb
commit
0f1cc8999c
25 changed files with 282 additions and 265 deletions
|
|
@ -73,4 +73,21 @@ void StringObject::enumeration(ExecutionState& state, bool (*callback)(Execution
|
|||
}
|
||||
Object::enumeration(state, callback, data);
|
||||
}
|
||||
|
||||
ObjectGetResult StringObject::getIndexedProperty(ExecutionState& state, const Value& property)
|
||||
{
|
||||
Value::ValueIndex idx;
|
||||
if (LIKELY(property.isUInt32())) {
|
||||
idx = property.asUInt32();
|
||||
} else {
|
||||
idx = property.toString(state)->tryToUseAsIndex();
|
||||
}
|
||||
if (idx != Value::InvalidIndexValue) {
|
||||
size_t strLen = m_primitiveValue->length();
|
||||
if (LIKELY(idx < strLen)) {
|
||||
return ObjectGetResult(Value(String::fromCharCode(m_primitiveValue->charAt(idx))), false, true, false);
|
||||
}
|
||||
}
|
||||
return get(state, ObjectPropertyName(state, property));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue