Bug 1885489 - Part 5: Add SnapshotIterator::readInt32(). r=iain
[gecko.git] / js / src / builtin / TestingFunctions.h
blobb823fabeb3b8e86559553ac7c5f19a5586829e27
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef builtin_TestingFunctions_h
8 #define builtin_TestingFunctions_h
10 #include "NamespaceImports.h" // JSContext, JSFunction, HandleObject, HandleValue, Value
12 namespace js {
14 [[nodiscard]] bool InitTestingFunctions();
16 [[nodiscard]] bool DefineTestingFunctions(JSContext* cx, HandleObject obj,
17 bool fuzzingSafe,
18 bool disableOOMFunctions);
20 [[nodiscard]] bool testingFunc_assertFloat32(JSContext* cx, unsigned argc,
21 Value* vp);
23 [[nodiscard]] bool testingFunc_assertRecoveredOnBailout(JSContext* cx,
24 unsigned argc,
25 Value* vp);
27 [[nodiscard]] bool testingFunc_serialize(JSContext* cx, unsigned argc,
28 Value* vp);
30 extern JSScript* TestingFunctionArgumentToScript(JSContext* cx, HandleValue v,
31 JSFunction** funp = nullptr);
33 #ifdef FUZZING_JS_FUZZILLI
34 uint32_t FuzzilliHashDouble(double value);
36 uint32_t FuzzilliHashBigInt(BigInt* bigInt);
38 void FuzzilliHashObjectInl(JSContext* cx, JSObject* obj, uint32_t* out);
39 void FuzzilliHashObject(JSContext* cx, JSObject* obj);
40 #endif
42 } /* namespace js */
44 #endif /* builtin_TestingFunctions_h */