8299402: Remove metaprogramming/isVolatile.hpp
Reviewed-by: kbarrett, iwalulya, tschatzl
This commit is contained in:
parent
c252a85fb0
commit
9d3d03997e
src/hotspot/share
test/hotspot/gtest/metaprogramming
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_METAPROGRAMMING_ISVOLATILE_HPP
|
||||
#define SHARE_METAPROGRAMMING_ISVOLATILE_HPP
|
||||
|
||||
#include "metaprogramming/integralConstant.hpp"
|
||||
|
||||
template <typename T> struct IsVolatile: public FalseType {};
|
||||
template <typename T> struct IsVolatile<volatile T>: public TrueType {};
|
||||
|
||||
#endif // SHARE_METAPROGRAMMING_ISVOLATILE_HPP
|
@ -35,13 +35,13 @@
|
||||
#include "metaprogramming/isIntegral.hpp"
|
||||
#include "metaprogramming/isPointer.hpp"
|
||||
#include "metaprogramming/isSame.hpp"
|
||||
#include "metaprogramming/isVolatile.hpp"
|
||||
#include "oops/accessDecorators.hpp"
|
||||
#include "oops/oopsHierarchy.hpp"
|
||||
#include "runtime/globals.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
// This metafunction returns either oop or narrowOop depending on whether
|
||||
// an access needs to use compressed oops or not.
|
||||
@ -1109,7 +1109,7 @@ namespace AccessInternal {
|
||||
// If a volatile address is passed in but no memory ordering decorator,
|
||||
// set the memory ordering to MO_RELAXED by default.
|
||||
const DecoratorSet expanded_decorators = DecoratorFixup<
|
||||
(IsVolatile<P>::value && !HasDecorator<decorators, MO_DECORATOR_MASK>::value) ?
|
||||
(std::is_volatile<P>::value && !HasDecorator<decorators, MO_DECORATOR_MASK>::value) ?
|
||||
(MO_RELAXED | decorators) : decorators>::value;
|
||||
store_reduce_types<expanded_decorators>(const_cast<DecayedP*>(addr), decayed_value);
|
||||
}
|
||||
@ -1135,7 +1135,7 @@ namespace AccessInternal {
|
||||
// If a volatile address is passed in but no memory ordering decorator,
|
||||
// set the memory ordering to MO_RELAXED by default.
|
||||
const DecoratorSet expanded_decorators = DecoratorFixup<
|
||||
(IsVolatile<P>::value && !HasDecorator<decorators, MO_DECORATOR_MASK>::value) ?
|
||||
(std::is_volatile<P>::value && !HasDecorator<decorators, MO_DECORATOR_MASK>::value) ?
|
||||
(MO_RELAXED | decorators) : decorators>::value;
|
||||
return load_reduce_types<expanded_decorators, DecayedT>(const_cast<DecayedP*>(addr));
|
||||
}
|
||||
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "metaprogramming/isVolatile.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
|
||||
class IsVolatileTest {
|
||||
class A: AllStatic {};
|
||||
|
||||
STATIC_ASSERT(IsVolatile<volatile int>::value);
|
||||
STATIC_ASSERT(IsVolatile<const volatile int>::value);
|
||||
STATIC_ASSERT(!IsVolatile<const int>::value);
|
||||
STATIC_ASSERT(!IsVolatile<int>::value);
|
||||
|
||||
STATIC_ASSERT(IsVolatile<volatile A>::value);
|
||||
STATIC_ASSERT(!IsVolatile<const A>::value);
|
||||
STATIC_ASSERT(!IsVolatile<A>::value);
|
||||
|
||||
STATIC_ASSERT(!IsVolatile<volatile A*>::value);
|
||||
STATIC_ASSERT(IsVolatile<A* volatile>::value);
|
||||
STATIC_ASSERT(IsVolatile<volatile A* volatile>::value);
|
||||
STATIC_ASSERT(IsVolatile<A* const volatile>::value);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user