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

Side by Side Diff: src/parsing/parser.cc

Issue 2412483005: Restore kDeclaration as a condition for temp-zone parsing (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | no next file with comments »
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/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 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after
2645 // - The function literal shouldn't be hinted to eagerly compile. 2645 // - The function literal shouldn't be hinted to eagerly compile.
2646 // - For asm.js functions the body needs to be available when module 2646 // - For asm.js functions the body needs to be available when module
2647 // validation is active, because we examine the entire module at once. 2647 // validation is active, because we examine the entire module at once.
2648 2648
2649 // Inner functions will be parsed using a temporary Zone. After parsing, we 2649 // Inner functions will be parsed using a temporary Zone. After parsing, we
2650 // will migrate unresolved variable into a Scope in the main Zone. 2650 // will migrate unresolved variable into a Scope in the main Zone.
2651 // TODO(marja): Refactor parsing modes: simplify this. 2651 // TODO(marja): Refactor parsing modes: simplify this.
2652 bool use_temp_zone = 2652 bool use_temp_zone =
2653 (FLAG_lazy_inner_functions 2653 (FLAG_lazy_inner_functions
2654 ? can_preparse 2654 ? can_preparse
2655 : (allow_lazy() && 2655 : (allow_lazy() && function_type == FunctionLiteral::kDeclaration &&
2656 eager_compile_hint == FunctionLiteral::kShouldLazyCompile)) && 2656 eager_compile_hint == FunctionLiteral::kShouldLazyCompile)) &&
2657 !(FLAG_validate_asm && scope()->IsAsmModule()); 2657 !(FLAG_validate_asm && scope()->IsAsmModule());
2658 bool is_lazy_inner_function = 2658 bool is_lazy_inner_function =
2659 use_temp_zone && FLAG_lazy_inner_functions && !is_lazy_top_level_function; 2659 use_temp_zone && FLAG_lazy_inner_functions && !is_lazy_top_level_function;
2660 2660
2661 // This Scope lives in the main zone. We'll migrate data into that zone later. 2661 // This Scope lives in the main zone. We'll migrate data into that zone later.
2662 DeclarationScope* scope = NewFunctionScope(kind); 2662 DeclarationScope* scope = NewFunctionScope(kind);
2663 SetLanguageMode(scope, language_mode); 2663 SetLanguageMode(scope, language_mode);
2664 2664
2665 ZoneList<Statement*>* body = nullptr; 2665 ZoneList<Statement*>* body = nullptr;
(...skipping 2790 matching lines...) Expand 10 before | Expand all | Expand 10 after
5456 5456
5457 return final_loop; 5457 return final_loop;
5458 } 5458 }
5459 5459
5460 #undef CHECK_OK 5460 #undef CHECK_OK
5461 #undef CHECK_OK_VOID 5461 #undef CHECK_OK_VOID
5462 #undef CHECK_FAILED 5462 #undef CHECK_FAILED
5463 5463
5464 } // namespace internal 5464 } // namespace internal
5465 } // namespace v8 5465 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698