Changeset 185989 in webkit for trunk/Source/JavaScriptCore/parser/SourceProviderCacheItem.h
- Timestamp:
- Jun 25, 2015, 11:49:20 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/SourceProviderCacheItem.h
r184828 r185989 36 36 struct SourceProviderCacheItemCreationParameters { 37 37 unsigned functionNameStart; 38 unsigned closeBraceLine; 39 unsigned closeBraceOffset; 40 unsigned closeBraceLineStartOffset; 38 unsigned lastTockenLine; 39 unsigned lastTockenStartOffset; 40 unsigned lastTockenEndOffset; 41 unsigned lastTockenLineStartOffset; 42 unsigned endFunctionOffset; 41 43 bool needsFullActivation; 42 44 bool usesEval; … … 44 46 Vector<RefPtr<UniquedStringImpl>> usedVariables; 45 47 Vector<RefPtr<UniquedStringImpl>> writtenVariables; 48 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 49 bool isBodyArrowExpression { false }; 50 JSTokenType tokenType { CLOSEBRACE }; 51 #endif 46 52 }; 47 53 … … 57 63 ~SourceProviderCacheItem(); 58 64 59 JSToken closeBraceToken() const65 JSToken endFunctionToken() const 60 66 { 61 67 JSToken token; 68 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 69 token.m_type = isBodyArrowExpression ? tokenType : CLOSEBRACE; 70 #else 62 71 token.m_type = CLOSEBRACE; 63 token.m_data.offset = closeBraceOffset; 64 token.m_location.startOffset = closeBraceOffset; 65 token.m_location.endOffset = closeBraceOffset + 1; 66 token.m_location.line = closeBraceLine; 67 token.m_location.lineStartOffset = closeBraceLineStartOffset; 72 #endif 73 token.m_data.offset = lastTockenStartOffset; 74 token.m_location.startOffset = lastTockenStartOffset; 75 token.m_location.endOffset = lastTockenEndOffset; 76 token.m_location.line = lastTockenLine; 77 token.m_location.lineStartOffset = lastTockenLineStartOffset; 68 78 // token.m_location.sourceOffset is initialized once by the client. So, 69 79 // we do not need to set it here. … … 73 83 unsigned functionNameStart : 31; 74 84 bool needsFullActivation : 1; 85 86 unsigned endFunctionOffset : 31; 87 unsigned lastTockenLine : 31; 88 unsigned lastTockenStartOffset : 31; 89 unsigned lastTockenEndOffset: 31; 75 90 76 unsigned closeBraceLine : 31;77 91 bool usesEval : 1; 78 92 79 unsigned closeBraceOffset : 31;80 93 bool strictMode : 1; 81 94 82 unsigned closeBraceLineStartOffset;95 unsigned lastTockenLineStartOffset; 83 96 unsigned usedVariablesCount; 84 97 unsigned writtenVariablesCount; … … 86 99 UniquedStringImpl** usedVariables() const { return const_cast<UniquedStringImpl**>(m_variables); } 87 100 UniquedStringImpl** writtenVariables() const { return const_cast<UniquedStringImpl**>(&m_variables[usedVariablesCount]); } 101 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 102 bool isBodyArrowExpression; 103 JSTokenType tokenType; 104 #endif 88 105 89 106 private: … … 110 127 : functionNameStart(parameters.functionNameStart) 111 128 , needsFullActivation(parameters.needsFullActivation) 112 , closeBraceLine(parameters.closeBraceLine) 129 , endFunctionOffset(parameters.endFunctionOffset) 130 , lastTockenLine(parameters.lastTockenLine) 131 , lastTockenStartOffset(parameters.lastTockenStartOffset) 132 , lastTockenEndOffset(parameters.lastTockenEndOffset) 113 133 , usesEval(parameters.usesEval) 114 , closeBraceOffset(parameters.closeBraceOffset)115 134 , strictMode(parameters.strictMode) 116 , closeBraceLineStartOffset(parameters.closeBraceLineStartOffset)135 , lastTockenLineStartOffset(parameters.lastTockenLineStartOffset) 117 136 , usedVariablesCount(parameters.usedVariables.size()) 118 137 , writtenVariablesCount(parameters.writtenVariables.size()) 138 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 139 , isBodyArrowExpression(parameters.isBodyArrowExpression) 140 , tokenType(parameters.tokenType) 141 #endif 119 142 { 120 143 unsigned j = 0;
Note:
See TracChangeset
for help on using the changeset viewer.