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:
seonghyun kim 2017-02-07 19:15:25 +09:00 committed by Young-il Choi
commit 0f1cc8999c
25 changed files with 282 additions and 265 deletions

View file

@ -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));
}
}