diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /JavaScriptCore/wtf/AlwaysInline.h | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'JavaScriptCore/wtf/AlwaysInline.h')
-rw-r--r-- | JavaScriptCore/wtf/AlwaysInline.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/JavaScriptCore/wtf/AlwaysInline.h b/JavaScriptCore/wtf/AlwaysInline.h index 3f54815..d39b2b9 100644 --- a/JavaScriptCore/wtf/AlwaysInline.h +++ b/JavaScriptCore/wtf/AlwaysInline.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2005, 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 @@ -18,8 +18,10 @@ * */ +#include "Platform.h" + #ifndef ALWAYS_INLINE -#if COMPILER(GCC) && defined(NDEBUG) +#if COMPILER(GCC) && defined(NDEBUG) && !COMPILER(MINGW) #define ALWAYS_INLINE inline __attribute__ ((__always_inline__)) #elif COMPILER(MSVC) && defined(NDEBUG) #define ALWAYS_INLINE __forceinline @@ -35,3 +37,19 @@ #define NEVER_INLINE #endif #endif + +#ifndef UNLIKELY +#if COMPILER(GCC) +#define UNLIKELY(x) __builtin_expect((x), 0) +#else +#define UNLIKELY(x) (x) +#endif +#endif + +#ifndef LIKELY +#if COMPILER(GCC) +#define LIKELY(x) __builtin_expect((x), 1) +#else +#define LIKELY(x) (x) +#endif +#endif |