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

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

Issue 2275313002: [parser] Eliminate ExpressionClassifier::MergeNonPatterns (Closed)
Patch Set: Rebase Created 4 years, 4 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 | src/parsing/parser-base.h » ('j') | 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 f97ef310fd27145f5b3184be301c55cff34535c3..f1c2d3a23969e07b1d47e503349aa46fc450b0e9 100644
--- a/src/parsing/expression-classifier.h
+++ b/src/parsing/expression-classifier.h
@@ -285,7 +285,14 @@ class ExpressionClassifier {
DCHECK_EQ(inner->reported_errors_, reported_errors_);
DCHECK_EQ(inner->reported_errors_begin_, reported_errors_end_);
DCHECK_EQ(inner->reported_errors_end_, reported_errors_->length());
- if (merge_non_patterns) MergeNonPatterns(inner);
+ DCHECK_EQ(inner->non_patterns_to_rewrite_, non_patterns_to_rewrite_);
+ DCHECK_LE(non_pattern_begin_, inner->non_pattern_begin_);
+ DCHECK_LE(inner->non_pattern_begin_, non_patterns_to_rewrite_->length());
+ // Merge non-patterns from the inner classifier, or discard them.
+ if (merge_non_patterns)
+ inner->non_pattern_begin_ = non_patterns_to_rewrite_->length();
+ else
+ non_patterns_to_rewrite_->Rewind(inner->non_pattern_begin_);
// Propagate errors from inner, but don't overwrite already recorded
// errors.
unsigned non_arrow_inner_invalid_productions =
@@ -376,11 +383,6 @@ class ExpressionClassifier {
non_patterns_to_rewrite_->Rewind(non_pattern_begin_);
}
- V8_INLINE void MergeNonPatterns(ExpressionClassifier* inner) {
- DCHECK_LE(non_pattern_begin_, inner->non_pattern_begin_);
- inner->non_pattern_begin_ = inner->non_patterns_to_rewrite_->length();
- }
-
private:
V8_INLINE const Error& reported_error(ErrorKind kind) const {
if (invalid_productions_ & (1 << kind)) {
« no previous file with comments | « no previous file | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698