| 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 | 10 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \ | 141 V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \ |
| 142 V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \ | 142 V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \ |
| 143 V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \ | 143 V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \ |
| 144 | 144 |
| 145 // TODO(srdjan): Implement _FixedSizeArrayIterator, get:current and | 145 // TODO(srdjan): Implement _FixedSizeArrayIterator, get:current and |
| 146 // _FixedSizeArrayIterator, moveNext. | 146 // _FixedSizeArrayIterator, moveNext. |
| 147 | 147 |
| 148 // Forward declarations. | 148 // Forward declarations. |
| 149 class Assembler; | 149 class Assembler; |
| 150 class Function; | 150 class Function; |
| 151 class Library; |
| 151 | 152 |
| 152 class Intrinsifier : public AllStatic { | 153 class Intrinsifier : public AllStatic { |
| 153 public: | 154 public: |
| 154 // Try to intrinsify 'function'. Returns true if the function intrinsified | 155 // Try to intrinsify 'function'. Returns true if the function intrinsified |
| 155 // completely and the code does not need to be generated (i.e., no slow | 156 // completely and the code does not need to be generated (i.e., no slow |
| 156 // path possible). | 157 // path possible). |
| 157 static void Intrinsify(const Function& function, Assembler* assembler); | 158 static void Intrinsify(const Function& function, Assembler* assembler); |
| 158 static bool CanIntrinsify(const Function& function); | 159 static bool CanIntrinsify(const Function& function); |
| 159 static void InitializeState(); | 160 static void InitializeState(); |
| 160 | 161 |
| 162 static bool TestFunction(const Library& lib, |
| 163 const char* class_name, |
| 164 const char* function_name, |
| 165 const char* test_class_name, |
| 166 const char* test_function_name); |
| 167 |
| 161 private: | 168 private: |
| 162 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ | 169 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ |
| 163 static void destination(Assembler* assembler); | 170 static void destination(Assembler* assembler); |
| 164 | 171 |
| 165 CORE_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 172 CORE_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 166 CORE_INTEGER_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 173 CORE_INTEGER_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 167 MATH_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 174 MATH_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 168 TYPED_DATA_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 175 TYPED_DATA_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 169 PROFILER_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 176 PROFILER_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 170 | 177 |
| 171 #undef DECLARE_FUNCTION | 178 #undef DECLARE_FUNCTION |
| 172 }; | 179 }; |
| 173 | 180 |
| 174 } // namespace dart | 181 } // namespace dart |
| 175 | 182 |
| 176 #endif // VM_INTRINSIFIER_H_ | 183 #endif // VM_INTRINSIFIER_H_ |
| OLD | NEW |