| 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 // Class for intrinsifying functions. | 4 // Class for intrinsifying functions. |
| 5 | 5 |
| 6 #include "vm/assembler.h" | 6 #include "vm/assembler.h" |
| 7 #include "vm/intrinsifier.h" | 7 #include "vm/intrinsifier.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
| 11 | 11 |
| 12 #include "vm/flow_graph.h" | 12 #include "vm/flow_graph.h" |
| 13 #include "vm/flow_graph_compiler.h" | 13 #include "vm/flow_graph_compiler.h" |
| 14 #include "vm/flow_graph_allocator.h" | 14 #include "vm/flow_graph_allocator.h" |
| 15 #include "vm/flow_graph_builder.h" | 15 #include "vm/flow_graph_builder.h" |
| 16 #include "vm/il_printer.h" | 16 #include "vm/il_printer.h" |
| 17 #include "vm/intermediate_language.h" | 17 #include "vm/intermediate_language.h" |
| 18 #include "vm/parser.h" | 18 #include "vm/parser.h" |
| 19 | 19 |
| 20 namespace dart { | 20 namespace dart { |
| 21 | 21 |
| 22 DEFINE_FLAG(bool, intrinsify, true, "Instrinsify when possible"); | 22 DEFINE_FLAG(bool, intrinsify, true, "Instrinsify when possible"); |
| 23 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 23 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| 24 DECLARE_FLAG(bool, code_comments); | 24 DECLARE_FLAG(bool, code_comments); |
| 25 DECLARE_FLAG(bool, print_flow_graph); | 25 DECLARE_FLAG(bool, print_flow_graph); |
| 26 DECLARE_FLAG(bool, print_flow_graph_optimized); | 26 DECLARE_FLAG(bool, print_flow_graph_optimized); |
| 27 DECLARE_FLAG(bool, enable_type_checks); | |
| 28 | 27 |
| 29 bool Intrinsifier::CanIntrinsify(const Function& function) { | 28 bool Intrinsifier::CanIntrinsify(const Function& function) { |
| 30 if (!FLAG_intrinsify) return false; | 29 if (!FLAG_intrinsify) return false; |
| 31 if (function.IsClosureFunction()) return false; | 30 if (function.IsClosureFunction()) return false; |
| 32 // Can occur because of compile-all flag. | 31 // Can occur because of compile-all flag. |
| 33 if (function.is_external()) return false; | 32 if (function.is_external()) return false; |
| 34 return function.is_intrinsic(); | 33 return function.is_intrinsic(); |
| 35 } | 34 } |
| 36 | 35 |
| 37 | 36 |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 new Value(growable_array), | 683 new Value(growable_array), |
| 685 new Value(length), | 684 new Value(length), |
| 686 kNoStoreBarrier, | 685 kNoStoreBarrier, |
| 687 builder.TokenPos())); | 686 builder.TokenPos())); |
| 688 Definition* null_def = builder.AddNullDefinition(); | 687 Definition* null_def = builder.AddNullDefinition(); |
| 689 builder.AddIntrinsicReturn(new Value(null_def)); | 688 builder.AddIntrinsicReturn(new Value(null_def)); |
| 690 return true; | 689 return true; |
| 691 } | 690 } |
| 692 | 691 |
| 693 } // namespace dart | 692 } // namespace dart |
| OLD | NEW |