| 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 if (lowering_->source_positions_ != NULL) { | |
| 20 SourcePositionTable::Scope pos(lowering_->source_positions_, node); | |
| 21 lowering_->Lower(node); | |
| 22 } else { | |
| 23 lowering_->Lower(node); | |
| 24 } | |
| 25 return GenericGraphVisit::CONTINUE; | |
| 26 } | |
| 27 | |
| 28 private: | |
| 29 LoweringBuilder* lowering_; | |
| 30 }; | |
| 31 | |
| 32 | |
| 33 LoweringBuilder::LoweringBuilder(Graph* graph, | |
| 34 SourcePositionTable* source_positions) | |
| 35 : graph_(graph), source_positions_(source_positions) {} | |
| 36 | |
| 37 | |
| 38 void LoweringBuilder::LowerAllNodes() { | |
| 39 NodeVisitor visitor(this); | |
| 40 graph()->VisitNodeInputsFromEnd(&visitor); | |
| 41 } | |
| 42 | |
| 43 } // namespace compiler | |
| 44 } // namespace internal | |
| 45 } // namespace v8 | |
| OLD | NEW |