summaryrefslogtreecommitdiff
path: root/js/src/jit/VMFunctions.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-09-01 15:44:29 +0200
committerMoonchild <moonchild@palemoon.org>2023-09-01 15:44:29 +0200
commit2d48de9998d5c4f768af051ce997777be126f8cd (patch)
treec6023db91bfadaa8e1d7c4c12d90ad63bf810454 /js/src/jit/VMFunctions.cpp
parent3b029cdfe482e5097ee09fa1998591faf9c1005b (diff)
parentee97a5dad40fb8d207b717cb2a0d487f54dd5f1d (diff)
downloaduxp-2d48de9998d5c4f768af051ce997777be126f8cd.tar.gz
Merge branch 'master' into releaseRC_20230901RB_20230904
Diffstat (limited to 'js/src/jit/VMFunctions.cpp')
-rw-r--r--js/src/jit/VMFunctions.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/js/src/jit/VMFunctions.cpp b/js/src/jit/VMFunctions.cpp
index 6e5676f153..8802d3582b 100644
--- a/js/src/jit/VMFunctions.cpp
+++ b/js/src/jit/VMFunctions.cpp
@@ -1236,15 +1236,27 @@ AssertValidSymbolPtr(JSContext* cx, JS::Symbol* sym)
MOZ_ASSERT(sym->getAllocKind() == gc::AllocKind::SYMBOL);
}
+void
+AssertValidBigIntPtr(JSContext* cx, JS::BigInt* bi) {
+ // FIXME: check runtime?
+ MOZ_ASSERT(cx->zone() == bi->zone());
+ MOZ_ASSERT(bi->isAligned());
+ MOZ_ASSERT(bi->isTenured());
+ MOZ_ASSERT(bi->getAllocKind() == gc::AllocKind::BIGINT);
+}
+
void
AssertValidValue(JSContext* cx, Value* v)
{
- if (v->isObject())
+ if (v->isObject()) {
AssertValidObjectPtr(cx, &v->toObject());
- else if (v->isString())
+ } else if (v->isString()) {
AssertValidStringPtr(cx, v->toString());
- else if (v->isSymbol())
+ } else if (v->isSymbol()) {
AssertValidSymbolPtr(cx, v->toSymbol());
+ } else if (v->isBigInt()) {
+ AssertValidBigIntPtr(cx, v->toBigInt());
+ }
}
bool