| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 | 4 |
| 5 #ifndef VM_METHOD_RECOGNIZER_H_ | 5 #ifndef VM_METHOD_RECOGNIZER_H_ |
| 6 #define VM_METHOD_RECOGNIZER_H_ | 6 #define VM_METHOD_RECOGNIZER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| 11 | 11 |
| 12 // (class-name, function-name, recognized enum, fingerprint). | 12 // (class-name, function-name, recognized enum, fingerprint). |
| 13 // When adding a new function add a 0 as fingerprint, build and run to get the | 13 // When adding a new function add a 0 as fingerprint, build and run to get the |
| 14 // correct fingerprint from the mismatch error. | 14 // correct fingerprint from the mismatch error. |
| 15 #define OTHER_RECOGNIZED_LIST(V) \ | 15 #define OTHER_RECOGNIZED_LIST(V) \ |
| 16 V(::, identical, ObjectIdentical, 496869842) \ | 16 V(::, identical, ObjectIdentical, 496869842) \ |
| 17 V(ClassID, getID, ClassIDgetID, 1322490980) \ | 17 V(ClassID, getID, ClassIDgetID, 1322490980) \ |
| 18 V(Object, Object., ObjectConstructor, 1066669787) \ | 18 V(Object, Object., ObjectConstructor, 1066669787) \ |
| 19 V(_List, ., ObjectArrayAllocate, 1595327584) \ | 19 V(_List, ., ObjectArrayAllocate, 1595327584) \ |
| 20 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 1541411498) \ | 20 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 1541411498) \ |
| 21 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 1032404349) \ | 21 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 1032404349) \ |
| 22 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 381073990) \ | 22 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 381073990) \ |
| 23 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1142676276) \ | 23 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1142676276) \ |
| 24 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 330269934) \ | 24 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 330269934) \ |
| 25 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 59490554) \ | 25 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 59490554) \ |
| 26 V(_TypedList, _getInt64, ByteArrayBaseGetInt64, 322272622) \ |
| 26 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 393003933) \ | 27 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 393003933) \ |
| 27 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1792407200) \ | 28 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1792407200) \ |
| 28 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1338379857) \ | 29 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1338379857) \ |
| 29 V(_TypedList, _getInt32x4, ByteArrayBaseGetInt32x4, 1469917805) \ | 30 V(_TypedList, _getInt32x4, ByteArrayBaseGetInt32x4, 1469917805) \ |
| 30 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 433348464) \ | 31 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 433348464) \ |
| 31 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 149406583) \ | 32 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 149406583) \ |
| 32 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 805477162) \ | 33 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 805477162) \ |
| 33 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 888580944) \ | 34 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 888580944) \ |
| 34 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1708248181) \ | 35 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1708248181) \ |
| 35 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1863152792) \ | 36 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1863152792) \ |
| 37 V(_TypedList, _setInt64, ByteArrayBaseSetInt64, 1473080053) \ |
| 36 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1148703855) \ | 38 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1148703855) \ |
| 37 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 972883980) \ | 39 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 972883980) \ |
| 38 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 950522310) \ | 40 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 950522310) \ |
| 39 V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 1301138078) \ | 41 V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 1301138078) \ |
| 40 V(_StringBase, _interpolate, StringBaseInterpolate, 1540062866) \ | 42 V(_StringBase, _interpolate, StringBaseInterpolate, 1540062866) \ |
| 41 V(_IntegerImplementation, toDouble, IntegerToDouble, 1084977108) \ | 43 V(_IntegerImplementation, toDouble, IntegerToDouble, 1084977108) \ |
| 42 V(_IntegerImplementation, _leftShiftWithMask32, IntegerLeftShiftWithMask32, \ | 44 V(_IntegerImplementation, _leftShiftWithMask32, IntegerLeftShiftWithMask32, \ |
| 43 597111055) \ | 45 597111055) \ |
| 44 V(_Double, truncateToDouble, DoubleTruncate, 2117801967) \ | 46 V(_Double, truncateToDouble, DoubleTruncate, 2117801967) \ |
| 45 V(_Double, roundToDouble, DoubleRound, 2124216110) \ | 47 V(_Double, roundToDouble, DoubleRound, 2124216110) \ |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \ | 131 V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \ |
| 130 1794849214) \ | 132 1794849214) \ |
| 131 V(_Int16Array, [], Int16ArrayGetIndexed, 74127855) \ | 133 V(_Int16Array, [], Int16ArrayGetIndexed, 74127855) \ |
| 132 V(_Int16Array, []=, Int16ArraySetIndexed, 1610252345) \ | 134 V(_Int16Array, []=, Int16ArraySetIndexed, 1610252345) \ |
| 133 V(_Uint16Array, [], Uint16ArrayGetIndexed, 470411953) \ | 135 V(_Uint16Array, [], Uint16ArrayGetIndexed, 470411953) \ |
| 134 V(_Uint16Array, []=, Uint16ArraySetIndexed, 1648929040) \ | 136 V(_Uint16Array, []=, Uint16ArraySetIndexed, 1648929040) \ |
| 135 V(_Int32Array, [], Int32ArrayGetIndexed, 203101370) \ | 137 V(_Int32Array, [], Int32ArrayGetIndexed, 203101370) \ |
| 136 V(_Int32Array, []=, Int32ArraySetIndexed, 338968571) \ | 138 V(_Int32Array, []=, Int32ArraySetIndexed, 338968571) \ |
| 137 V(_Uint32Array, [], Uint32ArrayGetIndexed, 1640672852) \ | 139 V(_Uint32Array, [], Uint32ArrayGetIndexed, 1640672852) \ |
| 138 V(_Uint32Array, []=, Uint32ArraySetIndexed, 1472976717) \ | 140 V(_Uint32Array, []=, Uint32ArraySetIndexed, 1472976717) \ |
| 141 V(_Int64Array, [], Int64ArrayGetIndexed, 206855782) \ |
| 142 V(_Int64Array, []=, Int64ArraySetIndexed, 1258282177) \ |
| 139 V(_Float32x4Array, [], Float32x4ArrayGetIndexed, 1466627059) \ | 143 V(_Float32x4Array, [], Float32x4ArrayGetIndexed, 1466627059) \ |
| 140 V(_Float32x4Array, []=, Float32x4ArraySetIndexed, 2141660076) \ | 144 V(_Float32x4Array, []=, Float32x4ArraySetIndexed, 2141660076) \ |
| 141 V(_Int32x4Array, [], Int32x4ArrayGetIndexed, 818792056) \ | 145 V(_Int32x4Array, [], Int32x4ArrayGetIndexed, 818792056) \ |
| 142 V(_Int32x4Array, []=, Int32x4ArraySetIndexed, 1021474038) \ | 146 V(_Int32x4Array, []=, Int32x4ArraySetIndexed, 1021474038) \ |
| 143 V(_Float64x2Array, [], Float64x2ArrayGetIndexed, 288114492) \ | 147 V(_Float64x2Array, [], Float64x2ArrayGetIndexed, 288114492) \ |
| 144 V(_Float64x2Array, []=, Float64x2ArraySetIndexed, 941746736) \ | 148 V(_Float64x2Array, []=, Float64x2ArraySetIndexed, 941746736) \ |
| 145 V(_Bigint, get:_neg, Bigint_getNeg, 1151514099) \ | 149 V(_Bigint, get:_neg, Bigint_getNeg, 1151514099) \ |
| 146 V(_Bigint, get:_used, Bigint_getUsed, 1308529543) \ | 150 V(_Bigint, get:_used, Bigint_getUsed, 1308529543) \ |
| 147 V(_Bigint, get:_digits, Bigint_getDigits, 1408062672) \ | 151 V(_Bigint, get:_digits, Bigint_getDigits, 1408062672) \ |
| 148 | 152 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 V(_Uint8Array, [], Uint8ArrayGetIndexed, 16125140) \ | 346 V(_Uint8Array, [], Uint8ArrayGetIndexed, 16125140) \ |
| 343 V(_Uint8Array, []=, Uint8ArraySetIndexed, 2018064553) \ | 347 V(_Uint8Array, []=, Uint8ArraySetIndexed, 2018064553) \ |
| 344 V(_Uint8ClampedArray, [], Uint8ClampedArrayGetIndexed, 430672063) \ | 348 V(_Uint8ClampedArray, [], Uint8ClampedArrayGetIndexed, 430672063) \ |
| 345 V(_Uint8ClampedArray, []=, Uint8ClampedArraySetIndexed, 821294340) \ | 349 V(_Uint8ClampedArray, []=, Uint8ClampedArraySetIndexed, 821294340) \ |
| 346 V(_Uint16Array, [], Uint16ArrayGetIndexed, 470411953) \ | 350 V(_Uint16Array, [], Uint16ArrayGetIndexed, 470411953) \ |
| 347 V(_Uint16Array, []=, Uint16ArraySetIndexed, 1648929040) \ | 351 V(_Uint16Array, []=, Uint16ArraySetIndexed, 1648929040) \ |
| 348 V(_Int16Array, [], Int16ArrayGetIndexed, 74127855) \ | 352 V(_Int16Array, [], Int16ArrayGetIndexed, 74127855) \ |
| 349 V(_Int16Array, []=, Int16ArraySetIndexed, 1610252345) \ | 353 V(_Int16Array, []=, Int16ArraySetIndexed, 1610252345) \ |
| 350 V(_Int32Array, [], Int32ArrayGetIndexed, 203101370) \ | 354 V(_Int32Array, [], Int32ArrayGetIndexed, 203101370) \ |
| 351 V(_Int32Array, []=, Int32ArraySetIndexed, 338968571) \ | 355 V(_Int32Array, []=, Int32ArraySetIndexed, 338968571) \ |
| 356 V(_Int64Array, [], Int64ArrayGetIndexed, 206855782) \ |
| 357 V(_Int64Array, []=, Int64ArraySetIndexed, 1258282177) \ |
| 352 V(_Uint8ArrayView, [], Uint8ArrayViewGetIndexed, 1543480955) \ | 358 V(_Uint8ArrayView, [], Uint8ArrayViewGetIndexed, 1543480955) \ |
| 353 V(_Uint8ArrayView, []=, Uint8ArrayViewSetIndexed, 936729641) \ | 359 V(_Uint8ArrayView, []=, Uint8ArrayViewSetIndexed, 936729641) \ |
| 354 V(_Int8ArrayView, [], Int8ArrayViewGetIndexed, 1898018934) \ | 360 V(_Int8ArrayView, [], Int8ArrayViewGetIndexed, 1898018934) \ |
| 355 V(_Int8ArrayView, []=, Int8ArrayViewSetIndexed, 111684506) \ | 361 V(_Int8ArrayView, []=, Int8ArrayViewSetIndexed, 111684506) \ |
| 356 V(::, asin, MathASin, 1651042633) \ | 362 V(::, asin, MathASin, 1651042633) \ |
| 357 V(::, acos, MathACos, 1139647090) \ | 363 V(::, acos, MathACos, 1139647090) \ |
| 358 V(::, atan, MathATan, 1668754384) \ | 364 V(::, atan, MathATan, 1668754384) \ |
| 359 V(::, atan2, MathATan2, 1845649456) \ | 365 V(::, atan2, MathATan2, 1845649456) \ |
| 360 V(::, cos, MathCos, 1951197905) \ | 366 V(::, cos, MathCos, 1951197905) \ |
| 361 V(::, exp, MathExp, 1809210829) \ | 367 V(::, exp, MathExp, 1809210829) \ |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 static Kind RecognizeKind(const Function& function); | 422 static Kind RecognizeKind(const Function& function); |
| 417 static bool AlwaysInline(const Function& function); | 423 static bool AlwaysInline(const Function& function); |
| 418 static bool PolymorphicTarget(const Function& function); | 424 static bool PolymorphicTarget(const Function& function); |
| 419 static const char* KindToCString(Kind kind); | 425 static const char* KindToCString(Kind kind); |
| 420 static void InitializeState(); | 426 static void InitializeState(); |
| 421 }; | 427 }; |
| 422 | 428 |
| 423 } // namespace dart | 429 } // namespace dart |
| 424 | 430 |
| 425 #endif // VM_METHOD_RECOGNIZER_H_ | 431 #endif // VM_METHOD_RECOGNIZER_H_ |
| OLD | NEW |