Ignore:
Timestamp:
Jul 18, 2011, 11:55:48 AM (14 years ago)
Author:
[email protected]
Message:

JSC JIT does not inline GC allocation fast paths
https://bugs.webkit.org/show_bug.cgi?id=64582

Patch by Filip Pizlo <[email protected]> on 2011-07-18
Reviewed by Oliver Hunt.

This addresses inlining allocation for the easiest-to-allocate cases:
op_new_object and op_create_this. Inlining GC allocation fast paths
required three changes. First, the JSGlobalData now saves the vtable
pointer of JSFinalObject, since that's what op_new_object and
op_create_this allocate. Second, the Heap exposes a reference to
the appropriate SizeClass, so that the JIT may inline accesses
directly to the SizeClass for JSFinalObject allocations. And third,
the JIT is extended with code to emit inline fast paths for GC
allocation. A stub call is emitted in the case where the inline fast
path fails.

  • heap/Heap.h:

(JSC::Heap::sizeClassFor):
(JSC::Heap::allocate):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileSlowCases):

  • jit/JIT.h:
  • jit/JITInlineMethods.h:

(JSC::JIT::emitAllocateJSFinalObject):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_new_object):
(JSC::JIT::emitSlow_op_new_object):
(JSC::JIT::emit_op_create_this):
(JSC::JIT::emitSlow_op_create_this):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_new_object):
(JSC::JIT::emitSlow_op_new_object):
(JSC::JIT::emit_op_create_this):
(JSC::JIT::emitSlow_op_create_this):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::storeVPtrs):

  • runtime/JSGlobalData.h:
  • runtime/JSObject.h:

(JSC::JSFinalObject::JSFinalObject):
(JSC::JSObject::offsetOfInheritorID):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r91095 r91199  
    300300
    301301        void emitWriteBarrier(RegisterID owner, RegisterID scratch);
     302       
     303        template<typename T>
     304        void emitAllocateJSFinalObject(T structure, RegisterID result, RegisterID scratch);
    302305
    303306#if USE(JSVALUE32_64)
     
    854857        void emitSlow_op_construct(Instruction*, Vector<SlowCaseEntry>::iterator&);
    855858        void emitSlow_op_convert_this(Instruction*, Vector<SlowCaseEntry>::iterator&);
     859        void emitSlow_op_create_this(Instruction*, Vector<SlowCaseEntry>::iterator&);
    856860        void emitSlow_op_div(Instruction*, Vector<SlowCaseEntry>::iterator&);
    857861        void emitSlow_op_eq(Instruction*, Vector<SlowCaseEntry>::iterator&);
     
    886890        void emitSlow_op_negate(Instruction*, Vector<SlowCaseEntry>::iterator&);
    887891        void emitSlow_op_neq(Instruction*, Vector<SlowCaseEntry>::iterator&);
     892        void emitSlow_op_new_object(Instruction*, Vector<SlowCaseEntry>::iterator&);
    888893        void emitSlow_op_not(Instruction*, Vector<SlowCaseEntry>::iterator&);
    889894        void emitSlow_op_nstricteq(Instruction*, Vector<SlowCaseEntry>::iterator&);
Note: See TracChangeset for help on using the changeset viewer.