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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "include/v8.h" | 10 #include "include/v8.h" |
11 #include "src/globals.h" | 11 #include "src/globals.h" |
12 #include "src/handles.h" | 12 #include "src/handles.h" |
13 #include "src/objects/scope-info.h" | 13 #include "src/objects/scope-info.h" |
| 14 #include "src/parsing/preparsed-scope-data.h" |
14 | 15 |
15 namespace v8 { | 16 namespace v8 { |
16 | 17 |
17 class Extension; | 18 class Extension; |
18 | 19 |
19 namespace internal { | 20 namespace internal { |
20 | 21 |
21 class AccountingAllocator; | 22 class AccountingAllocator; |
22 class AstRawString; | 23 class AstRawString; |
23 class AstValueFactory; | 24 class AstValueFactory; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 void set_character_stream(Utf16CharacterStream* character_stream) { | 96 void set_character_stream(Utf16CharacterStream* character_stream) { |
96 character_stream_ = character_stream; | 97 character_stream_ = character_stream; |
97 } | 98 } |
98 | 99 |
99 v8::Extension* extension() const { return extension_; } | 100 v8::Extension* extension() const { return extension_; } |
100 void set_extension(v8::Extension* extension) { extension_ = extension; } | 101 void set_extension(v8::Extension* extension) { extension_ = extension; } |
101 | 102 |
102 ScriptData** cached_data() const { return cached_data_; } | 103 ScriptData** cached_data() const { return cached_data_; } |
103 void set_cached_data(ScriptData** cached_data) { cached_data_ = cached_data; } | 104 void set_cached_data(ScriptData** cached_data) { cached_data_ = cached_data; } |
104 | 105 |
| 106 PreParsedScopeData* preparsed_scope_data() { return &preparsed_scope_data_; } |
| 107 |
105 ScriptCompiler::CompileOptions compile_options() const { | 108 ScriptCompiler::CompileOptions compile_options() const { |
106 return compile_options_; | 109 return compile_options_; |
107 } | 110 } |
108 void set_compile_options(ScriptCompiler::CompileOptions compile_options) { | 111 void set_compile_options(ScriptCompiler::CompileOptions compile_options) { |
109 compile_options_ = compile_options; | 112 compile_options_ = compile_options; |
110 } | 113 } |
111 | 114 |
112 DeclarationScope* script_scope() const { return script_scope_; } | 115 DeclarationScope* script_scope() const { return script_scope_; } |
113 void set_script_scope(DeclarationScope* script_scope) { | 116 void set_script_scope(DeclarationScope* script_scope) { |
114 script_scope_ = script_scope; | 117 script_scope_ = script_scope; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 int max_function_literal_id_; | 254 int max_function_literal_id_; |
252 | 255 |
253 // TODO(titzer): Move handles and isolate out of ParseInfo. | 256 // TODO(titzer): Move handles and isolate out of ParseInfo. |
254 Isolate* isolate_; | 257 Isolate* isolate_; |
255 Handle<SharedFunctionInfo> shared_; | 258 Handle<SharedFunctionInfo> shared_; |
256 Handle<Script> script_; | 259 Handle<Script> script_; |
257 MaybeHandle<ScopeInfo> maybe_outer_scope_info_; | 260 MaybeHandle<ScopeInfo> maybe_outer_scope_info_; |
258 | 261 |
259 //----------- Inputs+Outputs of parsing and scope analysis ----------------- | 262 //----------- Inputs+Outputs of parsing and scope analysis ----------------- |
260 ScriptData** cached_data_; // used if available, populated if requested. | 263 ScriptData** cached_data_; // used if available, populated if requested. |
| 264 PreParsedScopeData preparsed_scope_data_; |
261 AstValueFactory* ast_value_factory_; // used if available, otherwise new. | 265 AstValueFactory* ast_value_factory_; // used if available, otherwise new. |
262 const AstRawString* function_name_; | 266 const AstRawString* function_name_; |
263 | 267 |
264 //----------- Output of parsing and scope analysis ------------------------ | 268 //----------- Output of parsing and scope analysis ------------------------ |
265 FunctionLiteral* literal_; | 269 FunctionLiteral* literal_; |
266 | 270 |
267 void SetFlag(Flag f) { flags_ |= f; } | 271 void SetFlag(Flag f) { flags_ |= f; } |
268 void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; } | 272 void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; } |
269 bool GetFlag(Flag f) const { return (flags_ & f) != 0; } | 273 bool GetFlag(Flag f) const { return (flags_ & f) != 0; } |
270 }; | 274 }; |
271 | 275 |
272 } // namespace internal | 276 } // namespace internal |
273 } // namespace v8 | 277 } // namespace v8 |
274 | 278 |
275 #endif // V8_PARSING_PARSE_INFO_H_ | 279 #endif // V8_PARSING_PARSE_INFO_H_ |
OLD | NEW |