summaryrefslogtreecommitdiffstats
path: root/js/src
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-08 17:13:01 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:20 -0400
commitd074844a4e758209dcfd8ce12720680edd957b42 (patch)
tree16f13793c76b03f27829b30806ae7401a73f97fe /js/src
parent668254e2b2a7b4f1d6da703275b89f3753096f71 (diff)
downloadUXP-d074844a4e758209dcfd8ce12720680edd957b42.tar
UXP-d074844a4e758209dcfd8ce12720680edd957b42.tar.gz
UXP-d074844a4e758209dcfd8ce12720680edd957b42.tar.lz
UXP-d074844a4e758209dcfd8ce12720680edd957b42.tar.xz
UXP-d074844a4e758209dcfd8ce12720680edd957b42.zip
903389 - Make Make NativeGet[Getter]PureInline handle dense/typed array shapes.
Diffstat (limited to 'js/src')
-rw-r--r--js/src/jsobj.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp
index 418e08dad..5f6331ac8 100644
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -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;