summaryrefslogtreecommitdiff
path: root/js/src/jit/VMFunctions.cpp
diff options
context:
space:
mode:
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