Changeset 50982 in webkit for trunk/JavaScriptCore/jit


Ignore:
Timestamp:
Nov 13, 2009, 5:07:01 PM (16 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=31050

Patch by Zoltan Herczeg <[email protected]> on 2009-11-13
Reviewed by Gavin Barraclough.

Adding optimization support for mode JSVALUE32_64
on ARM systems.

  • jit/JIT.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileOpCall):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_method_check):
(JSC::JIT::compileGetByIdHotPath):
(JSC::JIT::compileGetByIdSlowCase):
(JSC::JIT::emit_op_put_by_id):

Location:
trunk/JavaScriptCore/jit
Files:
2 edited

Legend:

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

    r50981 r50982  
    467467        static const int patchOffsetMethodCheckPutFunction = 29;
    468468#elif PLATFORM(ARM_TRADITIONAL)
    469 // patchOffset... values should go here; JIT optimizations currently not supported on ARM with JSVALUE32_64.
     469        // These architecture specific value are used to enable patching - see comment on op_put_by_id.
     470        static const int patchOffsetPutByIdStructure = 4;
     471        static const int patchOffsetPutByIdExternalLoad = 16;
     472        static const int patchLengthPutByIdExternalLoad = 4;
     473        static const int patchOffsetPutByIdPropertyMapOffset1 = 20;
     474        static const int patchOffsetPutByIdPropertyMapOffset2 = 28;
     475        // These architecture specific value are used to enable patching - see comment on op_get_by_id.
     476        static const int patchOffsetGetByIdStructure = 4;
     477        static const int patchOffsetGetByIdBranchToSlowCase = 16;
     478        static const int patchOffsetGetByIdExternalLoad = 16;
     479        static const int patchLengthGetByIdExternalLoad = 4;
     480        static const int patchOffsetGetByIdPropertyMapOffset1 = 20;
     481        static const int patchOffsetGetByIdPropertyMapOffset2 = 28;
     482        static const int patchOffsetGetByIdPutResult = 36;
     483#if ENABLE(OPCODE_SAMPLING)
     484        #error "OPCODE_SAMPLING is not yet supported"
     485#else
     486        static const int patchOffsetGetByIdSlowCaseCall = 32;
     487#endif
     488        static const int patchOffsetOpCallCompareToJump = 12;
     489
     490        static const int patchOffsetMethodCheckProtoObj = 12;
     491        static const int patchOffsetMethodCheckProtoStruct = 20;
     492        static const int patchOffsetMethodCheckPutFunction = 32;
     493
     494        // sequenceOpCall
     495        static const int sequenceOpCallInstructionSpace = 12;
     496        static const int sequenceOpCallConstantSpace = 2;
     497        // sequenceMethodCheck
     498        static const int sequenceMethodCheckInstructionSpace = 40;
     499        static const int sequenceMethodCheckConstantSpace = 6;
     500        // sequenceGetByIdHotPath
     501        static const int sequenceGetByIdHotPathInstructionSpace = 36;
     502        static const int sequenceGetByIdHotPathConstantSpace = 4;
     503        // sequenceGetByIdSlowCase
     504        static const int sequenceGetByIdSlowCaseInstructionSpace = 40;
     505        static const int sequenceGetByIdSlowCaseConstantSpace = 2;
     506        // sequencePutById
     507        static const int sequencePutByIdInstructionSpace = 36;
     508        static const int sequencePutByIdConstantSpace = 4;
    470509#else
    471510#error "JSVALUE32_64 not supported on this platform."
     
    632671        static const int patchOffsetMethodCheckProtoStruct = 20;
    633672        static const int patchOffsetMethodCheckPutFunction = 32;
    634 #endif
    635 #endif // USE(JSVALUE32_64)
    636 
    637 #if PLATFORM(ARM_TRADITIONAL)
     673
    638674        // sequenceOpCall
    639675        static const int sequenceOpCallInstructionSpace = 12;
     
    652688        static const int sequencePutByIdConstantSpace = 3;
    653689#endif
     690#endif // USE(JSVALUE32_64)
    654691
    655692#if defined(ASSEMBLER_HAS_CONSTANT_POOL) && ASSEMBLER_HAS_CONSTANT_POOL
  • trunk/JavaScriptCore/jit/JITPropertyAccess.cpp

    r50254 r50982  
    213213    emitJumpSlowCaseIfNotJSCell(base, regT1);
    214214
     215    BEGIN_UNINTERRUPTED_SEQUENCE(sequenceMethodCheck);
     216
    215217    Jump structureCheck = branchPtrWithPatch(NotEqual, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), info.structureToCompare, ImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure)));
    216218    DataLabelPtr protoStructureToCompare, protoObj = moveWithPatch(ImmPtr(0), regT2);
     
    219221    // This will be relinked to load the function without doing a load.
    220222    DataLabelPtr putFunction = moveWithPatch(ImmPtr(0), regT0);
     223 
     224    END_UNINTERRUPTED_SEQUENCE(sequenceMethodCheck);
     225   
    221226    move(Imm32(JSValue::CellTag), regT1);
    222227    Jump match = jump();
     
    375380    // to array-length / prototype access tranpolines, and finally we also the the property-map access offset as a label
    376381    // to jump back to if one of these trampolies finds a match.
     382
     383    BEGIN_UNINTERRUPTED_SEQUENCE(sequenceGetByIdHotPath);
     384   
    377385    Label hotPathBegin(this);
    378386    m_propertyAccessCompilationInfo[m_propertyAccessInstructionIndex].hotPathBegin = hotPathBegin;
     
    397405    Label putResult(this);
    398406    ASSERT(differenceBetween(hotPathBegin, putResult) == patchOffsetGetByIdPutResult);
     407
     408    END_UNINTERRUPTED_SEQUENCE(sequenceGetByIdHotPath);
    399409}
    400410
     
    418428    linkSlowCase(iter);
    419429
     430    BEGIN_UNINTERRUPTED_SEQUENCE(sequenceGetByIdSlowCase);
     431
     432#ifndef NDEBUG
    420433    Label coldPathBegin(this);
    421 
     434#endif
    422435    JITStubCall stubCall(this, isMethodCheck ? cti_op_get_by_id_method_check : cti_op_get_by_id);
    423436    stubCall.addArgument(regT1, regT0);
     
    425438    Call call = stubCall.call(dst);
    426439
     440    END_UNINTERRUPTED_SEQUENCE(sequenceGetByIdSlowCase);
     441
    427442    ASSERT(differenceBetween(coldPathBegin, call) == patchOffsetGetByIdSlowCaseCall);
    428443
     
    444459
    445460    emitJumpSlowCaseIfNotJSCell(base, regT1);
     461
     462    BEGIN_UNINTERRUPTED_SEQUENCE(sequencePutById);
    446463
    447464    Label hotPathBegin(this);
     
    462479    DataLabel32 displacementLabel1 = storePtrWithAddressOffsetPatch(regT2, Address(regT0, patchGetByIdDefaultOffset)); // payload
    463480    DataLabel32 displacementLabel2 = storePtrWithAddressOffsetPatch(regT3, Address(regT0, patchGetByIdDefaultOffset)); // tag
     481
     482    END_UNINTERRUPTED_SEQUENCE(sequencePutById);
     483
    464484    ASSERT(differenceBetween(hotPathBegin, displacementLabel1) == patchOffsetPutByIdPropertyMapOffset1);
    465485    ASSERT(differenceBetween(hotPathBegin, displacementLabel2) == patchOffsetPutByIdPropertyMapOffset2);
Note: See TracChangeset for help on using the changeset viewer.