|
54 | 54 | of this document. For dated references, only the edition cited applies.
|
55 | 55 | For undated references, the latest edition of the referenced document
|
56 | 56 | (including any amendments) applies.
|
57 |
| - |
58 | 57 | \begin{itemize}
|
59 | 58 | \item Ecma International, \doccite{ECMAScript Language Specification},
|
60 | 59 | Standard Ecma-262, third edition, 1999.
|
|
320 | 319 | they are phrased as requirements on programs, parts of programs, or
|
321 | 320 | execution of programs. Such requirements have the following meaning:
|
322 | 321 | \begin{itemize}
|
323 |
| - |
324 | 322 | \item
|
325 | 323 | If a program contains no violations of the rules in this
|
326 | 324 | International Standard, a conforming implementation shall,
|
327 | 325 | within its resource limits, accept and correctly execute\footnote{``Correct execution'' can include undefined behavior, depending on
|
328 | 326 | the data being processed; see~\ref{intro.defs} and~\ref{intro.execution}.}
|
329 | 327 | that program.
|
330 |
| - |
331 | 328 | \item
|
332 | 329 | \indextext{message!diagnostic}%
|
333 | 330 | If a program contains a violation of any diagnosable rule or an occurrence
|
334 | 331 | of a construct described in this Standard as ``conditionally-supported'' when
|
335 | 332 | the implementation does not support that construct, a conforming implementation
|
336 | 333 | shall issue at least one diagnostic message.
|
337 |
| - |
338 | 334 | \item
|
339 | 335 | \indextext{behavior!undefined}%
|
340 | 336 | If a program contains a violation of a rule for which no diagnostic
|
341 | 337 | is required, this International Standard places no requirement on
|
342 | 338 | implementations with respect to that program.
|
343 |
| - |
344 | 339 | \end{itemize}
|
345 | 340 | \begin{note}
|
346 | 341 | During template argument deduction and substitution,
|
|
672 | 667 | \pnum
|
673 | 668 | For every object \tcode{x}, there is some object called the
|
674 | 669 | \defn{complete object of} \tcode{x}, determined as follows:
|
675 |
| - |
676 | 670 | \begin{itemize}
|
677 |
| - |
678 | 671 | \item
|
679 | 672 | If \tcode{x} is a complete object, then the complete object
|
680 | 673 | of \tcode{x} is itself.
|
681 | 674 |
|
682 | 675 | \item
|
683 | 676 | Otherwise, the complete object of \tcode{x} is the complete object
|
684 | 677 | of the (unique) object that contains \tcode{x}.
|
685 |
| - |
686 | 678 | \end{itemize}
|
687 | 679 |
|
688 | 680 | \pnum
|
|
821 | 813 | \indextext{conformance requirements}
|
822 | 814 | \pnum
|
823 | 815 | The least requirements on a conforming implementation are:
|
824 |
| - |
825 | 816 | \begin{itemize}
|
826 |
| - |
827 | 817 | \item
|
828 | 818 | Access to volatile objects are evaluated strictly according to the
|
829 | 819 | rules of the abstract machine.
|
830 |
| - |
831 | 820 | \item
|
832 | 821 | At program termination, all data written into files shall be
|
833 | 822 | identical to one of the possible results that execution of the program
|
834 | 823 | according to the abstract semantics would have produced.
|
835 |
| - |
836 | 824 | \item
|
837 | 825 | The input and output dynamics of interactive devices shall take
|
838 | 826 | place in such a fashion that prompting output is actually delivered before a program waits for input. What constitutes an interactive device is
|
839 | 827 | \impldef{interactive device}.
|
840 |
| - |
841 | 828 | \end{itemize}
|
842 | 829 |
|
843 | 830 | These collectively are referred to as the
|
|
892 | 879 |
|
893 | 880 | \pnum
|
894 | 881 | A \defn{constituent expression} is defined as follows:
|
895 |
| -%left blank intentionally for spacing reasons |
896 |
| - |
897 | 882 | \begin{itemize}
|
898 | 883 | \item
|
899 | 884 | The constituent expression of an expression is that expression.
|
|
918 | 903 |
|
919 | 904 | \pnum
|
920 | 905 | The \defn{immediate subexpression}{s} of an expression \tcode{e} are
|
921 |
| -%left blank intentionally for spacing reasons |
922 |
| - |
923 | 906 | \begin{itemize}
|
924 | 907 | \item
|
925 | 908 | the constituent expressions of \tcode{e}'s operands (Clause \ref{expr}),
|
|
950 | 933 |
|
951 | 934 | \pnum
|
952 | 935 | A \defn{full-expression} is
|
953 |
| -%left blank intentionally for spacing reasons |
954 |
| - |
955 | 936 | \begin{itemize}
|
956 | 937 | \item
|
957 | 938 | an unevaluated operand (Clause \ref{expr}),
|
|
1244 | 1225 | An evaluation \placeholder{A} \defn{carries a dependency} to an evaluation \placeholder{B} if
|
1245 | 1226 |
|
1246 | 1227 | \begin{itemize}
|
1247 |
| - |
1248 | 1228 | \item
|
1249 | 1229 | the value of \placeholder{A} is used as an operand of \placeholder{B}, unless:
|
1250 | 1230 | \begin{itemize}
|
1251 |
| - |
1252 | 1231 | \item
|
1253 | 1232 | \placeholder{B} is an invocation of any specialization of
|
1254 | 1233 | \tcode{std::kill_dependency}~(\ref{atomics.order}), or
|
1255 |
| - |
1256 | 1234 | \item
|
1257 | 1235 | \placeholder{A} is the left operand of a built-in logical AND (\tcode{\&\&},
|
1258 | 1236 | see~\ref{expr.log.and}) or logical OR (\tcode{||}, see~\ref{expr.log.or})
|
1259 | 1237 | operator, or
|
1260 |
| - |
1261 | 1238 | \item
|
1262 | 1239 | \placeholder{A} is the left operand of a conditional (\tcode{?:}, see~\ref{expr.cond})
|
1263 | 1240 | operator, or
|
1264 |
| - |
1265 | 1241 | \item
|
1266 | 1242 | \placeholder{A} is the left operand of the built-in comma (\tcode{,})
|
1267 | 1243 | operator~(\ref{expr.comma}); \end{itemize} or
|
1268 |
| - |
1269 | 1244 | \item
|
1270 | 1245 | \placeholder{A} writes a scalar object or bit-field \placeholder{M}, \placeholder{B} reads the value
|
1271 | 1246 | written by \placeholder{A} from \placeholder{M}, and \placeholder{A} is sequenced before \placeholder{B}, or
|
1272 |
| - |
1273 | 1247 | \item
|
1274 | 1248 | for some evaluation \placeholder{X}, \placeholder{A} carries a dependency to \placeholder{X}, and
|
1275 | 1249 | \placeholder{X} carries a dependency to \placeholder{B}.
|
1276 |
| - |
1277 | 1250 | \end{itemize}
|
1278 |
| - |
1279 | 1251 | \begin{note} ``Carries a dependency to'' is a subset of ``is sequenced before'',
|
1280 | 1252 | and is similarly strictly intra-thread. \end{note}
|
1281 | 1253 |
|
1282 | 1254 | \pnum
|
1283 | 1255 | An evaluation \placeholder{A} is \defn{dependency-ordered before} an evaluation
|
1284 | 1256 | \placeholder{B} if
|
1285 | 1257 | \begin{itemize}
|
1286 |
| - |
1287 | 1258 | \item
|
1288 | 1259 | \placeholder{A} performs a release operation on an atomic object \placeholder{M}, and, in
|
1289 | 1260 | another thread, \placeholder{B} performs a consume operation on \placeholder{M} and reads a
|
|
1303 | 1274 | \pnum
|
1304 | 1275 | An evaluation \placeholder{A} \defn{inter-thread happens before} an evaluation \placeholder{B}
|
1305 | 1276 | if
|
1306 |
| - |
1307 | 1277 | \begin{itemize}
|
1308 |
| - |
1309 | 1278 | \item
|
1310 |
| -\placeholder{A} synchronizes with \placeholder{B}, or |
1311 |
| - |
| 1279 | + \placeholder{A} synchronizes with \placeholder{B}, or |
1312 | 1280 | \item
|
1313 |
| -\placeholder{A} is dependency-ordered before \placeholder{B}, or |
1314 |
| - |
| 1281 | + \placeholder{A} is dependency-ordered before \placeholder{B}, or |
1315 | 1282 | \item
|
1316 |
| -for some evaluation \placeholder{X} |
1317 |
| - |
1318 |
| -\begin{itemize} |
1319 |
| -\item |
1320 |
| -\placeholder{A} synchronizes with \placeholder{X} and \placeholder{X} is sequenced before \placeholder{B}, |
1321 |
| -or |
1322 |
| - |
1323 |
| -\item |
1324 |
| -\placeholder{A} is sequenced before \placeholder{X} and \placeholder{X} inter-thread happens before |
1325 |
| -\placeholder{B}, or |
1326 |
| - |
1327 |
| -\item |
1328 |
| -\placeholder{A} inter-thread happens before \placeholder{X} and \placeholder{X} inter-thread happens |
1329 |
| -before \placeholder{B}. |
1330 |
| -\end{itemize} |
| 1283 | + for some evaluation \placeholder{X} |
| 1284 | + \begin{itemize} |
| 1285 | + \item |
| 1286 | + \placeholder{A} synchronizes with \placeholder{X} and \placeholder{X} |
| 1287 | + is sequenced before \placeholder{B}, or |
| 1288 | + \item |
| 1289 | + \placeholder{A} is sequenced before \placeholder{X} and \placeholder{X} |
| 1290 | + inter-thread happens before \placeholder{B}, or |
| 1291 | + \item |
| 1292 | + \placeholder{A} inter-thread happens before \placeholder{X} and \placeholder{X} |
| 1293 | + inter-thread happens before \placeholder{B}. |
| 1294 | + \end{itemize} |
1331 | 1295 | \end{itemize}
|
1332 |
| - |
1333 | 1296 | \begin{note} The ``inter-thread happens before'' relation describes arbitrary
|
1334 | 1297 | concatenations of ``sequenced before'', ``synchronizes with'' and
|
1335 | 1298 | ``dependency-ordered before'' relationships, with two exceptions. The first
|
|
1349 | 1312 | \pnum
|
1350 | 1313 | An evaluation \placeholder{A} \defn{happens before} an evaluation \placeholder{B}
|
1351 | 1314 | (or, equivalently, \placeholder{B} \defn{happens after} \placeholder{A}) if:
|
1352 |
| - |
1353 | 1315 | \begin{itemize}
|
1354 | 1316 | \item \placeholder{A} is sequenced before \placeholder{B}, or
|
1355 | 1317 | \item \placeholder{A} inter-thread happens before \placeholder{B}.
|
1356 | 1318 | \end{itemize}
|
1357 |
| - |
1358 | 1319 | The implementation shall ensure that no program execution demonstrates a cycle
|
1359 | 1320 | in the ``happens before'' relation. \begin{note} This cycle would otherwise be
|
1360 | 1321 | possible only through the use of consume operations. \end{note}
|
|
1363 | 1324 | A \defnx{visible side effect}{side effects!visible} \placeholder{A} on a scalar object or bit-field \placeholder{M}
|
1364 | 1325 | with respect to a value computation \placeholder{B} of \placeholder{M} satisfies the
|
1365 | 1326 | conditions:
|
1366 |
| - |
1367 | 1327 | \begin{itemize}
|
1368 | 1328 | \item \placeholder{A} happens before \placeholder{B} and
|
1369 | 1329 | \item there is no other
|
|
1514 | 1474 | \pnum
|
1515 | 1475 | The implementation may assume that any thread will eventually do one of the
|
1516 | 1476 | following:
|
1517 |
| - |
1518 | 1477 | \begin{itemize}
|
1519 |
| -\item |
1520 |
| -terminate, |
1521 |
| - |
1522 |
| -\item |
1523 |
| -make a call to a library I/O function, |
1524 |
| - |
1525 |
| -\item |
1526 |
| -read or modify a volatile object, or |
1527 |
| - |
1528 |
| -\item |
1529 |
| -perform a synchronization operation or an atomic operation. |
| 1478 | +\item terminate, |
| 1479 | +\item make a call to a library I/O function, |
| 1480 | +\item read or modify a volatile object, or |
| 1481 | +\item perform a synchronization operation or an atomic operation. |
1530 | 1482 | \end{itemize}
|
1531 |
| - |
1532 | 1483 | \begin{note} This is intended to allow compiler transformations such as removal of
|
1533 | 1484 | empty loops, even when termination cannot be proven. \end{note}
|
1534 | 1485 |
|
|
1537 | 1488 | that are either defined to be lock-free~(\ref{atomics.flag})
|
1538 | 1489 | or indicated as lock-free~(\ref{atomics.lockfree})
|
1539 | 1490 | are \defnx{lock-free executions}{lock-free execution}.
|
1540 |
| - |
1541 | 1491 | \begin{itemize}
|
1542 | 1492 | \item
|
1543 | 1493 | If there is only one thread that is not blocked~(\ref{defns.block})
|
|
1577 | 1527 | \pnum
|
1578 | 1528 | During the execution of a thread of execution, each of the following is termed
|
1579 | 1529 | an \defn{execution step}:
|
1580 |
| - |
1581 | 1530 | \begin{itemize}
|
1582 | 1531 | \item termination of the thread of execution,
|
1583 | 1532 | \item access to a volatile object, or
|
|
0 commit comments