Changeset 208830 in webkit
- Timestamp:
- Nov 16, 2016, 5:02:06 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r208824 r208830 1 2016-11-16 Geoffrey Garen <ggaren@apple.com> 2 3 UnlinkedCodeBlock should not have a starting line number 4 https://bugs.webkit.org/show_bug.cgi?id=164838 5 6 Reviewed by Mark Lam. 7 8 Here's how the starting line number in UnlinkedCodeBlock used to work: 9 10 (1) Assign the source code starting line number to the parser starting 11 line number. 12 13 (2) Assign (1) to the AST. 14 15 (3) Subtract (1) from (2) and assign to UnlinkedCodeBlock. 16 17 Then, when linking: 18 19 (4) Add (3) to (1). 20 21 This was an awesome no-op. 22 23 Generally, unlinked code is code that is not tied to any particular 24 web page or resource. So, it's inappropriate to think of it having a 25 starting line number. 26 27 * bytecode/UnlinkedCodeBlock.cpp: 28 (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): 29 * bytecode/UnlinkedCodeBlock.h: 30 (JSC::UnlinkedCodeBlock::recordParse): 31 (JSC::UnlinkedCodeBlock::hasCapturedVariables): 32 (JSC::UnlinkedCodeBlock::firstLine): Deleted. 33 * runtime/CodeCache.cpp: 34 (JSC::CodeCache::getUnlinkedGlobalCodeBlock): 35 * runtime/CodeCache.h: 36 (JSC::generateUnlinkedCodeBlock): 37 1 38 2016-11-16 Yusuke Suzuki <utatane.tea@gmail.com> 2 39 -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
r208312 r208830 71 71 , m_derivedContextType(static_cast<unsigned>(info.derivedContextType())) 72 72 , m_evalContextType(static_cast<unsigned>(info.evalContextType())) 73 , m_firstLine(0)74 73 , m_lineCount(0) 75 74 , m_endColumn(UINT_MAX) -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
r208637 r208830 348 348 bool typeProfilerExpressionInfoForBytecodeOffset(unsigned bytecodeOffset, unsigned& startDivot, unsigned& endDivot); 349 349 350 void recordParse(CodeFeatures features, bool hasCapturedVariables, unsigned firstLine, unsignedlineCount, unsigned endColumn)350 void recordParse(CodeFeatures features, bool hasCapturedVariables, unsigned lineCount, unsigned endColumn) 351 351 { 352 352 m_features = features; 353 353 m_hasCapturedVariables = hasCapturedVariables; 354 m_firstLine = firstLine;355 354 m_lineCount = lineCount; 356 355 // For the UnlinkedCodeBlock, startColumn is always 0. … … 365 364 CodeFeatures codeFeatures() const { return m_features; } 366 365 bool hasCapturedVariables() const { return m_hasCapturedVariables; } 367 unsigned firstLine() const { return m_firstLine; }368 366 unsigned lineCount() const { return m_lineCount; } 369 367 ALWAYS_INLINE unsigned startColumn() const { return 0; } … … 437 435 unsigned m_derivedContextType : 2; 438 436 unsigned m_evalContextType : 2; 439 unsigned m_firstLine;440 437 unsigned m_lineCount; 441 438 unsigned m_endColumn; -
trunk/Source/JavaScriptCore/runtime/CodeCache.cpp
r208768 r208830 62 62 if (cache && Options::useCodeCache()) { 63 63 UnlinkedCodeBlockType* unlinkedCodeBlock = jsCast<UnlinkedCodeBlockType*>(cache->cell.get()); 64 unsigned firstLine = source.firstLine() + unlinkedCodeBlock->firstLine();65 64 unsigned lineCount = unlinkedCodeBlock->lineCount(); 66 65 unsigned startColumn = unlinkedCodeBlock->startColumn() + source.startColumn(); 67 66 bool endColumnIsOnStartLine = !lineCount; 68 67 unsigned endColumn = unlinkedCodeBlock->endColumn() + (endColumnIsOnStartLine ? startColumn : 1); 69 executable->recordParse(unlinkedCodeBlock->codeFeatures(), unlinkedCodeBlock->hasCapturedVariables(), firstLine, firstLine+ lineCount, startColumn, endColumn);68 executable->recordParse(unlinkedCodeBlock->codeFeatures(), unlinkedCodeBlock->hasCapturedVariables(), source.firstLine(), source.firstLine() + lineCount, startColumn, endColumn); 70 69 source.provider()->setSourceURLDirective(unlinkedCodeBlock->sourceURLDirective()); 71 70 source.provider()->setSourceMappingURLDirective(unlinkedCodeBlock->sourceMappingURLDirective()); -
trunk/Source/JavaScriptCore/runtime/CodeCache.h
r208768 r208830 247 247 248 248 UnlinkedCodeBlockType* unlinkedCodeBlock = UnlinkedCodeBlockType::create(&vm, executable->executableInfo(), debuggerMode); 249 unlinkedCodeBlock->recordParse(rootNode->features(), rootNode->hasCapturedVariables(), rootNode->firstLine() - source.firstLine(),lineCount, unlinkedEndColumn);249 unlinkedCodeBlock->recordParse(rootNode->features(), rootNode->hasCapturedVariables(), lineCount, unlinkedEndColumn); 250 250 unlinkedCodeBlock->setSourceURLDirective(source.provider()->sourceURL()); 251 251 unlinkedCodeBlock->setSourceMappingURLDirective(source.provider()->sourceMappingURL());
Note:
See TracChangeset
for help on using the changeset viewer.