// Copyright 2016 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/parsing/parse-info.h" #include "src/api.h" #include "src/ast/ast-value-factory.h" #include "src/ast/ast.h" #include "src/heap/heap-inl.h" #include "src/objects-inl.h" #include "src/objects/scope-info.h" #include "src/zone/zone.h" namespace v8 { namespace internal { ParseInfo::ParseInfo(AccountingAllocator* zone_allocator) : zone_(std::make_shared(zone_allocator, ZONE_NAME)), flags_(0), source_stream_(nullptr), source_stream_encoding_(ScriptCompiler::StreamedSource::ONE_BYTE), character_stream_(nullptr), extension_(nullptr), compile_options_(ScriptCompiler::kNoCompileOptions), script_scope_(nullptr), asm_function_scope_(nullptr), unicode_cache_(nullptr), stack_limit_(0), hash_seed_(0), compiler_hints_(0), start_position_(0), end_position_(0), parameters_end_pos_(kNoSourcePosition), function_literal_id_(FunctionLiteral::kIdTypeInvalid), max_function_literal_id_(FunctionLiteral::kIdTypeInvalid), isolate_(nullptr), cached_data_(nullptr), ast_value_factory_(nullptr), function_name_(nullptr), literal_(nullptr), deferred_handles_(nullptr) {} ParseInfo::ParseInfo(Handle shared) : ParseInfo(shared->GetIsolate()->allocator()) { isolate_ = shared->GetIsolate(); set_toplevel(shared->is_toplevel()); set_allow_lazy_parsing(FLAG_lazy_inner_functions); set_hash_seed(isolate_->heap()->HashSeed()); set_is_named_expression(shared->is_named_expression()); set_calls_eval(shared->scope_info()->CallsEval()); set_compiler_hints(shared->compiler_hints()); set_start_position(shared->start_position()); set_end_position(shared->end_position()); function_literal_id_ = shared->function_literal_id(); set_stack_limit(isolate_->stack_guard()->real_climit()); set_unicode_cache(isolate_->unicode_cache()); set_language_mode(shared->language_mode()); set_shared_info(shared); set_module(shared->kind() == FunctionKind::kModule); Handle