chromium/v8/src/objects/scope-info.cc

// Copyright 2011 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/objects/scope-info.h"

#include <stdlib.h>

#include "src/ast/scopes.h"
#include "src/ast/variables.h"
#include "src/init/bootstrapper.h"
#include "src/objects/module-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/scope-info-inl.h"
#include "src/objects/string-set-inl.h"
#include "src/roots/roots.h"

// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"

namespace v8 {
namespace internal {

#ifdef DEBUG
bool ScopeInfo::Equals(Tagged<ScopeInfo> other,
                       bool is_live_edit_compare) const {}
#endif

// static
template <typename IsolateT>
Handle<ScopeInfo> ScopeInfo::Create(IsolateT* isolate, Zone* zone, Scope* scope,
                                    MaybeHandle<ScopeInfo> outer_scope) {}

template EXPORT_TEMPLATE_DEFINE()
    Handle<ScopeInfo> ScopeInfo::Create(Isolate* isolate, Zone* zone,
                                        Scope* scope,
                                        MaybeHandle<ScopeInfo> outer_scope);
template EXPORT_TEMPLATE_DEFINE()
    Handle<ScopeInfo> ScopeInfo::Create(LocalIsolate* isolate, Zone* zone,
                                        Scope* scope,
                                        MaybeHandle<ScopeInfo> outer_scope);

// static
Handle<ScopeInfo> ScopeInfo::CreateForWithScope(
    Isolate* isolate, MaybeHandle<ScopeInfo> outer_scope) {}

// static
Handle<ScopeInfo> ScopeInfo::CreateGlobalThisBinding(Isolate* isolate) {}

// static
Handle<ScopeInfo> ScopeInfo::CreateForEmptyFunction(Isolate* isolate) {}

// static
Handle<ScopeInfo> ScopeInfo::CreateForNativeContext(Isolate* isolate) {}

// static
Handle<ScopeInfo> ScopeInfo::CreateForShadowRealmNativeContext(
    Isolate* isolate) {}

// static
Handle<ScopeInfo> ScopeInfo::CreateForBootstrapping(Isolate* isolate,
                                                    BootstrappingType type) {}

Tagged<Object> ScopeInfo::get(int index) const {}

Tagged<Object> ScopeInfo::get(PtrComprCageBase cage_base, int index) const {}

void ScopeInfo::set(int index, Tagged<Smi> value) {}

void ScopeInfo::set(int index, Tagged<Object> value, WriteBarrierMode mode) {}

void ScopeInfo::CopyElements(Isolate* isolate, int dst_index,
                             Tagged<ScopeInfo> src, int src_index, int len,
                             WriteBarrierMode mode) {}

ObjectSlot ScopeInfo::RawFieldOfElementAt(int index) {}

int ScopeInfo::length() const {}

Tagged<ScopeInfo> ScopeInfo::Empty(Isolate* isolate) {}

bool ScopeInfo::IsEmpty() const {}

ScopeType ScopeInfo::scope_type() const {}

bool ScopeInfo::is_script_scope() const {}

bool ScopeInfo::SloppyEvalCanExtendVars() const {}

LanguageMode ScopeInfo::language_mode() const {}

bool ScopeInfo::is_declaration_scope() const {}

int ScopeInfo::ContextLength() const {}

// Needs to be kept in sync with Scope::UniqueIdInScript and
// SharedFunctionInfo::UniqueIdInScript.
int ScopeInfo::UniqueIdInScript() const {}

bool ScopeInfo::HasContextExtensionSlot() const {}

int ScopeInfo::ContextHeaderLength() const {}

bool ScopeInfo::HasReceiver() const {}

bool ScopeInfo::HasAllocatedReceiver() const {}

bool ScopeInfo::ClassScopeHasPrivateBrand() const {}

bool ScopeInfo::HasSavedClassVariable() const {}

bool ScopeInfo::HasNewTarget() const {}

bool ScopeInfo::HasFunctionName() const {}

bool ScopeInfo::HasContextAllocatedFunctionName() const {}

bool ScopeInfo::HasInferredFunctionName() const {}

bool ScopeInfo::HasPositionInfo() const {}

bool ScopeInfo::HasSharedFunctionName() const {}

void ScopeInfo::SetFunctionName(Tagged<UnionOf<Smi, String>> name) {}

void ScopeInfo::SetInferredFunctionName(Tagged<String> name) {}

bool ScopeInfo::HasOuterScopeInfo() const {}

bool ScopeInfo::IsDebugEvaluateScope() const {}

void ScopeInfo::SetIsDebugEvaluateScope() {}

bool ScopeInfo::PrivateNameLookupSkipsOuterClass() const {}

bool ScopeInfo::IsReplModeScope() const {}

bool ScopeInfo::IsHiddenCatchScope() const {}

bool ScopeInfo::IsWrappedFunctionScope() const {}

bool ScopeInfo::HasContext() const {}

Tagged<UnionOf<Smi, String>> ScopeInfo::FunctionName() const {}

Tagged<Object> ScopeInfo::InferredFunctionName() const {}

Tagged<String> ScopeInfo::FunctionDebugName() const {}

int ScopeInfo::StartPosition() const {}

int ScopeInfo::EndPosition() const {}

void ScopeInfo::SetPositionInfo(int start, int end) {}

Tagged<ScopeInfo> ScopeInfo::OuterScopeInfo() const {}

Tagged<SourceTextModuleInfo> ScopeInfo::ModuleDescriptorInfo() const {}

Tagged<String> ScopeInfo::ContextInlinedLocalName(int var) const {}

Tagged<String> ScopeInfo::ContextInlinedLocalName(PtrComprCageBase cage_base,
                                                  int var) const {}

VariableMode ScopeInfo::ContextLocalMode(int var) const {}

IsStaticFlag ScopeInfo::ContextLocalIsStaticFlag(int var) const {}

InitializationFlag ScopeInfo::ContextLocalInitFlag(int var) const {}

bool ScopeInfo::ContextLocalIsParameter(int var) const {}

uint32_t ScopeInfo::ContextLocalParameterNumber(int var) const {}

MaybeAssignedFlag ScopeInfo::ContextLocalMaybeAssignedFlag(int var) const {}

// static
bool ScopeInfo::VariableIsSynthetic(Tagged<String> name) {}

int ScopeInfo::ModuleVariableCount() const {}

int ScopeInfo::ModuleIndex(Tagged<String> name, VariableMode* mode,
                           InitializationFlag* init_flag,
                           MaybeAssignedFlag* maybe_assigned_flag) {}

int ScopeInfo::InlinedLocalNamesLookup(Tagged<String> name) {}

int ScopeInfo::ContextSlotIndex(Handle<String> name,
                                VariableLookupResult* lookup_result) {}

int ScopeInfo::ContextSlotIndex(Handle<String> name) {}

std::pair<Tagged<String>, int> ScopeInfo::SavedClassVariable() const {}

int ScopeInfo::ReceiverContextSlotIndex() const {}

int ScopeInfo::ParametersStartIndex() const {}

int ScopeInfo::FunctionContextSlotIndex(Tagged<String> name) const {}

FunctionKind ScopeInfo::function_kind() const {}

int ScopeInfo::ContextLocalNamesIndex() const {}

int ScopeInfo::ContextLocalInfosIndex() const {}

int ScopeInfo::SavedClassVariableInfoIndex() const {}

int ScopeInfo::FunctionVariableInfoIndex() const {}

int ScopeInfo::InferredFunctionNameIndex() const {}

int ScopeInfo::OuterScopeInfoIndex() const {}

int ScopeInfo::ModuleInfoIndex() const {}

int ScopeInfo::ModuleVariableCountIndex() const {}

int ScopeInfo::ModuleVariablesIndex() const {}

void ScopeInfo::ModuleVariable(int i, Tagged<String>* name, int* index,
                               VariableMode* mode,
                               InitializationFlag* init_flag,
                               MaybeAssignedFlag* maybe_assigned_flag) {}

uint32_t ScopeInfo::Hash() {}

std::ostream& operator<<(std::ostream& os, VariableAllocationInfo var_info) {}

template <typename IsolateT>
Handle<ModuleRequest> ModuleRequest::New(
    IsolateT* isolate, DirectHandle<String> specifier, ModuleImportPhase phase,
    DirectHandle<FixedArray> import_attributes, int position) {}

template Handle<ModuleRequest> ModuleRequest::New(
    Isolate* isolate, DirectHandle<String> specifier, ModuleImportPhase phase,
    DirectHandle<FixedArray> import_attributes, int position);
template Handle<ModuleRequest> ModuleRequest::New(
    LocalIsolate* isolate, DirectHandle<String> specifier,
    ModuleImportPhase phase, DirectHandle<FixedArray> import_attributes,
    int position);

template <typename IsolateT>
Handle<SourceTextModuleInfoEntry> SourceTextModuleInfoEntry::New(
    IsolateT* isolate, DirectHandle<UnionOf<String, Undefined>> export_name,
    DirectHandle<UnionOf<String, Undefined>> local_name,
    DirectHandle<UnionOf<String, Undefined>> import_name, int module_request,
    int cell_index, int beg_pos, int end_pos) {}

template Handle<SourceTextModuleInfoEntry> SourceTextModuleInfoEntry::New(
    Isolate* isolate, DirectHandle<UnionOf<String, Undefined>> export_name,
    DirectHandle<UnionOf<String, Undefined>> local_name,
    DirectHandle<UnionOf<String, Undefined>> import_name, int module_request,
    int cell_index, int beg_pos, int end_pos);
template Handle<SourceTextModuleInfoEntry> SourceTextModuleInfoEntry::New(
    LocalIsolate* isolate, DirectHandle<UnionOf<String, Undefined>> export_name,
    DirectHandle<UnionOf<String, Undefined>> local_name,
    DirectHandle<UnionOf<String, Undefined>> import_name, int module_request,
    int cell_index, int beg_pos, int end_pos);

template <typename IsolateT>
Handle<SourceTextModuleInfo> SourceTextModuleInfo::New(
    IsolateT* isolate, Zone* zone, SourceTextModuleDescriptor* descr) {}
template Handle<SourceTextModuleInfo> SourceTextModuleInfo::New(
    Isolate* isolate, Zone* zone, SourceTextModuleDescriptor* descr);
template Handle<SourceTextModuleInfo> SourceTextModuleInfo::New(
    LocalIsolate* isolate, Zone* zone, SourceTextModuleDescriptor* descr);

int SourceTextModuleInfo::RegularExportCount() const {}

Tagged<String> SourceTextModuleInfo::RegularExportLocalName(int i) const {}

int SourceTextModuleInfo::RegularExportCellIndex(int i) const {}

Tagged<FixedArray> SourceTextModuleInfo::RegularExportExportNames(int i) const {}

}  // namespace internal
}  // namespace v8

#include "src/objects/object-macros-undef.h"