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

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

Issue 2235433002: VM: Add more array intrinsics. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 4 years, 4 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.cc ('k') | runtime/vm/method_recognizer.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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 V(Int32x4, get:flagZ, Int32x4GetFlagZ, Bool, 0x20d61679) \ 104 V(Int32x4, get:flagZ, Int32x4GetFlagZ, Bool, 0x20d61679) \
105 V(Int32x4, get:flagW, Int32x4GetFlagW, Bool, 0x504478ac) \ 105 V(Int32x4, get:flagW, Int32x4GetFlagW, Bool, 0x504478ac) \
106 V(Int32x4, get:signMask, Int32x4GetSignMask, Dynamic, 0x2c1ec9e5) \ 106 V(Int32x4, get:signMask, Int32x4GetSignMask, Dynamic, 0x2c1ec9e5) \
107 V(Int32x4, shuffle, Int32x4Shuffle, Int32x4, 0x20bc0b16) \ 107 V(Int32x4, shuffle, Int32x4Shuffle, Int32x4, 0x20bc0b16) \
108 V(Int32x4, shuffleMix, Int32x4ShuffleMix, Int32x4, 0x5c7056e1) \ 108 V(Int32x4, shuffleMix, Int32x4ShuffleMix, Int32x4, 0x5c7056e1) \
109 V(Int32x4, select, Int32x4Select, Float32x4, 0x518ee337) \ 109 V(Int32x4, select, Int32x4Select, Float32x4, 0x518ee337) \
110 V(Int32x4, withFlagX, Int32x4WithFlagX, Int32x4, 0x0ef58fcf) \ 110 V(Int32x4, withFlagX, Int32x4WithFlagX, Int32x4, 0x0ef58fcf) \
111 V(Int32x4, withFlagY, Int32x4WithFlagY, Int32x4, 0x6485a9c4) \ 111 V(Int32x4, withFlagY, Int32x4WithFlagY, Int32x4, 0x6485a9c4) \
112 V(Int32x4, withFlagZ, Int32x4WithFlagZ, Int32x4, 0x267acdfa) \ 112 V(Int32x4, withFlagZ, Int32x4WithFlagZ, Int32x4, 0x267acdfa) \
113 V(Int32x4, withFlagW, Int32x4WithFlagW, Int32x4, 0x345ac675) \ 113 V(Int32x4, withFlagW, Int32x4WithFlagW, Int32x4, 0x345ac675) \
114 V(Float32List, [], Float32ArrayGetIndexed, Double, 0x5686528f) \
115 V(Float32List, []=, Float32ArraySetIndexed, Dynamic, 0x1b0d90df) \
116 V(Int8List, [], Int8ArrayGetIndexed, Smi, 0x069af8b3) \
117 V(Int8List, []=, Int8ArraySetIndexed, Dynamic, 0x33994cd7) \
118 V(Uint8ClampedList, [], Uint8ClampedArrayGetIndexed, Smi, 0x027603ed) \
119 V(Uint8ClampedList, []=, Uint8ClampedArraySetIndexed, Dynamic, 0x28f5f058) \
120 V(_ExternalUint8ClampedArray, [], ExternalUint8ClampedArrayGetIndexed, \
121 Smi, 0x027603ed) \
122 V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \
123 Dynamic, 0x28f5f058) \
124 V(Int16List, [], Int16ArrayGetIndexed, Smi, 0x173cd6a1) \
125 V(Int16List, []=, Int16ArraySetIndexed, Dynamic, 0x32f84e3c) \
126 V(Uint16List, [], Uint16ArrayGetIndexed, Smi, 0x3ececa2f) \
127 V(Uint16List, []=, Uint16ArraySetIndexed, Dynamic, 0x5c3a0bb9) \
128 V(Int32List, [], Int32ArrayGetIndexed, Dynamic, 0x262eef09) \
129 V(Int32List, []=, Int32ArraySetIndexed, Dynamic, 0x1b05b471) \
130 V(Int64List, [], Int64ArrayGetIndexed, Dynamic, 0x0c0c939a) \ 114 V(Int64List, [], Int64ArrayGetIndexed, Dynamic, 0x0c0c939a) \
131 V(Int64List, []=, Int64ArraySetIndexed, Dynamic, 0x3714d004) \ 115 V(Int64List, []=, Int64ArraySetIndexed, Dynamic, 0x3714d004) \
132 V(Float32x4List, [], Float32x4ArrayGetIndexed, Float32x4, 0x01c7017b) \ 116 V(Float32x4List, [], Float32x4ArrayGetIndexed, Float32x4, 0x01c7017b) \
133 V(Float32x4List, []=, Float32x4ArraySetIndexed, Dynamic, 0x56e843aa) \ 117 V(Float32x4List, []=, Float32x4ArraySetIndexed, Dynamic, 0x56e843aa) \
134 V(Int32x4List, [], Int32x4ArrayGetIndexed, Int32x4, 0x08353f8d) \ 118 V(Int32x4List, [], Int32x4ArrayGetIndexed, Int32x4, 0x08353f8d) \
135 V(Int32x4List, []=, Int32x4ArraySetIndexed, Dynamic, 0x1d9a47a5) \ 119 V(Int32x4List, []=, Int32x4ArraySetIndexed, Dynamic, 0x1d9a47a5) \
136 V(Float64x2List, [], Float64x2ArrayGetIndexed, Float64x2, 0x669b1498) \ 120 V(Float64x2List, [], Float64x2ArrayGetIndexed, Float64x2, 0x669b1498) \
137 V(Float64x2List, []=, Float64x2ArraySetIndexed, Dynamic, 0x76da6ffe) \ 121 V(Float64x2List, []=, Float64x2ArraySetIndexed, Dynamic, 0x76da6ffe) \
138 V(_Bigint, get:_neg, Bigint_getNeg, Bool, 0x7bf17a57) \ 122 V(_Bigint, get:_neg, Bigint_getNeg, Bool, 0x7bf17a57) \
139 V(_Bigint, get:_used, Bigint_getUsed, Smi, 0x55041013) \ 123 V(_Bigint, get:_used, Bigint_getUsed, Smi, 0x55041013) \
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 V(Float64List, ., TypedData_Float64Array_factory, \ 258 V(Float64List, ., TypedData_Float64Array_factory, \
275 TypedDataFloat64Array, 0x501be4f1) \ 259 TypedDataFloat64Array, 0x501be4f1) \
276 V(Float32x4List, ., TypedData_Float32x4Array_factory, \ 260 V(Float32x4List, ., TypedData_Float32x4Array_factory, \
277 TypedDataFloat32x4Array, 0x7a7dd718) \ 261 TypedDataFloat32x4Array, 0x7a7dd718) \
278 V(Int32x4List, ., TypedData_Int32x4Array_factory, \ 262 V(Int32x4List, ., TypedData_Int32x4Array_factory, \
279 TypedDataInt32x4Array, 0x1e0dca48) \ 263 TypedDataInt32x4Array, 0x1e0dca48) \
280 V(Float64x2List, ., TypedData_Float64x2Array_factory, \ 264 V(Float64x2List, ., TypedData_Float64x2Array_factory, \
281 TypedDataFloat64x2Array, 0x18cbf4d9) \ 265 TypedDataFloat64x2Array, 0x18cbf4d9) \
282 266
283 #define GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \ 267 #define GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
268 V(Int8List, [], Int8ArrayGetIndexed, Smi, 0x069af8b3) \
269 V(Int8List, []=, Int8ArraySetIndexed, Dynamic, 0x33994cd7) \
284 V(Uint8List, [], Uint8ArrayGetIndexed, Smi, 0x027603ed) \ 270 V(Uint8List, [], Uint8ArrayGetIndexed, Smi, 0x027603ed) \
285 V(Uint8List, []=, Uint8ArraySetIndexed, Dynamic, 0x060d5256) \ 271 V(Uint8List, []=, Uint8ArraySetIndexed, Dynamic, 0x060d5256) \
286 V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, Smi, 0x027603ed) \ 272 V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, Smi, 0x027603ed) \
287 V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, Dynamic, \ 273 V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, Dynamic, \
288 0x060d5256) \ 274 0x060d5256) \
275 V(Uint8ClampedList, [], Uint8ClampedArrayGetIndexed, Smi, 0x027603ed) \
276 V(Uint8ClampedList, []=, Uint8ClampedArraySetIndexed, Dynamic, 0x28f5f058) \
277 V(_ExternalUint8ClampedArray, [], ExternalUint8ClampedArrayGetIndexed, \
278 Smi, 0x027603ed) \
279 V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \
280 Dynamic, 0x28f5f058) \
281 V(Int16List, [], Int16ArrayGetIndexed, Smi, 0x173cd6a1) \
282 V(Int16List, []=, Int16ArraySetIndexed, Dynamic, 0x32f84e3c) \
283 V(Uint16List, [], Uint16ArrayGetIndexed, Smi, 0x3ececa2f) \
284 V(Uint16List, []=, Uint16ArraySetIndexed, Dynamic, 0x5c3a0bb9) \
285 V(Int32List, [], Int32ArrayGetIndexed, Dynamic, 0x262eef09) \
286 V(Int32List, []=, Int32ArraySetIndexed, Dynamic, 0x1b05b471) \
289 V(Uint32List, [], Uint32ArrayGetIndexed, Dynamic, 0x6040f7fb) \ 287 V(Uint32List, [], Uint32ArrayGetIndexed, Dynamic, 0x6040f7fb) \
290 V(Uint32List, []=, Uint32ArraySetIndexed, Dynamic, 0x3a4e1119) \ 288 V(Uint32List, []=, Uint32ArraySetIndexed, Dynamic, 0x3a4e1119) \
291 V(Float64List, [], Float64ArrayGetIndexed, Double, 0x7a27098d) \ 289 V(Float64List, [], Float64ArrayGetIndexed, Double, 0x7a27098d) \
292 V(Float64List, []=, Float64ArraySetIndexed, Dynamic, 0x139b2465) \ 290 V(Float64List, []=, Float64ArraySetIndexed, Dynamic, 0x139b2465) \
291 V(Float32List, [], Float32ArrayGetIndexed, Double, 0x5686528f) \
292 V(Float32List, []=, Float32ArraySetIndexed, Dynamic, 0x1b0d90df) \
293 V(_TypedList, get:length, TypedDataLength, Smi, 0x2090dc1a) \ 293 V(_TypedList, get:length, TypedDataLength, Smi, 0x2090dc1a) \
294 V(Float32x4, get:x, Float32x4ShuffleX, Double, 0x63d0c13f) \ 294 V(Float32x4, get:x, Float32x4ShuffleX, Double, 0x63d0c13f) \
295 V(Float32x4, get:y, Float32x4ShuffleY, Double, 0x20343b1b) \ 295 V(Float32x4, get:y, Float32x4ShuffleY, Double, 0x20343b1b) \
296 V(Float32x4, get:z, Float32x4ShuffleZ, Double, 0x13181dba) \ 296 V(Float32x4, get:z, Float32x4ShuffleZ, Double, 0x13181dba) \
297 V(Float32x4, get:w, Float32x4ShuffleW, Double, 0x69895020) \ 297 V(Float32x4, get:w, Float32x4ShuffleW, Double, 0x69895020) \
298 V(Float32x4, _mul, Float32x4Mul, Float32x4, 0x028d3146) \ 298 V(Float32x4, _mul, Float32x4Mul, Float32x4, 0x028d3146) \
299 V(Float32x4, _sub, Float32x4Sub, Float32x4, 0x062f78f7) \ 299 V(Float32x4, _sub, Float32x4Sub, Float32x4, 0x062f78f7) \
300 V(Float32x4, _add, Float32x4Add, Float32x4, 0x509f9006) \ 300 V(Float32x4, _add, Float32x4Add, Float32x4, 0x509f9006) \
301 301
302 #define GRAPH_CORE_INTRINSICS_LIST(V) \ 302 #define GRAPH_CORE_INTRINSICS_LIST(V) \
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 k##enum_name, 522 k##enum_name,
523 RECOGNIZED_LIST(DEFINE_ENUM_LIST) 523 RECOGNIZED_LIST(DEFINE_ENUM_LIST)
524 #undef DEFINE_ENUM_LIST 524 #undef DEFINE_ENUM_LIST
525 kNumRecognizedMethods 525 kNumRecognizedMethods
526 }; 526 };
527 527
528 static Kind RecognizeKind(const Function& function); 528 static Kind RecognizeKind(const Function& function);
529 static bool AlwaysInline(const Function& function); 529 static bool AlwaysInline(const Function& function);
530 static bool PolymorphicTarget(const Function& function); 530 static bool PolymorphicTarget(const Function& function);
531 static intptr_t ResultCid(const Function& function); 531 static intptr_t ResultCid(const Function& function);
532 static intptr_t MethodKindToReceiverCid(Kind kind);
532 static const char* KindToCString(Kind kind); 533 static const char* KindToCString(Kind kind);
533 #if defined(DART_NO_SNAPSHOT) 534 #if defined(DART_NO_SNAPSHOT)
534 static void InitializeState(); 535 static void InitializeState();
535 #endif // defined(DART_NO_SNAPSHOT). 536 #endif // defined(DART_NO_SNAPSHOT).
536 }; 537 };
537 538
538 539
539 #if defined(DART_NO_SNAPSHOT) 540 #if defined(DART_NO_SNAPSHOT)
540 #define CHECK_FINGERPRINT2(f, p0, p1, fp) \ 541 #define CHECK_FINGERPRINT2(f, p0, p1, fp) \
541 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp)) 542 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp))
(...skipping 26 matching lines...) Expand all
568 // Class that recognizes factories and returns corresponding result cid. 569 // Class that recognizes factories and returns corresponding result cid.
569 class FactoryRecognizer : public AllStatic { 570 class FactoryRecognizer : public AllStatic {
570 public: 571 public:
571 // Return kDynamicCid if factory is not recognized. 572 // Return kDynamicCid if factory is not recognized.
572 static intptr_t ResultCid(const Function& factory); 573 static intptr_t ResultCid(const Function& factory);
573 }; 574 };
574 575
575 } // namespace dart 576 } // namespace dart
576 577
577 #endif // VM_METHOD_RECOGNIZER_H_ 578 #endif // VM_METHOD_RECOGNIZER_H_
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier.cc ('k') | runtime/vm/method_recognizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698