OLD | NEW |
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 4150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4161 !parenthesized_function_; | 4161 !parenthesized_function_; |
4162 parenthesized_function_ = false; // The bit was set for this function only. | 4162 parenthesized_function_ = false; // The bit was set for this function only. |
4163 | 4163 |
4164 // Eager or lazy parse? | 4164 // Eager or lazy parse? |
4165 // If is_lazily_parsed, we'll parse lazy. If we can set a bookmark, we'll | 4165 // If is_lazily_parsed, we'll parse lazy. If we can set a bookmark, we'll |
4166 // pass it to SkipLazyFunctionBody, which may use it to abort lazy | 4166 // pass it to SkipLazyFunctionBody, which may use it to abort lazy |
4167 // parsing if it suspect that wasn't a good idea. If so, or if we didn't | 4167 // parsing if it suspect that wasn't a good idea. If so, or if we didn't |
4168 // try to lazy parse in the first place, we'll have to parse eagerly. | 4168 // try to lazy parse in the first place, we'll have to parse eagerly. |
4169 Scanner::BookmarkScope bookmark(scanner()); | 4169 Scanner::BookmarkScope bookmark(scanner()); |
4170 if (is_lazily_parsed) { | 4170 if (is_lazily_parsed) { |
4171 Scanner::BookmarkScope* maybe_bookmark = | 4171 // Deactivate bookmarks for now because they result |
4172 bookmark.Set() ? &bookmark : nullptr; | 4172 // race conditions while parsing. |
| 4173 Scanner::BookmarkScope* maybe_bookmark = nullptr; |
4173 SkipLazyFunctionBody(&materialized_literal_count, | 4174 SkipLazyFunctionBody(&materialized_literal_count, |
4174 &expected_property_count, /*CHECK_OK*/ ok, | 4175 &expected_property_count, /*CHECK_OK*/ ok, |
4175 maybe_bookmark); | 4176 maybe_bookmark); |
4176 | 4177 |
4177 if (bookmark.HasBeenReset()) { | 4178 if (bookmark.HasBeenReset()) { |
4178 // Trigger eager (re-)parsing, just below this block. | 4179 // Trigger eager (re-)parsing, just below this block. |
4179 is_lazily_parsed = false; | 4180 is_lazily_parsed = false; |
4180 | 4181 |
4181 // This is probably an initialization function. Inform the compiler it | 4182 // This is probably an initialization function. Inform the compiler it |
4182 // should also eager-compile this function, and that we expect it to be | 4183 // should also eager-compile this function, and that we expect it to be |
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6113 | 6114 |
6114 Expression* Parser::SpreadCallNew(Expression* function, | 6115 Expression* Parser::SpreadCallNew(Expression* function, |
6115 ZoneList<v8::internal::Expression*>* args, | 6116 ZoneList<v8::internal::Expression*>* args, |
6116 int pos) { | 6117 int pos) { |
6117 args->InsertAt(0, function, zone()); | 6118 args->InsertAt(0, function, zone()); |
6118 | 6119 |
6119 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); | 6120 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); |
6120 } | 6121 } |
6121 } // namespace internal | 6122 } // namespace internal |
6122 } // namespace v8 | 6123 } // namespace v8 |
OLD | NEW |