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 4178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4189 // parsing if it suspect that wasn't a good idea. If so, or if we didn't | 4189 // parsing if it suspect that wasn't a good idea. If so, or if we didn't |
4190 // try to lazy parse in the first place, we'll have to parse eagerly. | 4190 // try to lazy parse in the first place, we'll have to parse eagerly. |
4191 Scanner::BookmarkScope bookmark(scanner()); | 4191 Scanner::BookmarkScope bookmark(scanner()); |
4192 if (is_lazily_parsed) { | 4192 if (is_lazily_parsed) { |
4193 Scanner::BookmarkScope* maybe_bookmark = | 4193 Scanner::BookmarkScope* maybe_bookmark = |
4194 bookmark.Set() ? &bookmark : nullptr; | 4194 bookmark.Set() ? &bookmark : nullptr; |
4195 SkipLazyFunctionBody(&materialized_literal_count, | 4195 SkipLazyFunctionBody(&materialized_literal_count, |
4196 &expected_property_count, /*CHECK_OK*/ ok, | 4196 &expected_property_count, /*CHECK_OK*/ ok, |
4197 maybe_bookmark); | 4197 maybe_bookmark); |
4198 | 4198 |
4199 if (formals.materialized_literals_count > 0) { | 4199 materialized_literal_count += formals.materialized_literals_count + |
4200 materialized_literal_count += formals.materialized_literals_count; | 4200 function_state.materialized_literal_count(); |
4201 } | |
4202 | 4201 |
4203 if (bookmark.HasBeenReset()) { | 4202 if (bookmark.HasBeenReset()) { |
4204 // Trigger eager (re-)parsing, just below this block. | 4203 // Trigger eager (re-)parsing, just below this block. |
4205 is_lazily_parsed = false; | 4204 is_lazily_parsed = false; |
4206 | 4205 |
4207 // This is probably an initialization function. Inform the compiler it | 4206 // This is probably an initialization function. Inform the compiler it |
4208 // should also eager-compile this function, and that we expect it to be | 4207 // should also eager-compile this function, and that we expect it to be |
4209 // used once. | 4208 // used once. |
4210 eager_compile_hint = FunctionLiteral::kShouldEagerCompile; | 4209 eager_compile_hint = FunctionLiteral::kShouldEagerCompile; |
4211 should_be_used_once_hint = true; | 4210 should_be_used_once_hint = true; |
(...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6244 | 6243 |
6245 Expression* Parser::SpreadCallNew(Expression* function, | 6244 Expression* Parser::SpreadCallNew(Expression* function, |
6246 ZoneList<v8::internal::Expression*>* args, | 6245 ZoneList<v8::internal::Expression*>* args, |
6247 int pos) { | 6246 int pos) { |
6248 args->InsertAt(0, function, zone()); | 6247 args->InsertAt(0, function, zone()); |
6249 | 6248 |
6250 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); | 6249 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); |
6251 } | 6250 } |
6252 } // namespace internal | 6251 } // namespace internal |
6253 } // namespace v8 | 6252 } // namespace v8 |
OLD | NEW |