Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -47210,6 +47210,24 @@ <h1>Atomics.notify ( _ta_, _index_, _count_ )</h1>
</emu-alg>
</emu-clause>

<emu-clause id="Atomics.pause">
<h1>Atomics.pause ( )</h1>
<p>This function provides a hint to the CPU that the program is spin looping while waiting on a value.</p>
<p>It performs the following steps when called:</p>
<emu-alg>
1. If the execution environment of the ECMAScript implementation supports signaling to the operating system or CPU that the current executing code is in a spin-wait loop, send that signal.

Check warning on line 47218 in spec.html

View workflow job for this annotation

GitHub Actions / esmeta yet phrases detection

Newly Introduced Unknown Step

This step in INTRINSICS.Atomics.pause cannot be understood by ESMeta. Type check for this algorithm will not be performed after this line.
1. Return *undefined*.
</emu-alg>
<emu-note>
<p>This method is designed for programs implementing spin-wait loops, such as spinlock fast paths inside of mutexes, to provide a hint to the CPU that it is spinning while waiting on a value. It has no observable behaviour other than timing.</p>
<p>Implementations are expected to implement a pause or yield instruction if the best practices of the underlying architecture recommends such instructions in spin loops. For example, the <a href="https://www.intel.com/content/www/us/en/content-details/671488/intel-64-and-ia-32-architectures-optimization-reference-manual-volume-1.html">Intel Optimization Manual</a> recommends the <code>pause</code> instruction.</p>
<p>Implementations are encouraged to have an internal upper bound on the maximum amount of time paused on the order of tens to hundreds of nanoseconds.</p>
</emu-note>
<emu-note>
<p>Due to the overhead of function calls, it is reasonable that an inlined call to this method in an optimizing compiler waits a different amount of time than a non-inlined call.</p>
</emu-note>
</emu-clause>

<emu-clause id="sec-atomics.xor" type="built-in function">
<h1>Atomics.xor ( _ta_, _index_, _value_ )</h1>
<p>This function performs the following steps when called:</p>
Expand Down
Loading