Changeset 162389 in webkit


Ignore:
Timestamp:
Jan 20, 2014 4:45:05 PM (10 years ago)
Author:
mark.lam@apple.com
Message:

Removing CodeBlock::opDebugBytecodeOffsetForLineAndColumn() and friends.
<https://webkit.org/b/127321>

Reviewed by Geoffrey Garen.

We're changing plans and will be going with CodeBlock level breakpoints
instead of bytecode level breakpoints. As a result, we no longer need
the services of CodeBlock::opDebugBytecodeOffsetForLineAndColumn() (and
friends). This patch will remove that unused code.

  • GNUmakefile.list.am:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • bytecode/CodeBlock.cpp:
  • bytecode/CodeBlock.h:
  • bytecode/LineColumnInfo.h: Removed.
  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedCodeBlock::dumpExpressionRangeInfo):

  • bytecode/UnlinkedCodeBlock.h:
Location:
trunk/Source/JavaScriptCore
Files:
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r162377 r162389  
     12014-01-20  Mark Lam  <mark.lam@apple.com>
     2
     3        Removing CodeBlock::opDebugBytecodeOffsetForLineAndColumn() and friends.
     4        <https://webkit.org/b/127321>
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        We're changing plans and will be going with CodeBlock level breakpoints
     9        instead of bytecode level breakpoints. As a result, we no longer need
     10        the services of CodeBlock::opDebugBytecodeOffsetForLineAndColumn() (and
     11        friends). This patch will remove that unused code.
     12
     13        * GNUmakefile.list.am:
     14        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
     15        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
     16        * JavaScriptCore.xcodeproj/project.pbxproj:
     17        * bytecode/CodeBlock.cpp:
     18        * bytecode/CodeBlock.h:
     19        * bytecode/LineColumnInfo.h: Removed.
     20        * bytecode/UnlinkedCodeBlock.cpp:
     21        (JSC::UnlinkedCodeBlock::dumpExpressionRangeInfo):
     22        * bytecode/UnlinkedCodeBlock.h:
     23
    1242014-01-20  Mark Hahnenberg  <mhahnenberg@apple.com>
    225
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r162256 r162389  
    153153        Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp \
    154154        Source/JavaScriptCore/bytecode/LazyOperandValueProfile.h \
    155         Source/JavaScriptCore/bytecode/LineColumnInfo.h \
    156155        Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.cpp \
    157156        Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h \
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj

    r162256 r162389  
    817817    <ClInclude Include="..\bytecode\JumpTable.h" />
    818818    <ClInclude Include="..\bytecode\LazyOperandValueProfile.h" />
    819     <ClInclude Include="..\bytecode\LineColumnInfo.h" />
    820819    <ClInclude Include="..\bytecode\LLIntCallLinkInfo.h" />
    821820    <ClInclude Include="..\bytecode\MethodOfGettingAValueProfile.h" />
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters

    r162256 r162389  
    15031503      <Filter>bytecode</Filter>
    15041504    </ClInclude>
    1505     <ClInclude Include="..\bytecode\LineColumnInfo.h">
    1506       <Filter>bytecode</Filter>
    1507     </ClInclude>
    15081505    <ClInclude Include="..\bytecode\LLIntCallLinkInfo.h">
    15091506      <Filter>bytecode</Filter>
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r162256 r162389  
    13131313                FE20CE9D15F04A9500DF3430 /* LLIntCLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */; };
    13141314                FE20CE9E15F04A9500DF3430 /* LLIntCLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1315                 FE37DD56183C1E880018B2F0 /* LineColumnInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = FE37DD55183C1E880018B2F0 /* LineColumnInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
    13161315                FE4A331F15BD2E07006F54F3 /* VMInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */; };
    13171316                FE4A332015BD2E07006F54F3 /* VMInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4A331E15BD2E07006F54F3 /* VMInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    27232722                FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntCLoop.cpp; path = llint/LLIntCLoop.cpp; sourceTree = "<group>"; };
    27242723                FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntCLoop.h; path = llint/LLIntCLoop.h; sourceTree = "<group>"; };
    2725                 FE37DD55183C1E880018B2F0 /* LineColumnInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineColumnInfo.h; sourceTree = "<group>"; };
    27262724                FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMInspector.cpp; sourceTree = "<group>"; };
    27272725                FE4A331E15BD2E07006F54F3 /* VMInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMInspector.h; sourceTree = "<group>"; };
     
    42314229                        isa = PBXGroup;
    42324230                        children = (
    4233                                 FE37DD55183C1E880018B2F0 /* LineColumnInfo.h */,
    42344231                                0F8335B41639C1E3001443B5 /* ArrayAllocationProfile.cpp */,
    42354232                                0F8335B51639C1E3001443B5 /* ArrayAllocationProfile.h */,
     
    44724469                                A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */,
    44734470                                C2FCAE1317A9C24E0034C735 /* BytecodeLivenessAnalysis.h in Headers */,
    4474                                 FE37DD56183C1E880018B2F0 /* LineColumnInfo.h in Headers */,
    44754471                                0F8335B81639C1EA001443B5 /* ArrayAllocationProfile.h in Headers */,
    44764472                                A5840E29187CA5E600843B10 /* inline-and-minify-stylesheets-and-scripts.py in Headers */,
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r162284 r162389  
    25652565}
    25662566
    2567 unsigned CodeBlock::opDebugBytecodeOffsetForLineAndColumn(unsigned& line, unsigned& column)
    2568 {
    2569     unsigned lineAdjustment = m_ownerExecutable->lineNo();
    2570     ASSERT(line >= lineAdjustment);
    2571     unsigned unlinkedLine = line - lineAdjustment;
    2572     unsigned columnAdjustment = unlinkedLine ? 1 : firstLineColumnOffset();
    2573     ASSERT(column >= columnAdjustment);
    2574     unsigned unlinkedColumn = column - columnAdjustment;
    2575 
    2576     unsigned bytecodeOffset = m_unlinkedCode->opDebugBytecodeOffsetForLineAndColumn(unlinkedLine, unlinkedColumn);
    2577     if (bytecodeOffset != static_cast<unsigned>(WTF::notFound)) {
    2578         line = unlinkedLine + lineAdjustment;
    2579         column = unlinkedColumn + (unlinkedLine ? 1 : firstLineColumnOffset());
    2580     }
    2581     return bytecodeOffset;
    2582 }
    2583 
    25842567void CodeBlock::shrinkToFit(ShrinkMode shrinkMode)
    25852568{
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r162284 r162389  
    175175    void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot,
    176176                                          int& startOffset, int& endOffset, unsigned& line, unsigned& column);
    177     unsigned opDebugBytecodeOffsetForLineAndColumn(unsigned& line, unsigned& column);
    178177
    179178#if ENABLE(JIT)
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp

    r162256 r162389  
    311311    dataLog("}\n");
    312312}
    313 
    314 void UnlinkedCodeBlock::dumpOpDebugLineColumnInfoList()
    315 {
    316     LineColumnInfoList& infoList = this->opDebugLineColumnInfoList();
    317     size_t size = infoList.size();
    318 
    319     dataLogF("UnlinkedCodeBlock %p opDebugLineColumnInfoList[%zu] {\n", this, size);
    320     for (size_t i = 0; i < size; i++) {
    321         LineColumnInfo& info = infoList[i];
    322         dumpLineColumnEntry(i, instructions(), info.instructionOffset, info.line, info.column);
    323     }
    324     dataLog("}\n");
    325 }
    326313#endif
    327314
     
    360347    divot = info.divotPoint;
    361348    getLineAndColumn(info, line, column);
    362 }
    363 
    364 unsigned UnlinkedCodeBlock::opDebugBytecodeOffsetForLineAndColumn(unsigned& line, unsigned& column)
    365 {
    366     if (!m_expressionInfo.size())
    367         return static_cast<unsigned>(WTF::notFound);
    368 
    369     LineColumnInfo::LineColumnPair target(line, column);
    370     LineColumnInfoList& list = opDebugLineColumnInfoList();
    371 
    372     // Find the earliest op_debug bytecode whose line and column matches the
    373     // target line and column values. If an exact match is not found, then
    374     // find the nearest op_debug bytecode that precedes the target line and
    375     // column values. If there are more than one op_debug at that preceding
    376     // line and column value, then select the earliest of those.
    377     //
    378     // We want the earliest one because when we have multiple op_debug bytecodes
    379     // that map to a given line and column, a debugger user would expect to break
    380     // on the first one and step through the rest thereafter if needed.
    381 
    382     LineColumnInfoList::iterator it = std::lower_bound(list.begin(), list.end(), target);
    383     if (it == list.end() || *it > target)
    384         --it;
    385     ASSERT(it >= list.begin() && it < list.end() && *it <= target);
    386     ASSERT(it == list.begin() || *(it - 1) < *it);
    387 
    388     line = it->line;
    389     column = it->column;
    390 
    391     unsigned offset = it->instructionOffset;
    392     ASSERT(instructions()[offset].u.opcode == op_debug);
    393 
    394     return offset;
    395 }
    396 
    397 static bool compareLineColumnInfo(const LineColumnInfo& first, const LineColumnInfo& second)
    398 {
    399     return first < second;
    400 }
    401 
    402 UnlinkedCodeBlock::LineColumnInfoList& UnlinkedCodeBlock::opDebugLineColumnInfoList()
    403 {
    404     createRareDataIfNecessary();
    405 
    406     if (m_rareData->m_opDebugLineColumnInfoList) {
    407         ASSERT(m_rareData->m_opDebugLineColumnInfoList->size() <= m_expressionInfo.size());
    408         return *m_rareData->m_opDebugLineColumnInfoList;
    409     }
    410 
    411     Vector<ExpressionRangeInfo>& expressionInfo = m_expressionInfo;
    412     size_t size = m_expressionInfo.size();
    413 
    414     m_rareData->m_opDebugLineColumnInfoList = std::make_unique<LineColumnInfoList>();
    415     LineColumnInfoList& infoList = *m_rareData->m_opDebugLineColumnInfoList;
    416 
    417     for (size_t src = 0; src < size; src++) {
    418         ExpressionRangeInfo& exprInfo = expressionInfo[src];
    419         unsigned instructionOffset = exprInfo.instructionOffset;
    420         OpcodeID opcode = instructions()[instructionOffset].u.opcode;
    421         if (opcode == op_debug) {
    422             LineColumnInfo info;
    423             info.instructionOffset = instructionOffset;
    424             getLineAndColumn(exprInfo, info.line, info.column);
    425             infoList.append(info);
    426         }
    427     }
    428     infoList.shrinkToFit();
    429 
    430     std::sort(infoList.begin(), infoList.end(), compareLineColumnInfo);
    431 
    432     return *m_rareData->m_opDebugLineColumnInfoList.get();
    433349}
    434350
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h

    r162256 r162389  
    3434#include "JSCell.h"
    3535#include "JSString.h"
    36 #include "LineColumnInfo.h"
    3736#include "ParserModes.h"
    3837#include "RegExp.h"
     
    4342#include <wtf/Compression.h>
    4443#include <wtf/RefCountedArray.h>
    45 #include <wtf/StdLibExtras.h>
    4644#include <wtf/Vector.h>
    4745
     
    446444    void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot,
    447445        int& startOffset, int& endOffset, unsigned& line, unsigned& column);
    448     unsigned opDebugBytecodeOffsetForLineAndColumn(unsigned& line, unsigned& column);
    449446
    450447    void recordParse(CodeFeatures features, bool hasCapturedVariables, unsigned firstLine, unsigned lineCount, unsigned endColumn)
     
    466463
    467464    void dumpExpressionRangeInfo(); // For debugging purpose only.
    468     void dumpOpDebugLineColumnInfoList(); // For debugging purpose only.
    469465
    470466protected:
     
    489485
    490486    void getLineAndColumn(ExpressionRangeInfo&, unsigned& line, unsigned& column);
    491 
    492     typedef Vector<LineColumnInfo> LineColumnInfoList;
    493     LineColumnInfoList& opDebugLineColumnInfoList();
    494487
    495488    RefCountedArray<UnlinkedInstruction> m_unlinkedInstructions;
     
    557550
    558551        Vector<ExpressionRangeInfo::FatPosition> m_expressionInfoFatPositions;
    559         std::unique_ptr<LineColumnInfoList> m_opDebugLineColumnInfoList;
    560552    };
    561553
Note: See TracChangeset for help on using the changeset viewer.