Changeset 30651 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Feb 28, 2008, 2:16:46 PM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Geoffrey Garen.

TOTAL : 1.005x as fast 2867.6ms +/- 0.4% 2853.2ms +/- 0.3% significant

  • kjs/nodes.cpp: Tell the compiler that exceptions are unexpected (for the sake of branch prediction and code organization).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r30534 r30651  
    5151};
    5252
     53#if COMPILER(GCC)
     54#define UNLIKELY(x) \
     55  __builtin_expect ((x), 0)
     56#else
     57#define UNLIKELY(x) x
     58#endif
     59   
    5360#define KJS_CHECKEXCEPTION \
    54 if (exec->hadException()) \
     61if (UNLIKELY(exec->hadException())) \
    5562    return rethrowException(exec);
    5663
    5764#define KJS_CHECKEXCEPTIONVALUE \
    58 if (exec->hadException()) { \
     65if (UNLIKELY(exec->hadException())) { \
    5966    handleException(exec); \
    6067    return jsUndefined(); \
     
    6269
    6370#define KJS_CHECKEXCEPTIONNUMBER \
    64 if (exec->hadException()) { \
     71if (UNLIKELY(exec->hadException())) { \
    6572    handleException(exec); \
    6673    return 0; \
     
    6875
    6976#define KJS_CHECKEXCEPTIONBOOLEAN \
    70 if (exec->hadException()) { \
     77if (UNLIKELY(exec->hadException())) { \
    7178    handleException(exec); \
    7279    return false; \
     
    7481
    7582#define KJS_CHECKEXCEPTIONVOID \
    76 if (exec->hadException()) { \
     83if (UNLIKELY(exec->hadException())) { \
    7784    handleException(exec); \
    7885    return; \
Note: See TracChangeset for help on using the changeset viewer.