Ignore:
Timestamp:
Sep 9, 2017, 9:54:40 AM (8 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r221774.

This change introduced three debug JSC test timeouts.

Reverted changeset:

"Use JIT probes for DFG OSR exit."
https://bugs.webkit.org/show_bug.cgi?id=175144
http://trac.webkit.org/changeset/221774

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/ProbeStack.h

    r221774 r221823  
    5757    T get(void* logicalAddress)
    5858    {
    59         void* from = physicalAddressFor(logicalAddress);
    60         typename std::remove_const<T>::type to { };
    61         std::memcpy(&to, from, sizeof(to)); // Use std::memcpy to avoid strict aliasing issues.
    62         return to;
    63     }
    64     template<typename T>
    65     T get(void* logicalBaseAddress, ptrdiff_t offset)
    66     {
    67         return get<T>(reinterpret_cast<uint8_t*>(logicalBaseAddress) + offset);
     59        return *physicalAddressFor<T*>(logicalAddress);
    6860    }
    6961
     
    7264    {
    7365        m_dirtyBits |= dirtyBitFor(logicalAddress);
    74         void* to = physicalAddressFor(logicalAddress);
    75         std::memcpy(to, &value, sizeof(T)); // Use std::memcpy to avoid strict aliasing issues.
    76     }
    77     template<typename T>
    78     void set(void* logicalBaseAddress, ptrdiff_t offset, T value)
    79     {
    80         set<T>(reinterpret_cast<uint8_t*>(logicalBaseAddress) + offset, value);
     66        *physicalAddressFor<T*>(logicalAddress) = value;
    8167    }
    8268
     
    9581    }
    9682
    97     void* physicalAddressFor(void* logicalAddress)
     83    template<typename T, typename = typename std::enable_if<std::is_pointer<T>::value>::type>
     84    T physicalAddressFor(void* logicalAddress)
    9885    {
    99         return reinterpret_cast<uint8_t*>(logicalAddress) + m_physicalAddressOffset;
     86        uintptr_t offset = reinterpret_cast<uintptr_t>(logicalAddress) & s_pageMask;
     87        void* physicalAddress = reinterpret_cast<uint8_t*>(&m_buffer) + offset;
     88        return reinterpret_cast<T>(physicalAddress);
    10089    }
    10190
     
    10493    void* m_baseLogicalAddress { nullptr };
    10594    uintptr_t m_dirtyBits { 0 };
    106     ptrdiff_t m_physicalAddressOffset;
    10795
    10896    static constexpr size_t s_pageSize = 1024;
     
    133121    Stack(Stack&& other);
    134122
    135     void* lowWatermark()
    136     {
    137         // We use the chunkAddress for the low watermark because we'll be doing write backs
    138         // to the stack in increments of chunks. Hence, we'll treat the lowest address of
    139         // the chunk as the low watermark of any given set address.
    140         return Page::chunkAddressFor(m_lowWatermark);
    141     }
     123    void* lowWatermark() { return m_lowWatermark; }
    142124
    143125    template<typename T>
    144     T get(void* address)
     126    typename std::enable_if<!std::is_same<double, typename std::remove_cv<T>::type>::value, T>::type get(void* address)
    145127    {
    146128        Page* page = pageFor(address);
    147129        return page->get<T>(address);
    148130    }
    149     template<typename T>
    150     T get(void* logicalBaseAddress, ptrdiff_t offset)
    151     {
    152         return get<T>(reinterpret_cast<uint8_t*>(logicalBaseAddress) + offset);
    153     }
    154131
    155     template<typename T>
     132    template<typename T, typename = typename std::enable_if<!std::is_same<double, typename std::remove_cv<T>::type>::value>::type>
    156133    void set(void* address, T value)
    157134    {
     
    159136        page->set<T>(address, value);
    160137
    161         if (address < m_lowWatermark)
    162             m_lowWatermark = address;
     138        // We use the chunkAddress for the low watermark because we'll be doing write backs
     139        // to the stack in increments of chunks. Hence, we'll treat the lowest address of
     140        // the chunk as the low watermark of any given set address.
     141        void* chunkAddress = Page::chunkAddressFor(address);
     142        if (chunkAddress < m_lowWatermark)
     143            m_lowWatermark = chunkAddress;
    163144    }
     145
    164146    template<typename T>
    165     void set(void* logicalBaseAddress, ptrdiff_t offset, T value)
     147    typename std::enable_if<std::is_same<double, typename std::remove_cv<T>::type>::value, T>::type get(void* address)
    166148    {
    167         set<T>(reinterpret_cast<uint8_t*>(logicalBaseAddress) + offset, value);
     149        Page* page = pageFor(address);
     150        return bitwise_cast<double>(page->get<uint64_t>(address));
     151    }
     152
     153    template<typename T, typename = typename std::enable_if<std::is_same<double, typename std::remove_cv<T>::type>::value>::type>
     154    void set(void* address, double value)
     155    {
     156        set<uint64_t>(address, bitwise_cast<uint64_t>(value));
    168157    }
    169158
Note: See TracChangeset for help on using the changeset viewer.