| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 V(_StringBase, codeUnitAt, String_codeUnitAt, 984449525) \ | 81 V(_StringBase, codeUnitAt, String_codeUnitAt, 984449525) \ |
| 82 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 682660413) \ | 82 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 682660413) \ |
| 83 | 83 |
| 84 | 84 |
| 85 #define MATH_LIB_INTRINSIC_LIST(V) \ | 85 #define MATH_LIB_INTRINSIC_LIST(V) \ |
| 86 V(::, sqrt, Math_sqrt, 1662640002) \ | 86 V(::, sqrt, Math_sqrt, 1662640002) \ |
| 87 V(::, sin, Math_sin, 1273932041) \ | 87 V(::, sin, Math_sin, 1273932041) \ |
| 88 V(::, cos, Math_cos, 1749547468) \ | 88 V(::, cos, Math_cos, 1749547468) \ |
| 89 | 89 |
| 90 | 90 |
| 91 // Note that any intrinsified function is not inlined. Some optimizations | |
| 92 // rely on seeing the factories below instead of their inlined code. | |
| 93 #define SCALARLIST_LIB_INTRINSIC_LIST(V) \ | |
| 94 V(_ByteArrayBase, get:length, ByteArrayBase_getLength, 1095311202) \ | |
| 95 V(_Int64Array, [], Int64Array_getIndexed, 419006675) \ | |
| 96 V(_Uint64Array, [], Uint64Array_getIndexed, 2092868726) \ | |
| 97 V(_Int8Array, _new, Int8Array_new, 535958453) \ | |
| 98 V(_Uint8Array, _new, Uint8Array_new, 604355565) \ | |
| 99 V(_Uint8ClampedArray, _new, Uint8ClampedArray_new, 1070949952) \ | |
| 100 V(_Int16Array, _new, Int16Array_new, 903723993) \ | |
| 101 V(_Uint16Array, _new, Uint16Array_new, 133542762) \ | |
| 102 V(_Int32Array, _new, Int32Array_new, 8218286) \ | |
| 103 V(_Uint32Array, _new, Uint32Array_new, 469402161) \ | |
| 104 V(_Int64Array, _new, Int64Array_new, 60605075) \ | |
| 105 V(_Uint64Array, _new, Uint64Array_new, 624354107) \ | |
| 106 V(_Float32Array, _new, Float32Array_new, 109944959) \ | |
| 107 V(_Float64Array, _new, Float64Array_new, 147668392) \ | |
| 108 V(Int8List, ., Int8Array_factory, 216496111) \ | |
| 109 V(Uint8List, ., Uint8Array_factory, 1767464978) \ | |
| 110 V(Uint8ClampedList, ., Uint8ClampedArray_factory, 1968602860) \ | |
| 111 V(Int16List, ., Int16Array_factory, 1760814825) \ | |
| 112 V(Uint16List, ., Uint16Array_factory, 1684498763) \ | |
| 113 V(Int32List, ., Int32Array_factory, 1376656162) \ | |
| 114 V(Uint32List, ., Uint32Array_factory, 1954207744) \ | |
| 115 V(Int64List, ., Int64Array_factory, 284215425) \ | |
| 116 V(Uint64List, ., Uint64Array_factory, 870102373) \ | |
| 117 V(Float32List, ., Float32Array_factory, 1434337247) \ | |
| 118 V(Float64List, ., Float64Array_factory, 436526211) \ | |
| 119 | |
| 120 #define TYPEDDATA_LIB_INTRINSIC_LIST(V) \ | 91 #define TYPEDDATA_LIB_INTRINSIC_LIST(V) \ |
| 121 V(_TypedList, get:length, TypedData_getLength, 231908172) \ | 92 V(_TypedList, get:length, TypedData_getLength, 231908172) \ |
| 122 V(_Int8Array, _new, TypedData_Int8Array_new, 844274443) \ | 93 V(_Int8Array, _new, TypedData_Int8Array_new, 844274443) \ |
| 123 V(_Uint8Array, _new, TypedData_Uint8Array_new, 997951645) \ | 94 V(_Uint8Array, _new, TypedData_Uint8Array_new, 997951645) \ |
| 124 V(_Uint8ClampedArray, _new, TypedData_Uint8ClampedArray_new, 1025045044) \ | 95 V(_Uint8ClampedArray, _new, TypedData_Uint8ClampedArray_new, 1025045044) \ |
| 125 V(_Int16Array, _new, TypedData_Int16Array_new, 1064563368) \ | 96 V(_Int16Array, _new, TypedData_Int16Array_new, 1064563368) \ |
| 126 V(_Uint16Array, _new, TypedData_Uint16Array_new, 110927177) \ | 97 V(_Uint16Array, _new, TypedData_Uint16Array_new, 110927177) \ |
| 127 V(_Int32Array, _new, TypedData_Int32Array_new, 770802406) \ | 98 V(_Int32Array, _new, TypedData_Int32Array_new, 770802406) \ |
| 128 V(_Uint32Array, _new, TypedData_Uint32Array_new, 856841876) \ | 99 V(_Uint32Array, _new, TypedData_Uint32Array_new, 856841876) \ |
| 129 V(_Int64Array, _new, TypedData_Int64Array_new, 941769528) \ | 100 V(_Int64Array, _new, TypedData_Int64Array_new, 941769528) \ |
| (...skipping 29 matching lines...) Expand all Loading... |
| 159 static bool Intrinsify(const Function& function, Assembler* assembler); | 130 static bool Intrinsify(const Function& function, Assembler* assembler); |
| 160 static bool CanIntrinsify(const Function& function); | 131 static bool CanIntrinsify(const Function& function); |
| 161 static void InitializeState(); | 132 static void InitializeState(); |
| 162 | 133 |
| 163 private: | 134 private: |
| 164 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ | 135 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ |
| 165 static bool destination(Assembler* assembler); | 136 static bool destination(Assembler* assembler); |
| 166 | 137 |
| 167 CORE_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 138 CORE_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 168 MATH_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 139 MATH_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 169 SCALARLIST_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | |
| 170 TYPEDDATA_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) | 140 TYPEDDATA_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) |
| 171 | 141 |
| 172 #undef DECLARE_FUNCTION | 142 #undef DECLARE_FUNCTION |
| 173 }; | 143 }; |
| 174 | 144 |
| 175 } // namespace dart | 145 } // namespace dart |
| 176 | 146 |
| 177 #endif // VM_INTRINSIFIER_H_ | 147 #endif // VM_INTRINSIFIER_H_ |
| OLD | NEW |