Ignore:
Timestamp:
Jan 29, 2014, 11:18:54 AM (11 years ago)
Author:
[email protected]
Message:

Merge the jsCStack branch
https://bugs.webkit.org/show_bug.cgi?id=127763

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore:

Changes from http://svn.webkit.org/repository/webkit/branches/jsCStack
up to changeset 162958.

Source/WebCore:

Changes from http://svn.webkit.org/repository/webkit/branches/jsCStack
up to changeset 162958.

Source/WTF:

Changes from http://svn.webkit.org/repository/webkit/branches/jsCStack
up to changeset 162958.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITCode.h

    r162139 r163027  
    2727#define JITCode_h
    2828
    29 #if ENABLE(JIT) || ENABLE(LLINT)
     29#include "ArityCheckMode.h"
    3030#include "CallFrame.h"
    3131#include "Disassembler.h"
     
    3434#include "LegacyProfiler.h"
    3535#include "MacroAssemblerCodeRef.h"
    36 #endif
     36#include "RegisterPreservationMode.h"
    3737
    3838namespace JSC {
     
    5555    typedef MacroAssemblerCodePtr CodePtr;
    5656
    57     enum JITType { None, HostCallThunk, InterpreterThunk, BaselineJIT, DFGJIT, FTLJIT };
     57    enum JITType : uint8_t {
     58        None,
     59        HostCallThunk,
     60        InterpreterThunk,
     61        BaselineJIT,
     62        DFGJIT,
     63        FTLJIT
     64    };
    5865   
    5966    static JITType bottomTierJIT()
     
    165172    }
    166173   
    167     virtual CodePtr addressForCall() = 0;
     174    virtual CodePtr addressForCall(VM&, ExecutableBase*, ArityCheckMode, RegisterPreservationMode) = 0;
    168175    virtual void* executableAddressAtOffset(size_t offset) = 0;
    169176    void* executableAddress() { return executableAddressAtOffset(0); }
     
    176183    virtual FTL::ForOSREntryJITCode* ftlForOSREntry();
    177184   
    178     JSValue execute(VM*, ProtoCallFrame*, Register*);
     185    JSValue execute(VM*, ProtoCallFrame*);
    179186   
    180187    void* start() { return dataAddressAtOffset(0); }
     
    184191    virtual bool contains(void*) = 0;
    185192
    186     static PassRefPtr<JITCode> hostFunction(CodeRef);
    187 
    188193private:
    189194    JITType m_jitType;
    190195};
    191196
    192 class DirectJITCode : public JITCode {
    193 public:
    194     DirectJITCode(JITType);
    195     DirectJITCode(const CodeRef, JITType);
    196     virtual ~DirectJITCode();
    197    
    198     void initializeCodeRef(CodeRef ref);
    199 
    200     virtual CodePtr addressForCall() override;
     197class JITCodeWithCodeRef : public JITCode {
     198protected:
     199    JITCodeWithCodeRef(JITType);
     200    JITCodeWithCodeRef(CodeRef, JITType);
     201
     202public:
     203    virtual ~JITCodeWithCodeRef();
     204
    201205    virtual void* executableAddressAtOffset(size_t offset) override;
    202206    virtual void* dataAddressAtOffset(size_t offset) override;
     
    205209    virtual bool contains(void*) override;
    206210
     211protected:
     212    CodeRef m_ref;
     213};
     214
     215class DirectJITCode : public JITCodeWithCodeRef {
     216public:
     217    DirectJITCode(JITType);
     218    DirectJITCode(CodeRef, CodePtr withArityCheck, JITType);
     219    virtual ~DirectJITCode();
     220   
     221    void initializeCodeRef(CodeRef, CodePtr withArityCheck);
     222
     223    virtual CodePtr addressForCall(VM&, ExecutableBase*, ArityCheckMode, RegisterPreservationMode) override;
     224
    207225private:
    208     CodeRef m_ref;
     226    struct RegisterPreservationWrappers {
     227        CodeRef withoutArityCheck;
     228        CodeRef withArityCheck;
     229    };
     230
     231    RegisterPreservationWrappers* ensureWrappers();
     232   
     233    CodePtr m_withArityCheck;
     234   
     235    std::unique_ptr<RegisterPreservationWrappers> m_wrappers;
     236};
     237
     238class NativeJITCode : public JITCodeWithCodeRef {
     239public:
     240    NativeJITCode(JITType);
     241    NativeJITCode(CodeRef, JITType);
     242    virtual ~NativeJITCode();
     243   
     244    void initializeCodeRef(CodeRef);
     245
     246    virtual CodePtr addressForCall(VM&, ExecutableBase*, ArityCheckMode, RegisterPreservationMode) override;
    209247};
    210248
Note: See TracChangeset for help on using the changeset viewer.