V8 Project
v8::internal::compiler::IndexAndDisplacementMatcher Class Reference

#include <node-matchers.h>

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

Public Member Functions

 IndexAndDisplacementMatcher (Node *node)
 
Node * index_node ()
 
int displacement ()
 
int power ()
 
- Public Member Functions inherited from v8::internal::compiler::NodeMatcher
 NodeMatcher (Node *node)
 
Node * node () const
 
const Operatorop () const
 
IrOpcode::Value opcode () const
 
bool HasProperty (Operator::Property property) const
 
Node * InputAt (int index) const
 

Private Member Functions

void Match ()
 

Private Attributes

Node * index_node_
 
int displacement_
 
int power_
 

Detailed Description

Definition at line 197 of file node-matchers.h.

Constructor & Destructor Documentation

◆ IndexAndDisplacementMatcher()

v8::internal::compiler::IndexAndDisplacementMatcher::IndexAndDisplacementMatcher ( Node *  node)
inlineexplicit

Definition at line 199 of file node-matchers.h.

References Match().

+ Here is the call graph for this function:

Member Function Documentation

◆ displacement()

int v8::internal::compiler::IndexAndDisplacementMatcher::displacement ( )
inline

Definition at line 205 of file node-matchers.h.

205 { return displacement_; }

References displacement_.

Referenced by v8::internal::compiler::AddressingModeMatcher::AddressingModeMatcher().

+ Here is the caller graph for this function:

◆ index_node()

Node* v8::internal::compiler::IndexAndDisplacementMatcher::index_node ( )
inline

Definition at line 204 of file node-matchers.h.

204 { return index_node_; }

References index_node_.

Referenced by v8::internal::compiler::AddressingModeMatcher::AddressingModeMatcher().

+ Here is the caller graph for this function:

◆ Match()

void v8::internal::compiler::IndexAndDisplacementMatcher::Match ( )
inlineprivate

Definition at line 209 of file node-matchers.h.

209  {
210  if (opcode() == IrOpcode::kInt32Add) {
211  // Assume reduction has put constant on the right.
212  Int32BinopMatcher m(node());
213  if (m.right().HasValue()) {
214  displacement_ = m.right().Value();
215  index_node_ = m.left().node();
216  }
217  }
218  // Test scale factor.
219  ScaleFactorMatcher scale_matcher(index_node_);
220  if (scale_matcher.Matches()) {
221  index_node_ = scale_matcher.Left();
222  power_ = scale_matcher.Power();
223  }
224  }
BinopMatcher< Int32Matcher, Int32Matcher > Int32BinopMatcher
IrOpcode::Value opcode() const
Definition: node-matchers.h:21

References displacement_, index_node_, v8::internal::compiler::ScaleFactorMatcher::Left(), v8::internal::compiler::ScaleFactorMatcher::Matches(), v8::internal::compiler::NodeMatcher::node(), v8::internal::compiler::NodeMatcher::opcode(), v8::internal::compiler::ScaleFactorMatcher::Power(), and power_.

Referenced by IndexAndDisplacementMatcher().

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

◆ power()

int v8::internal::compiler::IndexAndDisplacementMatcher::power ( )
inline

Definition at line 206 of file node-matchers.h.

206 { return power_; }

References power_.

Referenced by v8::internal::compiler::AddressingModeMatcher::AddressingModeMatcher().

+ Here is the caller graph for this function:

Member Data Documentation

◆ displacement_

int v8::internal::compiler::IndexAndDisplacementMatcher::displacement_
private

Definition at line 227 of file node-matchers.h.

Referenced by displacement(), and Match().

◆ index_node_

Node* v8::internal::compiler::IndexAndDisplacementMatcher::index_node_
private

Definition at line 226 of file node-matchers.h.

Referenced by index_node(), and Match().

◆ power_

int v8::internal::compiler::IndexAndDisplacementMatcher::power_
private

Definition at line 228 of file node-matchers.h.

Referenced by Match(), and power().


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