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

Side by Side Diff: src/parser.cc

Issue 1302893002: Tighten & check the BookmarkScope API contract a bit. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/scanner.h » ('j') | src/scanner.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "src/parser.h" 5 #include "src/parser.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/ast-literal-reindexer.h" 9 #include "src/ast-literal-reindexer.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 4092 matching lines...) Expand 10 before | Expand all | Expand 10 after
4103 // parsing if it suspect that wasn't a good idea. If so, or if we didn't 4103 // parsing if it suspect that wasn't a good idea. If so, or if we didn't
4104 // try to lazy parse in the first place, we'll have to parse eagerly. 4104 // try to lazy parse in the first place, we'll have to parse eagerly.
4105 Scanner::BookmarkScope bookmark(scanner()); 4105 Scanner::BookmarkScope bookmark(scanner());
4106 if (is_lazily_parsed) { 4106 if (is_lazily_parsed) {
4107 Scanner::BookmarkScope* maybe_bookmark = 4107 Scanner::BookmarkScope* maybe_bookmark =
4108 bookmark.Set() ? &bookmark : nullptr; 4108 bookmark.Set() ? &bookmark : nullptr;
4109 SkipLazyFunctionBody(&materialized_literal_count, 4109 SkipLazyFunctionBody(&materialized_literal_count,
4110 &expected_property_count, /*CHECK_OK*/ ok, 4110 &expected_property_count, /*CHECK_OK*/ ok,
4111 maybe_bookmark); 4111 maybe_bookmark);
4112 4112
4113 if (bookmark.HasBeenReset()) { 4113 if (maybe_bookmark && maybe_bookmark->HasBeenReset()) {
4114 // Trigger eager (re-)parsing, just below this block. 4114 // Trigger eager (re-)parsing, just below this block.
4115 is_lazily_parsed = false; 4115 is_lazily_parsed = false;
4116 4116
4117 // This is probably an initialization function. Inform the compiler it 4117 // This is probably an initialization function. Inform the compiler it
4118 // should also eager-compile this function, and that we expect it to be 4118 // should also eager-compile this function, and that we expect it to be
4119 // used once. 4119 // used once.
4120 eager_compile_hint = FunctionLiteral::kShouldEagerCompile; 4120 eager_compile_hint = FunctionLiteral::kShouldEagerCompile;
4121 should_be_used_once_hint = true; 4121 should_be_used_once_hint = true;
4122 } 4122 }
4123 } 4123 }
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after
6015 Expression* Parser::SpreadCallNew(Expression* function, 6015 Expression* Parser::SpreadCallNew(Expression* function,
6016 ZoneList<v8::internal::Expression*>* args, 6016 ZoneList<v8::internal::Expression*>* args,
6017 int pos) { 6017 int pos) {
6018 args->InsertAt(0, function, zone()); 6018 args->InsertAt(0, function, zone());
6019 6019
6020 return factory()->NewCallRuntime( 6020 return factory()->NewCallRuntime(
6021 ast_value_factory()->reflect_construct_string(), NULL, args, pos); 6021 ast_value_factory()->reflect_construct_string(), NULL, args, pos);
6022 } 6022 }
6023 } // namespace internal 6023 } // namespace internal
6024 } // namespace v8 6024 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/scanner.h » ('j') | src/scanner.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698