| 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 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 TimerScope timer(FLAG_compiler_stats, &CompilerStats::codegen_timer); | 326 TimerScope timer(FLAG_compiler_stats, &CompilerStats::codegen_timer); |
| 327 bool is_compiled = false; | 327 bool is_compiled = false; |
| 328 // TODO(srdjan): Remove once the old compiler has been ripped out. | 328 // TODO(srdjan): Remove once the old compiler has been ripped out. |
| 329 #if defined(TARGET_ARCH_X64) | 329 #if defined(TARGET_ARCH_X64) |
| 330 const bool use_new_compiler = true; | 330 const bool use_new_compiler = true; |
| 331 #else | 331 #else |
| 332 const bool use_new_compiler = FLAG_use_new_compiler; | 332 const bool use_new_compiler = FLAG_use_new_compiler; |
| 333 #endif | 333 #endif |
| 334 if (use_new_compiler) { | 334 if (use_new_compiler) { |
| 335 is_compiled = CompileWithNewCompiler(parsed_function, optimized); | 335 is_compiled = CompileWithNewCompiler(parsed_function, optimized); |
| 336 if (!is_compiled && optimized) { |
| 337 // When bailing out from the optimizing compiler, mark function as |
| 338 // non-optimizable and return. |
| 339 parsed_function.function().set_is_optimizable(false); |
| 340 return; |
| 341 } |
| 336 } | 342 } |
| 337 | 343 |
| 338 if (!is_compiled) { | 344 if (!is_compiled) { |
| 339 CompileWithOldCompiler(parsed_function, optimized); | 345 CompileWithOldCompiler(parsed_function, optimized); |
| 340 } | 346 } |
| 341 } | 347 } |
| 342 | 348 |
| 343 | 349 |
| 344 static RawError* CompileFunctionHelper(const Function& function, | 350 static RawError* CompileFunctionHelper(const Function& function, |
| 345 bool optimized) { | 351 bool optimized) { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 isolate->object_store()->clear_sticky_error(); | 553 isolate->object_store()->clear_sticky_error(); |
| 548 isolate->set_long_jump_base(base); | 554 isolate->set_long_jump_base(base); |
| 549 return result.raw(); | 555 return result.raw(); |
| 550 } | 556 } |
| 551 UNREACHABLE(); | 557 UNREACHABLE(); |
| 552 return Object::null(); | 558 return Object::null(); |
| 553 } | 559 } |
| 554 | 560 |
| 555 | 561 |
| 556 } // namespace dart | 562 } // namespace dart |
| OLD | NEW |