Ignore:
Timestamp:
Nov 28, 2012, 1:11:53 PM (13 years ago)
Author:
[email protected]
Message:

Make source cache include more information about the function extent.
https://bugs.webkit.org/show_bug.cgi?id=103552

Reviewed by Gavin Barraclough.

Add a bit more information to the source cache.

  • parser/Parser.cpp:

(JSC::::parseFunctionInfo):

Store the function start offset

  • parser/SourceProviderCacheItem.h:

(JSC::SourceProviderCacheItem::SourceProviderCacheItem):
(SourceProviderCacheItem):

Add additional field for the start of the real function string, and re-arrange
fields to avoid growing the struct.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/SourceProviderCacheItem.h

    r127484 r136049  
    3636    WTF_MAKE_FAST_ALLOCATED;
    3737public:
    38     SourceProviderCacheItem(int closeBraceLine, int closeBracePos)
    39         : closeBraceLine(closeBraceLine)
     38    SourceProviderCacheItem(unsigned functionStart, unsigned closeBraceLine, unsigned closeBracePos)
     39        : functionStart(functionStart)
     40        , closeBraceLine(closeBraceLine)
    4041        , closeBracePos(closeBracePos)
    4142    {
     
    6061        return token;
    6162    }
     63
     64    unsigned functionStart : 31;
     65    bool needsFullActivation : 1;
    6266   
    63     int closeBraceLine;
    64     int closeBracePos;
    65     bool usesEval;
    66     bool strictMode;
    67     bool needsFullActivation;
     67    unsigned closeBraceLine : 31;
     68    bool usesEval : 1;
     69
     70    unsigned closeBracePos : 31;
     71    bool strictMode : 1;
     72
    6873    Vector<RefPtr<StringImpl> > usedVariables;
    6974    Vector<RefPtr<StringImpl> > writtenVariables;
Note: See TracChangeset for help on using the changeset viewer.