Ignore:
Timestamp:
Aug 5, 2011, 1:03:19 PM (14 years ago)
Author:
[email protected]
Message:

Inline allocation of function objects
https://bugs.webkit.org/show_bug.cgi?id=65779

Reviewed by Gavin Barraclough.

Inline allocation and initilisation of function objects
in generated code. This ended up being a 60-70% improvement
in function allocation performance. This improvement shows
up as a ~2% improvement in 32bit sunspider and V8, but is a
wash on 64-bit.

We currently don't inline the allocation of named function
expressions, as that requires being able to gc allocate a
variable object.

  • jit/JIT.cpp:

(JSC::JIT::privateCompileSlowCases):

  • jit/JIT.h:

(JSC::JIT::emitStoreCell):

  • jit/JITInlineMethods.h:

(JSC::JIT::emitAllocateBasicJSObject):
(JSC::JIT::emitAllocateJSFinalObject):
(JSC::JIT::emitAllocateJSFunction):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_new_func):
(JSC::JIT::emitSlow_op_new_func):
(JSC::JIT::emit_op_new_func_exp):
(JSC::JIT::emitSlow_op_new_func_exp):

  • jit/JITOpcodes32_64.cpp:

Removed duplicate implementation of op_new_func and op_new_func_exp

  • runtime/JSFunction.h:

(JSC::JSFunction::offsetOfScopeChain):
(JSC::JSFunction::offsetOfExecutable):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSFunction.h

    r91194 r92498  
    111111        virtual CallType getCallData(CallData&);
    112112
     113        static inline size_t offsetOfScopeChain()
     114        {
     115            return OBJECT_OFFSETOF(JSFunction, m_scopeChain);
     116        }
     117
     118        static inline size_t offsetOfExecutable()
     119        {
     120            return OBJECT_OFFSETOF(JSFunction, m_executable);
     121        }
     122
    113123    protected:
    114124        const static unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
Note: See TracChangeset for help on using the changeset viewer.