Commit 9010158c authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Remove wtf/alignment.h.

It is unused, except for two calls to is AlignedTo which can be inlined.

Change-Id: I4aa8b56548b2e217f3ed0eb03be5e7ae5a0d8c54
Reviewed-on: https://chromium-review.googlesource.com/c/1352987
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarYuta Kitamura <yutak@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612245}
parent ce3b3dd5
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h" #include "base/macros.h"
#include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/alignment.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/compiler.h" #include "third_party/blink/renderer/platform/wtf/compiler.h"
#include "third_party/blink/renderer/platform/wtf/type_traits.h" #include "third_party/blink/renderer/platform/wtf/type_traits.h"
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "third_party/blink/renderer/platform/graphics/contiguous_container.h" #include "third_party/blink/renderer/platform/graphics/contiguous_container.h"
#include "third_party/blink/renderer/platform/graphics/paint/display_item.h" #include "third_party/blink/renderer/platform/graphics/paint/display_item.h"
#include "third_party/blink/renderer/platform/graphics/paint/hit_test_display_item.h" #include "third_party/blink/renderer/platform/graphics/paint/hit_test_display_item.h"
#include "third_party/blink/renderer/platform/wtf/alignment.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h" #include "third_party/blink/renderer/platform/wtf/assertions.h"
namespace blink { namespace blink {
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "third_party/blink/renderer/platform/graphics/paint/paint_chunker.h" #include "third_party/blink/renderer/platform/graphics/paint/paint_chunker.h"
#include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/alignment.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h" #include "third_party/blink/renderer/platform/wtf/assertions.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h" #include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h" #include "third_party/blink/renderer/platform/wtf/hash_set.h"
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "third_party/blink/renderer/platform/heap/blink_gc.h" #include "third_party/blink/renderer/platform/heap/blink_gc.h"
#include "third_party/blink/renderer/platform/heap/heap_page.h" #include "third_party/blink/renderer/platform/heap/heap_page.h"
#include "third_party/blink/renderer/platform/wtf/alignment.h"
namespace blink { namespace blink {
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "third_party/blink/renderer/platform/geometry/float_point.h" #include "third_party/blink/renderer/platform/geometry/float_point.h"
#include "third_party/blink/renderer/platform/geometry/float_point_3d.h" #include "third_party/blink/renderer/platform/geometry/float_point_3d.h"
#include "third_party/blink/renderer/platform/wtf/alignment.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator.h"
namespace gfx { namespace gfx {
......
...@@ -45,7 +45,6 @@ config("wtf_config") { ...@@ -45,7 +45,6 @@ config("wtf_config") {
jumbo_component("wtf") { jumbo_component("wtf") {
sources = [ sources = [
"address_sanitizer.h", "address_sanitizer.h",
"alignment.h",
"allocator.cc", "allocator.cc",
"allocator.h", "allocator.h",
"allocator/partition_allocator.cc", "allocator/partition_allocator.cc",
......
/*
* Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_ALIGNMENT_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_ALIGNMENT_H_
#include <stdint.h>
#include "build/build_config.h"
namespace WTF {
#if defined(COMPILER_GCC)
#define WTF_ALIGN_OF(type) __alignof__(type)
#define WTF_ALIGNED(variable_type, variable, n) \
variable_type variable __attribute__((__aligned__(n)))
#elif defined(COMPILER_MSVC)
#define WTF_ALIGN_OF(type) __alignof(type)
#define WTF_ALIGNED(variable_type, variable, n) \
__declspec(align(n)) variable_type variable
#else
#error WTF_ALIGN macros need alignment control.
#endif
template <uintptr_t mask>
inline bool IsAlignedTo(const void* pointer) {
return !(reinterpret_cast<uintptr_t>(pointer) & mask);
}
} // namespace WTF
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_ALIGNMENT_H_
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <memory> #include <memory>
#include "base/numerics/checked_math.h" #include "base/numerics/checked_math.h"
#include "third_party/blink/renderer/platform/wtf/alignment.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/allocator/partition_allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator/partition_allocator.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h" #include "third_party/blink/renderer/platform/wtf/assertions.h"
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <stdint.h> #include <stdint.h>
#include "build/build_config.h" #include "build/build_config.h"
#include "third_party/blink/renderer/platform/wtf/alignment.h"
#include "third_party/blink/renderer/platform/wtf/cpu.h" #include "third_party/blink/renderer/platform/wtf/cpu.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h" #include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/unicode.h" #include "third_party/blink/renderer/platform/wtf/text/unicode.h"
...@@ -117,7 +116,9 @@ inline void CopyLCharsFromUCharSource(LChar* destination, ...@@ -117,7 +116,9 @@ inline void CopyLCharsFromUCharSource(LChar* destination,
const uintptr_t kMemoryAccessMask = kMemoryAccessSize - 1; const uintptr_t kMemoryAccessMask = kMemoryAccessSize - 1;
size_t i = 0; size_t i = 0;
for (; i < length && !IsAlignedTo<kMemoryAccessMask>(&source[i]); ++i) { for (; i < length &&
reinterpret_cast<uintptr_t>(&source[i]) & kMemoryAccessMask;
++i) {
DCHECK(!(source[i] & 0xff00)); DCHECK(!(source[i] & 0xff00));
destination[i] = static_cast<LChar>(source[i]); destination[i] = static_cast<LChar>(source[i]);
} }
...@@ -155,7 +156,7 @@ inline void CopyLCharsFromUCharSource(LChar* destination, ...@@ -155,7 +156,7 @@ inline void CopyLCharsFromUCharSource(LChar* destination,
if (length >= (2 * kMemoryAccessSize) - 1) { if (length >= (2 * kMemoryAccessSize) - 1) {
// Prefix: align dst on 64 bits. // Prefix: align dst on 64 bits.
const uintptr_t kMemoryAccessMask = kMemoryAccessSize - 1; const uintptr_t kMemoryAccessMask = kMemoryAccessSize - 1;
while (!IsAlignedTo<kMemoryAccessMask>(destination)) while (reinterpret_cast<uintptr_t>(destination) & kMemoryAccessMask)
*destination++ = static_cast<LChar>(*source++); *destination++ = static_cast<LChar>(*source++);
// Vector interleaved unpack, we only store the lower 8 bits. // Vector interleaved unpack, we only store the lower 8 bits.
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/template_util.h" #include "base/template_util.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "third_party/blink/renderer/platform/wtf/alignment.h"
#include "third_party/blink/renderer/platform/wtf/allocator/partition_allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator/partition_allocator.h"
#include "third_party/blink/renderer/platform/wtf/construct_traits.h" #include "third_party/blink/renderer/platform/wtf/construct_traits.h"
#include "third_party/blink/renderer/platform/wtf/container_annotations.h" #include "third_party/blink/renderer/platform/wtf/container_annotations.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment