Changeset 54747 in webkit for trunk/JavaScriptCore/bytecode


Ignore:
Timestamp:
Feb 12, 2010, 7:09:11 PM (16 years ago)
Author:
[email protected]
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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/CodeBlock.h

    r53400 r54747  
    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            hasSeenShouldRepatch = true;
    128129        }
    129130    };
     
    132133        MethodCallLinkInfo()
    133134            : cachedStructure(0)
     135            , cachedPrototypeStructure(0)
    134136        {
    135137        }
     
    137139        bool seenOnce()
    138140        {
    139             return cachedPrototypeStructure.isFlagSet(hasSeenShouldRepatch);
     141            ASSERT(!cachedStructure);
     142            return cachedPrototypeStructure;
    140143        }
    141144
    142145        void setSeen()
    143146        {
    144             cachedPrototypeStructure.setFlag(hasSeenShouldRepatch);
     147            ASSERT(!cachedStructure && !cachedPrototypeStructure);
     148            // We use the values of cachedStructure & cachedPrototypeStructure to indicate the
     149            // current state.
     150            //     - In the initial state, both are null.
     151            //     - Once this transition has been taken once, cachedStructure is
     152            //       null and cachedPrototypeStructure is set to a nun-null value.
     153            //     - Once the call is linked both structures are set to non-null values.
     154            cachedPrototypeStructure = (Structure*)1;
    145155        }
    146156
     
    148158        CodeLocationDataLabelPtr structureLabel;
    149159        Structure* cachedStructure;
    150         PtrAndFlags<Structure, HasSeenShouldRepatch> cachedPrototypeStructure;
     160        Structure* cachedPrototypeStructure;
    151161    };
    152162
Note: See TracChangeset for help on using the changeset viewer.