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

Side by Side Diff: src/parsing/parse-info.h

Issue 2399833002: Teach Scopes whether they will end up being lazily compiled or not (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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 #ifndef V8_PARSING_PARSE_INFO_H_ 5 #ifndef V8_PARSING_PARSE_INFO_H_
6 #define V8_PARSING_PARSE_INFO_H_ 6 #define V8_PARSING_PARSE_INFO_H_
7 7
8 #include "include/v8.h" 8 #include "include/v8.h"
9 #include "src/globals.h" 9 #include "src/globals.h"
10 #include "src/handles.h" 10 #include "src/handles.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 FLAG_ACCESSOR(kGlobal, is_global, set_global) 50 FLAG_ACCESSOR(kGlobal, is_global, set_global)
51 FLAG_ACCESSOR(kStrictMode, is_strict_mode, set_strict_mode) 51 FLAG_ACCESSOR(kStrictMode, is_strict_mode, set_strict_mode)
52 FLAG_ACCESSOR(kNative, is_native, set_native) 52 FLAG_ACCESSOR(kNative, is_native, set_native)
53 FLAG_ACCESSOR(kModule, is_module, set_module) 53 FLAG_ACCESSOR(kModule, is_module, set_module)
54 FLAG_ACCESSOR(kAllowLazyParsing, allow_lazy_parsing, set_allow_lazy_parsing) 54 FLAG_ACCESSOR(kAllowLazyParsing, allow_lazy_parsing, set_allow_lazy_parsing)
55 FLAG_ACCESSOR(kAstValueFactoryOwned, ast_value_factory_owned, 55 FLAG_ACCESSOR(kAstValueFactoryOwned, ast_value_factory_owned,
56 set_ast_value_factory_owned) 56 set_ast_value_factory_owned)
57 FLAG_ACCESSOR(kIsNamedExpression, is_named_expression, 57 FLAG_ACCESSOR(kIsNamedExpression, is_named_expression,
58 set_is_named_expression) 58 set_is_named_expression)
59 FLAG_ACCESSOR(kCallsEval, calls_eval, set_calls_eval) 59 FLAG_ACCESSOR(kCallsEval, calls_eval, set_calls_eval)
60 FLAG_ACCESSOR(kDebug, is_debug, set_is_debug)
61 FLAG_ACCESSOR(kSerializing, will_serialize, set_will_serialize)
60 62
61 #undef FLAG_ACCESSOR 63 #undef FLAG_ACCESSOR
62 64
63 void set_parse_restriction(ParseRestriction restriction) { 65 void set_parse_restriction(ParseRestriction restriction) {
64 SetFlag(kParseRestriction, restriction != NO_PARSE_RESTRICTION); 66 SetFlag(kParseRestriction, restriction != NO_PARSE_RESTRICTION);
65 } 67 }
66 68
67 ParseRestriction parse_restriction() const { 69 ParseRestriction parse_restriction() const {
68 return GetFlag(kParseRestriction) ? ONLY_SINGLE_FUNCTION_LITERAL 70 return GetFlag(kParseRestriction) ? ONLY_SINGLE_FUNCTION_LITERAL
69 : NO_PARSE_RESTRICTION; 71 : NO_PARSE_RESTRICTION;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 kLazy = 1 << 1, 201 kLazy = 1 << 1,
200 kEval = 1 << 2, 202 kEval = 1 << 2,
201 kGlobal = 1 << 3, 203 kGlobal = 1 << 3,
202 kStrictMode = 1 << 4, 204 kStrictMode = 1 << 4,
203 kNative = 1 << 5, 205 kNative = 1 << 5,
204 kParseRestriction = 1 << 6, 206 kParseRestriction = 1 << 6,
205 kModule = 1 << 7, 207 kModule = 1 << 7,
206 kAllowLazyParsing = 1 << 8, 208 kAllowLazyParsing = 1 << 8,
207 kIsNamedExpression = 1 << 9, 209 kIsNamedExpression = 1 << 9,
208 kCallsEval = 1 << 10, 210 kCallsEval = 1 << 10,
211 kDebug = 1 << 11,
212 kSerializing = 1 << 12,
209 // ---------- Output flags -------------------------- 213 // ---------- Output flags --------------------------
210 kAstValueFactoryOwned = 1 << 11 214 kAstValueFactoryOwned = 1 << 13
211 }; 215 };
212 216
213 //------------- Inputs to parsing and scope analysis ----------------------- 217 //------------- Inputs to parsing and scope analysis -----------------------
214 Zone* zone_; 218 Zone* zone_;
215 unsigned flags_; 219 unsigned flags_;
216 ScriptCompiler::ExternalSourceStream* source_stream_; 220 ScriptCompiler::ExternalSourceStream* source_stream_;
217 ScriptCompiler::StreamedSource::Encoding source_stream_encoding_; 221 ScriptCompiler::StreamedSource::Encoding source_stream_encoding_;
218 Utf16CharacterStream* character_stream_; 222 Utf16CharacterStream* character_stream_;
219 v8::Extension* extension_; 223 v8::Extension* extension_;
220 ScriptCompiler::CompileOptions compile_options_; 224 ScriptCompiler::CompileOptions compile_options_;
(...skipping 21 matching lines...) Expand all
242 246
243 void SetFlag(Flag f) { flags_ |= f; } 247 void SetFlag(Flag f) { flags_ |= f; }
244 void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; } 248 void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; }
245 bool GetFlag(Flag f) const { return (flags_ & f) != 0; } 249 bool GetFlag(Flag f) const { return (flags_ & f) != 0; }
246 }; 250 };
247 251
248 } // namespace internal 252 } // namespace internal
249 } // namespace v8 253 } // namespace v8
250 254
251 #endif // V8_PARSING_PARSE_INFO_H_ 255 #endif // V8_PARSING_PARSE_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698