| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 V(_Uint32Array, ., TypedData_Uint32Array_factory, 1811693442) \ | 127 V(_Uint32Array, ., TypedData_Uint32Array_factory, 1811693442) \ |
| 128 V(_Int64Array, ., TypedData_Int64Array_factory, 958749261) \ | 128 V(_Int64Array, ., TypedData_Int64Array_factory, 958749261) \ |
| 129 V(_Uint64Array, ., TypedData_Uint64Array_factory, 767338823) \ | 129 V(_Uint64Array, ., TypedData_Uint64Array_factory, 767338823) \ |
| 130 V(_Float32Array, ., TypedData_Float32Array_factory, 1721244151) \ | 130 V(_Float32Array, ., TypedData_Float32Array_factory, 1721244151) \ |
| 131 V(_Float64Array, ., TypedData_Float64Array_factory, 1599078532) \ | 131 V(_Float64Array, ., TypedData_Float64Array_factory, 1599078532) \ |
| 132 V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 879975401) \ | 132 V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 879975401) \ |
| 133 V(_Int32x4Array, ., TypedData_Int32x4Array_factory, 924582681) \ | 133 V(_Int32x4Array, ., TypedData_Int32x4Array_factory, 924582681) \ |
| 134 V(_Float64x2Array, ., TypedData_Float64x2Array_factory, 1654170890) \ | 134 V(_Float64x2Array, ., TypedData_Float64x2Array_factory, 1654170890) \ |
| 135 | 135 |
| 136 | 136 |
| 137 #define PROFILER_LIB_INTRINSIC_LIST(V) \ |
| 138 V(_UserTag, makeCurrent, UserTag_makeCurrent, 1038211262) \ |
| 139 V(::, _getCurrentTag, Profiler_getCurrentTag, 1559793589) \ |
| 140 V(::, _clearCurrentTag, Profiler_clearCurrentTag, 874694572) \ |
| 141 |
| 137 // TODO(srdjan): Implement _FixedSizeArrayIterator, get:current and | 142 // TODO(srdjan): Implement _FixedSizeArrayIterator, get:current and |
| 138 // _FixedSizeArrayIterator, moveNext. | 143 // _FixedSizeArrayIterator, moveNext. |
| 139 | 144 |
| 140 // Forward declarations. | 145 // Forward declarations. |
| 141 class Assembler; | 146 class Assembler; |
| 142 class Function; | 147 class Function; |
| 143 | 148 |
| 144 class Intrinsifier : public AllStatic { | 149 class Intrinsifier : public AllStatic { |
| 145 public: | 150 public: |
| 146 // Try to intrinsify 'function'. Returns true if the function intrinsified | 151 // Try to intrinsify 'function'. Returns true if the function intrinsified |
| 147 // completely and the code does not need to be generated (i.e., no slow | 152 // completely and the code does not need to be generated (i.e., no slow |
| 148 // path possible). | 153 // path possible). |
| 149 static void Intrinsify(const Function& function, Assembler* assembler); | 154 static void Intrinsify(const Function& function, Assembler* assembler); |
| 150 static bool CanIntrinsify(const Function& function); | 155 static bool CanIntrinsify(const Function& function); |
| 151 static void InitializeState(); | 156 static void InitializeState(); |
| 152 | 157 |
| 153 private: | 158 private: |
| 154 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ | 159 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ |
| 155 static void destination(Assembler* assembler); | 160 static void destination(Assembler* assembler); |
| 156 | 161 |
| 157 CORE_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 162 CORE_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 158 CORE_INTEGER_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 163 CORE_INTEGER_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 159 MATH_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 164 MATH_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 160 TYPED_DATA_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 165 TYPED_DATA_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 166 PROFILER_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 161 | 167 |
| 162 #undef DECLARE_FUNCTION | 168 #undef DECLARE_FUNCTION |
| 163 }; | 169 }; |
| 164 | 170 |
| 165 } // namespace dart | 171 } // namespace dart |
| 166 | 172 |
| 167 #endif // VM_INTRINSIFIER_H_ | 173 #endif // VM_INTRINSIFIER_H_ |
| OLD | NEW |