V8 Project
v8::internal::compiler::CopyVisitor Class Reference
+ Inheritance diagram for v8::internal::compiler::CopyVisitor:
+ Collaboration diagram for v8::internal::compiler::CopyVisitor:

Public Member Functions

 CopyVisitor (Graph *source_graph, Graph *target_graph, Zone *temp_zone)
 
GenericGraphVisit::Control Post (Node *original)
 
Node * GetCopy (Node *original)
 
void CopyGraph ()
 
const NodeVectorcopies ()
 
- Public Member Functions inherited from v8::internal::compiler::GenericGraphVisit::NullNodeVisitor< B, S >
Control Pre (GenericNode< B, S > *node)
 
Control Post (GenericNode< B, S > *node)
 
void PreEdge (GenericNode< B, S > *from, int index, GenericNode< B, S > *to)
 
void PostEdge (GenericNode< B, S > *from, int index, GenericNode< B, S > *to)
 

Private Member Functions

void ReplaceSentinels ()
 
Node * GetSentinel (Node *original)
 

Private Attributes

NodeVector copies_
 
NodeVector sentinels_
 
Graphsource_graph_
 
Graphtarget_graph_
 
Zonetemp_zone_
 
SimpleOperator sentinel_op_
 

Detailed Description

Definition at line 162 of file js-inlining.cc.

Constructor & Destructor Documentation

◆ CopyVisitor()

v8::internal::compiler::CopyVisitor::CopyVisitor ( Graph source_graph,
Graph target_graph,
Zone temp_zone 
)
inline

Definition at line 164 of file js-inlining.cc.

165  : copies_(source_graph->NodeCount(), NULL, temp_zone),
166  sentinels_(source_graph->NodeCount(), NULL, temp_zone),
167  source_graph_(source_graph),
168  target_graph_(target_graph),
169  temp_zone_(temp_zone),
170  sentinel_op_(IrOpcode::kDead, Operator::kNoProperties, 0, 0,
171  "sentinel") {}
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

Member Function Documentation

◆ copies()

const NodeVector& v8::internal::compiler::CopyVisitor::copies ( )
inline

Definition at line 203 of file js-inlining.cc.

203 { return copies_; }

References copies_.

Referenced by v8::internal::compiler::JSInliner::TryInlineCall().

+ Here is the caller graph for this function:

◆ CopyGraph()

void v8::internal::compiler::CopyVisitor::CopyGraph ( )
inline

Definition at line 198 of file js-inlining.cc.

198  {
201  }
void VisitNodeInputsFromEnd(Visitor *visitor)
Definition: graph-inl.h:30

References ReplaceSentinels(), source_graph_, and v8::internal::compiler::Graph::VisitNodeInputsFromEnd().

Referenced by v8::internal::compiler::JSInliner::TryInlineCall().

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

◆ GetCopy()

Node* v8::internal::compiler::CopyVisitor::GetCopy ( Node *  original)
inline

Definition at line 189 of file js-inlining.cc.

189  {
190  Node* copy = copies_[original->id()];
191  if (copy == NULL) {
192  copy = GetSentinel(original);
193  }
194  DCHECK_NE(NULL, copy);
195  return copy;
196  }
Node * GetSentinel(Node *original)
Definition: js-inlining.cc:216
#define DCHECK_NE(v1, v2)
Definition: logging.h:207

References copies_, DCHECK_NE, GetSentinel(), and NULL.

Referenced by Post(), and v8::internal::compiler::JSInliner::TryInlineCall().

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

◆ GetSentinel()

Node* v8::internal::compiler::CopyVisitor::GetSentinel ( Node *  original)
inlineprivate

Definition at line 216 of file js-inlining.cc.

216  {
217  Node* sentinel = sentinels_[original->id()];
218  if (sentinel == NULL) {
219  sentinel = target_graph_->NewNode(&sentinel_op_);
220  }
221  return sentinel;
222  }
Node * NewNode(const Operator *op, int input_count, Node **inputs)
Definition: graph.cc:24

References v8::internal::compiler::Graph::NewNode(), NULL, sentinel_op_, sentinels_, and target_graph_.

Referenced by GetCopy().

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

◆ Post()

GenericGraphVisit::Control v8::internal::compiler::CopyVisitor::Post ( Node *  original)
inline

Definition at line 173 of file js-inlining.cc.

173  {
174  NodeVector inputs(temp_zone_);
175  for (InputIter it = original->inputs().begin();
176  it != original->inputs().end(); ++it) {
177  inputs.push_back(GetCopy(*it));
178  }
179 
180  // Reuse the operator in the copy. This assumes that op lives in a zone
181  // that lives longer than graph()'s zone.
182  Node* copy =
183  target_graph_->NewNode(original->op(), static_cast<int>(inputs.size()),
184  (inputs.empty() ? NULL : &inputs.front()));
185  copies_[original->id()] = copy;
187  }
Node * GetCopy(Node *original)
Definition: js-inlining.cc:189
ZoneVector< Node * > NodeVector
Definition: node.h:72
Node::Inputs::iterator InputIter
Definition: node.h:82

References v8::internal::compiler::GenericGraphVisit::CONTINUE, copies_, GetCopy(), v8::internal::compiler::Graph::NewNode(), NULL, target_graph_, and temp_zone_.

+ Here is the call graph for this function:

◆ ReplaceSentinels()

void v8::internal::compiler::CopyVisitor::ReplaceSentinels ( )
inlineprivate

Definition at line 206 of file js-inlining.cc.

206  {
207  for (NodeId id = 0; id < source_graph_->NodeCount(); ++id) {
208  Node* sentinel = sentinels_[id];
209  if (sentinel == NULL) continue;
210  Node* copy = copies_[id];
211  DCHECK_NE(NULL, copy);
212  sentinel->ReplaceUses(copy);
213  }
214  }

References copies_, DCHECK_NE, v8::internal::compiler::GenericGraphBase::NodeCount(), NULL, sentinels_, and source_graph_.

Referenced by CopyGraph().

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

Member Data Documentation

◆ copies_

NodeVector v8::internal::compiler::CopyVisitor::copies_
private

Definition at line 224 of file js-inlining.cc.

Referenced by copies(), GetCopy(), Post(), and ReplaceSentinels().

◆ sentinel_op_

SimpleOperator v8::internal::compiler::CopyVisitor::sentinel_op_
private

Definition at line 229 of file js-inlining.cc.

Referenced by GetSentinel().

◆ sentinels_

NodeVector v8::internal::compiler::CopyVisitor::sentinels_
private

Definition at line 225 of file js-inlining.cc.

Referenced by GetSentinel(), and ReplaceSentinels().

◆ source_graph_

Graph* v8::internal::compiler::CopyVisitor::source_graph_
private

Definition at line 226 of file js-inlining.cc.

Referenced by CopyGraph(), and ReplaceSentinels().

◆ target_graph_

Graph* v8::internal::compiler::CopyVisitor::target_graph_
private

Definition at line 227 of file js-inlining.cc.

Referenced by GetSentinel(), and Post().

◆ temp_zone_

Zone* v8::internal::compiler::CopyVisitor::temp_zone_
private

Definition at line 228 of file js-inlining.cc.

Referenced by Post().


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