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

Side by Side Diff: src/parsing/parser-base.h

Issue 2341323002: Simplify Scanner bookmarking. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PARSING_PARSER_BASE_H 5 #ifndef V8_PARSING_PARSER_BASE_H
6 #define V8_PARSING_PARSER_BASE_H 6 #define V8_PARSING_PARSER_BASE_H
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 3875 matching lines...) Expand 10 before | Expand all | Expand 10 after
3886 Expect(Token::ARROW, CHECK_OK); 3886 Expect(Token::ARROW, CHECK_OK);
3887 3887
3888 if (peek() == Token::LBRACE) { 3888 if (peek() == Token::LBRACE) {
3889 // Multiple statement body 3889 // Multiple statement body
3890 Consume(Token::LBRACE); 3890 Consume(Token::LBRACE);
3891 DCHECK_EQ(scope(), formal_parameters.scope); 3891 DCHECK_EQ(scope(), formal_parameters.scope);
3892 bool is_lazily_parsed = (mode() == PARSE_LAZILY && 3892 bool is_lazily_parsed = (mode() == PARSE_LAZILY &&
3893 formal_parameters.scope->AllowsLazyParsing()); 3893 formal_parameters.scope->AllowsLazyParsing());
3894 if (is_lazily_parsed) { 3894 if (is_lazily_parsed) {
3895 Scanner::BookmarkScope bookmark(scanner()); 3895 Scanner::BookmarkScope bookmark(scanner());
3896 bool may_abort = bookmark.Set(); 3896 bookmark.Set();
3897 LazyParsingResult result = impl()->SkipLazyFunctionBody( 3897 LazyParsingResult result = impl()->SkipLazyFunctionBody(
3898 &materialized_literal_count, &expected_property_count, may_abort, 3898 &materialized_literal_count, &expected_property_count, true,
3899 CHECK_OK); 3899 CHECK_OK);
3900 3900
3901 if (formal_parameters.materialized_literals_count > 0) { 3901 if (formal_parameters.materialized_literals_count > 0) {
3902 materialized_literal_count += 3902 materialized_literal_count +=
3903 formal_parameters.materialized_literals_count; 3903 formal_parameters.materialized_literals_count;
3904 } 3904 }
3905 3905
3906 if (result == kLazyParsingAborted) { 3906 if (result == kLazyParsingAborted) {
3907 bookmark.Reset(); 3907 bookmark.Reset();
3908 // Trigger eager (re-)parsing, just below this block. 3908 // Trigger eager (re-)parsing, just below this block.
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
5030 has_seen_constructor_ = true; 5030 has_seen_constructor_ = true;
5031 return; 5031 return;
5032 } 5032 }
5033 } 5033 }
5034 5034
5035 5035
5036 } // namespace internal 5036 } // namespace internal
5037 } // namespace v8 5037 } // namespace v8
5038 5038
5039 #endif // V8_PARSING_PARSER_BASE_H 5039 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/scanner.h » ('j') | src/parsing/scanner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698