Ignore:
Timestamp:
Apr 13, 2012, 4:44:25 PM (13 years ago)
Author:
[email protected]
Message:

Don't rely on fixed offsets to patch method checks
https://bugs.webkit.org/show_bug.cgi?id=83958

Reviewed by Oliver Hunt.

  • bytecode/StructureStubInfo.h:
    • Add fields for the method check info.
  • jit/JIT.cpp:

(JSC::PropertyStubCompilationInfo::copyToStubInfo):

  • Store the offsets on the stub info, instead of asserting.
  • jit/JIT.h:
    • Delete all the method check related offsets.
  • jit/JITPropertyAccess.cpp:

(JSC::JIT::patchMethodCallProto):

  • Use the offset from the stubInfo.
  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • Pass the stubInfo to patchMethodCallProto.
File:
1 edited

Legend:

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

    r114157 r114183  
    11201120}
    11211121
    1122 void JIT::patchMethodCallProto(JSGlobalData& globalData, CodeBlock* codeBlock, MethodCallLinkInfo& methodCallLinkInfo, JSObject* callee, Structure* structure, JSObject* proto, ReturnAddressPtr returnAddress)
     1122void JIT::patchMethodCallProto(JSGlobalData& globalData, CodeBlock* codeBlock, MethodCallLinkInfo& methodCallLinkInfo, StructureStubInfo& stubInfo, JSObject* callee, Structure* structure, JSObject* proto, ReturnAddressPtr returnAddress)
    11231123{
    11241124    RepatchBuffer repatchBuffer(codeBlock);
     
    11281128   
    11291129    Structure* prototypeStructure = proto->structure();
    1130     methodCallLinkInfo.cachedPrototypeStructure.set(globalData, structureLocation.dataLabelPtrAtOffset(patchOffsetMethodCheckProtoStruct), codeBlock->ownerExecutable(), prototypeStructure);
    1131     methodCallLinkInfo.cachedPrototype.set(globalData, structureLocation.dataLabelPtrAtOffset(patchOffsetMethodCheckProtoObj), codeBlock->ownerExecutable(), proto);
    1132     methodCallLinkInfo.cachedFunction.set(globalData, structureLocation.dataLabelPtrAtOffset(patchOffsetMethodCheckPutFunction), codeBlock->ownerExecutable(), callee);
     1130    methodCallLinkInfo.cachedPrototypeStructure.set(globalData, structureLocation.dataLabelPtrAtOffset(stubInfo.patch.baseline.methodCheckProtoStructureToCompare), codeBlock->ownerExecutable(), prototypeStructure);
     1131    methodCallLinkInfo.cachedPrototype.set(globalData, structureLocation.dataLabelPtrAtOffset(stubInfo.patch.baseline.methodCheckProtoObj), codeBlock->ownerExecutable(), proto);
     1132    methodCallLinkInfo.cachedFunction.set(globalData, structureLocation.dataLabelPtrAtOffset(stubInfo.patch.baseline.methodCheckPutFunction), codeBlock->ownerExecutable(), callee);
    11331133    repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(cti_op_get_by_id_method_check_update));
    11341134}
Note: See TracChangeset for help on using the changeset viewer.