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

#include <ast.h>

Inheritance diagram for v8::internal::Literal:
Collaboration diagram for v8::internal::Literal:

Public Types

enum  Type {
  kSmi , kHeapNumber , kBigInt , kString ,
  kConsString , kBoolean , kUndefined , kNull ,
  kTheHole
}
 
- Public Types inherited from v8::internal::Expression
enum  Context { kUninitialized , kEffect , kValue , kTest }
 
- Public Types inherited from v8::internal::AstNode
enum  NodeType : uint8_t
 

Public Member Functions

Type type () const
 
bool IsPropertyName () const
 
bool AsArrayIndex (uint32_t *index) const
 
const AstRawStringAsRawPropertyName ()
 
Tagged< SmiAsSmiLiteral () const
 
bool AsBooleanLiteral () const
 
bool IsNumber () const
 
double AsNumber () const
 
AstBigInt AsBigInt () const
 
bool IsRawString () const
 
const AstRawStringAsRawString ()
 
bool IsConsString () const
 
AstConsStringAsConsString ()
 
V8_EXPORT_PRIVATE bool ToBooleanIsTrue () const
 
bool ToBooleanIsFalse () const
 
bool ToUint32 (uint32_t *value) const
 
template<typename IsolateT >
DirectHandle< ObjectBuildValue (IsolateT *isolate) const
 
uint32_t Hash ()
 
- Public Member Functions inherited from v8::internal::Expression
bool IsValidReferenceExpression () const
 
bool IsPrivateName () const
 
bool ToBooleanIsTrue () const
 
bool ToBooleanIsFalse () const
 
bool IsPropertyName () const
 
bool IsAnonymousFunctionDefinition () const
 
bool IsConciseMethodDefinition () const
 
bool IsAccessorFunctionDefinition () const
 
bool IsSmiLiteral () const
 
V8_EXPORT_PRIVATE bool IsNumberLiteral () const
 
bool IsStringLiteral () const
 
bool IsConsStringLiteral () const
 
bool IsNullLiteral () const
 
bool IsBooleanLiteral () const
 
bool IsTheHoleLiteral () const
 
bool IsUndefinedLiteral () const
 
bool IsNullOrUndefinedLiteral () const
 
bool IsLiteralButNotNullOrUndefined () const
 
bool IsCompileTimeValue ()
 
bool IsPattern ()
 
bool is_parenthesized () const
 
void mark_parenthesized ()
 
void clear_parenthesized ()
 
- Public Member Functions inherited from v8::internal::AstNode
NodeType node_type () const
 
int position () const
 
IterationStatementAsIterationStatement ()
 
MaterializedLiteralAsMaterializedLiteral ()
 
- Public Member Functions inherited from v8::internal::ZoneObject
void * operator new (size_t, Zone *)=delete
 
void * operator new (size_t size, void *ptr)
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)=delete
 

Static Public Member Functions

static bool Match (void *literal1, void *literal2)
 

Private Types

using TypeField = Expression::NextBitField<Type, 4>
 

Private Member Functions

 Literal (int smi, int position)
 
 Literal (double number, int position)
 
 Literal (AstBigInt bigint, int position)
 
 Literal (const AstRawString *string, int position)
 
 Literal (AstConsString *string, int position)
 
 Literal (bool boolean, int position)
 
 Literal (Type type, int position)
 

Private Attributes

friend Zone
 
union { 
 
   const AstRawString *   string_ 
 
   AstConsString *   cons_string_ 
 
   int   smi_ 
 
   double   number_ 
 
   AstBigInt   bigint_ 
 
   bool   boolean_ 
 
};  
 

Friends

class AstNodeFactory
 

Additional Inherited Members

- Protected Types inherited from v8::internal::Expression
template<class T , int size>
using NextBitField = IsParenthesizedField::Next<T, size>
 
- Protected Types inherited from v8::internal::AstNode
template<class T , int size>
using NextBitField = NodeTypeField::Next<T, size>
 
- Protected Member Functions inherited from v8::internal::Expression
 Expression (int pos, NodeType type)
 
- Protected Member Functions inherited from v8::internal::AstNode
 AstNode (int position, NodeType type)
 
- Protected Attributes inherited from v8::internal::AstNode
uint32_t bit_field_
 

Detailed Description

Definition at line 953 of file ast.h.

Member Typedef Documentation

◆ TypeField

Definition at line 1045 of file ast.h.

Member Enumeration Documentation

◆ Type

Enumerator
kSmi 
kHeapNumber 
kBigInt 
kString 
kConsString 
kBoolean 
kUndefined 
kNull 
kTheHole 

Definition at line 955 of file ast.h.

Constructor & Destructor Documentation

◆ Literal() [1/7]

v8::internal::Literal::Literal ( int smi,
int position )
inlineprivate

Definition at line 1047 of file ast.h.

Here is the call graph for this function:

◆ Literal() [2/7]

v8::internal::Literal::Literal ( double number,
int position )
inlineprivate

Definition at line 1051 of file ast.h.

Here is the call graph for this function:

◆ Literal() [3/7]

v8::internal::Literal::Literal ( AstBigInt bigint,
int position )
inlineprivate

Definition at line 1056 of file ast.h.

Here is the call graph for this function:

◆ Literal() [4/7]

v8::internal::Literal::Literal ( const AstRawString * string,
int position )
inlineprivate

Definition at line 1061 of file ast.h.

Here is the call graph for this function:

◆ Literal() [5/7]

v8::internal::Literal::Literal ( AstConsString * string,
int position )
inlineprivate

Definition at line 1066 of file ast.h.

Here is the call graph for this function:

◆ Literal() [6/7]

v8::internal::Literal::Literal ( bool boolean,
int position )
inlineprivate

Definition at line 1071 of file ast.h.

Here is the call graph for this function:

◆ Literal() [7/7]

v8::internal::Literal::Literal ( Type type,
int position )
inlineprivate

Definition at line 1076 of file ast.h.

Here is the call graph for this function:

Member Function Documentation

◆ AsArrayIndex()

bool v8::internal::Literal::AsArrayIndex ( uint32_t * index) const

Definition at line 1046 of file ast.cc.

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

◆ AsBigInt()

AstBigInt v8::internal::Literal::AsBigInt ( ) const
inline

Definition at line 1009 of file ast.h.

Here is the call graph for this function:

◆ AsBooleanLiteral()

bool v8::internal::Literal::AsBooleanLiteral ( ) const
inline

Definition at line 990 of file ast.h.

Here is the call graph for this function:

◆ AsConsString()

AstConsString * v8::internal::Literal::AsConsString ( )
inline

Definition at line 1021 of file ast.h.

Here is the call graph for this function:

◆ AsNumber()

double v8::internal::Literal::AsNumber ( ) const
inline

Definition at line 997 of file ast.h.

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

◆ AsRawPropertyName()

const AstRawString * v8::internal::Literal::AsRawPropertyName ( )
inline

Definition at line 980 of file ast.h.

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

◆ AsRawString()

const AstRawString * v8::internal::Literal::AsRawString ( )
inline

Definition at line 1015 of file ast.h.

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

◆ AsSmiLiteral()

Tagged< Smi > v8::internal::Literal::AsSmiLiteral ( ) const
inline

Definition at line 985 of file ast.h.

Here is the call graph for this function:

◆ BuildValue()

template<typename IsolateT >
DirectHandle< Object > v8::internal::Literal::BuildValue ( IsolateT * isolate) const

Definition at line 1051 of file ast.cc.

Here is the call graph for this function:

◆ Hash()

uint32_t v8::internal::Literal::Hash ( )

Definition at line 1115 of file ast.cc.

Here is the call graph for this function:

◆ IsConsString()

bool v8::internal::Literal::IsConsString ( ) const
inline

Definition at line 1020 of file ast.h.

Here is the call graph for this function:

◆ IsNumber()

bool v8::internal::Literal::IsNumber ( ) const
inline

Definition at line 996 of file ast.h.

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

◆ IsPropertyName()

bool v8::internal::Literal::IsPropertyName ( ) const

Definition at line 1025 of file ast.cc.

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

◆ IsRawString()

bool v8::internal::Literal::IsRawString ( ) const
inline

Definition at line 1014 of file ast.h.

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

◆ Match()

bool v8::internal::Literal::Match ( void * literal1,
void * literal2 )
static

Definition at line 1128 of file ast.cc.

Here is the caller graph for this function:

◆ ToBooleanIsFalse()

bool v8::internal::Literal::ToBooleanIsFalse ( ) const
inline

Definition at line 1027 of file ast.h.

Here is the call graph for this function:

◆ ToBooleanIsTrue()

V8_EXPORT_PRIVATE bool v8::internal::Literal::ToBooleanIsTrue ( ) const
Here is the caller graph for this function:

◆ ToUint32()

bool v8::internal::Literal::ToUint32 ( uint32_t * value) const

Definition at line 1031 of file ast.cc.

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

◆ type()

Type v8::internal::Literal::type ( ) const
inline

Definition at line 967 of file ast.h.

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

Friends And Related Symbol Documentation

◆ AstNodeFactory

friend class AstNodeFactory
friend

Definition at line 1042 of file ast.h.

Member Data Documentation

◆ [union]

union { ... } v8::internal::Literal

◆ bigint_

AstBigInt v8::internal::Literal::bigint_

Definition at line 1086 of file ast.h.

◆ boolean_

bool v8::internal::Literal::boolean_

Definition at line 1087 of file ast.h.

◆ cons_string_

AstConsString* v8::internal::Literal::cons_string_

Definition at line 1083 of file ast.h.

◆ number_

double v8::internal::Literal::number_

Definition at line 1085 of file ast.h.

◆ smi_

int v8::internal::Literal::smi_

Definition at line 1084 of file ast.h.

◆ string_

const AstRawString* v8::internal::Literal::string_

Definition at line 1082 of file ast.h.

◆ Zone

friend v8::internal::Literal::Zone
private

Definition at line 1043 of file ast.h.


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