Title: [153071] trunk/Source/_javascript_Core
Revision
153071
Author
[email protected]
Date
2013-07-23 17:41:46 -0700 (Tue, 23 Jul 2013)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (153070 => 153071)


--- trunk/Source/_javascript_Core/ChangeLog	2013-07-24 00:35:36 UTC (rev 153070)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-07-24 00:41:46 UTC (rev 153071)
@@ -1,3 +1,31 @@
+2013-07-23  Mark Lam  <[email protected]>
+
+        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):
+
 2013-07-22  Alex Christensen  <[email protected]>
 
         Added assembly files to Windows 64-bit builds.

Modified: trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (153070 => 153071)


--- trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2013-07-24 00:35:36 UTC (rev 153070)
+++ trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2013-07-24 00:41:46 UTC (rev 153071)
@@ -202,16 +202,15 @@
     return true;
 }
 
-ArgumentListNode* ArrayNode::toArgumentList(VM* vm, int lineNumber, int startPosition, unsigned sourceOffset) const
+ArgumentListNode* ArrayNode::toArgumentList(VM* vm, int lineNumber, int startPosition) const
 {
     ASSERT(!m_elision && !m_optional);
     ElementNode* ptr = m_element;
     if (!ptr)
         return 0;
-    JSTokenLocation location(sourceOffset);
+    JSTokenLocation location;
     location.line = lineNumber;
     location.startOffset = startPosition;
-    location.sourceOffset = sourceOffset;
     ArgumentListNode* head = new (vm) ArgumentListNode(location, ptr->value());
     ArgumentListNode* tail = head;
     ptr = ptr->next();
@@ -549,7 +548,7 @@
                 if (m_args->m_listNode->m_next) {
                     ASSERT(m_args->m_listNode->m_next->m_expr->isSimpleArray());
                     ASSERT(!m_args->m_listNode->m_next->m_next);
-                    m_args->m_listNode = static_cast<ArrayNode*>(m_args->m_listNode->m_next->m_expr)->toArgumentList(generator.vm(), 0, 0, 0);
+                    m_args->m_listNode = static_cast<ArrayNode*>(m_args->m_listNode->m_next->m_expr)->toArgumentList(generator.vm(), 0, 0);
                     RefPtr<RegisterID> realFunction = generator.emitMove(generator.tempDestination(dst), base.get());
                     CallArguments callArguments(generator, m_args);
                     generator.emitNode(callArguments.thisRegister(), oldList->m_expr);

Modified: trunk/Source/_javascript_Core/parser/Lexer.cpp (153070 => 153071)


--- trunk/Source/_javascript_Core/parser/Lexer.cpp	2013-07-24 00:35:36 UTC (rev 153070)
+++ trunk/Source/_javascript_Core/parser/Lexer.cpp	2013-07-24 00:41:46 UTC (rev 153071)
@@ -1323,7 +1323,6 @@
         return EOFTOK;
     
     tokenLocation->startOffset = currentOffset();
-    tokenLocation->sourceOffset = m_sourceOffset;
     ASSERT(currentOffset() >= currentLineStartOffset());
 
     CharacterType type;

Modified: trunk/Source/_javascript_Core/parser/Lexer.h (153070 => 153071)


--- trunk/Source/_javascript_Core/parser/Lexer.h	2013-07-24 00:35:36 UTC (rev 153070)
+++ trunk/Source/_javascript_Core/parser/Lexer.h	2013-07-24 00:41:46 UTC (rev 153071)
@@ -370,7 +370,6 @@
     tokenLocation->lineStartOffset = currentLineStartOffset();
     tokenLocation->startOffset = offsetFromSourcePtr(start);
     tokenLocation->endOffset = currentOffset();
-    tokenLocation->sourceOffset = m_sourceOffset;
     ASSERT(tokenLocation->startOffset >= tokenLocation->lineStartOffset);
     m_lastToken = IDENT;
     return IDENT;

Modified: trunk/Source/_javascript_Core/parser/Nodes.h (153070 => 153071)


--- trunk/Source/_javascript_Core/parser/Nodes.h	2013-07-24 00:35:36 UTC (rev 153070)
+++ trunk/Source/_javascript_Core/parser/Nodes.h	2013-07-24 00:41:46 UTC (rev 153071)
@@ -456,7 +456,7 @@
         ArrayNode(const JSTokenLocation&, ElementNode*);
         ArrayNode(const JSTokenLocation&, int elision, ElementNode*);
 
-        ArgumentListNode* toArgumentList(VM*, int, int, unsigned) const;
+        ArgumentListNode* toArgumentList(VM*, int, int) const;
 
     private:
         virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);

Modified: trunk/Source/_javascript_Core/parser/Parser.cpp (153070 => 153071)


--- trunk/Source/_javascript_Core/parser/Parser.cpp	2013-07-24 00:35:36 UTC (rev 153070)
+++ trunk/Source/_javascript_Core/parser/Parser.cpp	2013-07-24 00:41:46 UTC (rev 153071)
@@ -82,7 +82,6 @@
     m_lexer = adoptPtr(new LexerType(vm));
     m_arena = m_vm->parserArena.get();
     m_lexer->setCode(source, m_arena);
-    m_token.m_location.sourceOffset = source.startOffset();
     m_token.m_location.endOffset = source.startOffset();
     m_token.m_location.lineStartOffset = source.startOffset();
 
@@ -861,7 +860,7 @@
     if (const SourceProviderCacheItem* cachedInfo = TreeBuilder::CanUseFunctionCache ? findCachedFunctionInfo(openBraceOffset) : 0) {
         // If we're in a strict context, the cached function info must say it was strict too.
         ASSERT(!strictMode() || cachedInfo->strictMode);
-        JSTokenLocation endLocation(m_source->startOffset());
+        JSTokenLocation endLocation;
 
         endLocation.line = cachedInfo->closeBraceLine;
         endLocation.startOffset = cachedInfo->closeBraceOffset;
@@ -966,7 +965,7 @@
      * special case that looks for a colon as the next character in the input.
      */
     Vector<LabelInfo> labels;
-    JSTokenLocation location(m_source->startOffset());
+    JSTokenLocation location;
     do {
         int start = tokenStart();
         int startingLine = tokenLine();
@@ -1634,7 +1633,7 @@
     int expressionLine = tokenLine();
     int expressionLineStart = tokenLineStart();
     int newCount = 0;
-    JSTokenLocation location(m_source->startOffset());
+    JSTokenLocation location;
     while (match(NEW)) {
         next();
         newCount++;

Modified: trunk/Source/_javascript_Core/parser/Parser.h (153070 => 153071)


--- trunk/Source/_javascript_Core/parser/Parser.h	2013-07-24 00:35:36 UTC (rev 153070)
+++ trunk/Source/_javascript_Core/parser/Parser.h	2013-07-24 00:41:46 UTC (rev 153071)
@@ -1036,7 +1036,7 @@
 
     RefPtr<ParsedNode> result;
     if (m_sourceElements) {
-        JSTokenLocation endLocation(m_source->startOffset());
+        JSTokenLocation endLocation;
         endLocation.line = m_lexer->lastLineNumber();
         endLocation.lineStartOffset = m_lexer->currentLineStartOffset();
         endLocation.startOffset = m_lexer->currentOffset();

Modified: trunk/Source/_javascript_Core/parser/ParserTokens.h (153070 => 153071)


--- trunk/Source/_javascript_Core/parser/ParserTokens.h	2013-07-24 00:35:36 UTC (rev 153070)
+++ trunk/Source/_javascript_Core/parser/ParserTokens.h	2013-07-24 00:41:46 UTC (rev 153071)
@@ -161,26 +161,19 @@
 };
 
 struct JSTokenLocation {
-    JSTokenLocation(unsigned _sourceOffset = UINT_MAX) : line(0), lineStartOffset(0), startOffset(0), sourceOffset(_sourceOffset) { }
+    JSTokenLocation() : line(0), lineStartOffset(0), startOffset(0) { }
     JSTokenLocation(const JSTokenLocation& location)
     {
         line = location.line;
         lineStartOffset = location.lineStartOffset;
         startOffset = location.startOffset;
         endOffset = location.endOffset;
-        sourceOffset = location.sourceOffset;
-        ASSERT(sourceOffset != UINT_MAX);
     }
 
-    ALWAYS_INLINE unsigned lineStartPosition() const { ASSERT(sourceOffset != UINT_MAX); return lineStartOffset - sourceOffset; }
-    ALWAYS_INLINE unsigned startPosition() const { ASSERT(sourceOffset != UINT_MAX); return startOffset - sourceOffset; }
-    ALWAYS_INLINE unsigned endPosition() const { ASSERT(sourceOffset != UINT_MAX); return endOffset - sourceOffset; }
-
     int line;
     unsigned lineStartOffset;
     unsigned startOffset;
     unsigned endOffset;
-    unsigned sourceOffset;
 };
 
 struct JSToken {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to