зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1623957 - Part 10: Replace mozilla::Conditional with std::conditional. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D67658 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
18da032034
Коммит
94fe0cb565
|
@ -1038,9 +1038,8 @@ namespace detail {
|
|||
*/
|
||||
template <typename T>
|
||||
using MaybeWrapped =
|
||||
typename mozilla::Conditional<MapTypeToRootKind<T>::kind ==
|
||||
JS::RootKind::Traceable,
|
||||
js::DispatchWrapper<T>, T>::Type;
|
||||
std::conditional_t<MapTypeToRootKind<T>::kind == JS::RootKind::Traceable,
|
||||
js::DispatchWrapper<T>, T>;
|
||||
|
||||
// Dummy types to make it easier to understand template overload preference
|
||||
// ordering.
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#ifndef vm_SharedMem_h
|
||||
#define vm_SharedMem_h
|
||||
|
||||
#include "mozilla/TypeTraits.h"
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
template <typename T>
|
||||
|
@ -80,9 +78,8 @@ class SharedMem {
|
|||
#ifdef DEBUG
|
||||
MOZ_ASSERT(
|
||||
asValue() %
|
||||
sizeof(
|
||||
mozilla::Conditional<std::is_void_v<std::remove_pointer_t<U>>,
|
||||
char, std::remove_pointer_t<U>>) ==
|
||||
sizeof(std::conditional_t<std::is_void_v<std::remove_pointer_t<U>>,
|
||||
char, std::remove_pointer_t<U>>) ==
|
||||
0);
|
||||
if (sharedness_ == IsUnshared) {
|
||||
return SharedMem<U>::unshared(unwrap());
|
||||
|
@ -126,9 +123,8 @@ class SharedMem {
|
|||
SharedMem addBytes(size_t nbytes) {
|
||||
MOZ_ASSERT(
|
||||
nbytes %
|
||||
sizeof(
|
||||
mozilla::Conditional<std::is_void_v<std::remove_pointer_t<T>>,
|
||||
char, std::remove_pointer_t<T>>) ==
|
||||
sizeof(std::conditional_t<std::is_void_v<std::remove_pointer_t<T>>,
|
||||
char, std::remove_pointer_t<T>>) ==
|
||||
0);
|
||||
return SharedMem(
|
||||
reinterpret_cast<T>(reinterpret_cast<char*>(ptr_) + nbytes), *this);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "mozilla/Variant.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
|
||||
#include "gc/Rooting.h"
|
||||
#include "jit/JSJitFrameIter.h"
|
||||
|
@ -858,8 +859,8 @@ namespace detail {
|
|||
|
||||
/** Function call/construct args of statically-unknown count. */
|
||||
template <MaybeConstruct Construct>
|
||||
class GenericArgsBase : public mozilla::Conditional<Construct, AnyConstructArgs,
|
||||
AnyInvokeArgs>::Type {
|
||||
class GenericArgsBase
|
||||
: public std::conditional_t<Construct, AnyConstructArgs, AnyInvokeArgs> {
|
||||
protected:
|
||||
RootedValueVector v_;
|
||||
|
||||
|
@ -891,8 +892,8 @@ class GenericArgsBase : public mozilla::Conditional<Construct, AnyConstructArgs,
|
|||
|
||||
/** Function call/construct args of statically-known count. */
|
||||
template <MaybeConstruct Construct, size_t N>
|
||||
class FixedArgsBase : public mozilla::Conditional<Construct, AnyConstructArgs,
|
||||
AnyInvokeArgs>::Type {
|
||||
class FixedArgsBase
|
||||
: public std::conditional_t<Construct, AnyConstructArgs, AnyInvokeArgs> {
|
||||
static_assert(N <= ARGS_LENGTH_MAX, "o/~ too many args o/~");
|
||||
|
||||
protected:
|
||||
|
|
Загрузка…
Ссылка в новой задаче