Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: src/compiler/pipeline.cc

Issue 448113002: Minor simplification and cleanup of graph builder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/graph-builder.cc ('k') | test/cctest/compiler/simplified-graph-builder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/pipeline.h" 5 #include "src/compiler/pipeline.h"
6 6
7 #include "src/base/platform/elapsed-timer.h" 7 #include "src/base/platform/elapsed-timer.h"
8 #include "src/compiler/ast-graph-builder.h" 8 #include "src/compiler/ast-graph-builder.h"
9 #include "src/compiler/code-generator.h" 9 #include "src/compiler/code-generator.h"
10 #include "src/compiler/graph-replay.h" 10 #include "src/compiler/graph-replay.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 << AsDOT(*graph); 78 << AsDOT(*graph);
79 } 79 }
80 if (VerifyGraphs()) Verifier::Run(graph); 80 if (VerifyGraphs()) Verifier::Run(graph);
81 } 81 }
82 82
83 83
84 class AstGraphBuilderWithPositions : public AstGraphBuilder { 84 class AstGraphBuilderWithPositions : public AstGraphBuilder {
85 public: 85 public:
86 explicit AstGraphBuilderWithPositions(CompilationInfo* info, JSGraph* jsgraph, 86 explicit AstGraphBuilderWithPositions(CompilationInfo* info, JSGraph* jsgraph,
87 SourcePositionTable* source_positions) 87 SourcePositionTable* source_positions)
88 : AstGraphBuilder(info, jsgraph, source_positions) {} 88 : AstGraphBuilder(info, jsgraph), source_positions_(source_positions) {}
89
90 bool CreateGraph() V8_OVERRIDE {
91 SourcePositionTable::Scope pos(source_positions_,
92 SourcePosition::Unknown());
93 return AstGraphBuilder::CreateGraph();
94 }
89 95
90 #define DEF_VISIT(type) \ 96 #define DEF_VISIT(type) \
91 virtual void Visit##type(type* node) V8_OVERRIDE { \ 97 virtual void Visit##type(type* node) V8_OVERRIDE { \
92 SourcePositionTable::Scope pos(source_positions(), \ 98 SourcePositionTable::Scope pos(source_positions_, \
93 SourcePosition(node->position())); \ 99 SourcePosition(node->position())); \
94 AstGraphBuilder::Visit##type(node); \ 100 AstGraphBuilder::Visit##type(node); \
95 } 101 }
96 AST_NODE_LIST(DEF_VISIT) 102 AST_NODE_LIST(DEF_VISIT)
97 #undef DEF_VISIT 103 #undef DEF_VISIT
104
105 private:
106 SourcePositionTable* source_positions_;
98 }; 107 };
99 108
100 109
101 static void TraceSchedule(Schedule* schedule) { 110 static void TraceSchedule(Schedule* schedule) {
102 if (!FLAG_trace_turbo) return; 111 if (!FLAG_trace_turbo) return;
103 OFStream os(stdout); 112 OFStream os(stdout);
104 os << "-- Schedule --------------------------------------\n" << *schedule; 113 os << "-- Schedule --------------------------------------\n" << *schedule;
105 } 114 }
106 115
107 116
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } 304 }
296 305
297 306
298 void Pipeline::TearDown() { 307 void Pipeline::TearDown() {
299 InstructionOperand::TearDownCaches(); 308 InstructionOperand::TearDownCaches();
300 } 309 }
301 310
302 } // namespace compiler 311 } // namespace compiler
303 } // namespace internal 312 } // namespace internal
304 } // namespace v8 313 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/graph-builder.cc ('k') | test/cctest/compiler/simplified-graph-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698