+2008-02-28 Eric Christopher <echristo@apple.com>
+
+ 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).
+
2008-02-27 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Sam Weinig.
virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
};
+#if COMPILER(GCC)
+#define UNLIKELY(x) \
+ __builtin_expect ((x), 0)
+#else
+#define UNLIKELY(x) x
+#endif
+
#define KJS_CHECKEXCEPTION \
-if (exec->hadException()) \
+if (UNLIKELY(exec->hadException())) \
return rethrowException(exec);
#define KJS_CHECKEXCEPTIONVALUE \
-if (exec->hadException()) { \
+if (UNLIKELY(exec->hadException())) { \
handleException(exec); \
return jsUndefined(); \
}
#define KJS_CHECKEXCEPTIONNUMBER \
-if (exec->hadException()) { \
+if (UNLIKELY(exec->hadException())) { \
handleException(exec); \
return 0; \
}
#define KJS_CHECKEXCEPTIONBOOLEAN \
-if (exec->hadException()) { \
+if (UNLIKELY(exec->hadException())) { \
handleException(exec); \
return false; \
}
#define KJS_CHECKEXCEPTIONVOID \
-if (exec->hadException()) { \
+if (UNLIKELY(exec->hadException())) { \
handleException(exec); \
return; \
}