Commit 73c571d4 authored by barraclough@apple.com's avatar barraclough@apple.com

2009-06-15 Gavin Barraclough <barraclough@apple.com>

        Rubber Stamped by Sam Weinig.

        Rename PatchBuffer to LinkBuffer.  Previously our terminology has been a little
        mixed up, but we have decided to fix on refering to the process that takes place
        at the end of code generation as 'linking', and on any modifications that take
        place later (and once the code has potentially already been executed) as 'patching'.

        However, the term 'PatchBuffer' is already in use, and needs to be repurposed.

        To try to minimize confusion, we're going to switch the terminology over in stages,
        so for now we'll refer to later modifications as 'repatching'.  This means that the
        new 'PatchBuffer' has been introduced with the name 'RepatchBuffer' instead.

        This patch renames the old 'PatchBuffer' to 'LinkBuffer'.  We'll leave ToT in this
        state for a week or so to try to avoid to much overlap of the meaning of the term
        'PatchBuffer', then will come back and rename 'RepatchBuffer'.

        * assembler/ARMv7Assembler.h:
        * assembler/AbstractMacroAssembler.h:
        (JSC::AbstractMacroAssembler::LinkBuffer::LinkBuffer):
        (JSC::AbstractMacroAssembler::LinkBuffer::~LinkBuffer):
        * jit/JIT.cpp:
        (JSC::JIT::privateCompile):
        * jit/JITPropertyAccess.cpp:
        (JSC::JIT::privateCompilePutByIdTransition):
        (JSC::JIT::privateCompilePatchGetArrayLength):
        (JSC::JIT::privateCompileGetByIdProto):
        (JSC::JIT::privateCompileGetByIdSelfList):
        (JSC::JIT::privateCompileGetByIdProtoList):
        (JSC::JIT::privateCompileGetByIdChainList):
        (JSC::JIT::privateCompileGetByIdChain):
        * yarr/RegexJIT.cpp:
        (JSC::Yarr::RegexGenerator::compile):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9b814a43
2009-06-15 Gavin Barraclough <barraclough@apple.com>
Rubber Stamped by Sam Weinig.
Rename PatchBuffer to LinkBuffer. Previously our terminology has been a little
mixed up, but we have decided to fix on refering to the process that takes place
at the end of code generation as 'linking', and on any modifications that take
place later (and once the code has potentially already been executed) as 'patching'.
However, the term 'PatchBuffer' is already in use, and needs to be repurposed.
To try to minimize confusion, we're going to switch the terminology over in stages,
so for now we'll refer to later modifications as 'repatching'. This means that the
new 'PatchBuffer' has been introduced with the name 'RepatchBuffer' instead.
This patch renames the old 'PatchBuffer' to 'LinkBuffer'. We'll leave ToT in this
state for a week or so to try to avoid to much overlap of the meaning of the term
'PatchBuffer', then will come back and rename 'RepatchBuffer'.
* assembler/ARMv7Assembler.h:
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::LinkBuffer::LinkBuffer):
(JSC::AbstractMacroAssembler::LinkBuffer::~LinkBuffer):
* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::privateCompilePatchGetArrayLength):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdSelfList):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):
* yarr/RegexJIT.cpp:
(JSC::Yarr::RegexGenerator::compile):
2009-06-15 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig.
......@@ -1520,7 +1520,7 @@ public:
linkWithOffset(location, relative);
}
// bah, this mathod should really be static, since it is used by the PatchBuffer.
// bah, this mathod should really be static, since it is used by the LinkBuffer.
// return a bool saying whether the link was successful?
static void linkCall(void* code, JmpSrc from, void* to)
{
......
......@@ -49,7 +49,7 @@ public:
typedef MacroAssemblerCodeRef CodeRef;
class Jump;
class PatchBuffer;
class LinkBuffer;
class RepatchBuffer;
typedef typename AssemblerType::RegisterID RegisterID;
......@@ -221,7 +221,7 @@ public:
friend class AbstractMacroAssembler;
friend class Jump;
friend class MacroAssemblerCodeRef;
friend class PatchBuffer;
friend class LinkBuffer;
public:
Label()
......@@ -246,7 +246,7 @@ public:
class DataLabelPtr {
template<class TemplateAssemblerType>
friend class AbstractMacroAssembler;
friend class PatchBuffer;
friend class LinkBuffer;
public:
DataLabelPtr()
{
......@@ -268,7 +268,7 @@ public:
class DataLabel32 {
template<class TemplateAssemblerType>
friend class AbstractMacroAssembler;
friend class PatchBuffer;
friend class LinkBuffer;
public:
DataLabel32()
{
......@@ -292,7 +292,7 @@ public:
class Call {
template<class TemplateAssemblerType>
friend class AbstractMacroAssembler;
friend class PatchBuffer;
friend class LinkBuffer;
public:
enum Flags {
None = 0x0,
......@@ -337,7 +337,7 @@ public:
template<class TemplateAssemblerType>
friend class AbstractMacroAssembler;
friend class Call;
friend class PatchBuffer;
friend class LinkBuffer;
public:
Jump()
{
......@@ -367,7 +367,7 @@ public:
// A JumpList is a set of Jump objects.
// All jumps in the set will be linked to the same destination.
class JumpList {
friend class PatchBuffer;
friend class LinkBuffer;
public:
void link(AbstractMacroAssembler<AssemblerType>* masm)
......@@ -406,14 +406,14 @@ public:
};
// Section 3: PatchBuffer - utility to finalize code generation.
// Section 3: LinkBuffer - utility to finalize code generation.
static CodePtr trampolineAt(CodeRef ref, Label label)
{
return CodePtr(AssemblerType::getRelocatedAddress(ref.m_code.dataLocation(), label.m_label));
}
// PatchBuffer:
// LinkBuffer:
//
// This class assists in linking code generated by the macro assembler, once code generation
// has been completed, and the code has been copied to is final location in memory. At this
......@@ -430,12 +430,12 @@ public:
// FIXME: distinguish between Calls & Jumps (make a specific call to obtain the return
// address of calls, as opposed to a point that can be used to later relink a Jump -
// possibly wrap the later up in an object that can do just that).
class PatchBuffer : public Noncopyable {
class LinkBuffer : public Noncopyable {
public:
// Note: Initialization sequence is significant, since executablePool is a PassRefPtr.
// First, executablePool is copied into m_executablePool, then the initialization of
// m_code uses m_executablePool, *not* executablePool, since this is no longer valid.
PatchBuffer(AbstractMacroAssembler<AssemblerType>* masm, PassRefPtr<ExecutablePool> executablePool)
LinkBuffer(AbstractMacroAssembler<AssemblerType>* masm, PassRefPtr<ExecutablePool> executablePool)
: m_executablePool(executablePool)
, m_code(masm->m_assembler.executableCopy(m_executablePool.get()))
, m_size(masm->m_assembler.size())
......@@ -445,7 +445,7 @@ public:
{
}
~PatchBuffer()
~LinkBuffer()
{
ASSERT(m_completed);
}
......
......@@ -429,7 +429,7 @@ void JIT::privateCompile()
ASSERT(m_jmpTable.isEmpty());
PatchBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()));
LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()));
// Translate vPC offsets into addresses in JIT generated code, for switch tables.
for (unsigned i = 0; i < m_switches.size(); ++i) {
......@@ -851,7 +851,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
#endif
// All trampolines constructed! copy the code, link up calls, and set the pointers on the Machine object.
PatchBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()));
LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()));
#if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
patchBuffer.link(array_failureCases1Call, FunctionPtr(JITStubs::cti_op_get_by_id_array_fail));
......
......@@ -487,7 +487,7 @@ void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure
restoreArgumentReferenceForTrampoline();
Call failureCall = tailRecursiveCall();
PatchBuffer patchBuffer(this, m_codeBlock->executablePool());
LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
patchBuffer.link(failureCall, FunctionPtr(JITStubs::cti_op_put_by_id_fail));
......@@ -572,7 +572,7 @@ void JIT::privateCompilePatchGetArrayLength(ReturnAddressPtr returnAddress)
emitFastArithIntToImmNoCheck(regT2, regT0);
Jump success = jump();
PatchBuffer patchBuffer(this, m_codeBlock->executablePool());
LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
// Use the patch information to link the failure cases back to the original slow case routine.
CodeLocationLabel slowCaseBegin = stubInfo->callReturnLocation.labelAtOffset(-patchOffsetGetByIdSlowCaseCall);
......@@ -618,7 +618,7 @@ void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* str
Jump success = jump();
PatchBuffer patchBuffer(this, m_codeBlock->executablePool());
LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
// Use the patch information to link the failure cases back to the original slow case routine.
CodeLocationLabel slowCaseBegin = stubInfo->callReturnLocation.labelAtOffset(-patchOffsetGetByIdSlowCaseCall);
......@@ -647,7 +647,7 @@ void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, Polymorphic
compileGetDirectOffset(regT0, regT0, structure, cachedOffset);
Jump success = jump();
PatchBuffer patchBuffer(this, m_codeBlock->executablePool());
LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
// Use the patch information to link the failure cases back to the original slow case routine.
CodeLocationLabel lastProtoBegin = polymorphicStructures->list[currentIndex - 1].stubRoutine;
......@@ -693,7 +693,7 @@ void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, Polymorphi
Jump success = jump();
PatchBuffer patchBuffer(this, m_codeBlock->executablePool());
LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
// Use the patch information to link the failure cases back to the original slow case routine.
CodeLocationLabel lastProtoBegin = prototypeStructures->list[currentIndex - 1].stubRoutine;
......@@ -746,7 +746,7 @@ void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, Polymorphi
compileGetDirectOffset(protoObject, regT0, cachedOffset);
Jump success = jump();
PatchBuffer patchBuffer(this, m_codeBlock->executablePool());
LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
// Use the patch information to link the failure cases back to the original slow case routine.
CodeLocationLabel lastProtoBegin = prototypeStructures->list[currentIndex - 1].stubRoutine;
......@@ -799,7 +799,7 @@ void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* str
compileGetDirectOffset(protoObject, regT0, cachedOffset);
Jump success = jump();
PatchBuffer patchBuffer(this, m_codeBlock->executablePool());
LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
// Use the patch information to link the failure cases back to the original slow case routine.
patchBuffer.link(bucketsOfFail, stubInfo->callReturnLocation.labelAtOffset(-patchOffsetGetByIdSlowCaseCall));
......
......@@ -1358,7 +1358,7 @@ public:
{
generate();
PatchBuffer patchBuffer(this, globalData->executableAllocator.poolForSize(size()));
LinkBuffer patchBuffer(this, globalData->executableAllocator.poolForSize(size()));
for (unsigned i = 0; i < m_backtrackRecords.size(); ++i)
patchBuffer.patch(m_backtrackRecords[i].dataLabel, patchBuffer.locationOf(m_backtrackRecords[i].backtrackLocation));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment