Changeset 53391 in webkit


Ignore:
Timestamp:
Jan 17, 2010 11:28:53 PM (14 years ago)
Author:
barraclough@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=33731
Remove uses of PtrAndFlags from JIT data stuctures.

Reviewed by Oliver Hunt.

These break the OS X Leaks tool. Free up a bit in CallLinkInfo, and invalid
permutation of pointer states in MethodCallLinkInfo to represent the removed bits.

  • bytecode/CodeBlock.h:

(JSC::CallLinkInfo::seenOnce):
(JSC::CallLinkInfo::setSeen):
(JSC::MethodCallLinkInfo::MethodCallLinkInfo):
(JSC::MethodCallLinkInfo::seenOnce):
(JSC::MethodCallLinkInfo::setSeen):

  • jit/JIT.cpp:

(JSC::JIT::unlinkCall):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::patchMethodCallProto):

  • runtime/UString.h:
Location:
trunk/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r53371 r53391  
     12010-01-15  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=33731
     6        Remove uses of PtrAndFlags from JIT data stuctures.
     7
     8        These break the OS X Leaks tool.  Free up a bit in CallLinkInfo, and invalid
     9        permutation of pointer states in MethodCallLinkInfo to represent the removed bits.
     10
     11        * bytecode/CodeBlock.h:
     12        (JSC::CallLinkInfo::seenOnce):
     13        (JSC::CallLinkInfo::setSeen):
     14        (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
     15        (JSC::MethodCallLinkInfo::seenOnce):
     16        (JSC::MethodCallLinkInfo::setSeen):
     17        * jit/JIT.cpp:
     18        (JSC::JIT::unlinkCall):
     19        * jit/JITPropertyAccess.cpp:
     20        (JSC::JIT::patchMethodCallProto):
     21        * runtime/UString.h:
     22
    1232010-01-16  Maciej Stachowiak  <mjs@apple.com>
    224
  • trunk/JavaScriptCore/bytecode/CodeBlock.h

    r50537 r53391  
    111111        CodeLocationDataLabelPtr hotPathBegin;
    112112        CodeLocationNearCall hotPathOther;
    113         PtrAndFlags<CodeBlock, HasSeenShouldRepatch> ownerCodeBlock;
     113        CodeBlock* ownerCodeBlock;
    114114        CodeBlock* callee;
    115         unsigned position;
     115        unsigned position : 31;
     116        unsigned hasSeenShouldRepatch : 1;
    116117       
    117118        void setUnlinked() { callee = 0; }
     
    120121        bool seenOnce()
    121122        {
    122             return ownerCodeBlock.isFlagSet(hasSeenShouldRepatch);
     123            return hasSeenShouldRepatch;
    123124        }
    124125
    125126        void setSeen()
    126127        {
    127             ownerCodeBlock.setFlag(hasSeenShouldRepatch);
    128         }
    129     };
     128            hasSeenShouldRepatch = true;
     129        }
     130    };
     131
     132#define MethodCallLinkInfo_seenFlag ((Structure*)1)
    130133
    131134    struct MethodCallLinkInfo {
    132135        MethodCallLinkInfo()
    133136            : cachedStructure(0)
     137            , cachedPrototypeStructure(0)
    134138        {
    135139        }
     
    137141        bool seenOnce()
    138142        {
    139             return cachedPrototypeStructure.isFlagSet(hasSeenShouldRepatch);
     143            ASSERT(!cachedStructure);
     144            return cachedPrototypeStructure;
    140145        }
    141146
    142147        void setSeen()
    143148        {
    144             cachedPrototypeStructure.setFlag(hasSeenShouldRepatch);
     149            ASSERT(!cachedStructure && !cachedPrototypeStructure);
     150            // We use the values of cachedStructure & cachedPrototypeStructure to indicate the
     151            // current state.
     152            //     - In the initial state, both are null.
     153            //     - Once this transition has been taken once, cachedStructure is
     154            //       null and cachedPrototypeStructure is set to a nun-null value.
     155            //     - Once the call is linked both structures are set to non-null values.
     156            cachedPrototypeStructure = MethodCallLinkInfo_seenFlag;
    145157        }
    146158
     
    148160        CodeLocationDataLabelPtr structureLabel;
    149161        Structure* cachedStructure;
    150         PtrAndFlags<Structure, HasSeenShouldRepatch> cachedPrototypeStructure;
     162        Structure* cachedPrototypeStructure;
    151163    };
    152164
  • trunk/JavaScriptCore/jit/JIT.cpp

    r52920 r53391  
    583583    // (and, if a new JSFunction happened to be constructed at the same location, we could get a false positive
    584584    // match).  Reset the check so it no longer matches.
    585     RepatchBuffer repatchBuffer(callLinkInfo->ownerCodeBlock.get());
     585    RepatchBuffer repatchBuffer(callLinkInfo->ownerCodeBlock);
    586586#if USE(JSVALUE32_64)
    587587    repatchBuffer.repatch(callLinkInfo->hotPathBegin, 0);
  • trunk/JavaScriptCore/jit/JITPropertyAccess.cpp

    r52975 r53391  
    645645
    646646    Structure* prototypeStructure = proto->structure();
    647     ASSERT(!methodCallLinkInfo.cachedPrototypeStructure);
    648647    methodCallLinkInfo.cachedPrototypeStructure = prototypeStructure;
    649648    prototypeStructure->ref();
     
    15951594
    15961595    Structure* prototypeStructure = proto->structure();
    1597     ASSERT(!methodCallLinkInfo.cachedPrototypeStructure);
    15981596    methodCallLinkInfo.cachedPrototypeStructure = prototypeStructure;
    15991597    prototypeStructure->ref();
  • trunk/JavaScriptCore/runtime/UString.h

    r53320 r53391  
    3232#include <wtf/OwnFastMallocPtr.h>
    3333#include <wtf/PassRefPtr.h>
    34 #include <wtf/PtrAndFlags.h>
    3534#include <wtf/RefPtr.h>
    3635#include <wtf/Vector.h>
Note: See TracChangeset for help on using the changeset viewer.