Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Unified Diff: src/parsing/expression-classifier.h

Issue 2045733004: Optimization: Saves 30M instructions on x64 parsing ~6MB of JS code in parser-shell (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/expression-classifier.h
diff --git a/src/parsing/expression-classifier.h b/src/parsing/expression-classifier.h
index 3f70ed82d060965cce15739cb5f3cada9f204354..d3ac6daf97b935479129dc3978897c27c2fb44fa 100644
--- a/src/parsing/expression-classifier.h
+++ b/src/parsing/expression-classifier.h
@@ -17,16 +17,19 @@ template <typename Traits>
class ExpressionClassifier {
public:
struct Error {
- Error()
- : location(Scanner::Location::invalid()),
- message(MessageTemplate::kNone),
- type(kSyntaxError),
- arg(nullptr) {}
+ Error() { reset(); }
Scanner::Location location;
MessageTemplate::Template message : 30;
ParseErrorType type : 2;
const char* arg;
+
+ V8_INLINE void reset() {
+ location.beg_pos = location.end_pos = -1;
+ message = MessageTemplate::kNone;
+ type = kSyntaxError;
+ arg = nullptr;
+ }
};
enum TargetProduction {
@@ -320,12 +323,12 @@ class ExpressionClassifier {
void ForgiveCoverInitializedNameError() {
invalid_productions_ &= ~CoverInitializedNameProduction;
- cover_initialized_name_error_ = Error();
+ cover_initialized_name_error_.reset();
}
void ForgiveAssignmentPatternError() {
invalid_productions_ &= ~AssignmentPatternProduction;
- assignment_pattern_error_ = Error();
+ assignment_pattern_error_.reset();
}
void Accumulate(ExpressionClassifier* inner,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698