Changeset 162389 in webkit
- Timestamp:
- Jan 20, 2014 4:45:05 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r162377 r162389 1 2014-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 1 24 2014-01-20 Mark Hahnenberg <mhahnenberg@apple.com> 2 25 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r162256 r162389 153 153 Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp \ 154 154 Source/JavaScriptCore/bytecode/LazyOperandValueProfile.h \ 155 Source/JavaScriptCore/bytecode/LineColumnInfo.h \156 155 Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.cpp \ 157 156 Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
r162256 r162389 817 817 <ClInclude Include="..\bytecode\JumpTable.h" /> 818 818 <ClInclude Include="..\bytecode\LazyOperandValueProfile.h" /> 819 <ClInclude Include="..\bytecode\LineColumnInfo.h" />820 819 <ClInclude Include="..\bytecode\LLIntCallLinkInfo.h" /> 821 820 <ClInclude Include="..\bytecode\MethodOfGettingAValueProfile.h" /> -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
r162256 r162389 1503 1503 <Filter>bytecode</Filter> 1504 1504 </ClInclude> 1505 <ClInclude Include="..\bytecode\LineColumnInfo.h">1506 <Filter>bytecode</Filter>1507 </ClInclude>1508 1505 <ClInclude Include="..\bytecode\LLIntCallLinkInfo.h"> 1509 1506 <Filter>bytecode</Filter> -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r162256 r162389 1313 1313 FE20CE9D15F04A9500DF3430 /* LLIntCLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */; }; 1314 1314 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, ); }; };1316 1315 FE4A331F15BD2E07006F54F3 /* VMInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */; }; 1317 1316 FE4A332015BD2E07006F54F3 /* VMInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4A331E15BD2E07006F54F3 /* VMInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 2723 2722 FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntCLoop.cpp; path = llint/LLIntCLoop.cpp; sourceTree = "<group>"; }; 2724 2723 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>"; };2726 2724 FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMInspector.cpp; sourceTree = "<group>"; }; 2727 2725 FE4A331E15BD2E07006F54F3 /* VMInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMInspector.h; sourceTree = "<group>"; }; … … 4231 4229 isa = PBXGroup; 4232 4230 children = ( 4233 FE37DD55183C1E880018B2F0 /* LineColumnInfo.h */,4234 4231 0F8335B41639C1E3001443B5 /* ArrayAllocationProfile.cpp */, 4235 4232 0F8335B51639C1E3001443B5 /* ArrayAllocationProfile.h */, … … 4472 4469 A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */, 4473 4470 C2FCAE1317A9C24E0034C735 /* BytecodeLivenessAnalysis.h in Headers */, 4474 FE37DD56183C1E880018B2F0 /* LineColumnInfo.h in Headers */,4475 4471 0F8335B81639C1EA001443B5 /* ArrayAllocationProfile.h in Headers */, 4476 4472 A5840E29187CA5E600843B10 /* inline-and-minify-stylesheets-and-scripts.py in Headers */, -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r162284 r162389 2565 2565 } 2566 2566 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 2584 2567 void CodeBlock::shrinkToFit(ShrinkMode shrinkMode) 2585 2568 { -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r162284 r162389 175 175 void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, 176 176 int& startOffset, int& endOffset, unsigned& line, unsigned& column); 177 unsigned opDebugBytecodeOffsetForLineAndColumn(unsigned& line, unsigned& column);178 177 179 178 #if ENABLE(JIT) -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
r162256 r162389 311 311 dataLog("}\n"); 312 312 } 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 }326 313 #endif 327 314 … … 360 347 divot = info.divotPoint; 361 348 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 the373 // target line and column values. If an exact match is not found, then374 // find the nearest op_debug bytecode that precedes the target line and375 // column values. If there are more than one op_debug at that preceding376 // line and column value, then select the earliest of those.377 //378 // We want the earliest one because when we have multiple op_debug bytecodes379 // that map to a given line and column, a debugger user would expect to break380 // 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();433 349 } 434 350 -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
r162256 r162389 34 34 #include "JSCell.h" 35 35 #include "JSString.h" 36 #include "LineColumnInfo.h"37 36 #include "ParserModes.h" 38 37 #include "RegExp.h" … … 43 42 #include <wtf/Compression.h> 44 43 #include <wtf/RefCountedArray.h> 45 #include <wtf/StdLibExtras.h>46 44 #include <wtf/Vector.h> 47 45 … … 446 444 void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, 447 445 int& startOffset, int& endOffset, unsigned& line, unsigned& column); 448 unsigned opDebugBytecodeOffsetForLineAndColumn(unsigned& line, unsigned& column);449 446 450 447 void recordParse(CodeFeatures features, bool hasCapturedVariables, unsigned firstLine, unsigned lineCount, unsigned endColumn) … … 466 463 467 464 void dumpExpressionRangeInfo(); // For debugging purpose only. 468 void dumpOpDebugLineColumnInfoList(); // For debugging purpose only.469 465 470 466 protected: … … 489 485 490 486 void getLineAndColumn(ExpressionRangeInfo&, unsigned& line, unsigned& column); 491 492 typedef Vector<LineColumnInfo> LineColumnInfoList;493 LineColumnInfoList& opDebugLineColumnInfoList();494 487 495 488 RefCountedArray<UnlinkedInstruction> m_unlinkedInstructions; … … 557 550 558 551 Vector<ExpressionRangeInfo::FatPosition> m_expressionInfoFatPositions; 559 std::unique_ptr<LineColumnInfoList> m_opDebugLineColumnInfoList;560 552 }; 561 553
Note: See TracChangeset
for help on using the changeset viewer.