V8 Project
v8::internal::MaterializedLiteral Class Reference

#include <ast.h>

+ Inheritance diagram for v8::internal::MaterializedLiteral:
+ Collaboration diagram for v8::internal::MaterializedLiteral:

Public Member Functions

virtual MaterializedLiteralAsMaterializedLiteral ()
 
int literal_index ()
 
int depth () const
 
- Public Member Functions inherited from v8::internal::Expression
virtual bool IsValidReferenceExpression () const
 
virtual bool ToBooleanIsTrue () const
 
virtual bool ToBooleanIsFalse () const
 
virtual bool IsPropertyName () const
 
virtual bool ResultOverwriteAllowed () const
 
bool IsSmiLiteral () const
 
bool IsStringLiteral () const
 
bool IsNullLiteral () const
 
bool IsUndefinedLiteral (Isolate *isolate) const
 
Bounds bounds () const
 
void set_bounds (Bounds bounds)
 
unsigned parenthesization_level () const
 
bool is_parenthesized () const
 
void increase_parenthesization_level ()
 
virtual bool IsMonomorphic ()
 
virtual SmallMapList * GetReceiverTypes ()
 
virtual KeyedAccessStoreMode GetStoreMode ()
 
virtual void RecordToBooleanTypeFeedback (TypeFeedbackOracle *oracle)
 
byte to_boolean_types () const
 
BailoutId id () const
 
TypeFeedbackId test_id () const
 
- Public Member Functions inherited from v8::internal::AstNode
void * operator new (size_t size, Zone *zone)
 
 AstNode (int position)
 
virtual ~AstNode ()
 
virtual void Accept (AstVisitor *v)=0
 
virtual NodeType node_type () const =0
 
int position () const
 
virtual TargetCollector * AsTargetCollector ()
 
virtual BreakableStatementAsBreakableStatement ()
 
virtual IterationStatementAsIterationStatement ()
 
- Public Member Functions inherited from v8::internal::ZoneObject
 INLINE (void *operator new(size_t size, Zone *zone))
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)
 

Protected Member Functions

 MaterializedLiteral (Zone *zone, int literal_index, int pos, IdGen *id_gen)
 
bool is_simple () const
 
void set_is_simple (bool is_simple)
 
void set_depth (int depth)
 
void BuildConstants (Isolate *isolate)
 
Handle< ObjectGetBoilerplateValue (Expression *expression, Isolate *isolate)
 
- Protected Member Functions inherited from v8::internal::Expression
 Expression (Zone *zone, int pos, IdGen *id_gen)
 
void set_to_boolean_types (byte types)
 

Private Attributes

int literal_index_
 
bool is_simple_
 
int depth_
 

Friends

class CompileTimeValue
 
class ArrayLiteral
 
class ObjectLiteral
 

Additional Inherited Members

- Public Types inherited from v8::internal::Expression
enum  Context { kUninitialized , kEffect , kValue , kTest }
 
- Public Types inherited from v8::internal::AstNode
enum  NodeType { kInvalid = -1 }
 
- Static Protected Member Functions inherited from v8::internal::AstNode
static TypeFeedbackId reuse (BailoutId id)
 

Detailed Description

Definition at line 1401 of file ast.h.

Constructor & Destructor Documentation

◆ MaterializedLiteral()

v8::internal::MaterializedLiteral::MaterializedLiteral ( Zone zone,
int  literal_index,
int  pos,
IdGen id_gen 
)
inlineprotected

Definition at line 1414 of file ast.h.

1415  : Expression(zone, pos, id_gen),
1417  is_simple_(false),
1418  depth_(0) {}
Expression(Zone *zone, int pos, IdGen *id_gen)
Definition: ast.h:383

Member Function Documentation

◆ AsMaterializedLiteral()

virtual MaterializedLiteral* v8::internal::MaterializedLiteral::AsMaterializedLiteral ( )
inlinevirtual

Reimplemented from v8::internal::AstNode.

Definition at line 1403 of file ast.h.

1403 { return this; }

◆ BuildConstants()

void v8::internal::MaterializedLiteral::BuildConstants ( Isolate isolate)
protected

Definition at line 396 of file ast.cc.

396  {
397  if (IsArrayLiteral()) {
398  return AsArrayLiteral()->BuildConstantElements(isolate);
399  }
400  if (IsObjectLiteral()) {
401  return AsObjectLiteral()->BuildConstantProperties(isolate);
402  }
403  DCHECK(IsRegExpLiteral());
404  DCHECK(depth() >= 1); // Depth should be initialized.
405 }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, and depth().

+ Here is the call graph for this function:

◆ depth()

int v8::internal::MaterializedLiteral::depth ( ) const
inline

Definition at line 1407 of file ast.h.

1407  {
1408  // only callable after initialization.
1409  DCHECK(depth_ >= 1);
1410  return depth_;
1411  }

References DCHECK, and depth_.

Referenced by BuildConstants(), and set_depth().

+ Here is the caller graph for this function:

◆ GetBoilerplateValue()

Handle< Object > v8::internal::MaterializedLiteral::GetBoilerplateValue ( Expression expression,
Isolate isolate 
)
protected

Definition at line 384 of file ast.cc.

385  {
386  if (expression->IsLiteral()) {
387  return expression->AsLiteral()->value();
388  }
389  if (CompileTimeValue::IsCompileTimeValue(expression)) {
390  return CompileTimeValue::GetValue(isolate, expression);
391  }
392  return isolate->factory()->uninitialized_value();
393 }
static bool IsCompileTimeValue(Expression *expression)
Definition: parser.cc:3331
static Handle< FixedArray > GetValue(Isolate *isolate, Expression *expression)
Definition: parser.cc:3338

References v8::internal::Isolate::factory(), v8::internal::CompileTimeValue::GetValue(), and v8::internal::CompileTimeValue::IsCompileTimeValue().

+ Here is the call graph for this function:

◆ is_simple()

bool v8::internal::MaterializedLiteral::is_simple ( ) const
inlineprotected

Definition at line 1422 of file ast.h.

1422 { return is_simple_; }

References is_simple_.

Referenced by v8::internal::CompileTimeValue::IsCompileTimeValue(), and set_is_simple().

+ Here is the caller graph for this function:

◆ literal_index()

int v8::internal::MaterializedLiteral::literal_index ( )
inline

Definition at line 1405 of file ast.h.

1405 { return literal_index_; }

References literal_index_.

◆ set_depth()

void v8::internal::MaterializedLiteral::set_depth ( int  depth)
inlineprotected

Definition at line 1426 of file ast.h.

1426  {
1427  DCHECK(depth >= 1);
1428  depth_ = depth;
1429  }

References DCHECK, depth(), and depth_.

+ Here is the call graph for this function:

◆ set_is_simple()

void v8::internal::MaterializedLiteral::set_is_simple ( bool  is_simple)
inlineprotected

Definition at line 1423 of file ast.h.

1423 { is_simple_ = is_simple; }

References is_simple(), and is_simple_.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ ArrayLiteral

friend class ArrayLiteral
friend

Definition at line 1433 of file ast.h.

◆ CompileTimeValue

friend class CompileTimeValue
friend

Definition at line 1424 of file ast.h.

◆ ObjectLiteral

friend class ObjectLiteral
friend

Definition at line 1434 of file ast.h.

Member Data Documentation

◆ depth_

int v8::internal::MaterializedLiteral::depth_
private

Definition at line 1446 of file ast.h.

Referenced by depth(), and set_depth().

◆ is_simple_

bool v8::internal::MaterializedLiteral::is_simple_
private

Definition at line 1445 of file ast.h.

Referenced by is_simple(), and set_is_simple().

◆ literal_index_

int v8::internal::MaterializedLiteral::literal_index_
private

Definition at line 1444 of file ast.h.

Referenced by literal_index().


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