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

Unified Diff: src/utils.h

Issue 2734253003: Merged: Squashed multiple commits. (Closed)
Patch Set: Created 3 years, 9 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/compiler/wasm-compiler.cc ('k') | src/wasm/wasm-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index 45e397ac10f18e1d6a357e6fcf2540455c10367d..f6e50e519196235738f1e167d3bae605177a99a3 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -192,6 +192,11 @@ inline bool IsAddressAligned(Address addr,
return IsAligned(offs, alignment);
}
+template <typename T, typename U>
+inline T RoundUpToMultipleOfPowOf2(T value, U multiple) {
+ DCHECK(multiple && ((multiple & (multiple - 1)) == 0));
+ return (value + multiple - 1) & ~(multiple - 1);
+}
// Returns the maximum of the two parameters.
template <typename T>
@@ -515,6 +520,15 @@ const int kMinComplexMemCopy = 8;
// ----------------------------------------------------------------------------
// Miscellaneous
+// Memory offset for lower and higher bits in a 64 bit integer.
+#if defined(V8_TARGET_LITTLE_ENDIAN)
+static const int kInt64LowerHalfMemoryOffset = 0;
+static const int kInt64UpperHalfMemoryOffset = 4;
+#elif defined(V8_TARGET_BIG_ENDIAN)
+static const int kInt64LowerHalfMemoryOffset = 4;
+static const int kInt64UpperHalfMemoryOffset = 0;
+#endif // V8_TARGET_LITTLE_ENDIAN
+
// A static resource holds a static instance that can be reserved in
// a local scope using an instance of Access. Attempts to re-reserve
// the instance will cause an error.
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/wasm/wasm-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698