fune/js/public
Iain Ireland 2b0d5db98b Bug 1879225: Refactor IsFoo methods r=dminor
In [this commit](https://chromium-review.googlesource.com/c/v8/v8/+/4727690), V8 changed its IsFoo predicates from methods into free functions as part of the Tagged<T> work.

At first I was simply going to move the current implementation, but as I was writing a comment to explain why `bool IsByteArray(Object obj) { return true; }` was not as dumb as it looked, I decided that we could do better.

V8's ByteArrays are managed by the GC, and the typecheck can be done by looking at the map (shape). Our implementation of ByteArray is a length-prefixed array allocated by malloc, so we can't check the type the same way, but in debug builds we can stick a magic number in the header and validate that it hasn't been messed with.

We can use a dedicated MagicValue for the exception we throw when interrupting (which maps closely to V8's approach).

Differential Revision: https://phabricator.services.mozilla.com/D201916
2024-02-28 23:39:05 +00:00
..
experimental Bug 1878384 - Check for pinned length in more cases r=spidermonkey-reviewers,anba 2024-02-09 17:51:29 +00:00
friend Bug 1873328 - disallow nested groupings of the same type, to prevent infinite recursion r=jimb 2024-02-23 17:26:39 +00:00
shadow
AllocationLogging.h
AllocationRecording.h
AllocPolicy.h
Array.h
ArrayBuffer.h
ArrayBufferMaybeShared.h Bug 1842773 - Part 2: Add "resizable" flag to ArrayBuffer objects. r=sfink 2024-01-29 10:44:19 +00:00
BigInt.h Bug 1873317 - Change JS_PUBLIC_API function parameters with mozilla::Range to take references. r=spidermonkey-reviewers,evilpie 2024-01-06 18:37:22 +00:00
BuildId.h
CallAndConstruct.h
CallArgs.h Bug 1859832 - Avoid isMagic release assertion in CallArgsFromVp. r=iain 2023-10-19 05:52:51 +00:00
CallNonGenericMethod.h
CharacterEncoding.h Bug 1873827 - Use const reference for UTF8Chars parameters. r=sfink 2024-01-12 13:57:19 +00:00
Class.h
ColumnNumber.h Bug 1862814 - Part 5: Remove zeroOriginValue methods from column number classes. r=iain 2023-11-22 12:31:34 +00:00
ComparisonOperators.h
CompilationAndEvaluation.h
CompileOptions.h Bug 1835669 - Split import attributes pref to require explicit pref for assert syntax r=dminor 2024-01-19 01:01:30 +00:00
Context.h
ContextOptions.h Bug 1879179 - wasm: Use JSPrefs for WasmFeatures.h. r=bvisness 2024-02-27 16:56:02 +00:00
Conversions.h
Date.h Bug 1872116 - Fix year detection in checkTimeDateString r=whimboo,webdriver-reviewers,arai 2023-12-30 07:57:13 +00:00
Debug.h
Equality.h
ErrorInterceptor.h
ErrorReport.h
Exception.h
ForOfIterator.h
GCAnnotations.h
GCAPI.h Bug 1881303 - Part 2: Expose eager nursery collection tunables as prefs r=sfink 2024-02-23 09:20:31 +00:00
GCHashTable.h Bug 1828648 - Part 1: Make SweepingAPI.h an internal header r=jandem 2024-01-17 11:11:08 +00:00
GCPolicyAPI.h
GCTypeMacros.h
GCVariant.h
GCVector.h Bug 1872982 - Part 2: Partition inner view vector based on whether the view is in the nursery r=jandem 2024-01-05 14:55:24 +00:00
GlobalObject.h
HashTable.h
HeapAPI.h Bug 1878421 - Diagnostic patch to check zone pointers returned by the JS API r=sfink 2024-02-21 08:37:03 +00:00
HelperThreadAPI.h
Id.h Bug 1783397 - Part 10: Add {JSString,JS::Symbol,JS::PropertyKey}::dumpStringContent methods. r=mgaudet 2024-01-31 08:54:45 +00:00
Initialization.h
Interrupt.h
Iterator.h
JitCodeAPI.h Bug 1862692 - Part 4: Use 1-origin column number types in JitCodeAPI. r=iain 2023-11-09 11:41:05 +00:00
JSON.h Bug 1858803 - Add JS::ParseJSONWithHandler. r=bthrall 2024-01-26 15:39:38 +00:00
LocaleSensitive.h
MapAndSet.h Bug 1872151 - Update top-level comment in MapAndSet.h. r=spidermonkey-reviewers,arai DONTBUILD 2023-12-28 09:00:33 +00:00
MemoryCallbacks.h
MemoryFunctions.h
MemoryMetrics.h Bug 1863939 part 6 - Tidy up IC stub code. r=iain 2023-11-14 11:47:52 +00:00
Modules.h Bug 1877791 - Part 1: Implement JSON modules r=jonco,dminor 2024-02-23 15:20:31 +00:00
Object.h
Prefs.h Bug 1877193 part 18 - Assert startup prefs are set before JS_Init*. r=mgaudet,necko-reviewers,valentin 2024-02-06 12:51:34 +00:00
Principals.h
Printer.h Bug 1743098 - Write diagnostic output via printf_stderr r=jonco 2024-01-16 20:05:23 +00:00
Printf.h
ProfilingCategory.h
ProfilingFrameIterator.h Bug 1810332 - Show which wasm compiler a function is executing in profile. r=yury,profiler-reviewers,aabh 2024-02-27 00:44:21 +00:00
ProfilingStack.h
Promise.h
PropertyAndElement.h Bug 1854643 - Fix JS_DeletePropertyById argument type in header file. r=sfink 2023-09-25 12:12:52 +00:00
PropertyDescriptor.h
PropertySpec.h
ProtoKey.h Bug 1842773 - Part 29: Add {FixedLength,Growable}SharedArrayBufferObject classes. r=sfink,jandem 2024-01-29 10:44:31 +00:00
Proxy.h Bug 1849678 - Part 7: Rewrite old JSID comment. r=bthrall 2023-09-29 07:45:06 +00:00
Realm.h
RealmIterators.h
RealmOptions.h Bug 1877193 part 16 - Use JS::Prefs for resizable/growable arraybuffer prefs. r=anba 2024-02-06 12:51:33 +00:00
RefCounted.h
RegExp.h
RegExpFlags.h Bug 1879225: Add more irregexp support to RegExpFlags r=dminor 2024-02-28 23:39:04 +00:00
Result.h
RootingAPI.h Bug 1858921 - Part 5: Remove use of JS::RootingContext in the allocator r=sfink 2023-10-23 15:10:25 +00:00
SavedFrameAPI.h
ScalarType.h
ScriptPrivate.h
ShadowRealmCallbacks.h
SharedArrayBuffer.h
SliceBudget.h Bug 1865383 - Check slice budget when we start marking or sweeping r=sfink 2023-11-20 16:28:11 +00:00
SourceText.h
StableStringChars.h Bug 1853907 - Copy nursery chars for AutoStableStringChars r=jonco 2023-11-24 05:33:20 +00:00
Stack.h
StreamConsumer.h
String.h Bug 1873827 - Use const reference for UTF8Chars parameters. r=sfink 2024-01-12 13:57:19 +00:00
StructuredClone.h
Symbol.h
TelemetryTimers.h
TraceKind.h
TracingAPI.h
Transcoding.h
TypeDecls.h
UbiNode.h
UbiNodeBreadthFirst.h
UbiNodeCensus.h Bug 1873328 - disallow nested groupings of the same type, to prevent infinite recursion r=jimb 2024-02-23 17:26:39 +00:00
UbiNodeDominatorTree.h
UbiNodePostOrder.h
UbiNodeShortestPaths.h
UbiNodeUtils.h
UniquePtr.h
Utility.h
Value.h Bug 1879225: Refactor IsFoo methods r=dminor 2024-02-28 23:39:05 +00:00
ValueArray.h
Vector.h
WaitCallbacks.h
Warnings.h
WasmFeatures.h Bug 1860816: Ship wasm multi-memory. r=rhunt 2024-02-28 17:05:32 +00:00
WasmModule.h
WeakMap.h Bug 1860655 - Use Value in Get|SetWeakMapEntry. r=jonco 2023-11-14 11:57:54 +00:00
WeakMapPtr.h
Wrapper.h
WrapperCallbacks.h
Zone.h