Index: base/compiler_specific.h |
diff --git a/base/compiler_specific.h b/base/compiler_specific.h |
index 0dbc3ae576688908b41a1b5921c744a71f5ada4c..996db0e5a70e47190a58bd6a34e1f26dcb572b13 100644 |
--- a/base/compiler_specific.h |
+++ b/base/compiler_specific.h |
@@ -100,6 +100,17 @@ |
#define NOINLINE |
#endif |
+// For compatibility with callers in Blink: |
+#define NEVER_INLINE NOINLINE |
dcheng
2016/11/07 20:43:10
Btw, maybe a TODO here for eventual convergence. I
palmer
2016/11/07 21:54:14
Done.
|
+ |
+#if COMPILER_GCC && defined(NDEBUG) |
+#define ALWAYS_INLINE inline __attribute__((__always_inline__)) |
+#elif COMPILER_MSVC && defined(NDEBUG) |
+#define ALWAYS_INLINE __forceinline |
+#else |
+#define ALWAYS_INLINE inline |
+#endif |
+ |
// Specify memory alignment for structs, classes, etc. |
// Use like: |
// class ALIGNAS(16) MyClass { ... } |
@@ -196,6 +207,14 @@ |
#endif // defined(COMPILER_GCC) |
#endif // !defined(UNLIKELY) |
+#if !defined(LIKELY) |
+#if defined(COMPILER_GCC) |
+#define LIKELY(x) __builtin_expect((x), 1) |
+#else |
+#define LIKELY(x) (x) |
+#endif // defined(COMPILER_GCC) |
+#endif // !defined(LIKELY) |
+ |
// Compiler feature-detection. |
// clang.llvm.org/docs/LanguageExtensions.html#has-feature-and-has-extension |
#if defined(__has_feature) |