mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Add fast paths for hasProperty internal method (#407)
Also the Object.[[Get]] method is modified to follow the standard requirements without recursion. Signed-off-by: Robert Fancsik <frobert@inf.u-szeged.hu>
This commit is contained in:
parent
387a30267c
commit
1df4dcd1a8
10 changed files with 86 additions and 11 deletions
|
|
@ -155,6 +155,16 @@ ArgumentsObject::ArgumentsObject(ExecutionState& state, ScriptFunctionObject* so
|
|||
}
|
||||
}
|
||||
|
||||
ObjectHasPropertyResult ArgumentsObject::hasProperty(ExecutionState& state, const ObjectPropertyName& P)
|
||||
{
|
||||
uint64_t index = P.tryToUseAsIndex();
|
||||
if (LIKELY(!isModifiedArgument(index) && isMatchedArgument(index))) {
|
||||
return ObjectHasPropertyResult(ObjectGetResult(getIndexedPropertyValueQuickly(state, index), true, true, true));
|
||||
}
|
||||
|
||||
return Object::hasProperty(state, P);
|
||||
}
|
||||
|
||||
ObjectGetResult ArgumentsObject::getOwnProperty(ExecutionState& state, const ObjectPropertyName& P)
|
||||
{
|
||||
uint64_t index = P.tryToUseAsIndex();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue