summaryrefslogtreecommitdiff
path: root/js/src/vm
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-06-22 12:52:03 +0000
committerMoonchild <moonchild@palemoon.org>2020-06-22 12:52:03 +0000
commitb791b67121821257b8a4dc63ac96d83e5c7240b2 (patch)
tree26adf26104d67b7c4a457ac54cfb94f85c55a0dc /js/src/vm
parentc15bc7d3dd4dcbfdd3ed699e8ecfe29bc8e86b6f (diff)
downloaduxp-b791b67121821257b8a4dc63ac96d83e5c7240b2.tar.gz
Issue #1459 - Inline a number of helper functions.
Diffstat (limited to 'js/src/vm')
-rw-r--r--js/src/vm/UnboxedObject-inl.h38
1 files changed, 2 insertions, 36 deletions
diff --git a/js/src/vm/UnboxedObject-inl.h b/js/src/vm/UnboxedObject-inl.h
index f60b5ffb80..606e457280 100644
--- a/js/src/vm/UnboxedObject-inl.h
+++ b/js/src/vm/UnboxedObject-inl.h
@@ -176,40 +176,6 @@ UnboxedPlainObject::layout() const
// Combined methods for NativeObject and UnboxedArrayObject accesses.
/////////////////////////////////////////////////////////////////////
-static inline bool
-HasAnyBoxedOrUnboxedDenseElements(JSObject* obj)
-{
- return obj->isNative();
-}
-
-static inline size_t
-GetAnyBoxedOrUnboxedInitializedLength(JSObject* obj)
-{
- if (obj->isNative())
- return obj->as<NativeObject>().getDenseInitializedLength();
- return 0;
-}
-
-static inline size_t
-GetAnyBoxedOrUnboxedCapacity(JSObject* obj)
-{
- if (obj->isNative())
- return obj->as<NativeObject>().getDenseCapacity();
- return 0;
-}
-
-static inline Value
-GetAnyBoxedOrUnboxedDenseElement(JSObject* obj, size_t index)
-{
- return obj->as<NativeObject>().getDenseElement(index);
-}
-
-static inline size_t
-GetAnyBoxedOrUnboxedArrayLength(JSObject* obj)
-{
- return obj->as<ArrayObject>().length();
-}
-
static inline void
SetAnyBoxedOrUnboxedArrayLength(JSContext* cx, JSObject* obj, size_t length)
{
@@ -436,7 +402,7 @@ template <typename F>
DenseElementResult
CallBoxedOrUnboxedSpecialization(F f, JSObject* obj)
{
- if (!HasAnyBoxedOrUnboxedDenseElements(obj))
+ if (!obj->isNative())
return DenseElementResult::Incomplete;
switch (GetBoxedOrUnboxedType(obj)) {
case JSVAL_TYPE_MAGIC:
@@ -461,7 +427,7 @@ template <typename F>
DenseElementResult
CallBoxedOrUnboxedSpecialization(F f, JSObject* obj1, JSObject* obj2)
{
- if (!HasAnyBoxedOrUnboxedDenseElements(obj1) || !HasAnyBoxedOrUnboxedDenseElements(obj2))
+ if (!obj1->isNative() || !obj2->isNative())
return DenseElementResult::Incomplete;
#define SPECIALIZE_OBJ2(TYPE) \