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

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

Issue 2065453002: [module] Track script "module code" status Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Extend compilation cache to recognize module code Created 4 years, 6 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
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 "src/api.h" 7 #include "src/api.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/ast-expression-rewriter.h" 9 #include "src/ast/ast-expression-rewriter.h"
10 #include "src/ast/ast-expression-visitor.h" 10 #include "src/ast/ast-expression-visitor.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 set_lazy(); 69 set_lazy();
70 set_hash_seed(isolate_->heap()->HashSeed()); 70 set_hash_seed(isolate_->heap()->HashSeed());
71 set_stack_limit(isolate_->stack_guard()->real_climit()); 71 set_stack_limit(isolate_->stack_guard()->real_climit());
72 set_unicode_cache(isolate_->unicode_cache()); 72 set_unicode_cache(isolate_->unicode_cache());
73 set_language_mode(shared->language_mode()); 73 set_language_mode(shared->language_mode());
74 set_shared_info(shared); 74 set_shared_info(shared);
75 75
76 Handle<Script> script(Script::cast(shared->script())); 76 Handle<Script> script(Script::cast(shared->script()));
77 set_script(script); 77 set_script(script);
78
79 if (script->is_module()) {
80 set_module();
81 }
82
78 if (!script.is_null() && script->type() == Script::TYPE_NATIVE) { 83 if (!script.is_null() && script->type() == Script::TYPE_NATIVE) {
79 set_native(); 84 set_native();
80 } 85 }
81 } 86 }
82 87
83 88
84 ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) { 89 ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) {
85 isolate_ = script->GetIsolate(); 90 isolate_ = script->GetIsolate();
86 91
87 set_hash_seed(isolate_->heap()->HashSeed()); 92 set_hash_seed(isolate_->heap()->HashSeed());
88 set_stack_limit(isolate_->stack_guard()->real_climit()); 93 set_stack_limit(isolate_->stack_guard()->real_climit());
89 set_unicode_cache(isolate_->unicode_cache()); 94 set_unicode_cache(isolate_->unicode_cache());
90 set_script(script); 95 set_script(script);
91 96
97 if (script->is_module()) {
98 set_module();
99 }
100
92 if (script->type() == Script::TYPE_NATIVE) { 101 if (script->type() == Script::TYPE_NATIVE) {
93 set_native(); 102 set_native();
94 } 103 }
95 } 104 }
96 105
97 106
98 FunctionEntry ParseData::GetFunctionEntry(int start) { 107 FunctionEntry ParseData::GetFunctionEntry(int start) {
99 // The current pre-data entry must be a FunctionEntry with the given 108 // The current pre-data entry must be a FunctionEntry with the given
100 // start position. 109 // start position.
101 if ((function_index_ + FunctionEntry::kSize <= Length()) && 110 if ((function_index_ + FunctionEntry::kSize <= Length()) &&
(...skipping 6877 matching lines...) Expand 10 before | Expand all | Expand 10 after
6979 try_block, target); 6988 try_block, target);
6980 final_loop = target; 6989 final_loop = target;
6981 } 6990 }
6982 6991
6983 return final_loop; 6992 return final_loop;
6984 } 6993 }
6985 6994
6986 6995
6987 } // namespace internal 6996 } // namespace internal
6988 } // namespace v8 6997 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698