5#ifndef V8_PARSING_PARSE_INFO_H_
6#define V8_PARSING_PARSE_INFO_H_
28class AccountingAllocator;
30class AstStringConstants;
32class LazyCompileDispatcher;
33class DeclarationScope;
35class RuntimeCallStats;
38class Utf16CharacterStream;
42#define FLAG_FIELDS(V, _) \
43 V(is_toplevel, bool, 1, _) \
44 V(is_eager, bool, 1, _) \
45 V(is_eval, bool, 1, _) \
46 V(is_reparse, bool, 1, _) \
47 V(outer_language_mode, LanguageMode, 1, _) \
48 V(parse_restriction, ParseRestriction, 1, _) \
49 V(is_module, bool, 1, _) \
50 V(allow_lazy_parsing, bool, 1, _) \
51 V(is_lazy_compile, bool, 1, _) \
52 V(coverage_enabled, bool, 1, _) \
53 V(block_coverage_enabled, bool, 1, _) \
54 V(is_asm_wasm_broken, bool, 1, _) \
55 V(class_scope_has_private_brand, bool, 1, _) \
56 V(private_name_lookup_skips_outer_class, bool, 1, _) \
57 V(requires_instance_members_initializer, bool, 1, _) \
58 V(has_static_private_methods_or_accessors, bool, 1, _) \
59 V(might_always_turbofan, bool, 1, _) \
60 V(allow_natives_syntax, bool, 1, _) \
61 V(allow_lazy_compile, bool, 1, _) \
62 V(post_parallel_compile_tasks_for_eager_toplevel, bool, 1, _) \
63 V(post_parallel_compile_tasks_for_lazy, bool, 1, _) \
64 V(collect_source_positions, bool, 1, _) \
65 V(is_repl_mode, bool, 1, _) \
66 V(produce_compile_hints, bool, 1, _) \
67 V(compile_hints_magic_enabled, bool, 1, _) \
68 V(compile_hints_per_function_magic_enabled, bool, 1, _)
74 bool is_user_javascript,
97#define FLAG_GET_SET(NAME, TYPE, SIZE, _) \
98 TYPE NAME() const { return BitFields::NAME::decode(flags_); } \
99 UnoptimizedCompileFlags& set_##NAME(TYPE value) { \
100 flags_ = BitFields::NAME::update(flags_, value); \
114 function_kind_ =
value;
119 return function_syntax_kind_;
122 function_syntax_kind_ =
value;
127 return parsing_while_debugging_;
131 parsing_while_debugging_ =
value;
144 template <
typename T>
145 void SetFlagsFromFunction(T function);
146 void SetFlagsForToplevelCompile(
bool is_user_javascript,
166 return &pending_error_handler_;
169 return &pending_error_handler_;
204 return ast_value_factory_.get();
209 return ast_string_constants_;
235 uintptr_t stack_limit);
239 template <
typename IsolateT>
247 Zone*
zone()
const {
return reusable_state_->single_parse_zone(); }
252 uint64_t
hash_seed()
const {
return reusable_state_->hash_seed(); }
254 return reusable_state_->allocator();
257 return reusable_state_->ast_string_constants();
260 return reusable_state_->v8_file_logger();
263 return reusable_state_->dispatcher();
269 return state_->pending_error_handler();
280#if V8_ENABLE_WEBASSEMBLY
281 bool contains_asm_module()
const {
return contains_asm_module_; }
282 void set_contains_asm_module(
bool value) { contains_asm_module_ =
value; }
289 return character_stream_.get();
291 void set_character_stream(
292 std::unique_ptr<Utf16CharacterStream> character_stream);
293 void ResetCharacterStream();
299 consumed_preparse_data_.swap(data);
302 return consumed_preparse_data_.get();
307 script_scope_ = script_scope;
311 return reusable_state_->ast_value_factory();
316 function_name_ = function_name;
326 parameters_end_pos_ = parameters_end_pos;
330 return flags().function_syntax_kind() == FunctionSyntaxKind::kWrapped;
339 source_range_map_ = source_range_map;
359 compile_hint_callback_data_ =
data;
363 return compile_hint_callback_;
367 return compile_hint_callback_data_;
375 void CheckFlagsForToplevelCompileFromScript(
Tagged<Script> script);
389 void* compile_hint_callback_data_ =
nullptr;
401#if V8_ENABLE_WEBASSEMBLY
402 bool contains_asm_module_ : 1;
#define DEFINE_BIT_FIELDS(LIST_MACRO)
RegisterAllocator * allocator_
union v8::internal::@341::BuiltinMetadata::KindSpecificData data
V8FileLogger * v8_file_logger() const
DeclarationScope * script_scope_
const AstRawString * function_name() const
std::unique_ptr< Utf16CharacterStream > character_stream_
void set_has_module_in_scope_chain()
RuntimeCallStats * runtime_call_stats() const
bool is_streaming_compilation() const
const UnoptimizedCompileState * state() const
void AllocateSourceRangeMap()
void set_function_name(const AstRawString *function_name)
void set_extension(v8::Extension *extension)
DeclarationScope * script_scope() const
AccountingAllocator * allocator() const
void set_allow_eval_cache(bool value)
FunctionLiteral * literal_
SourceRangeMap * source_range_map_
LazyCompileDispatcher * dispatcher() const
bool has_module_in_scope_chain() const
bool is_streaming_compilation_
PendingCompilationErrorHandler * pending_error_handler()
Utf16CharacterStream * character_stream() const
const AstStringConstants * ast_string_constants() const
bool is_background_compilation() const
void set_language_mode(LanguageMode value)
UnoptimizedCompileState * state_
ConsumedPreparseData * consumed_preparse_data()
bool allow_eval_cache() const
bool is_wrapped_as_function() const
LanguageMode language_mode_
const UnoptimizedCompileFlags & flags() const
uint64_t hash_seed() const
FunctionLiteral * literal() const
int parameters_end_pos() const
void set_consumed_preparse_data(std::unique_ptr< ConsumedPreparseData > data)
bool is_background_compilation_
LanguageMode language_mode() const
void set_is_background_compilation()
void set_max_info_id(int max_info_id)
uintptr_t stack_limit() const
void SetCompileHintCallbackAndData(CompileHintCallback callback, void *data)
SourceRangeMap * source_range_map() const
bool has_module_in_scope_chain_
const UnoptimizedCompileFlags flags_
void * compile_hint_callback_data() const
v8::Extension * extension() const
void set_is_streaming_compilation()
v8::Extension * extension_
ReusableUnoptimizedCompileState * reusable_state_
CompileHintCallback compile_hint_callback() const
AstValueFactory * ast_value_factory() const
void set_source_range_map(SourceRangeMap *source_range_map)
void set_script_scope(DeclarationScope *script_scope)
const AstRawString * function_name_
void set_literal(FunctionLiteral *literal)
RuntimeCallStats * runtime_call_stats_
std::unique_ptr< ConsumedPreparseData > consumed_preparse_data_
void set_parameters_end_pos(int parameters_end_pos)
uint64_t hash_seed() const
~ReusableUnoptimizedCompileState()
AstValueFactory * ast_value_factory() const
AccountingAllocator * allocator() const
Zone * ast_raw_string_zone()
const AstStringConstants * ast_string_constants_
const AstStringConstants * ast_string_constants() const
void NotifySingleParseCompleted()
AccountingAllocator * allocator_
LazyCompileDispatcher * dispatcher_
std::unique_ptr< AstValueFactory > ast_value_factory_
Zone ast_raw_string_zone_
V8FileLogger * v8_file_logger_
Zone * single_parse_zone()
V8FileLogger * v8_file_logger() const
LazyCompileDispatcher * dispatcher() const
FunctionKind function_kind() const
UnoptimizedCompileFlags & set_function_kind(FunctionKind value)
FunctionSyntaxKind function_syntax_kind_
FunctionKind function_kind_
UnoptimizedCompileFlags & set_parsing_while_debugging(ParsingWhileDebugging value)
FunctionSyntaxKind function_syntax_kind() const
UnoptimizedCompileFlags & set_function_syntax_kind(FunctionSyntaxKind value)
ParsingWhileDebugging parsing_while_debugging_
UnoptimizedCompileFlags & set_script_id(int value)
ParsingWhileDebugging parsing_while_debugging() const
const PendingCompilationErrorHandler * pending_error_handler() const
PendingCompilationErrorHandler pending_error_handler_
PendingCompilationErrorHandler * pending_error_handler()
LanguageMode language_mode_
enum v8::internal::@1270::DeoptimizableCodeIterator::@67 state_
#define EXPORT_TEMPLATE_DECLARE(export)
other heap size flags(e.g. initial_heap_size) take precedence") DEFINE_SIZE_T( max_shared_heap_size
FunctionLiteral * literal
bool(*)(int, void *) CompileHintCallback
#define FLAG_FIELDS(V, _)
#define FLAG_GET_SET(NAME, TYPE, SIZE, _)
const uintptr_t stack_limit_
#define V8_EXPORT_PRIVATE
std::unique_ptr< ValueMirror > value