Changeset 36802 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Sep 23, 2008, 12:46:55 AM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-09-23 Maciej Stachowiak <[email protected]>

Reviewed by Darin.


~2% speedup on EarleyBoyer

The idea here is to record in the StructureID whether the class
needs a special hasInstance or if it can use the normal logic from
JSObject.


Based on this I inlined the real work directly into
cti_op_instanceof and put the fastest checks up front and the
error handling at the end (so it should be fairly straightforward
to split off the beginning to be inlined if desired).

I only did this for CTI, not the bytecode interpreter.


  • API/JSCallbackObject.h: (JSC::JSCallbackObject::createStructureID):
  • ChangeLog:
  • VM/Machine.cpp: (JSC::Machine::cti_op_instanceof):
  • kjs/JSImmediate.h: (JSC::JSImmediate::isAnyImmediate):
  • kjs/TypeInfo.h: (JSC::TypeInfo::overridesHasInstance): (JSC::TypeInfo::flags):

WebCore:

2008-09-23 Maciej Stachowiak <[email protected]>

Reviewed by Darin.

~2% speedup on EarleyBoyer

(WebCore updates.)


  • bindings/js/JSQuarantinedObjectWrapper.h: (WebCore::JSQuarantinedObjectWrapper::createStructureID):
Location:
trunk/JavaScriptCore/kjs
Files:
2 edited

Legend:

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

    r36726 r36802  
    155155        }
    156156
     157        static ALWAYS_INLINE bool isAnyImmediate(const JSValue* v1, const JSValue* v2, JSValue* v3)
     158        {
     159            return (reinterpret_cast<uintptr_t>(v1) | reinterpret_cast<uintptr_t>(v2) | reinterpret_cast<uintptr_t>(v3)) & TagMask;
     160        }
     161
    157162        static ALWAYS_INLINE bool areBothImmediate(const JSValue* v1, const JSValue* v2)
    158163        {
  • trunk/JavaScriptCore/kjs/TypeInfo.h

    r36766 r36802  
    3333
    3434    // WebCore uses this to make document.all and style.filter undetectable.
    35     static const unsigned MasqueradesAsUndefined = 0x1;
    36     static const unsigned ImplementsHasInstance = 0x2;
     35    static const unsigned MasqueradesAsUndefined = 1;
     36    static const unsigned ImplementsHasInstance = 1 << 1;
     37    static const unsigned OverridesHasInstance = 1 << 2;
    3738
    3839    class TypeInfo {
     
    4546        bool masqueradesAsUndefined() const { return m_flags & MasqueradesAsUndefined; }
    4647        bool implementsHasInstance() const { return m_flags & ImplementsHasInstance; }
     48        bool overridesHasInstance() const { return m_flags & OverridesHasInstance; }
    4749
     50        unsigned flags() const { return m_flags; }
    4851    private:
    4952        JSType m_type;
Note: See TracChangeset for help on using the changeset viewer.