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/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/ast/ast-expression-rewriter.h" | 10 #include "src/ast/ast-expression-rewriter.h" |
(...skipping 3470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3481 // Aborting inner function preparsing would leave scopes in an inconsistent | 3481 // Aborting inner function preparsing would leave scopes in an inconsistent |
3482 // state; we don't parse inner functions in the abortable mode anyway. | 3482 // state; we don't parse inner functions in the abortable mode anyway. |
3483 DCHECK(!is_inner_function || !may_abort); | 3483 DCHECK(!is_inner_function || !may_abort); |
3484 | 3484 |
3485 DeclarationScope* function_scope = function_state_->scope(); | 3485 DeclarationScope* function_scope = function_state_->scope(); |
3486 PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction( | 3486 PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction( |
3487 function_scope, parsing_module_, logger, is_inner_function, may_abort, | 3487 function_scope, parsing_module_, logger, is_inner_function, may_abort, |
3488 use_counts_); | 3488 use_counts_); |
3489 // Detaching the scopes created by PreParser from the Scope chain must be done | 3489 // Detaching the scopes created by PreParser from the Scope chain must be done |
3490 // above (see ParseFunctionLiteral & AnalyzePartially). | 3490 // above (see ParseFunctionLiteral & AnalyzePartially). |
3491 if (!is_inner_function) function_scope->ResetAfterPreparsing(); | 3491 if (!is_inner_function) { |
| 3492 function_scope->ResetAfterPreparsing(result == PreParser::kPreParseAbort); |
| 3493 } |
3492 if (pre_parse_timer_ != NULL) { | 3494 if (pre_parse_timer_ != NULL) { |
3493 pre_parse_timer_->Stop(); | 3495 pre_parse_timer_->Stop(); |
3494 } | 3496 } |
3495 return result; | 3497 return result; |
3496 } | 3498 } |
3497 | 3499 |
3498 Expression* Parser::InstallHomeObject(Expression* function_literal, | 3500 Expression* Parser::InstallHomeObject(Expression* function_literal, |
3499 Expression* home_object) { | 3501 Expression* home_object) { |
3500 Block* do_block = factory()->NewBlock(nullptr, 1, false, kNoSourcePosition); | 3502 Block* do_block = factory()->NewBlock(nullptr, 1, false, kNoSourcePosition); |
3501 Variable* result_var = | 3503 Variable* result_var = |
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5605 | 5607 |
5606 return final_loop; | 5608 return final_loop; |
5607 } | 5609 } |
5608 | 5610 |
5609 #undef CHECK_OK | 5611 #undef CHECK_OK |
5610 #undef CHECK_OK_VOID | 5612 #undef CHECK_OK_VOID |
5611 #undef CHECK_FAILED | 5613 #undef CHECK_FAILED |
5612 | 5614 |
5613 } // namespace internal | 5615 } // namespace internal |
5614 } // namespace v8 | 5616 } // namespace v8 |
OLD | NEW |