Repository navigation
Commit a374eeb
committed
[JSC] Location in JSToken is duplicate information
https://bugs.webkit.org/show_bug.cgi?id=297107
rdar://157820631
Reviewed by Yijia Huang.
JSLocation stored in JSToken is completely duplicate information. This
can be constructed by using m_startPosition and m_endPosition.
Originally only JSLocation exists, but we added m_startPosition and
m_endPosition later. As a result, we are storing duplicate information.
This patch removes it.
* Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::parse):
* Source/JavaScriptCore/parser/Lexer.cpp:
(JSC::Lexer<T>::fillTokenInfo):
(JSC::Lexer<T>::lexWithoutClearingLineTerminator):
(JSC::Lexer<T>::scanRegExp):
(JSC::Lexer<T>::scanTemplateString):
* Source/JavaScriptCore/parser/Lexer.h:
(JSC::Lexer::getToken):
(JSC::Lexer<T>::lexExpectIdentifier):
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements):
(JSC::Parser<LexerType>::parseAsyncFunctionSourceElements):
(JSC::Parser<LexerType>::parseAsyncGeneratorFunctionSourceElements):
(JSC::Parser<LexerType>::parseVariableDeclarationList):
(JSC::Parser<LexerType>::createBindingPattern):
(JSC::Parser<LexerType>::parseDestructuringPattern):
(JSC::Parser<LexerType>::parseTryStatement):
(JSC::Parser<LexerType>::parseStatement):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parseArrayLiteral):
* Source/JavaScriptCore/parser/Parser.h:
(JSC::Parser::tokenStart):
(JSC::Parser::tokenLine):
(JSC::Parser::tokenLineStart):
(JSC::Parser::tokenLocation):
(JSC::Parser::internalSaveLexerState):
* Source/JavaScriptCore/parser/ParserTokens.h:
(JSC::JSToken::location const):
* Source/JavaScriptCore/parser/SourceProviderCacheItem.h:
(JSC::SourceProviderCacheItem::endFunctionToken const):
Canonical link: https://commits.webkit.org/298443@main1 parent fae5b69 commit a374eeb
7 files changed
Lines changed: 82 additions & 96 deletions
File tree
- Source/JavaScriptCore
- inspector/agents
- parser
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1999 | 1999 | | |
2000 | 2000 | | |
2001 | 2001 | | |
2002 | | - | |
| 2002 | + | |
2003 | 2003 | | |
2004 | | - | |
2005 | | - | |
2006 | | - | |
2007 | | - | |
2008 | | - | |
2009 | 2004 | | |
2010 | 2005 | | |
2011 | 2006 | | |
| |||
2014 | 2009 | | |
2015 | 2010 | | |
2016 | 2011 | | |
2017 | | - | |
2018 | | - | |
2019 | | - | |
2020 | 2012 | | |
| 2013 | + | |
2021 | 2014 | | |
2022 | 2015 | | |
2023 | | - | |
2024 | 2016 | | |
2025 | 2017 | | |
2026 | 2018 | | |
2027 | 2019 | | |
2028 | 2020 | | |
2029 | | - | |
2030 | 2021 | | |
2031 | 2022 | | |
2032 | 2023 | | |
| |||
2221 | 2212 | | |
2222 | 2213 | | |
2223 | 2214 | | |
2224 | | - | |
2225 | | - | |
2226 | 2215 | | |
2227 | 2216 | | |
2228 | 2217 | | |
2229 | 2218 | | |
2230 | 2219 | | |
2231 | | - | |
| 2220 | + | |
2232 | 2221 | | |
2233 | 2222 | | |
2234 | 2223 | | |
| |||
2647 | 2636 | | |
2648 | 2637 | | |
2649 | 2638 | | |
2650 | | - | |
2651 | | - | |
2652 | 2639 | | |
2653 | 2640 | | |
2654 | 2641 | | |
| |||
2658 | 2645 | | |
2659 | 2646 | | |
2660 | 2647 | | |
2661 | | - | |
| 2648 | + | |
2662 | 2649 | | |
2663 | 2650 | | |
2664 | 2651 | | |
2665 | 2652 | | |
2666 | 2653 | | |
2667 | | - | |
| 2654 | + | |
2668 | 2655 | | |
2669 | 2656 | | |
2670 | 2657 | | |
| |||
2980 | 2967 | | |
2981 | 2968 | | |
2982 | 2969 | | |
2983 | | - | |
2984 | | - | |
2985 | | - | |
2986 | 2970 | | |
2987 | 2971 | | |
2988 | 2972 | | |
| |||
3012 | 2996 | | |
3013 | 2997 | | |
3014 | 2998 | | |
3015 | | - | |
| 2999 | + | |
3016 | 3000 | | |
3017 | 3001 | | |
3018 | 3002 | | |
| |||
3024 | 3008 | | |
3025 | 3009 | | |
3026 | 3010 | | |
3027 | | - | |
| 3011 | + | |
3028 | 3012 | | |
3029 | 3013 | | |
3030 | 3014 | | |
3031 | 3015 | | |
3032 | | - | |
| 3016 | + | |
3033 | 3017 | | |
3034 | 3018 | | |
3035 | 3019 | | |
| |||
3039 | 3023 | | |
3040 | 3024 | | |
3041 | 3025 | | |
3042 | | - | |
| 3026 | + | |
3043 | 3027 | | |
3044 | 3028 | | |
3045 | 3029 | | |
| |||
3077 | 3061 | | |
3078 | 3062 | | |
3079 | 3063 | | |
3080 | | - | |
| 3064 | + | |
3081 | 3065 | | |
3082 | 3066 | | |
3083 | 3067 | | |
| |||
3126 | 3110 | | |
3127 | 3111 | | |
3128 | 3112 | | |
3129 | | - | |
| 3113 | + | |
3130 | 3114 | | |
3131 | 3115 | | |
3132 | 3116 | | |
| |||
3142 | 3126 | | |
3143 | 3127 | | |
3144 | 3128 | | |
3145 | | - | |
| 3129 | + | |
3146 | 3130 | | |
3147 | 3131 | | |
3148 | 3132 | | |
| |||
3153 | 3137 | | |
3154 | 3138 | | |
3155 | 3139 | | |
3156 | | - | |
3157 | | - | |
3158 | | - | |
3159 | 3140 | | |
3160 | 3141 | | |
3161 | 3142 | | |
| |||
3168 | 3149 | | |
3169 | 3150 | | |
3170 | 3151 | | |
3171 | | - | |
| 3152 | + | |
3172 | 3153 | | |
3173 | 3154 | | |
3174 | 3155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
| 134 | + | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
360 | 359 | | |
361 | 360 | | |
362 | 361 | | |
| |||
396 | 395 | | |
397 | 396 | | |
398 | 397 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | 398 | | |
405 | 399 | | |
406 | 400 | | |
| |||
0 commit comments