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/jit/JIT.h

    r91199 r92498  
    5050
    5151    class CodeBlock;
     52    class FunctionExecutable;
    5253    class JIT;
    5354    class JSPropertyNameIterator;
     
    300301
    301302        void emitWriteBarrier(RegisterID owner, RegisterID scratch);
    302        
    303         template<typename T>
    304         void emitAllocateJSFinalObject(T structure, RegisterID result, RegisterID scratch);
     303
     304        template<typename ClassType, typename StructureType> void emitAllocateBasicJSObject(StructureType, void* vtable, RegisterID result, RegisterID storagePtr);
     305        template<typename T> void emitAllocateJSFinalObject(T structure, RegisterID result, RegisterID storagePtr);
     306        void emitAllocateJSFunction(FunctionExecutable*, RegisterID scopeChain, RegisterID result, RegisterID storagePtr);
    305307
    306308#if USE(JSVALUE32_64)
     
    529531        void emitGetVirtualRegisters(int src1, RegisterID dst1, int src2, RegisterID dst2);
    530532        void emitPutVirtualRegister(unsigned dst, RegisterID from = regT0);
     533        void emitStoreCell(unsigned dst, RegisterID payload, bool /* only used in JSValue32_64 */ = false)
     534        {
     535            emitPutVirtualRegister(dst, payload);
     536        }
    531537
    532538        int32_t getConstantOperandImmediateInt(unsigned src);
     
    907913        void emitSlow_op_to_primitive(Instruction*, Vector<SlowCaseEntry>::iterator&);
    908914        void emitSlow_op_urshift(Instruction*, Vector<SlowCaseEntry>::iterator&);
     915        void emitSlow_op_new_func(Instruction*, Vector<SlowCaseEntry>::iterator&);
     916        void emitSlow_op_new_func_exp(Instruction*, Vector<SlowCaseEntry>::iterator&);
    909917
    910918       
Note: See TracChangeset for help on using the changeset viewer.