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

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

Issue 1782003002: Simplify the VM's typed_data constructors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: added comment 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
« no previous file with comments | « runtime/vm/intrinsifier_x64.cc ('k') | runtime/vm/profiler_test.cc » ('j') | 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 V(_IntegerImplementation, >>, Integer_sar, 125091101) \ 238 V(_IntegerImplementation, >>, Integer_sar, 125091101) \
239 V(_Double, toInt, DoubleToInteger, 653210699) 239 V(_Double, toInt, DoubleToInteger, 653210699)
240 240
241 241
242 #define MATH_LIB_INTRINSIC_LIST(V) \ 242 #define MATH_LIB_INTRINSIC_LIST(V) \
243 V(::, sqrt, MathSqrt, 1446681622) \ 243 V(::, sqrt, MathSqrt, 1446681622) \
244 V(_Random, _nextState, Random_nextState, 1241583299) \ 244 V(_Random, _nextState, Random_nextState, 1241583299) \
245 245
246 246
247 #define TYPED_DATA_LIB_INTRINSIC_LIST(V) \ 247 #define TYPED_DATA_LIB_INTRINSIC_LIST(V) \
248 V(_Int8Array, _new, TypedData_Int8Array_new, 1025382728) \ 248 V(_Int8Array, ., TypedData_Int8Array_factory, 1058992179) \
249 V(_Uint8Array, _new, TypedData_Uint8Array_new, 1772090315) \ 249 V(_Uint8Array, ., TypedData_Uint8Array_factory, 1807546986) \
250 V(_Uint8ClampedArray, _new, TypedData_Uint8ClampedArray_new, 1817995920) \ 250 V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 548459853) \
251 V(_Int16Array, _new, TypedData_Int16Array_new, 857482727) \ 251 V(_Int16Array, ., TypedData_Int16Array_factory, 1796211480) \
252 V(_Uint16Array, _new, TypedData_Uint16Array_new, 224498043) \ 252 V(_Uint16Array, ., TypedData_Uint16Array_factory, 1960868166) \
253 V(_Int32Array, _new, TypedData_Int32Array_new, 662785062) \ 253 V(_Int32Array, ., TypedData_Int32Array_factory, 372258367) \
254 V(_Uint32Array, _new, TypedData_Uint32Array_new, 457777042) \ 254 V(_Uint32Array, ., TypedData_Uint32Array_factory, 1446612721) \
255 V(_Int64Array, _new, TypedData_Int64Array_new, 11424776) \ 255 V(_Int64Array, ., TypedData_Int64Array_factory, 964028713) \
256 V(_Uint64Array, _new, TypedData_Uint64Array_new, 580841705) \ 256 V(_Uint64Array, ., TypedData_Uint64Array_factory, 721823156) \
257 V(_Float32Array, _new, TypedData_Float32Array_new, 141243383) \ 257 V(_Float32Array, ., TypedData_Float32Array_factory, 392399264) \
258 V(_Float64Array, _new, TypedData_Float64Array_new, 2054234881) \ 258 V(_Float64Array, ., TypedData_Float64Array_factory, 42503976) \
259 V(_Float32x4Array, _new, TypedData_Float32x4Array_new, 1277009760) \ 259 V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1960198693) \
260 V(_Int32x4Array, _new, TypedData_Int32x4Array_new, 366994774) \ 260 V(_Int32x4Array, ., TypedData_Int32x4Array_factory, 1433742555) \
261 V(_Float64x2Array, _new, TypedData_Float64x2Array_new, 134695262) \ 261 V(_Float64x2Array, ., TypedData_Float64x2Array_factory, 165463437) \
262 V(_Int8Array, ., TypedData_Int8Array_factory, 484088513) \
263 V(_Uint8Array, ., TypedData_Uint8Array_factory, 1830561671) \
264 V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 980532456) \
265 V(_Int16Array, ., TypedData_Int16Array_factory, 2095566414) \
266 V(_Uint16Array, ., TypedData_Uint16Array_factory, 248627537) \
267 V(_Int32Array, ., TypedData_Int32Array_factory, 836050202) \
268 V(_Uint32Array, ., TypedData_Uint32Array_factory, 102123815) \
269 V(_Int64Array, ., TypedData_Int64Array_factory, 1820730838) \
270 V(_Uint64Array, ., TypedData_Uint64Array_factory, 1668399825) \
271 V(_Float32Array, ., TypedData_Float32Array_factory, 307228626) \
272 V(_Float64Array, ., TypedData_Float64Array_factory, 1700923139) \
273 V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1083909924) \
274 V(_Int32x4Array, ., TypedData_Int32x4Array_factory, 803703492) \
275 V(_Float64x2Array, ., TypedData_Float64x2Array_factory, 944719167) \
276 262
277 #define GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \ 263 #define GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
278 V(_Uint8Array, [], Uint8ArrayGetIndexed, 513704632) \ 264 V(_Uint8Array, [], Uint8ArrayGetIndexed, 513704632) \
279 V(_Uint8Array, []=, Uint8ArraySetIndexed, 2123520783) \ 265 V(_Uint8Array, []=, Uint8ArraySetIndexed, 2123520783) \
280 V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 513704632) \ 266 V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 513704632) \
281 V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 2123520783) \ 267 V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 2123520783) \
282 V(_Uint32Array, [], Uint32ArrayGetIndexed, 1179675338) \ 268 V(_Uint32Array, [], Uint32ArrayGetIndexed, 1179675338) \
283 V(_Uint32Array, []=, Uint32ArraySetIndexed, 1455695417) \ 269 V(_Uint32Array, []=, Uint32ArraySetIndexed, 1455695417) \
284 V(_Float64Array, []=, Float64ArraySetIndexed, 1929239576) \ 270 V(_Float64Array, []=, Float64ArraySetIndexed, 1929239576) \
285 V(_Float64Array, [], Float64ArrayGetIndexed, 816943529) \ 271 V(_Float64Array, [], Float64ArrayGetIndexed, 816943529) \
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp)) 497 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp))
512 #endif // defined(DART_NO_SNAPSHOT). 498 #endif // defined(DART_NO_SNAPSHOT).
513 499
514 500
515 // List of recognized list factories: 501 // List of recognized list factories:
516 // (factory-name-symbol, result-cid, fingerprint). 502 // (factory-name-symbol, result-cid, fingerprint).
517 #define RECOGNIZED_LIST_FACTORY_LIST(V) \ 503 #define RECOGNIZED_LIST_FACTORY_LIST(V) \
518 V(_ListFactory, kArrayCid, 184405219) \ 504 V(_ListFactory, kArrayCid, 184405219) \
519 V(_GrowableListWithData, kGrowableObjectArrayCid, 131424500) \ 505 V(_GrowableListWithData, kGrowableObjectArrayCid, 131424500) \
520 V(_GrowableListFactory, kGrowableObjectArrayCid, 664918385) \ 506 V(_GrowableListFactory, kGrowableObjectArrayCid, 664918385) \
521 V(_Int8ArrayFactory, kTypedDataInt8ArrayCid, 484088513) \ 507 V(_Int8ArrayFactory, kTypedDataInt8ArrayCid, 1058992179) \
522 V(_Uint8ArrayFactory, kTypedDataUint8ArrayCid, 1830561671) \ 508 V(_Uint8ArrayFactory, kTypedDataUint8ArrayCid, 1807546986) \
523 V(_Uint8ClampedArrayFactory, kTypedDataUint8ClampedArrayCid, 980532456) \ 509 V(_Uint8ClampedArrayFactory, kTypedDataUint8ClampedArrayCid, 548459853) \
524 V(_Int16ArrayFactory, kTypedDataInt16ArrayCid, 2095566414) \ 510 V(_Int16ArrayFactory, kTypedDataInt16ArrayCid, 1796211480) \
525 V(_Uint16ArrayFactory, kTypedDataUint16ArrayCid, 248627537) \ 511 V(_Uint16ArrayFactory, kTypedDataUint16ArrayCid, 1960868166) \
526 V(_Int32ArrayFactory, kTypedDataInt32ArrayCid, 836050202) \ 512 V(_Int32ArrayFactory, kTypedDataInt32ArrayCid, 372258367) \
527 V(_Uint32ArrayFactory, kTypedDataUint32ArrayCid, 102123815) \ 513 V(_Uint32ArrayFactory, kTypedDataUint32ArrayCid, 1446612721) \
528 V(_Int64ArrayFactory, kTypedDataInt64ArrayCid, 1820730838) \ 514 V(_Int64ArrayFactory, kTypedDataInt64ArrayCid, 964028713) \
529 V(_Uint64ArrayFactory, kTypedDataUint64ArrayCid, 1668399825) \ 515 V(_Uint64ArrayFactory, kTypedDataUint64ArrayCid, 721823156) \
530 V(_Float64ArrayFactory, kTypedDataFloat64ArrayCid, 1700923139) \ 516 V(_Float64ArrayFactory, kTypedDataFloat64ArrayCid, 42503976) \
531 V(_Float32ArrayFactory, kTypedDataFloat32ArrayCid, 307228626) \ 517 V(_Float32ArrayFactory, kTypedDataFloat32ArrayCid, 392399264) \
532 V(_Float32x4ArrayFactory, kTypedDataFloat32x4ArrayCid, 1083909924) \ 518 V(_Float32x4ArrayFactory, kTypedDataFloat32x4ArrayCid, 1960198693) \
533 519
534 520
535 // Class that recognizes factories and returns corresponding result cid. 521 // Class that recognizes factories and returns corresponding result cid.
536 class FactoryRecognizer : public AllStatic { 522 class FactoryRecognizer : public AllStatic {
537 public: 523 public:
538 // Return kDynamicCid if factory is not recognized. 524 // Return kDynamicCid if factory is not recognized.
539 static intptr_t ResultCid(const Function& factory); 525 static intptr_t ResultCid(const Function& factory);
540 }; 526 };
541 527
542 } // namespace dart 528 } // namespace dart
543 529
544 #endif // VM_METHOD_RECOGNIZER_H_ 530 #endif // VM_METHOD_RECOGNIZER_H_
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_x64.cc ('k') | runtime/vm/profiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698