| 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 #ifndef VM_INTRINSIFIER_H_ | 6 #ifndef VM_INTRINSIFIER_H_ |
| 7 #define VM_INTRINSIFIER_H_ | 7 #define VM_INTRINSIFIER_H_ |
| 8 | 8 |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/method_recognizer.h" | 10 #include "vm/method_recognizer.h" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 // Forward declarations. | 14 // Forward declarations. |
| 15 class Assembler; | 15 class Assembler; |
| 16 class FlowGraphCompiler; |
| 16 class Function; | 17 class Function; |
| 18 class TargetEntryInstr; |
| 19 class ParsedFunction; |
| 20 class FlowGraph; |
| 17 | 21 |
| 18 class Intrinsifier : public AllStatic { | 22 class Intrinsifier : public AllStatic { |
| 19 public: | 23 public: |
| 20 // Try to intrinsify 'function'. Returns true if the function intrinsified | 24 static void Intrinsify(ParsedFunction* parsed_function, |
| 21 // completely and the code does not need to be generated (i.e., no slow | 25 FlowGraphCompiler* compiler); |
| 22 // path possible). | |
| 23 static void Intrinsify(const Function& function, Assembler* assembler); | |
| 24 static void InitializeState(); | 26 static void InitializeState(); |
| 25 | 27 |
| 28 static bool GraphIntrinsify(ParsedFunction* parsed_function, |
| 29 FlowGraphCompiler* compiler); |
| 30 |
| 31 static intptr_t ParameterSlotFromSp(); |
| 32 |
| 26 private: | 33 private: |
| 27 static bool CanIntrinsify(const Function& function); | 34 static bool CanIntrinsify(const Function& function); |
| 28 | 35 |
| 29 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ | 36 #define DECLARE_FUNCTION(test_class_name, test_function_name, enum_name, fp) \ |
| 30 static void destination(Assembler* assembler); | 37 static void enum_name(Assembler* assembler); |
| 31 | 38 |
| 32 ALL_INTRINSICS_LIST(DECLARE_FUNCTION) | 39 ALL_INTRINSICS_LIST(DECLARE_FUNCTION) |
| 33 | 40 |
| 34 #undef DECLARE_FUNCTION | 41 #undef DECLARE_FUNCTION |
| 42 |
| 43 #define DECLARE_FUNCTION(test_class_name, test_function_name, enum_name, fp) \ |
| 44 static bool Build_##enum_name(FlowGraph* flow_graph); |
| 45 |
| 46 GRAPH_INTRINSICS_LIST(DECLARE_FUNCTION) |
| 47 |
| 48 #undef DECLARE_FUNCTION |
| 35 }; | 49 }; |
| 36 | 50 |
| 37 } // namespace dart | 51 } // namespace dart |
| 38 | 52 |
| 39 #endif // VM_INTRINSIFIER_H_ | 53 #endif // VM_INTRINSIFIER_H_ |
| OLD | NEW |