Changeset 201896 in webkit


Ignore:
Timestamp:
Jun 9, 2016 5:42:19 PM (8 years ago)
Author:
mark.lam@apple.com
Message:

Make some methods const.
https://bugs.webkit.org/show_bug.cgi?id=158594

Reviewed by Benjamin Poulain.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::columnNumberForBytecodeOffset):
(JSC::CodeBlock::expressionRangeForBytecodeOffset):

  • bytecode/CodeBlock.h:
  • bytecode/ExpressionRangeInfo.h:

(JSC::ExpressionRangeInfo::encodeFatColumnMode):
(JSC::ExpressionRangeInfo::decodeFatLineMode):
(JSC::ExpressionRangeInfo::decodeFatColumnMode):

  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedCodeBlock::lineNumberForBytecodeOffset):
(JSC::UnlinkedCodeBlock::getLineAndColumn):
(JSC::UnlinkedCodeBlock::expressionRangeForBytecodeOffset):

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedCodeBlock::createRareDataIfNecessary):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::isOpcode):
(JSC::StackFrame::computeLineAndColumn):
(JSC::StackFrame::toString):

  • interpreter/Interpreter.h:

(JSC::StackFrame::isNative):

Location:
trunk/Source/JavaScriptCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r201892 r201896  
     12016-06-09  Mark Lam  <mark.lam@apple.com>
     2
     3        Make some methods const.
     4        https://bugs.webkit.org/show_bug.cgi?id=158594
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        * bytecode/CodeBlock.cpp:
     9        (JSC::CodeBlock::columnNumberForBytecodeOffset):
     10        (JSC::CodeBlock::expressionRangeForBytecodeOffset):
     11        * bytecode/CodeBlock.h:
     12        * bytecode/ExpressionRangeInfo.h:
     13        (JSC::ExpressionRangeInfo::encodeFatColumnMode):
     14        (JSC::ExpressionRangeInfo::decodeFatLineMode):
     15        (JSC::ExpressionRangeInfo::decodeFatColumnMode):
     16        * bytecode/UnlinkedCodeBlock.cpp:
     17        (JSC::UnlinkedCodeBlock::lineNumberForBytecodeOffset):
     18        (JSC::UnlinkedCodeBlock::getLineAndColumn):
     19        (JSC::UnlinkedCodeBlock::expressionRangeForBytecodeOffset):
     20        * bytecode/UnlinkedCodeBlock.h:
     21        (JSC::UnlinkedCodeBlock::createRareDataIfNecessary):
     22        * interpreter/Interpreter.cpp:
     23        (JSC::Interpreter::isOpcode):
     24        (JSC::StackFrame::computeLineAndColumn):
     25        (JSC::StackFrame::toString):
     26        * interpreter/Interpreter.h:
     27        (JSC::StackFrame::isNative):
     28
    1292016-06-09  Michael Saboff  <msaboff@apple.com>
    230
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r201866 r201896  
    31773177}
    31783178
    3179 void CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset, unsigned& line, unsigned& column)
     3179void CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset, unsigned& line, unsigned& column) const
    31803180{
    31813181    m_unlinkedCode->expressionRangeForBytecodeOffset(bytecodeOffset, divot, startOffset, endOffset, line, column);
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r201617 r201896  
    231231    unsigned columnNumberForBytecodeOffset(unsigned bytecodeOffset);
    232232    void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot,
    233                                           int& startOffset, int& endOffset, unsigned& line, unsigned& column);
     233        int& startOffset, int& endOffset, unsigned& line, unsigned& column) const;
    234234
    235235    Optional<unsigned> bytecodeOffsetFromCallSiteIndex(CallSiteIndex);
  • trunk/Source/JavaScriptCore/bytecode/ExpressionRangeInfo.h

    r152494 r201896  
    11/*
    2  * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012-2013, 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    8787    }
    8888
    89     void decodeFatLineMode(unsigned& line, unsigned& column)
     89    void decodeFatLineMode(unsigned& line, unsigned& column) const
    9090    {
    9191        line = (position >> FatLineModeLineShift) & FatLineModeLineMask;
     
    9393    }
    9494
    95     void decodeFatColumnMode(unsigned& line, unsigned& column)
     95    void decodeFatColumnMode(unsigned& line, unsigned& column) const
    9696    {
    9797        line = (position >> FatColumnModeLineShift) & FatColumnModeLineMask;
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp

    r201622 r201896  
    11/*
    2  * Copyright (C) 2012, 2013, 2015 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2012-2013, 2015-2016 Apple Inc. All Rights Reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    129129}
    130130
    131 inline void UnlinkedCodeBlock::getLineAndColumn(ExpressionRangeInfo& info,
    132     unsigned& line, unsigned& column)
     131inline void UnlinkedCodeBlock::getLineAndColumn(const ExpressionRangeInfo& info,
     132    unsigned& line, unsigned& column) const
    133133{
    134134    switch (info.mode) {
     
    186186
    187187void UnlinkedCodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset,
    188     int& divot, int& startOffset, int& endOffset, unsigned& line, unsigned& column)
     188    int& divot, int& startOffset, int& endOffset, unsigned& line, unsigned& column) const
    189189{
    190190    ASSERT(bytecodeOffset < instructions().count());
     
    199199    }
    200200
    201     Vector<ExpressionRangeInfo>& expressionInfo = m_expressionInfo;
     201    const Vector<ExpressionRangeInfo>& expressionInfo = m_expressionInfo;
    202202
    203203    int low = 0;
     
    214214        low = 1;
    215215
    216     ExpressionRangeInfo& info = expressionInfo[low - 1];
     216    const ExpressionRangeInfo& info = expressionInfo[low - 1];
    217217    startOffset = info.startOffset;
    218218    endOffset = info.endOffset;
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h

    r201542 r201896  
    11/*
    2  * Copyright (C) 2012-2015 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2012-2016 Apple Inc. All Rights Reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    326326
    327327    void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot,
    328         int& startOffset, int& endOffset, unsigned& line, unsigned& column);
     328        int& startOffset, int& endOffset, unsigned& line, unsigned& column) const;
    329329
    330330    bool typeProfilerExpressionInfoForBytecodeOffset(unsigned bytecodeOffset, unsigned& startDivot, unsigned& endDivot);
     
    388388    }
    389389
    390     void getLineAndColumn(ExpressionRangeInfo&, unsigned& line, unsigned& column);
     390    void getLineAndColumn(const ExpressionRangeInfo&, unsigned& line, unsigned& column) const;
    391391
    392392    int m_numParameters;
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r201830 r201896  
    445445}
    446446
    447 void StackFrame::computeLineAndColumn(unsigned& line, unsigned& column)
     447void StackFrame::computeLineAndColumn(unsigned& line, unsigned& column) const
    448448{
    449449    if (!codeBlock) {
     
    463463}
    464464
    465 String StackFrame::toString(VM& vm)
     465String StackFrame::toString(VM& vm) const
    466466{
    467467    StringBuilder traceBuild;
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.h

    r201830 r201896  
    9191        bool isNative() const { return !codeBlock; }
    9292
    93         void computeLineAndColumn(unsigned& line, unsigned& column);
     93        void computeLineAndColumn(unsigned& line, unsigned& column) const;
    9494        String functionName(VM&) const;
    9595        intptr_t sourceID() const;
    9696        String sourceURL() const;
    97         String toString(VM&);
     97        String toString(VM&) const;
    9898    };
    9999
Note: See TracChangeset for help on using the changeset viewer.