Changeset 50201 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Oct 28, 2009, 12:13:37 AM (16 years ago)
Author:
[email protected]
Message:

Rubber Stamped by Samuel Q. Weinig.

Patch by Gavin Barraclough <[email protected]> on 2009-10-27
Make the asserts protecting the offsets in the JIT more descriptive.

  • 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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r50183 r50201  
     12009-10-27  Gavin Barraclough  <[email protected]>
     2
     3        Rubber Stamped by Samuel Q. Weinig.
     4
     5        Make the asserts protecting the offsets in the JIT more descriptive.
     6
     7        * jit/JIT.h:
     8        * jit/JITCall.cpp:
     9        (JSC::JIT::compileOpCall):
     10        * jit/JITPropertyAccess.cpp:
     11        (JSC::JIT::emit_op_method_check):
     12        (JSC::JIT::compileGetByIdHotPath):
     13        (JSC::JIT::compileGetByIdSlowCase):
     14        (JSC::JIT::emit_op_put_by_id):
     15
    1162009-10-27  Geoffrey Garen  <[email protected]>
    217
  • trunk/JavaScriptCore/jit/JIT.h

    r50109 r50201  
    3838#define JIT_CLASS_ALIGNMENT
    3939#endif
     40
     41#define ASSERT_JIT_OFFSET(actual, expected) ASSERT_WITH_MESSAGE(actual == expected, "JIT Offset \"%s\" shoud be %d, not %d.\n", #expected, actual, expected);
    4042
    4143#include "CodeBlock.h"
  • trunk/JavaScriptCore/jit/JITCall.cpp

    r49293 r50201  
    615615
    616616    addSlowCase(jumpToSlow);
    617     ASSERT(differenceBetween(addressOfLinkedFunctionCheck, jumpToSlow) == patchOffsetOpCallCompareToJump);
     617    ASSERT_JIT_OFFSET(differenceBetween(addressOfLinkedFunctionCheck, jumpToSlow), patchOffsetOpCallCompareToJump);
    618618    m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathBegin = addressOfLinkedFunctionCheck;
    619619
  • trunk/JavaScriptCore/jit/JITPropertyAccess.cpp

    r49820 r50201  
    11331133    Jump match = jump();
    11341134
    1135     ASSERT(differenceBetween(info.structureToCompare, protoObj) == patchOffsetMethodCheckProtoObj);
    1136     ASSERT(differenceBetween(info.structureToCompare, protoStructureToCompare) == patchOffsetMethodCheckProtoStruct);
    1137     ASSERT(differenceBetween(info.structureToCompare, putFunction) == patchOffsetMethodCheckPutFunction);
     1135    ASSERT_JIT_OFFSET(differenceBetween(info.structureToCompare, protoObj), patchOffsetMethodCheckProtoObj);
     1136    ASSERT_JIT_OFFSET(differenceBetween(info.structureToCompare, protoStructureToCompare), patchOffsetMethodCheckProtoStruct);
     1137    ASSERT_JIT_OFFSET(differenceBetween(info.structureToCompare, putFunction), patchOffsetMethodCheckPutFunction);
    11381138
    11391139    // Link the failure cases here.
     
    12021202    Jump structureCheck = branchPtrWithPatch(NotEqual, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), structureToCompare, ImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure)));
    12031203    addSlowCase(structureCheck);
    1204     ASSERT(differenceBetween(hotPathBegin, structureToCompare) == patchOffsetGetByIdStructure);
    1205     ASSERT(differenceBetween(hotPathBegin, structureCheck) == patchOffsetGetByIdBranchToSlowCase);
     1204    ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, structureToCompare), patchOffsetGetByIdStructure);
     1205    ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, structureCheck), patchOffsetGetByIdBranchToSlowCase)
    12061206
    12071207    Label externalLoad = loadPtrWithPatchToLEA(Address(regT0, OBJECT_OFFSETOF(JSObject, m_externalStorage)), regT0);
    12081208    Label externalLoadComplete(this);
    1209     ASSERT(differenceBetween(hotPathBegin, externalLoad) == patchOffsetGetByIdExternalLoad);
    1210     ASSERT(differenceBetween(externalLoad, externalLoadComplete) == patchLengthGetByIdExternalLoad);
     1209    ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, externalLoad), patchOffsetGetByIdExternalLoad);
     1210    ASSERT_JIT_OFFSET(differenceBetween(externalLoad, externalLoadComplete), patchLengthGetByIdExternalLoad);
    12111211
    12121212    DataLabel32 displacementLabel = loadPtrWithAddressOffsetPatch(Address(regT0, patchGetByIdDefaultOffset), regT0);
    1213     ASSERT(differenceBetween(hotPathBegin, displacementLabel) == patchOffsetGetByIdPropertyMapOffset);
     1213    ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, displacementLabel), patchOffsetGetByIdPropertyMapOffset);
    12141214
    12151215    Label putResult(this);
     
    12171217    END_UNINTERRUPTED_SEQUENCE(sequenceGetByIdHotPath);
    12181218
    1219     ASSERT(differenceBetween(hotPathBegin, putResult) == patchOffsetGetByIdPutResult);
     1219    ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, putResult), patchOffsetGetByIdPutResult);
    12201220}
    12211221
     
    12521252    END_UNINTERRUPTED_SEQUENCE(sequenceGetByIdSlowCase);
    12531253
    1254     ASSERT(differenceBetween(coldPathBegin, call) == patchOffsetGetByIdSlowCaseCall);
     1254    ASSERT_JIT_OFFSET(differenceBetween(coldPathBegin, call), patchOffsetGetByIdSlowCaseCall);
    12551255
    12561256    // Track the location of the call; this will be used to recover patch information.
     
    12831283    DataLabelPtr structureToCompare;
    12841284    addSlowCase(branchPtrWithPatch(NotEqual, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), structureToCompare, ImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure))));
    1285     ASSERT(differenceBetween(hotPathBegin, structureToCompare) == patchOffsetPutByIdStructure);
     1285    ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, structureToCompare), patchOffsetPutByIdStructure);
    12861286
    12871287    // Plant a load from a bogus ofset in the object's property map; we will patch this later, if it is to be used.
    12881288    Label externalLoad = loadPtrWithPatchToLEA(Address(regT0, OBJECT_OFFSETOF(JSObject, m_externalStorage)), regT0);
    12891289    Label externalLoadComplete(this);
    1290     ASSERT(differenceBetween(hotPathBegin, externalLoad) == patchOffsetPutByIdExternalLoad);
    1291     ASSERT(differenceBetween(externalLoad, externalLoadComplete) == patchLengthPutByIdExternalLoad);
     1290    ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, externalLoad), patchOffsetPutByIdExternalLoad);
     1291    ASSERT_JIT_OFFSET(differenceBetween(externalLoad, externalLoadComplete), patchLengthPutByIdExternalLoad);
    12921292
    12931293    DataLabel32 displacementLabel = storePtrWithAddressOffsetPatch(regT1, Address(regT0, patchGetByIdDefaultOffset));
     
    12951295    END_UNINTERRUPTED_SEQUENCE(sequencePutById);
    12961296
    1297     ASSERT(differenceBetween(hotPathBegin, displacementLabel) == patchOffsetPutByIdPropertyMapOffset);
     1297    ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, displacementLabel), patchOffsetPutByIdPropertyMapOffset);
    12981298}
    12991299
Note: See TracChangeset for help on using the changeset viewer.