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

#include <node-matchers.h>

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

Public Member Functions

 ScaleFactorMatcher (Node *node)
 
bool Matches ()
 
int Power ()
 
Node * Left ()
 
- 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 * left_
 
int power_
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ScaleFactorMatcher()

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

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

149  : NodeMatcher(node), left_(NULL), power_(0) {
150  Match();
151  }
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

References Match().

+ Here is the call graph for this function:

Member Function Documentation

◆ Left()

Node* v8::internal::compiler::ScaleFactorMatcher::Left ( )
inline

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

158  {
159  DCHECK(Matches());
160  return left_;
161  }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, left_, and Matches().

Referenced by v8::internal::compiler::IndexAndDisplacementMatcher::Match().

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

◆ Match()

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

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

164  {
165  if (opcode() != IrOpcode::kInt32Mul) return;
166  Int32BinopMatcher m(node());
167  if (!m.right().HasValue()) return;
168  int32_t value = m.right().Value();
169  switch (value) {
170  case 8:
171  power_++; // Fall through.
172  case 4:
173  power_++; // Fall through.
174  case 2:
175  power_++; // Fall through.
176  case 1:
177  break;
178  default:
179  return;
180  }
181  left_ = m.left().node();
182  }
int int32_t
Definition: unicode.cc:24
BinopMatcher< Int32Matcher, Int32Matcher > Int32BinopMatcher
IrOpcode::Value opcode() const
Definition: node-matchers.h:21

References left_, v8::internal::compiler::NodeMatcher::node(), v8::internal::compiler::NodeMatcher::opcode(), and power_.

Referenced by ScaleFactorMatcher().

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

◆ Matches()

bool v8::internal::compiler::ScaleFactorMatcher::Matches ( )
inline

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

153 { return left_ != NULL; }

References left_, and NULL.

Referenced by Left(), v8::internal::compiler::IndexAndDisplacementMatcher::Match(), and Power().

+ Here is the caller graph for this function:

◆ Power()

int v8::internal::compiler::ScaleFactorMatcher::Power ( )
inline

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

154  {
155  DCHECK(Matches());
156  return power_;
157  }

References DCHECK, Matches(), and power_.

Referenced by v8::internal::compiler::IndexAndDisplacementMatcher::Match().

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

Member Data Documentation

◆ left_

Node* v8::internal::compiler::ScaleFactorMatcher::left_
private

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

Referenced by Left(), Match(), and Matches().

◆ power_

int v8::internal::compiler::ScaleFactorMatcher::power_
private

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

Referenced by Match(), and Power().


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