V8 Project
v8::internal::compiler::Operator Class Referenceabstract

#include <operator.h>

+ Inheritance diagram for v8::internal::compiler::Operator:
+ Collaboration diagram for v8::internal::compiler::Operator:

Public Types

enum  Property {
  kNoProperties = 0 , kReducible = 1 << 0 , kCommutative = 1 << 1 , kAssociative = 1 << 2 ,
  kIdempotent = 1 << 3 , kNoRead = 1 << 4 , kNoWrite = 1 << 5 , kNoThrow = 1 << 6 ,
  kFoldable = kNoRead | kNoWrite , kEliminatable = kNoWrite | kNoThrow , kPure = kNoRead | kNoWrite | kNoThrow | kIdempotent
}
 
typedef uint8_t Opcode
 
typedef base::Flags< Property, uint8_t > Properties
 

Public Member Functions

 Operator (Opcode opcode, Properties properties, const char *mnemonic)
 
virtual ~Operator ()
 
Opcode opcode () const
 
const char * mnemonic () const
 
virtual bool Equals (const Operator *other) const =0
 
virtual int HashCode () const =0
 
bool HasProperty (Property property) const
 
virtual int InputCount () const =0
 
virtual int OutputCount () const =0
 
Properties properties () const
 
- 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

virtual OStreamPrintTo (OStream &os) const =0
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (Operator)
 

Private Attributes

Opcode opcode_
 
Properties properties_
 
const char * mnemonic_
 

Friends

OStreamoperator<< (OStream &os, const Operator &op)
 

Detailed Description

Definition at line 28 of file operator.h.

Member Typedef Documentation

◆ Opcode

Definition at line 30 of file operator.h.

◆ Properties

Definition at line 48 of file operator.h.

Member Enumeration Documentation

◆ Property

Enumerator
kNoProperties 
kReducible 
kCommutative 
kAssociative 
kIdempotent 
kNoRead 
kNoWrite 
kNoThrow 
kFoldable 
kEliminatable 
kPure 

Definition at line 34 of file operator.h.

34  {
35  kNoProperties = 0,
36  kReducible = 1 << 0, // Participates in strength reduction.
37  kCommutative = 1 << 1, // OP(a, b) == OP(b, a) for all inputs.
38  kAssociative = 1 << 2, // OP(a, OP(b,c)) == OP(OP(a,b), c) for all inputs.
39  kIdempotent = 1 << 3, // OP(a); OP(a) == OP(a).
40  kNoRead = 1 << 4, // Has no scheduling dependency on Effects
41  kNoWrite = 1 << 5, // Does not modify any Effects and thereby
42  // create new scheduling dependencies.
43  kNoThrow = 1 << 6, // Can never generate an exception.
47  };

Constructor & Destructor Documentation

◆ Operator()

v8::internal::compiler::Operator::Operator ( Opcode  opcode,
Properties  properties,
const char *  mnemonic 
)
inline

Definition at line 50 of file operator.h.

◆ ~Operator()

v8::internal::compiler::Operator::~Operator ( )
virtual

Definition at line 11 of file operator.cc.

11 {}

Member Function Documentation

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::compiler::Operator::DISALLOW_COPY_AND_ASSIGN ( Operator  )
private

◆ Equals()

virtual bool v8::internal::compiler::Operator::Equals ( const Operator other) const
pure virtual

◆ HashCode()

virtual int v8::internal::compiler::Operator::HashCode ( ) const
pure virtual

◆ HasProperty()

bool v8::internal::compiler::Operator::HasProperty ( Property  property) const
inline

Definition at line 74 of file operator.h.

74  {
75  return (properties() & property) == property;
76  }

References properties().

Referenced by v8::internal::compiler::OperatorProperties::GetControlInputCount(), v8::internal::compiler::OperatorProperties::GetEffectInputCount(), and v8::internal::compiler::NodeMatcher::HasProperty().

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

◆ InputCount()

virtual int v8::internal::compiler::Operator::InputCount ( ) const
pure virtual

Implemented in v8::internal::compiler::Operator1< T >, v8::internal::compiler::Operator1< int >, and v8::internal::compiler::SimpleOperator.

Referenced by v8::internal::compiler::OperatorProperties::GetValueInputCount(), v8::internal::compiler::StructuredGraphBuilder::MakeNode(), and v8::internal::compiler::Graph::NewNode().

+ Here is the caller graph for this function:

◆ mnemonic()

const char* v8::internal::compiler::Operator::mnemonic ( ) const
inline

Definition at line 61 of file operator.h.

61 { return mnemonic_; }

References mnemonic_.

Referenced by v8::internal::compiler::SimpleOperator::PrintTo(), and v8::internal::compiler::Operator1< T >::PrintTo().

+ Here is the caller graph for this function:

◆ opcode()

◆ OutputCount()

virtual int v8::internal::compiler::Operator::OutputCount ( ) const
pure virtual

Implemented in v8::internal::compiler::Operator1< T >, v8::internal::compiler::Operator1< int >, and v8::internal::compiler::SimpleOperator.

Referenced by v8::internal::compiler::OperatorProperties::GetValueOutputCount().

+ Here is the caller graph for this function:

◆ PrintTo()

virtual OStream& v8::internal::compiler::Operator::PrintTo ( OStream os) const
protectedpure virtual

◆ properties()

Properties v8::internal::compiler::Operator::properties ( ) const
inline

Definition at line 84 of file operator.h.

84 { return properties_; }

References properties_.

Referenced by HasProperty(), and v8::internal::compiler::TEST_P().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

OStream& operator<< ( OStream os,
const Operator op 
)
friend

Definition at line 45 of file node.cc.

45 { return op.PrintTo(os); }

Member Data Documentation

◆ mnemonic_

const char* v8::internal::compiler::Operator::mnemonic_
private

Definition at line 96 of file operator.h.

Referenced by mnemonic().

◆ opcode_

Opcode v8::internal::compiler::Operator::opcode_
private

Definition at line 94 of file operator.h.

Referenced by opcode().

◆ properties_

Properties v8::internal::compiler::Operator::properties_
private

Definition at line 95 of file operator.h.

Referenced by properties().


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