OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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/graph-inl.h" |
| 6 #include "src/compiler/lowering-builder.h" |
| 7 #include "src/compiler/node-aux-data-inl.h" |
| 8 #include "src/compiler/node-properties-inl.h" |
| 9 |
| 10 namespace v8 { |
| 11 namespace internal { |
| 12 namespace compiler { |
| 13 |
| 14 class LoweringBuilder::NodeVisitor : public NullNodeVisitor { |
| 15 public: |
| 16 explicit NodeVisitor(LoweringBuilder* lowering) : lowering_(lowering) {} |
| 17 |
| 18 GenericGraphVisit::Control Post(Node* node) { |
| 19 SourcePositionTable::Scope pos(lowering_->source_positions_, node); |
| 20 lowering_->Lower(node); |
| 21 return GenericGraphVisit::CONTINUE; |
| 22 } |
| 23 |
| 24 private: |
| 25 LoweringBuilder* lowering_; |
| 26 }; |
| 27 |
| 28 |
| 29 LoweringBuilder::LoweringBuilder(Graph* graph, |
| 30 SourcePositionTable* source_positions) |
| 31 : graph_(graph), source_positions_(source_positions) {} |
| 32 |
| 33 |
| 34 void LoweringBuilder::LowerAllNodes() { |
| 35 NodeVisitor visitor(this); |
| 36 graph()->VisitNodeInputsFromEnd(&visitor); |
| 37 } |
| 38 |
| 39 } // namespace compiler |
| 40 } // namespace internal |
| 41 } // namespace v8 |
OLD | NEW |