Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: runtime/vm/method_recognizer.h

Issue 1808503003: Add graph intrinsics for math library functions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« runtime/vm/intrinsifier.cc ('K') | « runtime/vm/intrinsifier.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 IntegerLeftShiftWithMask32, 1634465017) \ 45 IntegerLeftShiftWithMask32, 1634465017) \
46 V(_Double, truncateToDouble, DoubleTruncate, 791143891) \ 46 V(_Double, truncateToDouble, DoubleTruncate, 791143891) \
47 V(_Double, roundToDouble, DoubleRound, 797558034) \ 47 V(_Double, roundToDouble, DoubleRound, 797558034) \
48 V(_Double, floorToDouble, DoubleFloor, 1789426271) \ 48 V(_Double, floorToDouble, DoubleFloor, 1789426271) \
49 V(_Double, ceilToDouble, DoubleCeil, 453271198) \ 49 V(_Double, ceilToDouble, DoubleCeil, 453271198) \
50 V(_Double, _modulo, DoubleMod, 1093862165) \ 50 V(_Double, _modulo, DoubleMod, 1093862165) \
51 V(_Double, _add, DoubleAdd, 1190606283) \ 51 V(_Double, _add, DoubleAdd, 1190606283) \
52 V(_Double, _sub, DoubleSub, 1086286468) \ 52 V(_Double, _sub, DoubleSub, 1086286468) \
53 V(_Double, _mul, DoubleMul, 166332351) \ 53 V(_Double, _mul, DoubleMul, 166332351) \
54 V(_Double, _div, DoubleDiv, 821396195) \ 54 V(_Double, _div, DoubleDiv, 821396195) \
55 V(::, sin, MathSin, 939048573) \
56 V(::, cos, MathCos, 1148850331) \
57 V(::, tan, MathTan, 179725235) \
58 V(::, asin, MathAsin, 848695059) \
59 V(::, acos, MathAcos, 337299516) \
60 V(::, atan, MathAtan, 866406810) \
61 V(::, atan2, MathAtan2, 1901969510) \
62 V(::, min, MathMin, 1115051548) \ 55 V(::, min, MathMin, 1115051548) \
63 V(::, max, MathMax, 1410473322) \ 56 V(::, max, MathMax, 1410473322) \
64 V(::, _doublePow, MathDoublePow, 562154128) \ 57 V(::, _doublePow, MathDoublePow, 562154128) \
65 V(Float32x4, Float32x4., Float32x4Constructor, 1849420944) \ 58 V(Float32x4, Float32x4., Float32x4Constructor, 1849420944) \
66 V(Float32x4, Float32x4.zero, Float32x4Zero, 762161262) \ 59 V(Float32x4, Float32x4.zero, Float32x4Zero, 762161262) \
67 V(Float32x4, Float32x4.splat, Float32x4Splat, 255855286) \ 60 V(Float32x4, Float32x4.splat, Float32x4Splat, 255855286) \
68 V(Float32x4, Float32x4.fromInt32x4Bits, Float32x4FromInt32x4Bits, 1718571366)\ 61 V(Float32x4, Float32x4.fromInt32x4Bits, Float32x4FromInt32x4Bits, 1718571366)\
69 V(Float32x4, Float32x4.fromFloat64x2, Float32x4FromFloat64x2, 1458098858) \ 62 V(Float32x4, Float32x4.fromFloat64x2, Float32x4FromFloat64x2, 1458098858) \
70 V(_Float32x4, shuffle, Float32x4Shuffle, 2015957023) \ 63 V(_Float32x4, shuffle, Float32x4Shuffle, 2015957023) \
71 V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 1099087979) \ 64 V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 1099087979) \
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 V(_IntegerImplementation, >=, Integer_greaterEqualThan, 1815180096) \ 229 V(_IntegerImplementation, >=, Integer_greaterEqualThan, 1815180096) \
237 V(_IntegerImplementation, <<, Integer_shl, 293751452) \ 230 V(_IntegerImplementation, <<, Integer_shl, 293751452) \
238 V(_IntegerImplementation, >>, Integer_sar, 125091101) \ 231 V(_IntegerImplementation, >>, Integer_sar, 125091101) \
239 V(_Double, toInt, DoubleToInteger, 653210699) 232 V(_Double, toInt, DoubleToInteger, 653210699)
240 233
241 234
242 #define MATH_LIB_INTRINSIC_LIST(V) \ 235 #define MATH_LIB_INTRINSIC_LIST(V) \
243 V(::, sqrt, MathSqrt, 1446681622) \ 236 V(::, sqrt, MathSqrt, 1446681622) \
244 V(_Random, _nextState, Random_nextState, 1241583299) \ 237 V(_Random, _nextState, Random_nextState, 1241583299) \
245 238
239 #define GRAPH_MATH_LIB_INTRINSIC_LIST(V) \
240 V(::, sin, MathSin, 939048573) \
241 V(::, cos, MathCos, 1148850331) \
242 V(::, tan, MathTan, 179725235) \
243 V(::, asin, MathAsin, 848695059) \
244 V(::, acos, MathAcos, 337299516) \
245 V(::, atan, MathAtan, 866406810) \
246 V(::, atan2, MathAtan2, 1901969510) \
246 247
247 #define TYPED_DATA_LIB_INTRINSIC_LIST(V) \ 248 #define TYPED_DATA_LIB_INTRINSIC_LIST(V) \
248 V(_Int8Array, ., TypedData_Int8Array_factory, 1058992179) \ 249 V(_Int8Array, ., TypedData_Int8Array_factory, 1058992179) \
249 V(_Uint8Array, ., TypedData_Uint8Array_factory, 1807546986) \ 250 V(_Uint8Array, ., TypedData_Uint8Array_factory, 1807546986) \
250 V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 548459853) \ 251 V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 548459853) \
251 V(_Int16Array, ., TypedData_Int16Array_factory, 1796211480) \ 252 V(_Int16Array, ., TypedData_Int16Array_factory, 1796211480) \
252 V(_Uint16Array, ., TypedData_Uint16Array_factory, 1960868166) \ 253 V(_Uint16Array, ., TypedData_Uint16Array_factory, 1960868166) \
253 V(_Int32Array, ., TypedData_Int32Array_factory, 372258367) \ 254 V(_Int32Array, ., TypedData_Int32Array_factory, 372258367) \
254 V(_Uint32Array, ., TypedData_Uint32Array_factory, 1446612721) \ 255 V(_Uint32Array, ., TypedData_Uint32Array_factory, 1446612721) \
255 V(_Int64Array, ., TypedData_Int64Array_factory, 964028713) \ 256 V(_Int64Array, ., TypedData_Int64Array_factory, 964028713) \
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 V(_GrowableList, _setData, GrowableArraySetData, 1496536873) \ 289 V(_GrowableList, _setData, GrowableArraySetData, 1496536873) \
289 V(_GrowableList, _setLength, GrowableArraySetLength, 32203572) \ 290 V(_GrowableList, _setLength, GrowableArraySetLength, 32203572) \
290 V(_GrowableList, [], GrowableArrayGetIndexed, 1957529650) \ 291 V(_GrowableList, [], GrowableArrayGetIndexed, 1957529650) \
291 V(_GrowableList, []=, GrowableArraySetIndexed, 225246870) \ 292 V(_GrowableList, []=, GrowableArraySetIndexed, 225246870) \
292 V(_StringBase, get:length, StringBaseLength, 707533587) \ 293 V(_StringBase, get:length, StringBaseLength, 707533587) \
293 V(_Double, unary-, DoubleFlipSignBit, 1783281169) 294 V(_Double, unary-, DoubleFlipSignBit, 1783281169)
294 295
295 #define GRAPH_INTRINSICS_LIST(V) \ 296 #define GRAPH_INTRINSICS_LIST(V) \
296 GRAPH_CORE_INTRINSICS_LIST(V) \ 297 GRAPH_CORE_INTRINSICS_LIST(V) \
297 GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \ 298 GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
299 GRAPH_MATH_LIB_INTRINSIC_LIST(V) \
298 300
299 #define DEVELOPER_LIB_INTRINSIC_LIST(V) \ 301 #define DEVELOPER_LIB_INTRINSIC_LIST(V) \
300 V(_UserTag, makeCurrent, UserTag_makeCurrent, 187721469) \ 302 V(_UserTag, makeCurrent, UserTag_makeCurrent, 187721469) \
301 V(::, _getDefaultTag, UserTag_defaultTag, 1872263331) \ 303 V(::, _getDefaultTag, UserTag_defaultTag, 1872263331) \
302 V(::, _getCurrentTag, Profiler_getCurrentTag, 692104531) \ 304 V(::, _getCurrentTag, Profiler_getCurrentTag, 692104531) \
303 305
304 #define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \ 306 #define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
305 CORE_LIB_INTRINSIC_LIST(V) \ 307 CORE_LIB_INTRINSIC_LIST(V) \
306 DEVELOPER_LIB_INTRINSIC_LIST(V) \ 308 DEVELOPER_LIB_INTRINSIC_LIST(V) \
307 MATH_LIB_INTRINSIC_LIST(V) \ 309 MATH_LIB_INTRINSIC_LIST(V) \
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 V(::, asin, MathASin, 848695059) \ 390 V(::, asin, MathASin, 848695059) \
389 V(::, acos, MathACos, 337299516) \ 391 V(::, acos, MathACos, 337299516) \
390 V(::, atan, MathATan, 866406810) \ 392 V(::, atan, MathATan, 866406810) \
391 V(::, atan2, MathATan2, 1901969510) \ 393 V(::, atan2, MathATan2, 1901969510) \
392 V(::, cos, MathCos, 1148850331) \ 394 V(::, cos, MathCos, 1148850331) \
393 V(::, exp, MathExp, 1006863255) \ 395 V(::, exp, MathExp, 1006863255) \
394 V(::, log, MathLog, 817988874) \ 396 V(::, log, MathLog, 817988874) \
395 V(::, max, MathMax, 1410473322) \ 397 V(::, max, MathMax, 1410473322) \
396 V(::, min, MathMin, 1115051548) \ 398 V(::, min, MathMin, 1115051548) \
397 V(::, pow, MathPow, 864430827) \ 399 V(::, pow, MathPow, 864430827) \
398 V(::, sin, MathSin, 939048573) \
399 V(::, sqrt, MathSqrt, 1446681622) \ 400 V(::, sqrt, MathSqrt, 1446681622) \
400 V(::, tan, MathTan, 179725235) \ 401 V(::, tan, MathTan, 179725235) \
401 V(Lists, copy, ListsCopy, 564237562) \ 402 V(Lists, copy, ListsCopy, 564237562) \
402 V(_Bigint, get:_neg, Bigint_getNeg, 1681019799) \ 403 V(_Bigint, get:_neg, Bigint_getNeg, 1681019799) \
403 V(_Bigint, get:_used, Bigint_getUsed, 1439136438) \ 404 V(_Bigint, get:_used, Bigint_getUsed, 1439136438) \
404 V(_Bigint, get:_digits, Bigint_getDigits, 769722770) \ 405 V(_Bigint, get:_digits, Bigint_getDigits, 769722770) \
405 V(_HashVMBase, get:_index, LinkedHashMap_getIndex, 2048715833) \ 406 V(_HashVMBase, get:_index, LinkedHashMap_getIndex, 2048715833) \
406 V(_HashVMBase, set:_index, LinkedHashMap_setIndex, 1882796480) \ 407 V(_HashVMBase, set:_index, LinkedHashMap_setIndex, 1882796480) \
407 V(_HashVMBase, get:_data, LinkedHashMap_getData, 942992497) \ 408 V(_HashVMBase, get:_data, LinkedHashMap_getData, 942992497) \
408 V(_HashVMBase, set:_data, LinkedHashMap_setData, 1410623019) \ 409 V(_HashVMBase, set:_data, LinkedHashMap_setData, 1410623019) \
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 // Class that recognizes factories and returns corresponding result cid. 522 // Class that recognizes factories and returns corresponding result cid.
522 class FactoryRecognizer : public AllStatic { 523 class FactoryRecognizer : public AllStatic {
523 public: 524 public:
524 // Return kDynamicCid if factory is not recognized. 525 // Return kDynamicCid if factory is not recognized.
525 static intptr_t ResultCid(const Function& factory); 526 static intptr_t ResultCid(const Function& factory);
526 }; 527 };
527 528
528 } // namespace dart 529 } // namespace dart
529 530
530 #endif // VM_METHOD_RECOGNIZER_H_ 531 #endif // VM_METHOD_RECOGNIZER_H_
OLDNEW
« runtime/vm/intrinsifier.cc ('K') | « runtime/vm/intrinsifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698