| .eslintrc.mjs |
|
6713 |
| Array-inl.h |
|
1106 |
| Array.cpp |
Whether obj may have indexed properties anywhere besides its dense
elements. This includes other indexed properties in its shape hierarchy, and
indexed properties or elements along its prototype chain.
|
167880 |
| Array.h |
JS Array interface. |
7780 |
| Array.js |
ES5 15.4.4.16. |
34402 |
| AsyncDisposableStack.js |
|
2810 |
| AsyncDisposableStackObject.cpp |
static |
14564 |
| AsyncDisposableStackObject.h |
namespace js |
1826 |
| AsyncFunction.js |
|
617 |
| AsyncIteration.js |
ECMA262 7.4.7 AsyncIteratorClose |
14743 |
| AtomicsObject.cpp |
JS Atomics pseudo-module.
See chapter 24.4 "The Atomics Object" and chapter 27 "Memory Model" in
ECMAScript 2021 for the full specification.
|
65522 |
| AtomicsObject.h |
|
6999 |
| BigInt.cpp |
BigInt.prototype.valueOf ( )
ES2025 draft rev e42d11da7753bd933b1e7a5f3cb657ab0a8f6251
|
7518 |
| BigInt.h |
|
1607 |
| Boolean-inl.h |
namespace js |
1258 |
| Boolean.cpp |
JS boolean implementation.
|
4923 |
| Boolean.h |
JS boolean interface. |
625 |
| DataViewObject.cpp |
bytesPerElement = |
39378 |
| DataViewObject.h |
Return the current byteLength, or |Nothing| if the DataView is detached or
out-of-bounds.
|
8138 |
| DisposableStack.js |
|
1936 |
| DisposableStackObject.cpp |
static |
13771 |
| DisposableStackObject.h |
namespace js |
1924 |
| DisposableStackObjectBase.cpp |
Explicit Resource Management Proposal
27.4.3.1 AsyncDisposableStack.prototype.adopt ( value, onDisposeAsync )
https://arai-a.github.io/ecma262-compare/?pr=3000&id=sec-asyncdisposablestack.prototype.adopt
Step 5.a
27.3.3.1 DisposableStack.prototype.adopt ( value, onDispose )
https://arai-a.github.io/ecma262-compare/?pr=3000&id=sec-disposablestack.prototype.adopt
Step 5.a
|
11569 |
| DisposableStackObjectBase.h |
namespace js |
2597 |
| embedjs.py |
\
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
namespace js {
namespace %(namespace)s {
static const %(sources_type)s data[] = { %(sources_data)s };
static const %(sources_type)s * const %(sources_name)s = reinterpret_cast<const %(sources_type)s *>(data);
uint32_t GetCompressedSize() {
return %(compressed_total_length)i;
}
uint32_t GetRawScriptsSize() {
return %(raw_total_length)i;
}
} // selfhosted
} // js
|
7160 |
| Error.js |
ES6 20140718 draft 19.5.3.4. |
867 |
| Eval.cpp |
static |
18974 |
| Eval.h |
builtin_Eval_h |
1357 |
| FinalizationRegistryObject.cpp |
static |
27837 |
| FinalizationRegistryObject.h |
FinalizationRegistry objects allow a program to register to receive a
callback after a 'target' object dies. The callback is passed a 'held value'
(that hopefully doesn't entrain the target). An 'unregister token' is an
object which can be used to remove multiple previous registrations in one go.
To arrange this, the following data structures are used:
+---------------------------------------+-------------------------------+
| FinalizationRegistry compartment | Target zone / compartment |
| | |
| +------------------------------+ | +------------------+ |
| +--+ FinalizationRegistry | | | Zone | |
| | +---+----------------+---------+ | +---------+--------+ |
| | | | | | |
| | v v | v |
| | +---+---+ +---------+---------+ | +------------+------------+ |
| | |Record | | Registrations | | | FinalizationObservers | |
| | |Vector | | map | | +------------+------------+ |
| | +---+---+ +-------------------+ | | |
| | | | Weak :Records| | | |
| | | | unregister:Vector | | v |
| | | | token : | | +------------+------------+ |
| | | +--------------+----+ | | RecordMap map | |
| | | | | +-------------------------+ |
| | | | | | Target : ObserverList | |
| | | | | | object : | |
| | * v * v | +----+-------------+------+ |
| | +-------------------------+-+ * | | | |
| | | FinalizationRecordObject +<--------------------------+ |
| | +---------------------------+ | | |
| | | Queue +--+ | v |
| | +---------------------------+ | | +----+-----+ |
| | | Held value | | | | Target | |
| | +---------------------------+ | | | GC thing | |
| | | | +----------+ |
| +--------------+ +--------------+ | |
| | | | |
| v v | |
| +----------+---+----------+ | |
| | FinalizationQueueObject | | |
| +-------------------------+ | |
| | |
+---------------------------------------+-------------------------------+
A FinalizationRegistry consists of several parts:
- the FinalizationRegistry object that consumers see
- zero or more FinalizationRecordObjects representing registered targets
- a FinalizationQueue containing records for targets that have died, used to
queue and call the cleanup callbacks
- a weakmap tracking unregister tokens and their associated records
Registering a target with a FinalizationRegistry creates a FinalizationRecord
containing a pointer to the queue and the heldValue. This is added to the
registry's vector of registered targets and also to a linked list of
finalization observers which is used to actually track the target.
When a target is registered an unregister token may be supplied. If so, this
is also recorded by the registry and is stored in a map of
registrations. They keys of this map are weakly held and do not keep the
unregister token alive.
When targets are unregistered, the registration is looked up in the weakmap
and the corresponding records are cleared.
The finalization observer lists are swept during GC to check for records
associated with dying targets. For such targets the associated record list is
processed and each record is added to the FinalizationQueueObject. At a later
time this causes the client's cleanup callback to be run.
|
10884 |
| Generator.js |
|
2855 |
| HandlerFunction-inl.h |
Handler for operations that act on a target object, and possibly upon
an extra value.
|
3893 |
| intl |
|
|
| Iterator.js |
ECMA262 7.2.7 |
51299 |
| JSON.cpp |
https://262.ecma-international.org/14.0/#sec-quotejsonstring
Requires that the destination has enough space allocated for src after
escaping (that is, `2 + 6 * (srcEnd - srcBegin)` characters).
|
64460 |
| JSON.h |
If stringifyBehavior is RestrictedSafe, Stringify will attempt to assert the
API requirements of JS::ToJSONMaybeSafely as it traverses the graph, and will
not try to invoke .toJSON on things as it goes.
|
2171 |
| Map.js |
|
6712 |
| MapObject-inl.h |
builtin_MapObject_inl_h |
3678 |
| MapObject.cpp |
HashableValue ********************************************************* |
63176 |
| MapObject.h |
Comparing two ropes for equality can fail. The js::HashTable template
requires infallible hash() and match() operations. Therefore we require
all values to be converted to hashable form before being used as a key
in a Map or Set object.
All values except ropes are hashable as-is.
|
14348 |
| ModuleObject.cpp |
|
80051 |
| ModuleObject.h |
|
20923 |
| Number.js |
|
1752 |
| Object.cpp |
Make an object whether this was called with 'new' or not. |
72682 |
| Object.h |
Like IdToValue, but convert int jsids to strings. This is used when
exposing a jsid to script for Object.getOwnProperty{Names,Symbols}
or scriptable proxy traps.
|
2753 |
| Object.js |
ES6 draft rev 32 (2015 Feb 2) 19.1.2.9. |
11376 |
| OrderedHashTableObject-inl.h |
builtin_OrderedHashTableObject_inl_h |
902 |
| OrderedHashTableObject.h |
[SMDOC] OrderedHashTableObject (JS Map/Set implementation)
This file defines js::OrderedHashMapObject (js::MapObject base class) and
js::OrderedHashSetObject (js::SetObject base class).
It also defines two templates, js::OrderedHashMapImpl and
js::OrderedHashSetImpl, that operate on these objects and implement the
ordered hash table algorithm. These templates are defined separately from
the JS object types because it lets us switch between different template
instantiations to enable or disable GC barriers.
The implemented hash table algorithm is different from HashMap and HashSet in
MFBT:
- JS Map/Set iterators must visit entries in insertion order. The hashing
is a pure performance optimization and does not affect iteration order.
- Iterator objects must remain valid even when entries are added, removed,
or the table is resized.
Implementation
==============
The hash table contains two arrays: an array of data entries that stores all
entries (in insertion/enumeration order) and a separate array of hash buckets
that provides O(1) lookup performance instead of O(n).
As an optimization, we allocate a single buffer that stores both of these
arrays (and the HashCodeScrambler). We allocate this buffer when the first
entry is added to the table.
The capacity of the data array is based on the number of hash buckets and the
FillFactor constant (currently 8.0/3.0).
For example, consider the following JS code:
var m = new Map();
m.set(1, "a");
m.set(2, "b");
m.set(3, "c");
m.set(4, "d");
m.delete(2);
After this, the Map object might look like this:
HashTableSlot
| +---------+---------+
+--> | Data #3 | Data #2 |
+-----+---+-----+---+
| |
+---------|----------------------------+
+----------------+ |
| |
DataSlot v v
| +------------+------------+------------+------------+------------+
| | Data #0 | Data #1 | Data #2 | Data #3 | Data #4 |
+--> | key: 1 | key: $empty| key: 3 | key: 4 | <free> |
| value: "a" | value: # | value: "c" | value: "d" | |
| chain: null| chain: null| chain: #0 | chain: #1 | |
+------------+------------+------+-----+------+-----+------------+
^ ^ | |
| | | |
| +------------|------------+
+-------------------------+
LiveCountSlot = 3 (number of entries in the table)
DataCapacitySlot = 5 (total capacity of the data array)
DataLengthSlot = 4 (number of entries used, including deleted items)
HashShiftSlot = 31 (2 hash buckets; see hashShiftToNumHashBuckets)
In this case we have only two hash buckets and each bucket contains two Data
entries. Entries in the same bucket form a linked list using the |chain|
field. This implements separate chaining for hash collisions.
When an entry is deleted from the table, we set its key to the
MagicValue(JS_HASH_KEY_EMPTY) tombstone Value, shown as $empty in this
diagram. Deleted entries are removed when the table is resized or compacted.
Iterators
=========
Each hash table has a doubly linked list of iterators for it. This is used to
update active iterators when we remove an entry, when we compact the table,
or when we clear the table. See TableIteratorObject and IterOps.
HashCodeScrambler
=================
Each table has a HashCodeScrambler, used to avoid revealing JSObject*
addresses. See bug 1312001 and HashValue in MapObject.cpp
Nursery GC Optimizations
========================
Each table has a list of keys allocated in the nursery that's traced by the
OrderedHashTableRef store buffer entry. This avoids tracing all non-nursery
entries during a nursery GC.
Similarly, each table has a separate list of nursery-allocated iterators.
This list is cleared at the start of a nursery GC and rebuilt when iterators
are promoted. See Nursery::clearMapAndSetNurseryIterators.
|
52803 |
| ParseRecordObject.cpp |
static |
2192 |
| ParseRecordObject.h |
|
2044 |
| Profilers.cpp |
Profiling-related API |
15548 |
| Profilers.h |
Functions for controlling profilers from within JS: Valgrind, Perf, etc
|
2777 |
| Promise-inl.h |
Given a settled (i.e. fulfilled or rejected, not pending) promise, sets
|promise.[[PromiseIsHandled]]| to true and removes it from the list of
unhandled rejected promises.
NOTE: If you need to set |promise.[[PromiseIsHandled]]| on a pending promise,
use |PromiseObject::setHandled()| directly.
|
1577 |
| Promise.cpp |
ES2023 draft rev 714fa3dd1e8237ae9c666146270f81880089eca5
Promise Resolve Functions
https://tc39.es/ecma262/#sec-promise-resolve-functions
|
283510 |
| Promise.h |
Unforgeable version of the JS builtin Promise.all.
Takes a HandleValueVector of Promise objects and returns a promise that's
resolved with an array of resolution values when all those promises have
been resolved, or rejected with the rejection value of the first rejected
promise.
Asserts that all objects in the `promises` vector are, maybe wrapped,
instances of `Promise` or a subclass of `Promise`.
|
11747 |
| Promise.js |
|
2167 |
| RawJSONObject.cpp |
static |
1490 |
| RawJSONObject.h |
builtin_RawJSONObject_h |
719 |
| Reflect.cpp |
Reflect methods ******************************************************* |
6940 |
| Reflect.h |
builtin_Reflect_h |
967 |
| Reflect.js |
, newTarget |
5536 |
| ReflectParse.cpp |
JS reflection package. |
127645 |
| RegExp.cpp |
Implements RegExpBuiltinExec: Steps 18-35
https://tc39.es/ecma262/#sec-regexpbuiltinexec
|
82087 |
| RegExp.h |
The following builtin natives are extern'd for pointer comparison in
other parts of the engine.
|
8166 |
| RegExp.js |
|
34422 |
| RegExpGlobalReplaceOpt.h.js |
|
5436 |
| RegExpLocalReplaceOpt.h.js |
|
4030 |
| SelfHostingDefines.h |
Spec: ECMAScript Language Specification, 5.1 edition, 9.2 and 11.4.9 |
5571 |
| Set.js |
|
13359 |
| ShadowRealm.cpp |
static |
24860 |
| ShadowRealm.h |
|
1082 |
| Sorting-inl.h |
|
9476 |
| Sorting.h |
|
5641 |
| String.cpp |
Forward declarations for URI encode/decode and helper routines
|
143861 |
| String.h |
Initialize the String class, returning its prototype object. |
3605 |
| String.js |
A helper function implementing the logic for both String.prototype.padStart
and String.prototype.padEnd as described in ES7 Draft March 29, 2016
|
24797 |
| Symbol.cpp |
|
7484 |
| Symbol.h |
Stores this Symbol object's [[PrimitiveValue]]. |
2439 |
| temporal |
|
|
| TestingFunctions.cpp |
|
349243 |
| TestingFunctions.h |
namespace js |
1691 |
| TestingUtility.cpp |
|
11858 |
| TestingUtility.h |
namespace js |
3388 |
| TypedArray.js |
Steps 3-5 (non-wrapped typed arrays). |
30968 |
| TypedArrayConstants.h |
|
878 |
| Utilities.js |
Abstract operations defined in ECMAScript Language Specification ********* |
5377 |
| WeakMap.js |
Upsert proposal
WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
https://tc39.es/proposal-upsert/
|
2520 |
| WeakMapObject-inl.h |
builtin_WeakMapObject_inl_h |
3182 |
| WeakMapObject.cpp |
static |
13758 |
| WeakMapObject.h |
builtin_WeakMapObject_h |
3044 |
| WeakRefObject.cpp |
static |
8825 |
| WeakRefObject.h |
builtin_WeakRefObject_h |
1385 |
| WeakSet.js |
|
628 |
| WeakSetObject.cpp |
static |
8183 |
| WeakSetObject.h |
builtin_WeakSetObject_h |
2023 |
| WrappedFunctionObject.cpp |
|
11697 |
| WrappedFunctionObject.h |
|
1431 |