Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: src/base/division-by-constant.h

Issue 2393603002: Revert of Turn libbase into a component (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/base/debug/stack_trace.h ('k') | src/base/division-by-constant.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/division-by-constant.h
diff --git a/src/base/division-by-constant.h b/src/base/division-by-constant.h
index d018ea5ff1cbb37b3113ded30f7027a3d67bee8e..02e7e14b0141c5b7d89bad6b6382e6c613ca2bdf 100644
--- a/src/base/division-by-constant.h
+++ b/src/base/division-by-constant.h
@@ -4,10 +4,6 @@
#ifndef V8_BASE_DIVISION_BY_CONSTANT_H_
#define V8_BASE_DIVISION_BY_CONSTANT_H_
-
-#include <stdint.h>
-
-#include "src/base/base-export.h"
namespace v8 {
namespace base {
@@ -18,12 +14,10 @@
// Delight", chapter 10. The template parameter must be one of the unsigned
// integral types.
template <class T>
-struct V8_BASE_EXPORT MagicNumbersForDivision {
+struct MagicNumbersForDivision {
MagicNumbersForDivision(T m, unsigned s, bool a)
: multiplier(m), shift(s), add(a) {}
- bool operator==(const MagicNumbersForDivision& rhs) const {
- return multiplier == rhs.multiplier && shift == rhs.shift && add == rhs.add;
- }
+ bool operator==(const MagicNumbersForDivision& rhs) const;
T multiplier;
unsigned shift;
@@ -34,28 +28,16 @@
// Calculate the multiplier and shift for signed division via multiplication.
// The divisor must not be -1, 0 or 1 when interpreted as a signed value.
template <class T>
-V8_BASE_EXPORT MagicNumbersForDivision<T> SignedDivisionByConstant(T d);
+MagicNumbersForDivision<T> SignedDivisionByConstant(T d);
+
// Calculate the multiplier and shift for unsigned division via multiplication,
// see Warren's "Hacker's Delight", chapter 10. The divisor must not be 0 and
// leading_zeros can be used to speed up the calculation if the given number of
// upper bits of the dividend value are known to be zero.
template <class T>
-V8_BASE_EXPORT MagicNumbersForDivision<T> UnsignedDivisionByConstant(
+MagicNumbersForDivision<T> UnsignedDivisionByConstant(
T d, unsigned leading_zeros = 0);
-
-template struct V8_BASE_EXPORT MagicNumbersForDivision<uint32_t>;
-template struct V8_BASE_EXPORT MagicNumbersForDivision<uint64_t>;
-
-extern template V8_BASE_EXPORT MagicNumbersForDivision<uint32_t>
-SignedDivisionByConstant(uint32_t d);
-extern template V8_BASE_EXPORT MagicNumbersForDivision<uint64_t>
-SignedDivisionByConstant(uint64_t d);
-
-extern template V8_BASE_EXPORT MagicNumbersForDivision<uint32_t>
-UnsignedDivisionByConstant(uint32_t d, unsigned leading_zeros);
-extern template V8_BASE_EXPORT MagicNumbersForDivision<uint64_t>
-UnsignedDivisionByConstant(uint64_t d, unsigned leading_zeros);
} // namespace base
} // namespace v8
« no previous file with comments | « src/base/debug/stack_trace.h ('k') | src/base/division-by-constant.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698