Ignore:
Timestamp:
May 18, 2009, 1:22:52 PM (16 years ago)
Author:
[email protected]
Message:

2009-05-18 Jan Michael Alonzo <[email protected]>

Reviewed by Xan Lopez.

[Gtk] Various autotools build refactoring and fixes
https://bugs.webkit.org/show_bug.cgi?id=25286

Add -no-install and -no-fast-install to programs and tests that we
don't install. Also remove -O2 since this is already handled at
configure time.

  • GNUmakefile.am:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/AbstractMacroAssembler.h

    r43837 r43839  
    2727#define AbstractMacroAssembler_h
    2828
    29 #include <wtf/Noncopyable.h>
    3029#include <wtf/Platform.h>
    31 #include <wtf/UnusedParam.h>
    3230
    3331#if ENABLE(ASSEMBLER)
     
    4644    class CodeLocationDataLabel32;
    4745    class CodeLocationDataLabelPtr;
    48     class ProcessorReturnAddress;
    49 
    50     struct CodeRef;
    5146
    5247    typedef typename AssemblerType::RegisterID RegisterID;
     
    200195    // it may be used as a destination for a jump.
    201196    class Label {
    202         template<class TemplateAssemblerType>
     197        friend class Jump;
     198        template<class AssemblerType_T>
    203199        friend class AbstractMacroAssembler;
    204         friend class Jump;
    205         friend class PatchBuffer;
    206 
    207         friend struct CodeRef;
    208 
     200        friend class PatchBuffer;
    209201    public:
    210202        Label()
     
    228220    // patched after the code has been generated.
    229221    class DataLabelPtr {
    230         template<class TemplateAssemblerType>
     222        template<class AssemblerType_T>
    231223        friend class AbstractMacroAssembler;
    232224        friend class PatchBuffer;
     
    250242    // patched after the code has been generated.
    251243    class DataLabel32 {
    252         template<class TemplateAssemblerType>
     244        template<class AssemblerType_T>
    253245        friend class AbstractMacroAssembler;
    254246        friend class PatchBuffer;
     
    274266    // destination.
    275267    class Call {
    276         template<class TemplateAssemblerType>
     268        friend class PatchBuffer;
     269        template<class AssemblerType_T>
    277270        friend class AbstractMacroAssembler;
    278         friend class PatchBuffer;
    279271    public:
    280272        enum Flags {
     
    318310    // destination.
    319311    class Jump {
    320         template<class TemplateAssemblerType>
     312        friend class PatchBuffer;
     313        template<class AssemblerType_T>
    321314        friend class AbstractMacroAssembler;
    322315        friend class Call;
    323         friend class PatchBuffer;
    324316    public:
    325317        Jump()
     
    464456        friend class CodeLocationJump;
    465457        friend class PatchBuffer;
    466         friend class ProcessorReturnAddress;
    467 
    468458    public:
    469459        CodeLocationLabel()
     
    625615        }
    626616
    627         void relinkCallerToTrampoline(CodeLocationLabel label)
    628         {
    629             AssemblerType::patchMacroAssemblerCall(reinterpret_cast<intptr_t>(this->m_location), label.getJumpDestination());
    630         }
    631        
    632617        template<typename FunctionSig>
    633618        void relinkCallerToFunction(FunctionSig* newCalleeFunction)
     
    652637
    653638
    654     // Section 4: CodeRef & PatchBuffer - utility to finalize code generation.
    655 
    656     // CodeRef:
    657     //
    658     // A reference to a section of JIT generated code.  A CodeRef consists of a
    659     // pointer to the code, and a ref pointer to the pool from within which it
    660     // was allocated.
    661     class CodeRef {
    662     public:
    663         CodeRef()
    664             : m_code(0)
    665 #ifndef NDEBUG
    666             , m_size(0)
    667 #endif
    668         {
    669         }
    670 
    671         CodeRef(AbstractMacroAssembler<AssemblerType>* masm, PassRefPtr<ExecutablePool> executablePool)
    672             : m_executablePool(executablePool)
    673 #ifndef NDEBUG
    674             , m_size(masm->m_assembler.size())
    675 #endif
    676         {
    677             m_code = masm->m_assembler.executableCopy(m_executablePool.get());
    678         }
    679 
    680         CodeRef(void* code, PassRefPtr<ExecutablePool> executablePool, size_t size)
    681             : m_code(code)
    682             , m_executablePool(executablePool)
    683         {
    684 #ifndef NDEBUG
    685             m_size = size;
    686 #else
    687             UNUSED_PARAM(size);
    688 #endif
    689         }
    690 
    691         void* trampolineAt(Label label)
    692         {
    693             return AssemblerType::getRelocatedAddress(m_code, label.m_label);
    694         }
    695        
    696         void* m_code;
    697         RefPtr<ExecutablePool> m_executablePool;
    698 #ifndef NDEBUG
    699         size_t m_size;
    700 #endif
    701     };
     639    // Section 4: The patch buffer - utility to finalize code generation.
     640
    702641
    703642    // PatchBuffer:
     
    718657    // address of calls, as opposed to a point that can be used to later relink a Jump -
    719658    // possibly wrap the later up in an object that can do just that).
    720     class PatchBuffer : public Noncopyable {
    721     public:
    722         PatchBuffer(AbstractMacroAssembler<AssemblerType>* masm, PassRefPtr<ExecutablePool> executablePool)
    723             : m_ref(masm, executablePool)
    724 #ifndef NDEBUG
    725             , m_completed(false)
    726 #endif
    727         {
    728         }
    729 
    730 #ifndef NDEBUG
    731         ~PatchBuffer()
    732         {
    733             ASSERT(m_completed);
    734         }
    735 #endif
    736 
     659    class PatchBuffer {
     660    public:
     661        PatchBuffer(void* code)
     662            : m_code(code)
     663        {
     664        }
     665
     666        CodeLocationLabel entry()
     667        {
     668            return CodeLocationLabel(m_code);
     669        }
     670
     671        void* trampolineAt(Label label)
     672        {
     673            return AssemblerType::getRelocatedAddress(m_code, label.m_label);
     674        }
     675       
    737676        // These methods are used to link or set values at code generation time.
    738677
     
    742681            ASSERT(call.isFlagSet(Call::Linkable));
    743682#if PLATFORM(X86_64)
    744             if (call.isFlagSet(Call::Near))
    745                 AssemblerType::linkCall(code(), call.m_jmp, reinterpret_cast<void*>(function));
    746             else {
    747                 intptr_t callLocation = reinterpret_cast<intptr_t>(AssemblerType::getRelocatedAddress(code(), call.m_jmp));
     683            if (call.isFlagSet(Call::Near)) {
     684                AssemblerType::linkCall(m_code, call.m_jmp, reinterpret_cast<void*>(function));
     685            } else {
     686                intptr_t callLocation = reinterpret_cast<intptr_t>(AssemblerType::getRelocatedAddress(m_code, call.m_jmp));
    748687                AssemblerType::patchMacroAssemblerCall(callLocation, reinterpret_cast<void*>(function));
    749688            }
    750689#else
    751             AssemblerType::linkCall(code(), call.m_jmp, reinterpret_cast<void*>(function));
     690            AssemblerType::linkCall(m_code, call.m_jmp, reinterpret_cast<void*>(function));
    752691#endif
    753692        }
     
    756695        void linkTailRecursive(Jump jump, FunctionSig* function)
    757696        {
    758             AssemblerType::linkJump(code(), jump.m_jmp, reinterpret_cast<void*>(function));
     697            AssemblerType::linkJump(m_code, jump.m_jmp, reinterpret_cast<void*>(function));
    759698        }
    760699
     
    762701        void linkTailRecursive(JumpList list, FunctionSig* function)
    763702        {
     703            for (unsigned i = 0; i < list.m_jumps.size(); ++i) {
     704                AssemblerType::linkJump(m_code, list.m_jumps[i].m_jmp, reinterpret_cast<void*>(function));
     705            }
     706        }
     707
     708        void link(Jump jump, CodeLocationLabel label)
     709        {
     710            AssemblerType::linkJump(m_code, jump.m_jmp, label.m_location);
     711        }
     712
     713        void link(JumpList list, CodeLocationLabel label)
     714        {
    764715            for (unsigned i = 0; i < list.m_jumps.size(); ++i)
    765                 AssemblerType::linkJump(code(), list.m_jumps[i].m_jmp, reinterpret_cast<void*>(function));
    766         }
    767 
    768         void link(Jump jump, CodeLocationLabel label)
    769         {
    770             AssemblerType::linkJump(code(), jump.m_jmp, label.m_location);
    771         }
    772 
    773         void link(JumpList list, CodeLocationLabel label)
    774         {
    775             for (unsigned i = 0; i < list.m_jumps.size(); ++i)
    776                 AssemblerType::linkJump(code(), list.m_jumps[i].m_jmp, label.m_location);
     716                AssemblerType::linkJump(m_code, list.m_jumps[i].m_jmp, label.m_location);
    777717        }
    778718
    779719        void patch(DataLabelPtr label, void* value)
    780720        {
    781             AssemblerType::patchAddress(code(), label.m_label, value);
    782         }
    783 
    784         void patch(DataLabelPtr label, CodeLocationLabel value)
    785         {
    786             AssemblerType::patchAddress(code(), label.m_label, value.getJumpDestination());
     721            AssemblerType::patchAddress(m_code, label.m_label, value);
    787722        }
    788723
     
    793728            ASSERT(call.isFlagSet(Call::Linkable));
    794729            ASSERT(!call.isFlagSet(Call::Near));
    795             return CodeLocationCall(AssemblerType::getRelocatedAddress(code(), call.m_jmp));
     730            return CodeLocationCall(AssemblerType::getRelocatedAddress(m_code, call.m_jmp));
    796731        }
    797732
     
    800735            ASSERT(call.isFlagSet(Call::Linkable));
    801736            ASSERT(call.isFlagSet(Call::Near));
    802             return CodeLocationNearCall(AssemblerType::getRelocatedAddress(code(), call.m_jmp));
     737            return CodeLocationNearCall(AssemblerType::getRelocatedAddress(m_code, call.m_jmp));
    803738        }
    804739
    805740        CodeLocationLabel locationOf(Label label)
    806741        {
    807             return CodeLocationLabel(AssemblerType::getRelocatedAddress(code(), label.m_label));
     742            return CodeLocationLabel(AssemblerType::getRelocatedAddress(m_code, label.m_label));
    808743        }
    809744
    810745        CodeLocationDataLabelPtr locationOf(DataLabelPtr label)
    811746        {
    812             return CodeLocationDataLabelPtr(AssemblerType::getRelocatedAddress(code(), label.m_label));
     747            return CodeLocationDataLabelPtr(AssemblerType::getRelocatedAddress(m_code, label.m_label));
    813748        }
    814749
    815750        CodeLocationDataLabel32 locationOf(DataLabel32 label)
    816751        {
    817             return CodeLocationDataLabel32(AssemblerType::getRelocatedAddress(code(), label.m_label));
     752            return CodeLocationDataLabel32(AssemblerType::getRelocatedAddress(m_code, label.m_label));
    818753        }
    819754
     
    825760        }
    826761
    827         // Upon completion of all patching either 'finalizeCode()' or 'finalizeCodeAddendum()' should be called
    828         // once to complete generation of the code.  'finalizeCode()' is suited to situations
    829         // where the executable pool must also be retained, the lighter-weight 'finalizeCodeAddendum()' is
    830         // suited to adding to an existing allocation.
    831         CodeRef finalizeCode()
    832         {
    833             performFinalization();
    834 
    835             return m_ref;
    836         }
    837         CodeLocationLabel finalizeCodeAddendum()
    838         {
    839             performFinalization();
    840 
    841             return CodeLocationLabel(code());
    842         }
    843 
    844     private:
    845         // Keep this private! - the underlying code should only be obtained externally via
    846         // finalizeCode() or finalizeCodeAddendum().
    847         void* code()
    848         {
    849             return m_ref.m_code;
    850         }
    851 
    852         void performFinalization()
    853         {
    854 #ifndef NDEBUG
    855             ASSERT(!m_completed);
    856             m_completed = true;
    857 #endif
    858         }
    859 
    860         CodeRef m_ref;
    861 #ifndef NDEBUG
    862         bool m_completed;
    863 #endif
     762    private:
     763        void* m_code;
    864764    };
    865765
     
    870770    {
    871771        return m_assembler.size();
     772    }
     773
     774    void* copyCode(ExecutablePool* allocator)
     775    {
     776        return m_assembler.executableCopy(allocator);
    872777    }
    873778
Note: See TracChangeset for help on using the changeset viewer.