v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::Script Class Reference

#include <script.h>

Inheritance diagram for v8::internal::Script:
Collaboration diagram for v8::internal::Script:

Classes

class  Iterator
 
struct  PositionInfo
 

Public Types

enum class  Type { kNative = 0 , kExtension = 1 , kNormal = 2 , kInspector = 4 }
 
enum class  CompilationType { kHost = 0 , kEval = 1 }
 
enum class  CompilationState { kInitial = 0 , kCompiled = 1 }
 
enum class  OffsetFlag { kNoOffset , kWithOffset }
 
using BodyDescriptor = StructBodyDescriptor
 

Public Member Functions

bool is_wrapped () const
 
bool has_eval_from_shared () const
 
uint32_t flags () const
 
void set_flags (uint32_t new_flags)
 
CompilationType compilation_type () const
 
void set_compilation_type (CompilationType type)
 
bool produce_compile_hints () const
 
void set_produce_compile_hints (bool produce_compile_hints)
 
bool deserialized () const
 
void set_deserialized (bool value)
 
CompilationState compilation_state ()
 
void set_compilation_state (CompilationState state)
 
bool is_repl_mode () const
 
void set_is_repl_mode (bool value)
 
v8::ScriptOriginOptions origin_options ()
 
void set_origin_options (ScriptOriginOptions origin_options)
 
bool HasValidSource ()
 
bool HasSourceURLComment () const
 
bool HasSourceMappingURLComment () const
 
bool IsMaybeUnfinalized (Isolate *isolate) const
 
Tagged< ObjectGetNameOrSourceURL ()
 
Tagged< ScriptGetEvalOrigin ()
 
bool has_line_ends () const
 
bool CanHaveLineEnds () const
 
V8_EXPORT_PRIVATE bool GetPositionInfo (int position, PositionInfo *info, OffsetFlag offset_flag=OffsetFlag::kWithOffset) const
 
V8_EXPORT_PRIVATE bool GetPositionInfoWithLineEnds (int position, PositionInfo *info, const String::LineEndsVector &line_ends, OffsetFlag offset_flag=OffsetFlag::kWithOffset) const
 
V8_EXPORT_PRIVATE void AddPositionInfoOffset (PositionInfo *info, OffsetFlag offset_flag=OffsetFlag::kWithOffset) const
 
bool IsSubjectToDebugging () const
 
bool IsUserJavaScript () const
 
void TraceScriptRundown ()
 
void TraceScriptRundownSources ()
 
int GetColumnNumber (int code_pos) const
 
int GetLineNumber (int code_pos) const
 
template<typename IsolateT >
void InitLineEndsInternal (IsolateT *isolate, DirectHandle< Script > script)
 

Static Public Member Functions

static DirectHandle< StringGetScriptHash (Isolate *isolate, DirectHandle< Script > script, bool forceForInspector)
 
static int GetEvalPosition (Isolate *isolate, DirectHandle< Script > script)
 
static void InitLineEnds (Isolate *isolate, DirectHandle< Script > script)
 
static void InitLineEnds (LocalIsolate *isolate, DirectHandle< Script > script)
 
static V8_EXPORT_PRIVATE String::LineEndsVector GetLineEnds (Isolate *isolate, DirectHandle< Script > script)
 
static void SetSource (Isolate *isolate, DirectHandle< Script > script, DirectHandle< String > source)
 
static bool GetPositionInfo (DirectHandle< Script > script, int position, PositionInfo *info, OffsetFlag offset_flag=OffsetFlag::kWithOffset)
 
static bool GetLineColumnWithLineEnds (int position, int &line, int &column, const String::LineEndsVector &line_ends)
 
static int GetColumnNumber (DirectHandle< Script > script, int code_offset)
 
static V8_EXPORT_PRIVATE int GetLineNumber (DirectHandle< Script > script, int code_offset)
 
template<typename IsolateT >
static MaybeHandle< SharedFunctionInfoFindSharedFunctionInfo (DirectHandle< Script > script, IsolateT *isolate, FunctionLiteral *function_literal)
 

Static Public Attributes

static constexpr int kTemporaryScriptId = -2
 

Private Member Functions

template<typename LineEndsContainer >
bool GetPositionInfoInternal (const LineEndsContainer &ends, int position, Script::PositionInfo *info, const DisallowGarbageCollection &no_gc) const
 

Static Private Member Functions

template<typename IsolateT >
static void V8_PRESERVE_MOST InitLineEndsInternal (IsolateT *isolate, DirectHandle< Script > script)
 

Private Attributes

friend Factory
 
friend FactoryBase< Factory >
 
friend FactoryBase< LocalFactory >
 

Detailed Description

Definition at line 38 of file script.h.

Member Typedef Documentation

◆ BodyDescriptor

Member Enumeration Documentation

◆ CompilationState

Enumerator
kInitial 
kCompiled 

Definition at line 60 of file script.h.

◆ CompilationType

Enumerator
kHost 
kEval 

Definition at line 57 of file script.h.

◆ OffsetFlag

Enumerator
kNoOffset 
kWithOffset 

Definition at line 208 of file script.h.

◆ Type

enum class v8::internal::Script::Type
strong
Enumerator
kNative 
kExtension 
kNormal 
kInspector 

Definition at line 46 of file script.h.

Member Function Documentation

◆ AddPositionInfoOffset()

void v8::internal::Script::AddPositionInfoOffset ( PositionInfo * info,
OffsetFlag offset_flag = OffsetFlag::kWithOffset ) const

Definition at line 4581 of file objects.cc.

Here is the caller graph for this function:

◆ CanHaveLineEnds()

bool v8::internal::Script::CanHaveLineEnds ( ) const
inline

Definition at line 192 of file script-inl.h.

◆ compilation_state()

Script::CompilationState v8::internal::Script::compilation_state ( )
inline

Definition at line 142 of file script-inl.h.

Here is the call graph for this function:

◆ compilation_type()

Script::CompilationType v8::internal::Script::compilation_type ( ) const
inline

Definition at line 136 of file script-inl.h.

Here is the call graph for this function:

◆ deserialized()

bool v8::internal::Script::deserialized ( ) const
inline

Definition at line 157 of file script-inl.h.

Here is the call graph for this function:

◆ FindSharedFunctionInfo()

template<typename IsolateT >
template MaybeHandle< SharedFunctionInfo > v8::internal::Script::FindSharedFunctionInfo ( DirectHandle< Script > script,
IsolateT * isolate,
FunctionLiteral * function_literal )
static

Definition at line 4763 of file objects.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flags()

uint32_t v8::internal::Script::flags ( ) const
inline

Definition at line 124 of file script-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetColumnNumber() [1/2]

int v8::internal::Script::GetColumnNumber ( DirectHandle< Script > script,
int code_offset )
static

Definition at line 4686 of file objects.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetColumnNumber() [2/2]

int v8::internal::Script::GetColumnNumber ( int code_pos) const

Definition at line 4692 of file objects.cc.

Here is the call graph for this function:

◆ GetEvalOrigin()

Tagged< Script > v8::internal::Script::GetEvalOrigin ( )
inline

Definition at line 227 of file script-inl.h.

Here is the call graph for this function:

◆ GetEvalPosition()

int v8::internal::Script::GetEvalPosition ( Isolate * isolate,
DirectHandle< Script > script )
static

Definition at line 4294 of file objects.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLineColumnWithLineEnds()

bool v8::internal::Script::GetLineColumnWithLineEnds ( int position,
int & line,
int & column,
const String::LineEndsVector & line_ends )
static

Definition at line 4669 of file objects.cc.

◆ GetLineEnds()

String::LineEndsVector v8::internal::Script::GetLineEnds ( Isolate * isolate,
DirectHandle< Script > script )
static

Definition at line 4316 of file objects.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLineNumber() [1/2]

int v8::internal::Script::GetLineNumber ( DirectHandle< Script > script,
int code_offset )
static

Definition at line 4698 of file objects.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLineNumber() [2/2]

int v8::internal::Script::GetLineNumber ( int code_pos) const

Definition at line 4704 of file objects.cc.

Here is the call graph for this function:

◆ GetNameOrSourceURL()

Tagged< Object > v8::internal::Script::GetNameOrSourceURL ( )

Definition at line 4710 of file objects.cc.

◆ GetPositionInfo() [1/2]

bool v8::internal::Script::GetPositionInfo ( DirectHandle< Script > script,
int position,
PositionInfo * info,
OffsetFlag offset_flag = OffsetFlag::kWithOffset )
static

Definition at line 4367 of file objects.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPositionInfo() [2/2]

bool v8::internal::Script::GetPositionInfo ( int position,
PositionInfo * info,
OffsetFlag offset_flag = OffsetFlag::kWithOffset ) const

Definition at line 4622 of file objects.cc.

Here is the call graph for this function:

◆ GetPositionInfoInternal()

template<typename LineEndsContainer >
template bool v8::internal::Script::GetPositionInfoInternal< Tagged< FixedArray > > ( const LineEndsContainer & ends,
int position,
Script::PositionInfo * info,
const DisallowGarbageCollection & no_gc ) const
private

Definition at line 4595 of file objects.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPositionInfoWithLineEnds()

bool v8::internal::Script::GetPositionInfoWithLineEnds ( int position,
PositionInfo * info,
const String::LineEndsVector & line_ends,
OffsetFlag offset_flag = OffsetFlag::kWithOffset ) const

Definition at line 4658 of file objects.cc.

Here is the call graph for this function:

◆ GetScriptHash()

DirectHandle< String > v8::internal::Script::GetScriptHash ( Isolate * isolate,
DirectHandle< Script > script,
bool forceForInspector )
static

Definition at line 4717 of file objects.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_eval_from_shared()

bool v8::internal::Script::has_eval_from_shared ( ) const
inline

◆ has_line_ends()

bool v8::internal::Script::has_line_ends ( ) const
inline

Definition at line 190 of file script-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasSourceMappingURLComment()

bool v8::internal::Script::HasSourceMappingURLComment ( ) const
inline

Definition at line 215 of file script-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasSourceURLComment()

bool v8::internal::Script::HasSourceURLComment ( ) const
inline

Definition at line 211 of file script-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasValidSource()

bool v8::internal::Script::HasValidSource ( )
inline

Definition at line 177 of file script-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitLineEnds() [1/2]

void v8::internal::Script::InitLineEnds ( Isolate * isolate,
DirectHandle< Script > script )
inlinestatic

Definition at line 201 of file script-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitLineEnds() [2/2]

void v8::internal::Script::InitLineEnds ( LocalIsolate * isolate,
DirectHandle< Script > script )
inlinestatic

Definition at line 206 of file script-inl.h.

Here is the call graph for this function:

◆ InitLineEndsInternal() [1/2]

template<typename IsolateT >
void v8::internal::Script::InitLineEndsInternal ( IsolateT * isolate,
DirectHandle< Script > script )

Definition at line 4330 of file objects.cc.

Here is the call graph for this function:

◆ InitLineEndsInternal() [2/2]

template<typename IsolateT >
static void V8_PRESERVE_MOST v8::internal::Script::InitLineEndsInternal ( IsolateT * isolate,
DirectHandle< Script > script )
staticprivate
Here is the caller graph for this function:

◆ is_repl_mode()

bool v8::internal::Script::is_repl_mode ( ) const
inline

Definition at line 163 of file script-inl.h.

Here is the call graph for this function:

◆ is_wrapped()

bool v8::internal::Script::is_wrapped ( ) const
inline

◆ IsMaybeUnfinalized()

bool v8::internal::Script::IsMaybeUnfinalized ( Isolate * isolate) const
inline

Definition at line 220 of file script-inl.h.

Here is the call graph for this function:

◆ IsSubjectToDebugging()

bool v8::internal::Script::IsSubjectToDebugging ( ) const

Definition at line 4383 of file objects.cc.

Here is the call graph for this function:

◆ IsUserJavaScript()

bool v8::internal::Script::IsUserJavaScript ( ) const

Definition at line 4398 of file objects.cc.

◆ origin_options()

ScriptOriginOptions v8::internal::Script::origin_options ( )
inline

Definition at line 169 of file script-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ produce_compile_hints()

bool v8::internal::Script::produce_compile_hints ( ) const
inline

Definition at line 149 of file script-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_compilation_state()

void v8::internal::Script::set_compilation_state ( CompilationState state)
inline

Definition at line 145 of file script-inl.h.

Here is the call graph for this function:

◆ set_compilation_type()

void v8::internal::Script::set_compilation_type ( CompilationType type)
inline

Definition at line 139 of file script-inl.h.

Here is the call graph for this function:

◆ set_deserialized()

void v8::internal::Script::set_deserialized ( bool value)
inline

Definition at line 159 of file script-inl.h.

Here is the call graph for this function:

◆ set_flags()

void v8::internal::Script::set_flags ( uint32_t new_flags)
inline

Definition at line 131 of file script-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_is_repl_mode()

void v8::internal::Script::set_is_repl_mode ( bool value)
inline

Definition at line 165 of file script-inl.h.

Here is the call graph for this function:

◆ set_origin_options()

void v8::internal::Script::set_origin_options ( ScriptOriginOptions origin_options)
inline

Definition at line 172 of file script-inl.h.

Here is the call graph for this function:

◆ set_produce_compile_hints()

void v8::internal::Script::set_produce_compile_hints ( bool produce_compile_hints)
inline

Definition at line 153 of file script-inl.h.

Here is the call graph for this function:

◆ SetSource()

void v8::internal::Script::SetSource ( Isolate * isolate,
DirectHandle< Script > script,
DirectHandle< String > source )
static

Definition at line 4349 of file objects.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TraceScriptRundown()

void v8::internal::Script::TraceScriptRundown ( )

Definition at line 4414 of file objects.cc.

Here is the call graph for this function:

◆ TraceScriptRundownSources()

void v8::internal::Script::TraceScriptRundownSources ( )

Definition at line 4443 of file objects.cc.

Here is the call graph for this function:

Member Data Documentation

◆ Factory

friend v8::internal::Script::Factory
private

Definition at line 283 of file script.h.

◆ FactoryBase< Factory >

friend v8::internal::Script::FactoryBase< Factory >
private

Definition at line 284 of file script.h.

◆ FactoryBase< LocalFactory >

friend v8::internal::Script::FactoryBase< LocalFactory >
private

Definition at line 285 of file script.h.

◆ kTemporaryScriptId

int v8::internal::Script::kTemporaryScriptId = -2
staticconstexpr

Definition at line 42 of file script.h.


The documentation for this class was generated from the following files: