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

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: 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 } else {
82 set_global();
mike3 2016/06/12 19:54:48 Since ParseInfo keeps a reference to its Script, t
vogelheim 2016/06/14 15:20:50 Removing the bit would also be ok; not sure if it'
vogelheim 2016/06/14 15:20:50 How do we know it's not an eval? (See more elabora
mike3 2016/06/19 16:59:00 Acknowledged.
83 }
84
78 if (!script.is_null() && script->type() == Script::TYPE_NATIVE) { 85 if (!script.is_null() && script->type() == Script::TYPE_NATIVE) {
79 set_native(); 86 set_native();
80 } 87 }
81 } 88 }
82 89
83 90
84 ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) { 91 ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) {
85 isolate_ = script->GetIsolate(); 92 isolate_ = script->GetIsolate();
86 93
87 set_hash_seed(isolate_->heap()->HashSeed()); 94 set_hash_seed(isolate_->heap()->HashSeed());
88 set_stack_limit(isolate_->stack_guard()->real_climit()); 95 set_stack_limit(isolate_->stack_guard()->real_climit());
89 set_unicode_cache(isolate_->unicode_cache()); 96 set_unicode_cache(isolate_->unicode_cache());
90 set_script(script); 97 set_script(script);
91 98
99 if (script->is_module()) {
100 set_module();
101 } else {
102 set_global();
vogelheim 2016/06/14 15:20:49 as above...
mike3 2016/06/19 16:59:00 Acknowledged.
103 }
104
92 if (script->type() == Script::TYPE_NATIVE) { 105 if (script->type() == Script::TYPE_NATIVE) {
93 set_native(); 106 set_native();
94 } 107 }
95 } 108 }
96 109
97 110
98 FunctionEntry ParseData::GetFunctionEntry(int start) { 111 FunctionEntry ParseData::GetFunctionEntry(int start) {
99 // The current pre-data entry must be a FunctionEntry with the given 112 // The current pre-data entry must be a FunctionEntry with the given
100 // start position. 113 // start position.
101 if ((function_index_ + FunctionEntry::kSize <= Length()) && 114 if ((function_index_ + FunctionEntry::kSize <= Length()) &&
(...skipping 6871 matching lines...) Expand 10 before | Expand all | Expand 10 after
6973 try_block, target); 6986 try_block, target);
6974 final_loop = target; 6987 final_loop = target;
6975 } 6988 }
6976 6989
6977 return final_loop; 6990 return final_loop;
6978 } 6991 }
6979 6992
6980 6993
6981 } // namespace internal 6994 } // namespace internal
6982 } // namespace v8 6995 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698