mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
903389 - Make Make NativeGet[Getter]PureInline handle dense/typed array shapes.
This commit is contained in:
parent
2391e18681
commit
5d929d8c47
1 changed files with 13 additions and 4 deletions
|
|
@ -2326,9 +2326,18 @@ js::LookupOwnPropertyPure(ExclusiveContext* cx, JSObject* obj, jsid id, Shape**
|
|||
}
|
||||
|
||||
static inline bool
|
||||
NativeGetPureInline(NativeObject* pobj, Shape* shape, Value* vp)
|
||||
NativeGetPureInline(NativeObject* pobj, jsid id, Shape* shape, Value* vp)
|
||||
{
|
||||
/* Fail if we have a custom getter. */
|
||||
if (IsImplicitDenseOrTypedArrayElement(shape)) {
|
||||
// For simplicity we ignore the TypedArray with string index case.
|
||||
if (!JSID_IS_INT(id))
|
||||
return false;
|
||||
|
||||
*vp = pobj->getDenseOrTypedArrayElement(JSID_TO_INT(id));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Fail if we have a custom getter.
|
||||
if (!shape->hasDefaultGetter())
|
||||
return false;
|
||||
|
||||
|
|
@ -2355,13 +2364,13 @@ js::GetPropertyPure(ExclusiveContext* cx, JSObject* obj, jsid id, Value* vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
return pobj->isNative() && NativeGetPureInline(&pobj->as<NativeObject>(), shape, vp);
|
||||
return pobj->isNative() && NativeGetPureInline(&pobj->as<NativeObject>(), id, shape, vp);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
NativeGetGetterPureInline(Shape* shape, JSFunction** fp)
|
||||
{
|
||||
if (shape->hasGetterObject()) {
|
||||
if (!IsImplicitDenseOrTypedArrayElement(shape) && shape->hasGetterObject()) {
|
||||
if (shape->getterObject()->is<JSFunction>()) {
|
||||
*fp = &shape->getterObject()->as<JSFunction>();
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue