| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 4285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4296 } | 4296 } |
| 4297 | 4297 |
| 4298 FlowGraph* graph = | 4298 FlowGraph* graph = |
| 4299 new(I) FlowGraph(parsed_function(), graph_entry_, last_used_block_id_); | 4299 new(I) FlowGraph(parsed_function(), graph_entry_, last_used_block_id_); |
| 4300 return graph; | 4300 return graph; |
| 4301 } | 4301 } |
| 4302 | 4302 |
| 4303 | 4303 |
| 4304 void FlowGraphBuilder::PruneUnreachable() { | 4304 void FlowGraphBuilder::PruneUnreachable() { |
| 4305 ASSERT(osr_id_ != Isolate::kNoDeoptId); | 4305 ASSERT(osr_id_ != Isolate::kNoDeoptId); |
| 4306 BitVector* block_marks = new(I) BitVector(I, last_used_block_id_ + 1); | 4306 Zone* zone = parsed_function()->zone(); |
| 4307 BitVector* block_marks = new(zone) BitVector(zone, last_used_block_id_ + 1); |
| 4307 bool found = graph_entry_->PruneUnreachable(this, graph_entry_, NULL, osr_id_, | 4308 bool found = graph_entry_->PruneUnreachable(this, graph_entry_, NULL, osr_id_, |
| 4308 block_marks); | 4309 block_marks); |
| 4309 ASSERT(found); | 4310 ASSERT(found); |
| 4310 } | 4311 } |
| 4311 | 4312 |
| 4312 | 4313 |
| 4313 void FlowGraphBuilder::Bailout(const char* reason) const { | 4314 void FlowGraphBuilder::Bailout(const char* reason) const { |
| 4314 const Function& function = parsed_function_->function(); | 4315 const Function& function = parsed_function_->function(); |
| 4315 Report::MessageF(Report::kBailout, | 4316 Report::MessageF(Report::kBailout, |
| 4316 Script::Handle(function.script()), | 4317 Script::Handle(function.script()), |
| 4317 function.token_pos(), | 4318 function.token_pos(), |
| 4318 "FlowGraphBuilder Bailout: %s %s", | 4319 "FlowGraphBuilder Bailout: %s %s", |
| 4319 String::Handle(function.name()).ToCString(), | 4320 String::Handle(function.name()).ToCString(), |
| 4320 reason); | 4321 reason); |
| 4321 UNREACHABLE(); | 4322 UNREACHABLE(); |
| 4322 } | 4323 } |
| 4323 | 4324 |
| 4324 } // namespace dart | 4325 } // namespace dart |
| OLD | NEW |