Bug 1355554 - Part 7: Remove outdated comments about atomics implementation details. r=jorendorff
authorAndré Bargull <andre.bargull@gmail.com>
Wed, 20 May 2020 11:12:06 +0000
changeset 531220 b4607c8f46610c7c5df462d1594096e62c76ce79
parent 531219 646b52cf410ff8f69c59adb6169162d97cde0aef
child 531221 740634c137bbc1e06e8d5a649f87d4a8146c5174
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1355554
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1355554 - Part 7: Remove outdated comments about atomics implementation details. r=jorendorff Differential Revision: https://phabricator.services.mozilla.com/D24085
js/src/builtin/AtomicsObject.cpp
--- a/js/src/builtin/AtomicsObject.cpp
+++ b/js/src/builtin/AtomicsObject.cpp
@@ -2,58 +2,23 @@
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * 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/. */
 
 /*
  * JS Atomics pseudo-module.
  *
- * See "Spec: JavaScript Shared Memory, Atomics, and Locks" for the
- * full specification.
- *
- * In addition to what is specified there, we throw an Error object if
- * the futex API hooks have not been installed on the runtime.
- * Essentially that is an implementation error at a higher level.
- *
- *
- * Note on the current implementation of atomic operations.
- *
- * The Mozilla atomics are not sufficient to implement these APIs
- * because we need to support 8-bit, 16-bit, and 32-bit data: the
- * Mozilla atomics only support 32-bit data.
- *
- * At the moment we include mozilla/Atomics.h, which will define
- * MOZ_HAVE_CXX11_ATOMICS and include <atomic> if we have C++11
- * atomics.
- *
- * If MOZ_HAVE_CXX11_ATOMICS is set we'll use C++11 atomics.
- *
- * Otherwise, if the compiler has them we'll fall back on gcc/Clang
- * intrinsics.
- *
- * Otherwise, if we're on VC++2012, we'll use C++11 atomics even if
- * MOZ_HAVE_CXX11_ATOMICS is not defined.  The compiler has the
- * atomics but they are disabled in Mozilla due to a performance bug.
- * That performance bug does not affect the Atomics code.  See
- * mozilla/Atomics.h for further comments on that bug.
- *
- * Otherwise, if we're on VC++2010 or VC++2008, we'll emulate the
- * gcc/Clang intrinsics with simple code below using the VC++
- * intrinsics, like the VC++2012 solution this is a stopgap since
- * we're about to start using VC++2013 anyway.
- *
- * If none of those options are available then the build must disable
- * shared memory, or compilation will fail with a predictable error.
+ * See chapter 24.4 "The Atomics Object" and chapter 27 "Memory Model" in
+ * ECMAScript 2021 for the full specification.
  */
 
 #include "builtin/AtomicsObject.h"
 
 #include "mozilla/Atomics.h"
-#include "mozilla/CheckedInt.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/ScopeExit.h"
 #include "mozilla/Unused.h"
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
@@ -1046,11 +1011,8 @@ static JSObject* CreateAtomicsObject(JSC
 }
 
 static const ClassSpec AtomicsClassSpec = {CreateAtomicsObject, nullptr,
                                            AtomicsMethods, AtomicsProperties};
 
 const JSClass AtomicsObject::class_ = {
     "Atomics", JSCLASS_HAS_CACHED_PROTO(JSProto_Atomics), JS_NULL_CLASS_OPS,
     &AtomicsClassSpec};
-
-#undef CXX11_ATOMICS
-#undef GNU_ATOMICS