Don't rely on fixed offsets to patch get_by_id/put_by_id
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 19:24:14 +0000 (19:24 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 19:24:14 +0000 (19:24 +0000)
commitf14ef92f6526cec4d5bb16b4668fada6279bb4c4
treea97476c625188d4f13aad92f30d98376ff70ec87
parent26c9b81574e4c70ff6c9c9d20400e6fe7170d07e
Don't rely on fixed offsets to patch get_by_id/put_by_id
https://bugs.webkit.org/show_bug.cgi?id=83924

Reviewed by Oliver Hunt.

Store offsets in the structure stub info, as we do for the DFG JIT.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::differenceBetween):
    - this method can be static (now used from PropertyStubCompilationInfo::copyToStubInfo, will be removed soon!)
* bytecode/StructureStubInfo.h:
    - added new fields for baseline JIT offsets.
* jit/JIT.cpp:
(JSC::PropertyStubCompilationInfo::copyToStubInfo):
    - moved out from JIT::privateCompile.
(JSC::JIT::privateCompile):
    - moved out code to PropertyStubCompilationInfo::copyToStubInfo.
* jit/JIT.h:
(PropertyStubCompilationInfo):
    - added helper functions to initializae PropertyStubCompilationInfo, state to store more offset info.
    - removed many offsets.
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_method_check):
(JSC::JIT::compileGetByIdHotPath):
(JSC::JIT::compileGetByIdSlowCase):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::patchGetByIdSelf):
(JSC::JIT::patchPutByIdReplace):
(JSC::JIT::privateCompilePatchGetArrayLength):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdSelfList):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):
(JSC::JIT::resetPatchGetById):
(JSC::JIT::resetPatchPutById):
    - changed code generation to use new interface to store info on PropertyStubCompilationInfo.
    - changed repatch functions to read offsets from the structure stub info.
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_method_check):
(JSC::JIT::compileGetByIdHotPath):
(JSC::JIT::compileGetByIdSlowCase):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::patchGetByIdSelf):
(JSC::JIT::patchPutByIdReplace):
(JSC::JIT::privateCompilePatchGetArrayLength):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdSelfList):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):
(JSC::JIT::resetPatchGetById):
(JSC::JIT::resetPatchPutById):
    - changed code generation to use new interface to store info on PropertyStubCompilationInfo.
    - changed repatch functions to read offsets from the structure stub info.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/AbstractMacroAssembler.h
Source/JavaScriptCore/bytecode/StructureStubInfo.h
Source/JavaScriptCore/jit/JIT.cpp
Source/JavaScriptCore/jit/JIT.h
Source/JavaScriptCore/jit/JITPropertyAccess.cpp
Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp