OLD | NEW |
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 FLAG_ACCESSOR(kEval, is_eval, set_eval) | 49 FLAG_ACCESSOR(kEval, is_eval, set_eval) |
50 FLAG_ACCESSOR(kStrictMode, is_strict_mode, set_strict_mode) | 50 FLAG_ACCESSOR(kStrictMode, is_strict_mode, set_strict_mode) |
51 FLAG_ACCESSOR(kNative, is_native, set_native) | 51 FLAG_ACCESSOR(kNative, is_native, set_native) |
52 FLAG_ACCESSOR(kModule, is_module, set_module) | 52 FLAG_ACCESSOR(kModule, is_module, set_module) |
53 FLAG_ACCESSOR(kAllowLazyParsing, allow_lazy_parsing, set_allow_lazy_parsing) | 53 FLAG_ACCESSOR(kAllowLazyParsing, allow_lazy_parsing, set_allow_lazy_parsing) |
54 FLAG_ACCESSOR(kAstValueFactoryOwned, ast_value_factory_owned, | 54 FLAG_ACCESSOR(kAstValueFactoryOwned, ast_value_factory_owned, |
55 set_ast_value_factory_owned) | 55 set_ast_value_factory_owned) |
56 FLAG_ACCESSOR(kIsNamedExpression, is_named_expression, | 56 FLAG_ACCESSOR(kIsNamedExpression, is_named_expression, |
57 set_is_named_expression) | 57 set_is_named_expression) |
58 FLAG_ACCESSOR(kCallsEval, calls_eval, set_calls_eval) | 58 FLAG_ACCESSOR(kCallsEval, calls_eval, set_calls_eval) |
| 59 FLAG_ACCESSOR(kDebug, is_debug, set_is_debug) |
| 60 FLAG_ACCESSOR(kSerializing, will_serialize, set_will_serialize) |
59 | 61 |
60 #undef FLAG_ACCESSOR | 62 #undef FLAG_ACCESSOR |
61 | 63 |
62 void set_parse_restriction(ParseRestriction restriction) { | 64 void set_parse_restriction(ParseRestriction restriction) { |
63 SetFlag(kParseRestriction, restriction != NO_PARSE_RESTRICTION); | 65 SetFlag(kParseRestriction, restriction != NO_PARSE_RESTRICTION); |
64 } | 66 } |
65 | 67 |
66 ParseRestriction parse_restriction() const { | 68 ParseRestriction parse_restriction() const { |
67 return GetFlag(kParseRestriction) ? ONLY_SINGLE_FUNCTION_LITERAL | 69 return GetFlag(kParseRestriction) ? ONLY_SINGLE_FUNCTION_LITERAL |
68 : NO_PARSE_RESTRICTION; | 70 : NO_PARSE_RESTRICTION; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 kToplevel = 1 << 0, | 199 kToplevel = 1 << 0, |
198 kLazy = 1 << 1, | 200 kLazy = 1 << 1, |
199 kEval = 1 << 2, | 201 kEval = 1 << 2, |
200 kStrictMode = 1 << 3, | 202 kStrictMode = 1 << 3, |
201 kNative = 1 << 4, | 203 kNative = 1 << 4, |
202 kParseRestriction = 1 << 5, | 204 kParseRestriction = 1 << 5, |
203 kModule = 1 << 6, | 205 kModule = 1 << 6, |
204 kAllowLazyParsing = 1 << 7, | 206 kAllowLazyParsing = 1 << 7, |
205 kIsNamedExpression = 1 << 8, | 207 kIsNamedExpression = 1 << 8, |
206 kCallsEval = 1 << 9, | 208 kCallsEval = 1 << 9, |
| 209 kDebug = 1 << 10, |
| 210 kSerializing = 1 << 11, |
207 // ---------- Output flags -------------------------- | 211 // ---------- Output flags -------------------------- |
208 kAstValueFactoryOwned = 1 << 10 | 212 kAstValueFactoryOwned = 1 << 12 |
209 }; | 213 }; |
210 | 214 |
211 //------------- Inputs to parsing and scope analysis ----------------------- | 215 //------------- Inputs to parsing and scope analysis ----------------------- |
212 Zone* zone_; | 216 Zone* zone_; |
213 unsigned flags_; | 217 unsigned flags_; |
214 ScriptCompiler::ExternalSourceStream* source_stream_; | 218 ScriptCompiler::ExternalSourceStream* source_stream_; |
215 ScriptCompiler::StreamedSource::Encoding source_stream_encoding_; | 219 ScriptCompiler::StreamedSource::Encoding source_stream_encoding_; |
216 Utf16CharacterStream* character_stream_; | 220 Utf16CharacterStream* character_stream_; |
217 v8::Extension* extension_; | 221 v8::Extension* extension_; |
218 ScriptCompiler::CompileOptions compile_options_; | 222 ScriptCompiler::CompileOptions compile_options_; |
(...skipping 21 matching lines...) Expand all Loading... |
240 | 244 |
241 void SetFlag(Flag f) { flags_ |= f; } | 245 void SetFlag(Flag f) { flags_ |= f; } |
242 void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; } | 246 void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; } |
243 bool GetFlag(Flag f) const { return (flags_ & f) != 0; } | 247 bool GetFlag(Flag f) const { return (flags_ & f) != 0; } |
244 }; | 248 }; |
245 | 249 |
246 } // namespace internal | 250 } // namespace internal |
247 } // namespace v8 | 251 } // namespace v8 |
248 | 252 |
249 #endif // V8_PARSING_PARSE_INFO_H_ | 253 #endif // V8_PARSING_PARSE_INFO_H_ |
OLD | NEW |