V8 Project
schedule.cc
Go to the documentation of this file.
1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "src/compiler/node.h"
9 #include "src/ostreams.h"
10 
11 namespace v8 {
12 namespace internal {
13 namespace compiler {
14 
16  switch (c) {
18  return os << "none";
20  return os << "goto";
22  return os << "branch";
24  return os << "return";
26  return os << "throw";
27  }
28  UNREACHABLE();
29  return os;
30 }
31 
32 
34  // TODO(svenpanne) Const-correct the RPO stuff/iterators.
35  BasicBlockVector* rpo = const_cast<Schedule*>(&s)->rpo_order();
36  for (BasicBlockVectorIter i = rpo->begin(); i != rpo->end(); ++i) {
37  BasicBlock* block = *i;
38  os << "--- BLOCK B" << block->id();
39  if (block->PredecessorCount() != 0) os << " <- ";
40  BasicBlock::Predecessors predecessors = block->predecessors();
41  bool comma = false;
42  for (BasicBlock::Predecessors::iterator j = predecessors.begin();
43  j != predecessors.end(); ++j) {
44  if (comma) os << ", ";
45  comma = true;
46  os << "B" << (*j)->id();
47  }
48  os << " ---\n";
49  for (BasicBlock::const_iterator j = block->begin(); j != block->end();
50  ++j) {
51  Node* node = *j;
52  os << " " << *node;
53  if (!NodeProperties::IsControl(node)) {
54  Bounds bounds = NodeProperties::GetBounds(node);
55  os << " : ";
56  bounds.lower->PrintTo(os);
57  if (!bounds.upper->Is(bounds.lower)) {
58  os << "..";
59  bounds.upper->PrintTo(os);
60  }
61  }
62  os << "\n";
63  }
64  BasicBlock::Control control = block->control_;
65  if (control != BasicBlock::kNone) {
66  os << " ";
67  if (block->control_input_ != NULL) {
68  os << *block->control_input_;
69  } else {
70  os << "Goto";
71  }
72  os << " -> ";
73  BasicBlock::Successors successors = block->successors();
74  comma = false;
75  for (BasicBlock::Successors::iterator j = successors.begin();
76  j != successors.end(); ++j) {
77  if (comma) os << ", ";
78  comma = true;
79  os << "B" << (*j)->id();
80  }
81  os << "\n";
82  }
83  }
84  return os;
85 }
86 } // namespace compiler
87 } // namespace internal
88 } // namespace v8
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
std::ostream & operator<<(std::ostream &os, const MachineType &type)
BasicBlockVector::iterator BasicBlockVectorIter
Definition: schedule.h:150
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20