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

Unified Diff: src/base/bits.h

Issue 1952843002: Create TimeBase for time related classes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | src/base/bits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/bits.h
diff --git a/src/base/bits.h b/src/base/bits.h
index 0e7662488428899bb8ca96677d873fcabac284db..2e6527b0548ec54f6640cc629d06c0a729959fe3 100644
--- a/src/base/bits.h
+++ b/src/base/bits.h
@@ -16,6 +16,12 @@
namespace v8 {
namespace base {
+
+namespace internal {
jochen (gone - plz use gerrit) 2016/05/06 09:43:02 safe_math.h has using internal::CheckedNumeric in
lpy 2016/05/06 17:23:23 It's used in the declaration of FromCheckedNumeric
+template <typename T>
+class CheckedNumeric;
+}
+
namespace bits {
// CountPopulation32(value) returns the number of bits set in |value|.
@@ -296,6 +302,21 @@ inline uint32_t UnsignedMod32(uint32_t lhs, uint32_t rhs) {
return rhs ? lhs % rhs : 0u;
}
+
+// Clamp |value| on overflow and underflow conditions.
+int64_t FromCheckedNumeric(const internal::CheckedNumeric<int64_t> value);
+
+
+// SignedSaturatedAdd64(lhs, rhs) adds |lhs| and |rhs|,
+// checks and returns the result.
+int64_t SignedSaturatedAdd64(int64_t lhs, int64_t rhs);
+
+
+// SignedSaturatedSub64(lhs, rhs) substracts |lhs| by |rhs|,
+// checks and returns the result.
+int64_t SignedSaturatedSub64(int64_t lhs, int64_t rhs);
+
+
} // namespace bits
} // namespace base
} // namespace v8
« no previous file with comments | « no previous file | src/base/bits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698