| 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/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // LongJump. | 261 // LongJump. |
| 262 { | 262 { |
| 263 TimerScope timer(FLAG_compiler_stats, | 263 TimerScope timer(FLAG_compiler_stats, |
| 264 &CompilerStats::graphbuilder_timer, | 264 &CompilerStats::graphbuilder_timer, |
| 265 isolate); | 265 isolate); |
| 266 Array& ic_data_array = Array::Handle(); | 266 Array& ic_data_array = Array::Handle(); |
| 267 if (optimized) { | 267 if (optimized) { |
| 268 ASSERT(function.HasCode()); | 268 ASSERT(function.HasCode()); |
| 269 // Extract type feedback before the graph is built, as the graph | 269 // Extract type feedback before the graph is built, as the graph |
| 270 // builder uses it to attach it to nodes. | 270 // builder uses it to attach it to nodes. |
| 271 // Do not use type feedback to optimize a function that was | 271 ASSERT(function.deoptimization_counter() < |
| 272 // deoptimized too often. | 272 FLAG_deoptimization_counter_threshold); |
| 273 if (function.deoptimization_counter() < | 273 const Code& unoptimized_code = |
| 274 FLAG_deoptimization_counter_threshold) { | 274 Code::Handle(function.unoptimized_code()); |
| 275 const Code& unoptimized_code = | 275 ic_data_array = unoptimized_code.ExtractTypeFeedbackArray(); |
| 276 Code::Handle(function.unoptimized_code()); | |
| 277 ic_data_array = unoptimized_code.ExtractTypeFeedbackArray(); | |
| 278 } | |
| 279 } | 276 } |
| 280 | 277 |
| 281 // Build the flow graph. | 278 // Build the flow graph. |
| 282 FlowGraphBuilder builder(parsed_function, | 279 FlowGraphBuilder builder(parsed_function, |
| 283 ic_data_array, | 280 ic_data_array, |
| 284 NULL, // NULL = not inlining. | 281 NULL, // NULL = not inlining. |
| 285 osr_id); | 282 osr_id); |
| 286 flow_graph = builder.BuildGraph(); | 283 flow_graph = builder.BuildGraph(); |
| 287 } | 284 } |
| 288 | 285 |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 Object::Handle(isolate->object_store()->sticky_error()); | 877 Object::Handle(isolate->object_store()->sticky_error()); |
| 881 isolate->object_store()->clear_sticky_error(); | 878 isolate->object_store()->clear_sticky_error(); |
| 882 isolate->set_long_jump_base(base); | 879 isolate->set_long_jump_base(base); |
| 883 return result.raw(); | 880 return result.raw(); |
| 884 } | 881 } |
| 885 UNREACHABLE(); | 882 UNREACHABLE(); |
| 886 return Object::null(); | 883 return Object::null(); |
| 887 } | 884 } |
| 888 | 885 |
| 889 } // namespace dart | 886 } // namespace dart |
| OLD | NEW |