Changeset 153071 in webkit


Ignore:
Timestamp:
Jul 23, 2013 5:41:46 PM (11 years ago)
Author:
mark.lam@apple.com
Message:

Removed unused sourceOffset from JSTokenLocation.
https://bugs.webkit.org/show_bug.cgi?id=118996.

Reviewed by Geoffrey Garen.

This also removes the assertion reported in the bug because it is now
moot, thereby resolving the assertion failure issue on Windows.

  • bytecompiler/NodesCodegen.cpp:

(JSC::ArrayNode::toArgumentList):
(JSC::ApplyFunctionCallDotNode::emitBytecode):

  • parser/Lexer.cpp:

(JSC::::lex):

  • parser/Lexer.h:

(JSC::::lexExpectIdentifier):

  • parser/Nodes.h:
  • parser/Parser.cpp:

(JSC::::Parser):
(JSC::::parseFunctionInfo):
(JSC::::parseExpressionOrLabelStatement):
(JSC::::parseMemberExpression):

  • parser/Parser.h:

(JSC::::parse):

  • parser/ParserTokens.h:

(JSC::JSTokenLocation::JSTokenLocation):

Location:
trunk/Source/JavaScriptCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r152982 r153071  
     12013-07-23  Mark Lam  <mark.lam@apple.com>
     2
     3        Removed unused sourceOffset from JSTokenLocation.
     4        https://bugs.webkit.org/show_bug.cgi?id=118996.
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        This also removes the assertion reported in the bug because it is now
     9        moot, thereby resolving the assertion failure issue on Windows.
     10
     11        * bytecompiler/NodesCodegen.cpp:
     12        (JSC::ArrayNode::toArgumentList):
     13        (JSC::ApplyFunctionCallDotNode::emitBytecode):
     14        * parser/Lexer.cpp:
     15        (JSC::::lex):
     16        * parser/Lexer.h:
     17        (JSC::::lexExpectIdentifier):
     18        * parser/Nodes.h:
     19        * parser/Parser.cpp:
     20        (JSC::::Parser):
     21        (JSC::::parseFunctionInfo):
     22        (JSC::::parseExpressionOrLabelStatement):
     23        (JSC::::parseMemberExpression):
     24        * parser/Parser.h:
     25        (JSC::::parse):
     26        * parser/ParserTokens.h:
     27        (JSC::JSTokenLocation::JSTokenLocation):
     28
    1292013-07-22  Alex Christensen  <achristensen@apple.com>
    230
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r152494 r153071  
    203203}
    204204
    205 ArgumentListNode* ArrayNode::toArgumentList(VM* vm, int lineNumber, int startPosition, unsigned sourceOffset) const
     205ArgumentListNode* ArrayNode::toArgumentList(VM* vm, int lineNumber, int startPosition) const
    206206{
    207207    ASSERT(!m_elision && !m_optional);
     
    209209    if (!ptr)
    210210        return 0;
    211     JSTokenLocation location(sourceOffset);
     211    JSTokenLocation location;
    212212    location.line = lineNumber;
    213213    location.startOffset = startPosition;
    214     location.sourceOffset = sourceOffset;
    215214    ArgumentListNode* head = new (vm) ArgumentListNode(location, ptr->value());
    216215    ArgumentListNode* tail = head;
     
    550549                    ASSERT(m_args->m_listNode->m_next->m_expr->isSimpleArray());
    551550                    ASSERT(!m_args->m_listNode->m_next->m_next);
    552                     m_args->m_listNode = static_cast<ArrayNode*>(m_args->m_listNode->m_next->m_expr)->toArgumentList(generator.vm(), 0, 0, 0);
     551                    m_args->m_listNode = static_cast<ArrayNode*>(m_args->m_listNode->m_next->m_expr)->toArgumentList(generator.vm(), 0, 0);
    553552                    RefPtr<RegisterID> realFunction = generator.emitMove(generator.tempDestination(dst), base.get());
    554553                    CallArguments callArguments(generator, m_args);
  • trunk/Source/JavaScriptCore/parser/Lexer.cpp

    r152494 r153071  
    13241324   
    13251325    tokenLocation->startOffset = currentOffset();
    1326     tokenLocation->sourceOffset = m_sourceOffset;
    13271326    ASSERT(currentOffset() >= currentLineStartOffset());
    13281327
  • trunk/Source/JavaScriptCore/parser/Lexer.h

    r152494 r153071  
    371371    tokenLocation->startOffset = offsetFromSourcePtr(start);
    372372    tokenLocation->endOffset = currentOffset();
    373     tokenLocation->sourceOffset = m_sourceOffset;
    374373    ASSERT(tokenLocation->startOffset >= tokenLocation->lineStartOffset);
    375374    m_lastToken = IDENT;
  • trunk/Source/JavaScriptCore/parser/Nodes.h

    r152494 r153071  
    457457        ArrayNode(const JSTokenLocation&, int elision, ElementNode*);
    458458
    459         ArgumentListNode* toArgumentList(VM*, int, int, unsigned) const;
     459        ArgumentListNode* toArgumentList(VM*, int, int) const;
    460460
    461461    private:
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r152494 r153071  
    8383    m_arena = m_vm->parserArena.get();
    8484    m_lexer->setCode(source, m_arena);
    85     m_token.m_location.sourceOffset = source.startOffset();
    8685    m_token.m_location.endOffset = source.startOffset();
    8786    m_token.m_location.lineStartOffset = source.startOffset();
     
    862861        // If we're in a strict context, the cached function info must say it was strict too.
    863862        ASSERT(!strictMode() || cachedInfo->strictMode);
    864         JSTokenLocation endLocation(m_source->startOffset());
     863        JSTokenLocation endLocation;
    865864
    866865        endLocation.line = cachedInfo->closeBraceLine;
     
    967966     */
    968967    Vector<LabelInfo> labels;
    969     JSTokenLocation location(m_source->startOffset());
     968    JSTokenLocation location;
    970969    do {
    971970        int start = tokenStart();
     
    16351634    int expressionLineStart = tokenLineStart();
    16361635    int newCount = 0;
    1637     JSTokenLocation location(m_source->startOffset());
     1636    JSTokenLocation location;
    16381637    while (match(NEW)) {
    16391638        next();
  • trunk/Source/JavaScriptCore/parser/Parser.h

    r152494 r153071  
    10371037    RefPtr<ParsedNode> result;
    10381038    if (m_sourceElements) {
    1039         JSTokenLocation endLocation(m_source->startOffset());
     1039        JSTokenLocation endLocation;
    10401040        endLocation.line = m_lexer->lastLineNumber();
    10411041        endLocation.lineStartOffset = m_lexer->currentLineStartOffset();
  • trunk/Source/JavaScriptCore/parser/ParserTokens.h

    r152497 r153071  
    162162
    163163struct JSTokenLocation {
    164     JSTokenLocation(unsigned _sourceOffset = UINT_MAX) : line(0), lineStartOffset(0), startOffset(0), sourceOffset(_sourceOffset) { }
     164    JSTokenLocation() : line(0), lineStartOffset(0), startOffset(0) { }
    165165    JSTokenLocation(const JSTokenLocation& location)
    166166    {
     
    169169        startOffset = location.startOffset;
    170170        endOffset = location.endOffset;
    171         sourceOffset = location.sourceOffset;
    172         ASSERT(sourceOffset != UINT_MAX);
    173171    }
    174 
    175     ALWAYS_INLINE unsigned lineStartPosition() const { ASSERT(sourceOffset != UINT_MAX); return lineStartOffset - sourceOffset; }
    176     ALWAYS_INLINE unsigned startPosition() const { ASSERT(sourceOffset != UINT_MAX); return startOffset - sourceOffset; }
    177     ALWAYS_INLINE unsigned endPosition() const { ASSERT(sourceOffset != UINT_MAX); return endOffset - sourceOffset; }
    178172
    179173    int line;
     
    181175    unsigned startOffset;
    182176    unsigned endOffset;
    183     unsigned sourceOffset;
    184177};
    185178
Note: See TracChangeset for help on using the changeset viewer.