| 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 12 matching lines...) Expand all Loading... |
| 23 #include "vm/object_store.h" | 23 #include "vm/object_store.h" |
| 24 #include "vm/os.h" | 24 #include "vm/os.h" |
| 25 #include "vm/parser.h" | 25 #include "vm/parser.h" |
| 26 #include "vm/scanner.h" | 26 #include "vm/scanner.h" |
| 27 #include "vm/symbols.h" | 27 #include "vm/symbols.h" |
| 28 #include "vm/timer.h" | 28 #include "vm/timer.h" |
| 29 | 29 |
| 30 namespace dart { | 30 namespace dart { |
| 31 | 31 |
| 32 DEFINE_FLAG(bool, disassemble, false, "Disassemble dart code."); | 32 DEFINE_FLAG(bool, disassemble, false, "Disassemble dart code."); |
| 33 DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from ssa compiler."); |
| 33 DEFINE_FLAG(bool, trace_compiler, false, "Trace compiler operations."); | 34 DEFINE_FLAG(bool, trace_compiler, false, "Trace compiler operations."); |
| 35 #if defined(TARGET_ARCH_X64) |
| 36 DEFINE_FLAG(bool, use_ssa, true, "Use SSA form"); |
| 37 #else |
| 38 DEFINE_FLAG(bool, use_ssa, false, "Use SSA form"); |
| 39 #endif |
| 34 DEFINE_FLAG(int, deoptimization_counter_threshold, 5, | 40 DEFINE_FLAG(int, deoptimization_counter_threshold, 5, |
| 35 "How many times we allow deoptimization before we disallow" | 41 "How many times we allow deoptimization before we disallow" |
| 36 " certain optimizations"); | 42 " certain optimizations"); |
| 37 DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from ssa compiler."); | |
| 38 DECLARE_FLAG(bool, print_flow_graph); | 43 DECLARE_FLAG(bool, print_flow_graph); |
| 39 DECLARE_FLAG(bool, use_ssa); | |
| 40 | 44 |
| 41 | 45 |
| 42 // Compile a function. Should call only if the function has not been compiled. | 46 // Compile a function. Should call only if the function has not been compiled. |
| 43 // Arg0: function object. | 47 // Arg0: function object. |
| 44 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { | 48 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { |
| 45 ASSERT(arguments.Count() == kCompileFunctionRuntimeEntry.argument_count()); | 49 ASSERT(arguments.Count() == kCompileFunctionRuntimeEntry.argument_count()); |
| 46 const Function& function = Function::CheckedHandle(arguments.At(0)); | 50 const Function& function = Function::CheckedHandle(arguments.At(0)); |
| 47 ASSERT(!function.HasCode()); | 51 ASSERT(!function.HasCode()); |
| 48 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 52 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
| 49 if (!error.IsNull()) { | 53 if (!error.IsNull()) { |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 isolate->object_store()->clear_sticky_error(); | 487 isolate->object_store()->clear_sticky_error(); |
| 484 isolate->set_long_jump_base(base); | 488 isolate->set_long_jump_base(base); |
| 485 return result.raw(); | 489 return result.raw(); |
| 486 } | 490 } |
| 487 UNREACHABLE(); | 491 UNREACHABLE(); |
| 488 return Object::null(); | 492 return Object::null(); |
| 489 } | 493 } |
| 490 | 494 |
| 491 | 495 |
| 492 } // namespace dart | 496 } // namespace dart |
| OLD | NEW |