зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1398113 - Use NameToId for known property names to avoid the indexed property check in AtomToId. r=jandem
--HG-- extra : rebase_source : 1f475f02d98d6696c85207cdafb9e713743984ab extra : histedit_source : 99612f2c6174d4d76914ea0f0fd76b9f6299fe5e
This commit is contained in:
Родитель
0e71aaaadf
Коммит
aa75b0997a
|
@ -3694,8 +3694,8 @@ BytecodeEmitter::iteratorResultShape(unsigned* shape)
|
|||
if (!obj)
|
||||
return false;
|
||||
|
||||
Rooted<jsid> value_id(cx, AtomToId(cx->names().value));
|
||||
Rooted<jsid> done_id(cx, AtomToId(cx->names().done));
|
||||
Rooted<jsid> value_id(cx, NameToId(cx->names().value));
|
||||
Rooted<jsid> done_id(cx, NameToId(cx->names().done));
|
||||
if (!NativeDefineProperty(cx, obj, value_id, UndefinedHandleValue, nullptr, nullptr,
|
||||
JSPROP_ENUMERATE))
|
||||
{
|
||||
|
|
|
@ -47,6 +47,10 @@ AtomToId(JSAtom* atom)
|
|||
return JSID_FROM_BITS(size_t(atom));
|
||||
}
|
||||
|
||||
// Use the NameToId method instead!
|
||||
inline jsid
|
||||
AtomToId(PropertyName* name) = delete;
|
||||
|
||||
inline bool
|
||||
ValueToIdPure(const Value& v, jsid* id)
|
||||
{
|
||||
|
|
|
@ -1409,7 +1409,7 @@ js::proxy_revocable(JSContext* cx, unsigned argc, Value* vp)
|
|||
MOZ_ASSERT(proxyVal.toObject().is<ProxyObject>());
|
||||
|
||||
RootedObject revoker(cx, NewFunctionByIdWithReserved(cx, RevokeProxy, 0, 0,
|
||||
AtomToId(cx->names().revoke)));
|
||||
NameToId(cx->names().revoke)));
|
||||
if (!revoker)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -6761,10 +6761,10 @@ DebuggerScript_getOffsetsCoverage(JSContext* cx, unsigned argc, Value* vp)
|
|||
if (!result)
|
||||
return false;
|
||||
|
||||
RootedId offsetId(cx, AtomToId(cx->names().offset));
|
||||
RootedId lineNumberId(cx, AtomToId(cx->names().lineNumber));
|
||||
RootedId columnNumberId(cx, AtomToId(cx->names().columnNumber));
|
||||
RootedId countId(cx, AtomToId(cx->names().count));
|
||||
RootedId offsetId(cx, NameToId(cx->names().offset));
|
||||
RootedId lineNumberId(cx, NameToId(cx->names().lineNumber));
|
||||
RootedId columnNumberId(cx, NameToId(cx->names().columnNumber));
|
||||
RootedId countId(cx, NameToId(cx->names().count));
|
||||
|
||||
RootedObject item(cx);
|
||||
RootedValue offsetValue(cx);
|
||||
|
|
|
@ -1765,7 +1765,7 @@ static bool
|
|||
CombineArrayObjectElements(JSContext* cx, ArrayObject* obj, JSValueType* elementType)
|
||||
{
|
||||
if (obj->inDictionaryMode() ||
|
||||
obj->lastProperty()->propid() != AtomToId(cx->names().length) ||
|
||||
obj->lastProperty()->propid() != NameToId(cx->names().length) ||
|
||||
!obj->lastProperty()->previous()->isEmptyShape())
|
||||
{
|
||||
// Only use an unboxed representation if the object has no properties.
|
||||
|
|
Загрузка…
Ссылка в новой задаче