Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (201895 => 201896)
--- trunk/Source/_javascript_Core/ChangeLog 2016-06-10 00:21:16 UTC (rev 201895)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-06-10 00:42:19 UTC (rev 201896)
@@ -1,3 +1,31 @@
+2016-06-09 Mark Lam <[email protected]>
+
+ 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):
+
2016-06-09 Michael Saboff <[email protected]>
ES6: Reusing function name as a parameter name shouldn't throw Syntax Error
Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (201895 => 201896)
--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp 2016-06-10 00:21:16 UTC (rev 201895)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp 2016-06-10 00:42:19 UTC (rev 201896)
@@ -3176,7 +3176,7 @@
return column;
}
-void CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset, unsigned& line, unsigned& column)
+void CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset, unsigned& line, unsigned& column) const
{
m_unlinkedCode->expressionRangeForBytecodeOffset(bytecodeOffset, divot, startOffset, endOffset, line, column);
divot += m_sourceOffset;
Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (201895 => 201896)
--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h 2016-06-10 00:21:16 UTC (rev 201895)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h 2016-06-10 00:42:19 UTC (rev 201896)
@@ -230,7 +230,7 @@
unsigned lineNumberForBytecodeOffset(unsigned bytecodeOffset);
unsigned columnNumberForBytecodeOffset(unsigned bytecodeOffset);
void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot,
- int& startOffset, int& endOffset, unsigned& line, unsigned& column);
+ int& startOffset, int& endOffset, unsigned& line, unsigned& column) const;
Optional<unsigned> bytecodeOffsetFromCallSiteIndex(CallSiteIndex);
Modified: trunk/Source/_javascript_Core/bytecode/ExpressionRangeInfo.h (201895 => 201896)
--- trunk/Source/_javascript_Core/bytecode/ExpressionRangeInfo.h 2016-06-10 00:21:16 UTC (rev 201895)
+++ trunk/Source/_javascript_Core/bytecode/ExpressionRangeInfo.h 2016-06-10 00:42:19 UTC (rev 201896)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2013, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -86,13 +86,13 @@
position = ((line & FatColumnModeLineMask) << FatColumnModeLineShift | (column & FatColumnModeColumnMask));
}
- void decodeFatLineMode(unsigned& line, unsigned& column)
+ void decodeFatLineMode(unsigned& line, unsigned& column) const
{
line = (position >> FatLineModeLineShift) & FatLineModeLineMask;
column = position & FatLineModeColumnMask;
}
- void decodeFatColumnMode(unsigned& line, unsigned& column)
+ void decodeFatColumnMode(unsigned& line, unsigned& column) const
{
line = (position >> FatColumnModeLineShift) & FatColumnModeLineMask;
column = position & FatColumnModeColumnMask;
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp (201895 => 201896)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp 2016-06-10 00:21:16 UTC (rev 201895)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp 2016-06-10 00:42:19 UTC (rev 201896)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012, 2013, 2015 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2012-2013, 2015-2016 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -128,8 +128,8 @@
return line;
}
-inline void UnlinkedCodeBlock::getLineAndColumn(ExpressionRangeInfo& info,
- unsigned& line, unsigned& column)
+inline void UnlinkedCodeBlock::getLineAndColumn(const ExpressionRangeInfo& info,
+ unsigned& line, unsigned& column) const
{
switch (info.mode) {
case ExpressionRangeInfo::FatLineMode:
@@ -185,7 +185,7 @@
#endif
void UnlinkedCodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset,
- int& divot, int& startOffset, int& endOffset, unsigned& line, unsigned& column)
+ int& divot, int& startOffset, int& endOffset, unsigned& line, unsigned& column) const
{
ASSERT(bytecodeOffset < instructions().count());
@@ -198,7 +198,7 @@
return;
}
- Vector<ExpressionRangeInfo>& expressionInfo = m_expressionInfo;
+ const Vector<ExpressionRangeInfo>& expressionInfo = m_expressionInfo;
int low = 0;
int high = expressionInfo.size();
@@ -213,7 +213,7 @@
if (!low)
low = 1;
- ExpressionRangeInfo& info = expressionInfo[low - 1];
+ const ExpressionRangeInfo& info = expressionInfo[low - 1];
startOffset = info.startOffset;
endOffset = info.endOffset;
divot = info.divotPoint;
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h (201895 => 201896)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h 2016-06-10 00:21:16 UTC (rev 201895)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h 2016-06-10 00:42:19 UTC (rev 201896)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2015 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2012-2016 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -325,7 +325,7 @@
int lineNumberForBytecodeOffset(unsigned bytecodeOffset);
void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot,
- int& startOffset, int& endOffset, unsigned& line, unsigned& column);
+ int& startOffset, int& endOffset, unsigned& line, unsigned& column) const;
bool typeProfilerExpressionInfoForBytecodeOffset(unsigned bytecodeOffset, unsigned& startDivot, unsigned& endDivot);
@@ -387,7 +387,7 @@
m_rareData = std::make_unique<RareData>();
}
- void getLineAndColumn(ExpressionRangeInfo&, unsigned& line, unsigned& column);
+ void getLineAndColumn(const ExpressionRangeInfo&, unsigned& line, unsigned& column) const;
int m_numParameters;
Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (201895 => 201896)
--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp 2016-06-10 00:21:16 UTC (rev 201895)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp 2016-06-10 00:42:19 UTC (rev 201896)
@@ -444,7 +444,7 @@
#endif
}
-void StackFrame::computeLineAndColumn(unsigned& line, unsigned& column)
+void StackFrame::computeLineAndColumn(unsigned& line, unsigned& column) const
{
if (!codeBlock) {
line = 0;
@@ -462,7 +462,7 @@
line = executable->overrideLineNumber();
}
-String StackFrame::toString(VM& vm)
+String StackFrame::toString(VM& vm) const
{
StringBuilder traceBuild;
String functionName = this->functionName(vm);
Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.h (201895 => 201896)
--- trunk/Source/_javascript_Core/interpreter/Interpreter.h 2016-06-10 00:21:16 UTC (rev 201895)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.h 2016-06-10 00:42:19 UTC (rev 201896)
@@ -90,11 +90,11 @@
bool isNative() const { return !codeBlock; }
- void computeLineAndColumn(unsigned& line, unsigned& column);
+ void computeLineAndColumn(unsigned& line, unsigned& column) const;
String functionName(VM&) const;
intptr_t sourceID() const;
String sourceURL() const;
- String toString(VM&);
+ String toString(VM&) const;
};
class SuspendExceptionScope {