Changeset 237492 in webkit for trunk/Source/JavaScriptCore/parser/SourceCodeKey.h
- Timestamp:
- Oct 27, 2018, 7:41:22 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/SourceCodeKey.h
r237478 r237492 30 30 #include "UnlinkedSourceCode.h" 31 31 #include <wtf/HashTraits.h> 32 #include <wtf/Hasher.h> 32 33 33 34 namespace JSC { … … 72 73 class SourceCodeKey { 73 74 public: 74 SourceCodeKey() 75 { 76 } 75 SourceCodeKey() = default; 77 76 78 77 SourceCodeKey( 79 78 const UnlinkedSourceCode& sourceCode, const String& name, SourceCodeType codeType, JSParserStrictMode strictMode, 80 79 JSParserScriptMode scriptMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext, 81 DebuggerMode debuggerMode, TypeProfilerEnabled typeProfilerEnabled, ControlFlowProfilerEnabled controlFlowProfilerEnabled )80 DebuggerMode debuggerMode, TypeProfilerEnabled typeProfilerEnabled, ControlFlowProfilerEnabled controlFlowProfilerEnabled, std::optional<int> functionConstructorParametersEndPosition) 82 81 : m_sourceCode(sourceCode) 83 82 , m_name(name) 84 83 , m_flags(codeType, strictMode, scriptMode, derivedContextType, evalContextType, isArrowFunctionContext, debuggerMode, typeProfilerEnabled, controlFlowProfilerEnabled) 85 , m_hash(sourceCode.hash() ^ m_flags.bits()) 84 , m_functionConstructorParametersEndPosition(functionConstructorParametersEndPosition.value_or(-1)) 85 , m_hash(sourceCode.hash() ^ computeHash(m_flags.bits(), m_functionConstructorParametersEndPosition)) 86 86 { 87 87 } … … 109 109 && length() == other.length() 110 110 && m_flags == other.m_flags 111 && m_functionConstructorParametersEndPosition == other.m_functionConstructorParametersEndPosition 111 112 && m_name == other.m_name 112 113 && string() == other.string(); … … 128 129 String m_name; 129 130 SourceCodeFlags m_flags; 130 unsigned m_hash; 131 int m_functionConstructorParametersEndPosition { -1 }; 132 unsigned m_hash { 0 }; 131 133 }; 132 134
Note:
See TracChangeset
for help on using the changeset viewer.