Ignore:
Timestamp:
May 30, 2008, 2:10:42 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Oliver Hunt.

https://bugs.webkit.org/show_bug.cgi?id=19180
speed up SunSpider by optimizing immediate number cases

Also fixed three JavaScriptCore regressions seen on PowerPC - we didn't clip right shift
parameter to 0...31.

1.6% improvement on SunSpider, without significant regressions on any tests.

  • VM/Machine.cpp: (KJS::Machine::privateExecute): Added fast paths for >>, ==, ===, !=, !==. Changed order of memory accesses in many cases, making them less dependent on gcc's ability to properly assign registers. With this, I could move exception checks back into slow code paths, and saw less randomness in general.
  • kjs/JSImmediate.h: (KJS::JSImmediate::rightShiftImmediateNumbers): Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSImmediate.h

    r34171 r34258  
    8181    {
    8282        return (getTag(v) == UndefinedType);
     83    }
     84
     85    static bool isNegative(const JSValue* v)
     86    {
     87        ASSERT(isNumber(v));
     88        return reinterpret_cast<uintptr_t>(v) & 0x80000000;
    8389    }
    8490
     
    119125    }
    120126
     127    static ALWAYS_INLINE JSValue* rightShiftImmediateNumbers(const JSValue* val, const JSValue* shift)
     128    {
     129        ASSERT(areBothImmediateNumbers(val, shift));
     130        return reinterpret_cast<JSValue*>((reinterpret_cast<intptr_t>(val) >> ((reinterpret_cast<uintptr_t>(shift) >> 2) & 0x1f)) | NumberType);
     131    }
     132
    121133    static ALWAYS_INLINE bool canDoFastAdditiveOperations(const JSValue* v)
    122134    {
Note: See TracChangeset for help on using the changeset viewer.