OLD | NEW |
---|---|
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 <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/base/platform/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
10 #include "src/compiler/ast-graph-builder.h" | 10 #include "src/compiler/ast-graph-builder.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 SourcePositionTable* source_positions) | 138 SourcePositionTable* source_positions) |
139 : AstGraphBuilder(info, jsgraph), source_positions_(source_positions) {} | 139 : AstGraphBuilder(info, jsgraph), source_positions_(source_positions) {} |
140 | 140 |
141 bool CreateGraph() { | 141 bool CreateGraph() { |
142 SourcePositionTable::Scope pos(source_positions_, | 142 SourcePositionTable::Scope pos(source_positions_, |
143 SourcePosition::Unknown()); | 143 SourcePosition::Unknown()); |
144 return AstGraphBuilder::CreateGraph(); | 144 return AstGraphBuilder::CreateGraph(); |
145 } | 145 } |
146 | 146 |
147 #define DEF_VISIT(type) \ | 147 #define DEF_VISIT(type) \ |
148 virtual void Visit##type(type* node) OVERRIDE { \ | 148 virtual void Visit##type(type* node) OVERRIDE { \ |
149 SourcePositionTable::Scope pos(source_positions_, \ | 149 SourcePositionTable::Scope pos(source_positions_, \ |
150 SourcePosition(node->position())); \ | 150 SourcePosition(node->position())); \ |
151 AstGraphBuilder::Visit##type(node); \ | 151 AstGraphBuilder::Visit##type(node); \ |
152 } | 152 } |
153 AST_NODE_LIST(DEF_VISIT) | 153 AST_NODE_LIST(DEF_VISIT) |
154 #undef DEF_VISIT | 154 #undef DEF_VISIT |
155 | 155 |
156 private: | 156 private: |
157 SourcePositionTable* source_positions_; | 157 SourcePositionTable* source_positions_; |
158 }; | 158 }; |
159 | 159 |
160 | 160 |
161 static void TraceSchedule(Schedule* schedule) { | 161 static void TraceSchedule(Schedule* schedule) { |
162 if (!FLAG_trace_turbo) return; | 162 if (!FLAG_trace_turbo) return; |
163 OFStream os(stdout); | 163 OFStream os(stdout); |
164 os << "-- Schedule --------------------------------------\n" << *schedule; | 164 os << "-- Schedule --------------------------------------\n" << *schedule; |
165 } | 165 } |
166 | 166 |
167 | 167 |
168 Handle<Code> Pipeline::GenerateCode() { | 168 Handle<Code> Pipeline::GenerateCode() { |
169 if (info()->function()->dont_optimize_reason() == kTryCatchStatement || | 169 if (info()->function()->dont_optimize_reason() == kTryCatchStatement || |
170 info()->function()->dont_optimize_reason() == kTryFinallyStatement || | 170 info()->function()->dont_optimize_reason() == kTryFinallyStatement || |
171 // TODO(turbofan): Make ES6 for-of work and remove this bailout. | 171 // TODO(turbofan): Make ES6 for-of work and remove this bailout. |
172 info()->function()->dont_optimize_reason() == kForOfStatement || | 172 info()->function()->dont_optimize_reason() == kForOfStatement || |
173 // TODO(turbofan): Make super work and remove this bailout. | 173 // TODO(turbofan): Make super work and remove this bailout. |
174 info()->function()->dont_optimize_reason() == kSuperReference || | 174 info()->function()->dont_optimize_reason() == kSuperReference || |
175 // TODO(turbofan): Make ES6 classes work and remove this bailout. | |
176 info()->function()->dont_optimize_reason() == kClassLiteral || | |
arv (Not doing code reviews)
2014/10/03 21:19:59
Why isn't this sufficient?
| |
175 // TODO(turbofan): Make OSR work and remove this bailout. | 177 // TODO(turbofan): Make OSR work and remove this bailout. |
176 info()->is_osr()) { | 178 info()->is_osr()) { |
177 return Handle<Code>::null(); | 179 return Handle<Code>::null(); |
178 } | 180 } |
179 | 181 |
180 if (FLAG_turbo_stats) isolate()->GetTStatistics()->Initialize(info_); | 182 if (FLAG_turbo_stats) isolate()->GetTStatistics()->Initialize(info_); |
181 | 183 |
182 if (FLAG_trace_turbo) { | 184 if (FLAG_trace_turbo) { |
183 OFStream os(stdout); | 185 OFStream os(stdout); |
184 os << "---------------------------------------------------\n" | 186 os << "---------------------------------------------------\n" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
444 } | 446 } |
445 | 447 |
446 | 448 |
447 void Pipeline::TearDown() { | 449 void Pipeline::TearDown() { |
448 InstructionOperand::TearDownCaches(); | 450 InstructionOperand::TearDownCaches(); |
449 } | 451 } |
450 | 452 |
451 } // namespace compiler | 453 } // namespace compiler |
452 } // namespace internal | 454 } // namespace internal |
453 } // namespace v8 | 455 } // namespace v8 |
OLD | NEW |