| 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/compiler.h" | 5 #include "vm/compiler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 | 8 |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 isolate->set_deopt_id(0); | 270 isolate->set_deopt_id(0); |
| 271 LongJumpScope jump; | 271 LongJumpScope jump; |
| 272 if (setjmp(*jump.Set()) == 0) { | 272 if (setjmp(*jump.Set()) == 0) { |
| 273 FlowGraph* flow_graph = NULL; | 273 FlowGraph* flow_graph = NULL; |
| 274 // TimerScope needs an isolate to be properly terminated in case of a | 274 // TimerScope needs an isolate to be properly terminated in case of a |
| 275 // LongJump. | 275 // LongJump. |
| 276 { | 276 { |
| 277 TimerScope timer(FLAG_compiler_stats, | 277 TimerScope timer(FLAG_compiler_stats, |
| 278 &CompilerStats::graphbuilder_timer, | 278 &CompilerStats::graphbuilder_timer, |
| 279 isolate); | 279 isolate); |
| 280 Array& ic_data_array = Array::Handle(); | 280 ZoneGrowableArray<const ICData*>* ic_data_array = |
| 281 new(isolate) ZoneGrowableArray<const ICData*>(); |
| 281 if (optimized) { | 282 if (optimized) { |
| 282 ASSERT(function.HasCode()); | 283 ASSERT(function.HasCode()); |
| 283 // Extract type feedback before the graph is built, as the graph | 284 // Extract type feedback before the graph is built, as the graph |
| 284 // builder uses it to attach it to nodes. | 285 // builder uses it to attach it to nodes. |
| 285 ASSERT(function.deoptimization_counter() < | 286 ASSERT(function.deoptimization_counter() < |
| 286 FLAG_deoptimization_counter_threshold); | 287 FLAG_deoptimization_counter_threshold); |
| 287 ic_data_array = function.RestoreICDataMap(); | 288 function.RestoreICDataMap(ic_data_array); |
| 288 } | 289 } |
| 289 | 290 |
| 290 // Build the flow graph. | 291 // Build the flow graph. |
| 291 FlowGraphBuilder builder(parsed_function, | 292 FlowGraphBuilder builder(parsed_function, |
| 292 ic_data_array, | 293 *ic_data_array, |
| 293 NULL, // NULL = not inlining. | 294 NULL, // NULL = not inlining. |
| 294 osr_id, | 295 osr_id, |
| 295 optimized); | 296 optimized); |
| 296 flow_graph = builder.BuildGraph(); | 297 flow_graph = builder.BuildGraph(); |
| 297 } | 298 } |
| 298 | 299 |
| 299 if (FLAG_print_flow_graph || | 300 if (FLAG_print_flow_graph || |
| 300 (optimized && FLAG_print_flow_graph_optimized)) { | 301 (optimized && FLAG_print_flow_graph_optimized)) { |
| 301 if (osr_id == Isolate::kNoDeoptId) { | 302 if (osr_id == Isolate::kNoDeoptId) { |
| 302 FlowGraphPrinter::PrintGraph("Before Optimizations", flow_graph); | 303 FlowGraphPrinter::PrintGraph("Before Optimizations", flow_graph); |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 const Object& result = | 980 const Object& result = |
| 980 Object::Handle(isolate->object_store()->sticky_error()); | 981 Object::Handle(isolate->object_store()->sticky_error()); |
| 981 isolate->object_store()->clear_sticky_error(); | 982 isolate->object_store()->clear_sticky_error(); |
| 982 return result.raw(); | 983 return result.raw(); |
| 983 } | 984 } |
| 984 UNREACHABLE(); | 985 UNREACHABLE(); |
| 985 return Object::null(); | 986 return Object::null(); |
| 986 } | 987 } |
| 987 | 988 |
| 988 } // namespace dart | 989 } // namespace dart |
| OLD | NEW |