| // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| // Class for intrinsifying functions. |
| |
| #ifndef VM_INTRINSIFIER_H_ |
| #define VM_INTRINSIFIER_H_ |
| |
| #include "vm/allocation.h" |
| #include "vm/method_recognizer.h" |
| |
| namespace dart { |
| |
| // Forward declarations. |
| class Assembler; |
| class Function; |
| |
| class Intrinsifier : public AllStatic { |
| public: |
| // Try to intrinsify 'function'. Returns true if the function intrinsified |
| // completely and the code does not need to be generated (i.e., no slow |
| // path possible). |
| static void Intrinsify(const Function& function, Assembler* assembler); |
| static void InitializeState(); |
| |
| private: |
| static bool CanIntrinsify(const Function& function); |
| |
| #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ |
| static void destination(Assembler* assembler); |
| |
| ALL_INTRINSICS_LIST(DECLARE_FUNCTION) |
| |
| #undef DECLARE_FUNCTION |
| }; |
| |
| } // namespace dart |
| |
| #endif // VM_INTRINSIFIER_H_ |