V8 Project
v8::internal::Expression Class Reference

#include <ast.h>

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

Public Types

enum  Context { kUninitialized , kEffect , kValue , kTest }
 
- Public Types inherited from v8::internal::AstNode
enum  NodeType { kInvalid = -1 }
 

Public Member Functions

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 ()
 
virtual MaterializedLiteralAsMaterializedLiteral ()
 
- 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

 Expression (Zone *zone, int pos, IdGen *id_gen)
 
void set_to_boolean_types (byte types)
 

Private Attributes

Bounds bounds_
 
byte to_boolean_types_
 
unsigned parenthesization_level_
 
const BailoutId id_
 
const TypeFeedbackId test_id_
 

Additional Inherited Members

- Static Protected Member Functions inherited from v8::internal::AstNode
static TypeFeedbackId reuse (BailoutId id)
 

Detailed Description

Definition at line 311 of file ast.h.

Member Enumeration Documentation

◆ Context

Enumerator
kUninitialized 
kEffect 
kValue 
kTest 

Definition at line 313 of file ast.h.

313  {
314  // Not assigned a context yet, or else will not be visited during
315  // code generation.
317  // Evaluated for its side effects.
318  kEffect,
319  // Evaluated for its value (and side effects).
320  kValue,
321  // Evaluated for control flow (and side effects).
322  kTest
323  };

Constructor & Destructor Documentation

◆ Expression()

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

Definition at line 383 of file ast.h.

384  : AstNode(pos),
385  bounds_(Bounds::Unbounded(zone)),
387  id_(id_gen->GetNextId()),
388  test_id_(id_gen->GetNextId()) {}
AstNode(int position)
Definition: ast.h:213
unsigned parenthesization_level_
Definition: ast.h:394
const BailoutId id_
Definition: ast.h:396
const TypeFeedbackId test_id_
Definition: ast.h:397
static BoundsImpl Unbounded(Region *region)
Definition: types.h:1010

Member Function Documentation

◆ bounds()

Bounds v8::internal::Expression::bounds ( ) const
inline

Definition at line 353 of file ast.h.

353 { return bounds_; }

References bounds_.

Referenced by v8::internal::AstTyper::NarrowLowerType(), v8::internal::AstTyper::NarrowType(), and set_bounds().

+ Here is the caller graph for this function:

◆ GetReceiverTypes()

virtual SmallMapList* v8::internal::Expression::GetReceiverTypes ( )
inlinevirtual

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 366 of file ast.h.

366  {
367  UNREACHABLE();
368  return NULL;
369  }
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define UNREACHABLE()
Definition: logging.h:30

References NULL, and UNREACHABLE.

Referenced by v8::internal::ComputeReceiverTypes().

+ Here is the caller graph for this function:

◆ GetStoreMode()

virtual KeyedAccessStoreMode v8::internal::Expression::GetStoreMode ( )
inlinevirtual

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 370 of file ast.h.

370  {
371  UNREACHABLE();
372  return STANDARD_STORE;
373  }
@ STANDARD_STORE
Definition: objects.h:154

References v8::internal::STANDARD_STORE, and UNREACHABLE.

Referenced by v8::internal::HOptimizedGraphBuilder::HandleKeyedElementAccess().

+ Here is the caller graph for this function:

◆ id()

BailoutId v8::internal::Expression::id ( ) const
inline

Definition at line 379 of file ast.h.

379 { return id_; }

References id_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildArrayCall(), and v8::internal::FullCodeGenerator::PrepareForBailout().

+ Here is the caller graph for this function:

◆ increase_parenthesization_level()

void v8::internal::Expression::increase_parenthesization_level ( )
inline

Definition at line 359 of file ast.h.

References parenthesization_level_.

◆ is_parenthesized()

bool v8::internal::Expression::is_parenthesized ( ) const
inline

Definition at line 358 of file ast.h.

358 { return parenthesization_level_ > 0; }

References parenthesization_level_.

◆ IsMonomorphic()

virtual bool v8::internal::Expression::IsMonomorphic ( )
inlinevirtual

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 362 of file ast.h.

362  {
363  UNREACHABLE();
364  return false;
365  }

References UNREACHABLE.

Referenced by v8::internal::ComputeReceiverTypes().

+ Here is the caller graph for this function:

◆ IsNullLiteral()

bool v8::internal::Expression::IsNullLiteral ( ) const

Definition at line 46 of file ast.cc.

46  {
47  return IsLiteral() && AsLiteral()->value()->IsNull();
48 }

Referenced by v8::internal::MatchLiteralCompareNull().

+ Here is the caller graph for this function:

◆ IsPropertyName()

virtual bool v8::internal::Expression::IsPropertyName ( ) const
inlinevirtual

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 334 of file ast.h.

334 { return false; }

Referenced by v8::internal::HOptimizedGraphBuilder::HandleKeyedElementAccess(), and v8::internal::ParserTraits::PushPropertyName().

+ Here is the caller graph for this function:

◆ IsSmiLiteral()

bool v8::internal::Expression::IsSmiLiteral ( ) const

Definition at line 36 of file ast.cc.

36  {
37  return IsLiteral() && AsLiteral()->value()->IsSmi();
38 }

◆ IsStringLiteral()

bool v8::internal::Expression::IsStringLiteral ( ) const

Definition at line 41 of file ast.cc.

41  {
42  return IsLiteral() && AsLiteral()->value()->IsString();
43 }

Referenced by v8::internal::MatchLiteralCompareTypeof().

+ Here is the caller graph for this function:

◆ IsUndefinedLiteral()

bool v8::internal::Expression::IsUndefinedLiteral ( Isolate isolate) const

Definition at line 51 of file ast.cc.

51  {
52  const VariableProxy* var_proxy = AsVariableProxy();
53  if (var_proxy == NULL) return false;
54  Variable* var = var_proxy->var();
55  // The global identifier "undefined" is immutable. Everything
56  // else could be reassigned.
57  return var != NULL && var->location() == Variable::UNALLOCATED &&
58  var_proxy->raw_name()->IsOneByteEqualTo("undefined");
59 }

References v8::internal::Variable::location(), NULL, and v8::internal::Variable::UNALLOCATED.

Referenced by v8::internal::MatchLiteralCompareUndefined().

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

◆ IsValidReferenceExpression()

virtual bool v8::internal::Expression::IsValidReferenceExpression ( ) const
inlinevirtual

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 325 of file ast.h.

325 { return false; }

Referenced by v8::internal::compiler::DetermineLhsKind(), and v8::internal::compiler::AstGraphBuilder::VisitForInAssignment().

+ Here is the caller graph for this function:

◆ parenthesization_level()

unsigned v8::internal::Expression::parenthesization_level ( ) const
inline

Definition at line 357 of file ast.h.

357 { return parenthesization_level_; }

References parenthesization_level_.

Referenced by v8::internal::CheckAndDeclareArrowParameter().

+ Here is the caller graph for this function:

◆ RecordToBooleanTypeFeedback()

void v8::internal::Expression::RecordToBooleanTypeFeedback ( TypeFeedbackOracle oracle)
virtual

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >, and v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 562 of file ast.cc.

562  {
563  to_boolean_types_ = oracle->ToBooleanTypes(test_id());
564 }
TypeFeedbackId test_id() const
Definition: ast.h:380

References test_id(), to_boolean_types_, and v8::internal::TypeFeedbackOracle::ToBooleanTypes().

+ Here is the call graph for this function:

◆ ResultOverwriteAllowed()

virtual bool v8::internal::Expression::ResultOverwriteAllowed ( ) const
inlinevirtual

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 338 of file ast.h.

338 { return false; }

Referenced by v8::internal::FullCodeGenerator::VisitArithmeticExpression().

+ Here is the caller graph for this function:

◆ set_bounds()

void v8::internal::Expression::set_bounds ( Bounds  bounds)
inline

Definition at line 354 of file ast.h.

354 { bounds_ = bounds; }
Bounds bounds() const
Definition: ast.h:353

References bounds(), and bounds_.

Referenced by v8::internal::AstTyper::NarrowLowerType(), and v8::internal::AstTyper::NarrowType().

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

◆ set_to_boolean_types()

void v8::internal::Expression::set_to_boolean_types ( byte  types)
inlineprotected

Definition at line 389 of file ast.h.

389 { to_boolean_types_ = types; }

References to_boolean_types_.

◆ test_id()

TypeFeedbackId v8::internal::Expression::test_id ( ) const
inline

Definition at line 380 of file ast.h.

380 { return test_id_; }

References test_id_.

Referenced by RecordToBooleanTypeFeedback().

+ Here is the caller graph for this function:

◆ to_boolean_types()

byte v8::internal::Expression::to_boolean_types ( ) const
inline

Definition at line 377 of file ast.h.

377 { return to_boolean_types_; }

References to_boolean_types_.

◆ ToBooleanIsFalse()

virtual bool v8::internal::Expression::ToBooleanIsFalse ( ) const
inlinevirtual

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 329 of file ast.h.

329 { return false; }

◆ ToBooleanIsTrue()

virtual bool v8::internal::Expression::ToBooleanIsTrue ( ) const
inlinevirtual

Reimplemented in v8::internal::FINAL< kOperandKind, kNumCachedOperands >.

Definition at line 328 of file ast.h.

328 { return false; }

Member Data Documentation

◆ bounds_

Bounds v8::internal::Expression::bounds_
private

Definition at line 392 of file ast.h.

Referenced by bounds(), and set_bounds().

◆ id_

const BailoutId v8::internal::Expression::id_
private

Definition at line 396 of file ast.h.

Referenced by id().

◆ parenthesization_level_

unsigned v8::internal::Expression::parenthesization_level_
private

◆ test_id_

const TypeFeedbackId v8::internal::Expression::test_id_
private

Definition at line 397 of file ast.h.

Referenced by test_id().

◆ to_boolean_types_

byte v8::internal::Expression::to_boolean_types_
private

Definition at line 393 of file ast.h.

Referenced by RecordToBooleanTypeFeedback(), set_to_boolean_types(), and to_boolean_types().


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