Commit 0d5fdb9b authored by mark.lam@apple.com's avatar mark.lam@apple.com

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



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent db9d1212
2013-07-23 Mark Lam <mark.lam@apple.com>
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 <achristensen@apple.com>
Added assembly files to Windows 64-bit builds.
......
......@@ -202,16 +202,15 @@ bool ArrayNode::isSimpleArray() const
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 @@ RegisterID* ApplyFunctionCallDotNode::emitBytecode(BytecodeGenerator& generator,
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);
......
......@@ -1323,7 +1323,6 @@ start:
return EOFTOK;
tokenLocation->startOffset = currentOffset();
tokenLocation->sourceOffset = m_sourceOffset;
ASSERT(currentOffset() >= currentLineStartOffset());
CharacterType type;
......
......@@ -370,7 +370,6 @@ ALWAYS_INLINE JSTokenType Lexer<T>::lexExpectIdentifier(JSTokenData* tokenData,
tokenLocation->lineStartOffset = currentLineStartOffset();
tokenLocation->startOffset = offsetFromSourcePtr(start);
tokenLocation->endOffset = currentOffset();
tokenLocation->sourceOffset = m_sourceOffset;
ASSERT(tokenLocation->startOffset >= tokenLocation->lineStartOffset);
m_lastToken = IDENT;
return IDENT;
......
......@@ -456,7 +456,7 @@ namespace JSC {
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);
......
......@@ -82,7 +82,6 @@ Parser<LexerType>::Parser(VM* vm, const SourceCode& source, FunctionParameters*
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 @@ template <FunctionRequirements requirements, bool nameIsInContainingScope, class
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 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseExpressionOrL
* 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 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseMemberExpres
int expressionLine = tokenLine();
int expressionLineStart = tokenLineStart();
int newCount = 0;
JSTokenLocation location(m_source->startOffset());
JSTokenLocation location;
while (match(NEW)) {
next();
newCount++;
......
......@@ -1036,7 +1036,7 @@ PassRefPtr<ParsedNode> Parser<LexerType>::parse(ParserError& error)
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();
......
......@@ -161,26 +161,19 @@ union JSTokenData {
};
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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment