Commit 098cbb41 authored by mjs's avatar mjs

Reviewed by Oliver.

        
        - encourage GCC a little harder to inline a few hot functions for 1.5% improvement on SunSpider.

        * kjs/value.h:
        (KJS::JSValue::getUInt32):
        (KJS::JSValue::getTruncatedInt32):
        (KJS::JSValue::toNumber):
        * wtf/PassRefPtr.h:
        (WTF::PassRefPtr::~PassRefPtr):
        * wtf/RefPtr.h:
        (WTF::RefPtr::operator->):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7f52fd69
2007-10-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- encourage GCC a little harder to inline a few hot functions for 1.5% improvement on SunSpider.
* kjs/value.h:
(KJS::JSValue::getUInt32):
(KJS::JSValue::getTruncatedInt32):
(KJS::JSValue::toNumber):
* wtf/PassRefPtr.h:
(WTF::PassRefPtr::~PassRefPtr):
* wtf/RefPtr.h:
(WTF::RefPtr::operator->):
2007-10-26 Mark Rowe <mrowe@apple.com>
Gtk build fix.
......
......@@ -337,12 +337,12 @@ inline const JSObject *JSValue::getObject() const
return JSImmediate::isImmediate(this) ? 0 : asCell()->getObject();
}
inline bool JSValue::getUInt32(uint32_t& v) const
ALWAYS_INLINE bool JSValue::getUInt32(uint32_t& v) const
{
return JSImmediate::isImmediate(this) ? JSImmediate::getUInt32(this, v) : asCell()->getUInt32(v);
}
inline bool JSValue::getTruncatedInt32(int32_t& v) const
ALWAYS_INLINE bool JSValue::getTruncatedInt32(int32_t& v) const
{
return JSImmediate::isImmediate(this) ? JSImmediate::getTruncatedInt32(this, v) : asCell()->getTruncatedInt32(v);
}
......@@ -387,7 +387,7 @@ inline bool JSValue::toBoolean(ExecState *exec) const
return JSImmediate::isImmediate(this) ? JSImmediate::toBoolean(this) : asCell()->toBoolean(exec);
}
inline double JSValue::toNumber(ExecState *exec) const
ALWAYS_INLINE double JSValue::toNumber(ExecState *exec) const
{
return JSImmediate::isImmediate(this) ? JSImmediate::toDouble(this) : asCell()->toNumber(exec);
}
......
......@@ -23,6 +23,8 @@
#ifndef WTF_PassRefPtr_h
#define WTF_PassRefPtr_h
#include "AlwaysInline.h"
namespace WTF {
template<typename T> class RefPtr;
......@@ -42,7 +44,7 @@ namespace WTF {
PassRefPtr(const PassRefPtr& o) : m_ptr(o.releaseRef()) {}
template <typename U> PassRefPtr(const PassRefPtr<U>& o) : m_ptr(o.releaseRef()) { }
~PassRefPtr() { if (T* ptr = m_ptr) ptr->deref(); }
ALWAYS_INLINE ~PassRefPtr() { if (T* ptr = m_ptr) ptr->deref(); }
template <class U>
PassRefPtr(const RefPtr<U>& o) : m_ptr(o.get()) { if (T* ptr = m_ptr) ptr->ref(); }
......
......@@ -24,6 +24,7 @@
#define WTF_RefPtr_h
#include <algorithm>
#include "AlwaysInline.h"
namespace WTF {
......@@ -47,7 +48,7 @@ namespace WTF {
PassRefPtr<T> release() { PassRefPtr<T> tmp = adoptRef(m_ptr); m_ptr = 0; return tmp; }
T& operator*() const { return *m_ptr; }
T *operator->() const { return m_ptr; }
ALWAYS_INLINE T *operator->() const { return m_ptr; }
bool operator!() const { return !m_ptr; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment