Ignore:
Timestamp:
Aug 12, 2009, 10:58:36 PM (16 years ago)
Author:
[email protected]
Message:

Add optimize call and property access support for ARM JIT.
https://bugs.webkit.org/show_bug.cgi?id=24986

Patch by Gabor Loki <[email protected]> on 2009-08-12
Reviewed by Gavin Barraclough.

For tightly coupled sequences the BEGIN_UNINTERRUPTED_SEQUENCE and
END_UNINTERRUPTED_SEQUENCE macros have been introduced which ensure
space for instructions and constants of the named sequence. This
method is vital for those architecture which are using constant pool.

The 'latePatch' method - which was linked to JmpSrc - is replaced with
a port specific solution (each calls are marked to place their address
on the constant pool).

  • assembler/ARMAssembler.cpp:

(JSC::ARMAssembler::linkBranch):
(JSC::ARMAssembler::executableCopy): Add extra align for constant pool.

  • assembler/ARMAssembler.h:

(JSC::ARMAssembler::JmpSrc::JmpSrc):
(JSC::ARMAssembler::sizeOfConstantPool):
(JSC::ARMAssembler::jmp):
(JSC::ARMAssembler::linkCall):

  • assembler/ARMv7Assembler.h:
  • assembler/AbstractMacroAssembler.h:
  • assembler/AssemblerBufferWithConstantPool.h:

(JSC::AssemblerBufferWithConstantPool::flushIfNoSpaceFor): Fix the
computation of the remaining space.

  • assembler/MacroAssemblerARM.h:

(JSC::MacroAssemblerARM::branch32):
(JSC::MacroAssemblerARM::nearCall):
(JSC::MacroAssemblerARM::call):
(JSC::MacroAssemblerARM::branchPtrWithPatch):
(JSC::MacroAssemblerARM::ensureSpace):
(JSC::MacroAssemblerARM::sizeOfConstantPool):
(JSC::MacroAssemblerARM::prepareCall):

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

(JSC::JIT::compileOpCall):

  • jit/JITInlineMethods.h:

(JSC::JIT::beginUninterruptedSequence):
(JSC::JIT::endUninterruptedSequence):

  • jit/JITPropertyAccess.cpp:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JITPropertyAccess.cpp

    r46879 r47186  
    11231123    m_methodCallCompilationInfo.append(MethodCallCompilationInfo(m_propertyAccessInstructionIndex));
    11241124    MethodCallCompilationInfo& info = m_methodCallCompilationInfo.last();
     1125
    11251126    Jump notCell = emitJumpIfNotJSCell(regT0);
     1127
     1128    BEGIN_UNINTERRUPTED_SEQUENCE(sequenceMethodCheck);
     1129
    11261130    Jump structureCheck = branchPtrWithPatch(NotEqual, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), info.structureToCompare, ImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure)));
    11271131    DataLabelPtr protoStructureToCompare, protoObj = moveWithPatch(ImmPtr(0), regT1);
     
    11301134    // This will be relinked to load the function without doing a load.
    11311135    DataLabelPtr putFunction = moveWithPatch(ImmPtr(0), regT0);
     1136
     1137    END_UNINTERRUPTED_SEQUENCE(sequenceMethodCheck);
     1138
    11321139    Jump match = jump();
    11331140
     
    11921199
    11931200    emitJumpSlowCaseIfNotJSCell(regT0, baseVReg);
     1201
     1202    BEGIN_UNINTERRUPTED_SEQUENCE(sequenceGetByIdHotPath);
    11941203
    11951204    Label hotPathBegin(this);
     
    12111220
    12121221    Label putResult(this);
     1222
     1223    END_UNINTERRUPTED_SEQUENCE(sequenceGetByIdHotPath);
     1224
    12131225    ASSERT(differenceBetween(hotPathBegin, putResult) == patchOffsetGetByIdPutResult);
    12141226}
     
    12331245    linkSlowCaseIfNotJSCell(iter, baseVReg);
    12341246    linkSlowCase(iter);
     1247
     1248    BEGIN_UNINTERRUPTED_SEQUENCE(sequenceGetByIdSlowCase);
    12351249
    12361250#ifndef NDEBUG
     
    12421256    Call call = stubCall.call(resultVReg);
    12431257
     1258    END_UNINTERRUPTED_SEQUENCE(sequenceGetByIdSlowCase);
     1259
    12441260    ASSERT(differenceBetween(coldPathBegin, call) == patchOffsetGetByIdSlowCaseCall);
    12451261
     
    12641280    // Jump to a slow case if either the base object is an immediate, or if the Structure does not match.
    12651281    emitJumpSlowCaseIfNotJSCell(regT0, baseVReg);
     1282
     1283    BEGIN_UNINTERRUPTED_SEQUENCE(sequencePutById);
    12661284
    12671285    Label hotPathBegin(this);
     
    12801298
    12811299    DataLabel32 displacementLabel = storePtrWithAddressOffsetPatch(regT1, Address(regT0, patchGetByIdDefaultOffset));
     1300
     1301    END_UNINTERRUPTED_SEQUENCE(sequencePutById);
     1302
    12821303    ASSERT(differenceBetween(hotPathBegin, displacementLabel) == patchOffsetPutByIdPropertyMapOffset);
    12831304}
Note: See TracChangeset for help on using the changeset viewer.