| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 if (case_targets_[i] == NULL) { | 229 if (case_targets_[i] == NULL) { |
| 230 case_targets_[i] = | 230 case_targets_[i] = |
| 231 new JoinEntryInstr(owner()->AllocateBlockId(), try_index()); | 231 new JoinEntryInstr(owner()->AllocateBlockId(), try_index()); |
| 232 } | 232 } |
| 233 return case_targets_[i]; | 233 return case_targets_[i]; |
| 234 } | 234 } |
| 235 return NULL; | 235 return NULL; |
| 236 } | 236 } |
| 237 | 237 |
| 238 | 238 |
| 239 FlowGraphBuilder::FlowGraphBuilder(ParsedFunction* parsed_function, | 239 FlowGraphBuilder::FlowGraphBuilder( |
| 240 const Array& ic_data_array, | 240 ParsedFunction* parsed_function, |
| 241 InlineExitCollector* exit_collector, | 241 const ZoneGrowableArray<const ICData*>& ic_data_array, |
| 242 intptr_t osr_id, | 242 InlineExitCollector* exit_collector, |
| 243 bool is_optimizing) | 243 intptr_t osr_id, |
| 244 : parsed_function_(parsed_function), | 244 bool is_optimizing) : |
| 245 ic_data_array_(ic_data_array), | 245 parsed_function_(parsed_function), |
| 246 num_copied_params_(parsed_function->num_copied_params()), | 246 ic_data_array_(ic_data_array), |
| 247 // All parameters are copied if any parameter is. | 247 num_copied_params_(parsed_function->num_copied_params()), |
| 248 num_non_copied_params_((num_copied_params_ == 0) | 248 // All parameters are copied if any parameter is. |
| 249 ? parsed_function->function().num_fixed_parameters() | 249 num_non_copied_params_((num_copied_params_ == 0) |
| 250 : 0), | 250 ? parsed_function->function().num_fixed_parameters() |
| 251 num_stack_locals_(parsed_function->num_stack_locals()), | 251 : 0), |
| 252 exit_collector_(exit_collector), | 252 num_stack_locals_(parsed_function->num_stack_locals()), |
| 253 guarded_fields_(new ZoneGrowableArray<const Field*>()), | 253 exit_collector_(exit_collector), |
| 254 last_used_block_id_(0), // 0 is used for the graph entry. | 254 guarded_fields_(new ZoneGrowableArray<const Field*>()), |
| 255 try_index_(CatchClauseNode::kInvalidTryIndex), | 255 last_used_block_id_(0), // 0 is used for the graph entry. |
| 256 catch_try_index_(CatchClauseNode::kInvalidTryIndex), | 256 try_index_(CatchClauseNode::kInvalidTryIndex), |
| 257 loop_depth_(0), | 257 catch_try_index_(CatchClauseNode::kInvalidTryIndex), |
| 258 graph_entry_(NULL), | 258 loop_depth_(0), |
| 259 temp_count_(0), | 259 graph_entry_(NULL), |
| 260 args_pushed_(0), | 260 temp_count_(0), |
| 261 nesting_stack_(NULL), | 261 args_pushed_(0), |
| 262 osr_id_(osr_id), | 262 nesting_stack_(NULL), |
| 263 is_optimizing_(is_optimizing) { } | 263 osr_id_(osr_id), |
| 264 is_optimizing_(is_optimizing) { } |
| 264 | 265 |
| 265 | 266 |
| 266 void FlowGraphBuilder::AddCatchEntry(CatchBlockEntryInstr* entry) { | 267 void FlowGraphBuilder::AddCatchEntry(CatchBlockEntryInstr* entry) { |
| 267 graph_entry_->AddCatchEntry(entry); | 268 graph_entry_->AddCatchEntry(entry); |
| 268 } | 269 } |
| 269 | 270 |
| 270 | 271 |
| 271 void InlineExitCollector::PrepareGraphs(FlowGraph* callee_graph) { | 272 void InlineExitCollector::PrepareGraphs(FlowGraph* callee_graph) { |
| 272 ASSERT(callee_graph->graph_entry()->SuccessorCount() == 1); | 273 ASSERT(callee_graph->graph_entry()->SuccessorCount() == 1); |
| 273 ASSERT(callee_graph->max_block_id() > caller_graph_->max_block_id()); | 274 ASSERT(callee_graph->max_block_id() > caller_graph_->max_block_id()); |
| (...skipping 3727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4001 LanguageError::kBailout, | 4002 LanguageError::kBailout, |
| 4002 Heap::kNew, | 4003 Heap::kNew, |
| 4003 "FlowGraphBuilder Bailout: %s %s", | 4004 "FlowGraphBuilder Bailout: %s %s", |
| 4004 String::Handle(I, function.name()).ToCString(), | 4005 String::Handle(I, function.name()).ToCString(), |
| 4005 reason)); | 4006 reason)); |
| 4006 I->long_jump_base()->Jump(1, error); | 4007 I->long_jump_base()->Jump(1, error); |
| 4007 UNREACHABLE(); | 4008 UNREACHABLE(); |
| 4008 } | 4009 } |
| 4009 | 4010 |
| 4010 } // namespace dart | 4011 } // namespace dart |
| OLD | NEW |