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

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

Issue 539153002: Port and integrate the irregexp engine from V8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed Ivan's comments. Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intrinsifier_x64.cc ('k') | runtime/vm/object.h » ('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 20 matching lines...) Expand all
31 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 149406583) \ 31 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 149406583) \
32 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 805477162) \ 32 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 805477162) \
33 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 888580944) \ 33 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 888580944) \
34 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1708248181) \ 34 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1708248181) \
35 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1863152792) \ 35 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1863152792) \
36 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1148703855) \ 36 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1148703855) \
37 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 972883980) \ 37 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 972883980) \
38 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 950522310) \ 38 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 950522310) \
39 V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 1301138078) \ 39 V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 1301138078) \
40 V(_StringBase, _interpolate, StringBaseInterpolate, 1540062866) \ 40 V(_StringBase, _interpolate, StringBaseInterpolate, 1540062866) \
41 V(_OneByteString, _oneCodeUnitAt, OneByteString_oneCodeUnitAt, 1042963962) \
42 V(_OneByteString, _twoCodeUnitsAt, OneByteString_twoCodeUnitsAt, 1094453328) \
43 V(_OneByteString, _fourCodeUnitsAt, OneByteString_fourCodeUnitsAt, \
44 1600083803) \
45 V(_TwoByteString, _oneCodeUnitAt, TwoByteString_oneCodeUnitAt, 1205041289) \
46 V(_TwoByteString, _twoCodeUnitsAt, TwoByteString_twoCodeUnitsAt, 1256530655) \
41 V(_IntegerImplementation, toDouble, IntegerToDouble, 1084977108) \ 47 V(_IntegerImplementation, toDouble, IntegerToDouble, 1084977108) \
42 V(_IntegerImplementation, _leftShiftWithMask32, IntegerLeftShiftWithMask32, \ 48 V(_IntegerImplementation, _leftShiftWithMask32, IntegerLeftShiftWithMask32, \
43 597111055) \ 49 597111055) \
44 V(_Double, truncateToDouble, DoubleTruncate, 2117801967) \ 50 V(_Double, truncateToDouble, DoubleTruncate, 2117801967) \
45 V(_Double, roundToDouble, DoubleRound, 2124216110) \ 51 V(_Double, roundToDouble, DoubleRound, 2124216110) \
46 V(_Double, floorToDouble, DoubleFloor, 968600699) \ 52 V(_Double, floorToDouble, DoubleFloor, 968600699) \
47 V(_Double, ceilToDouble, DoubleCeil, 1779929274) \ 53 V(_Double, ceilToDouble, DoubleCeil, 1779929274) \
48 V(_Double, _modulo, DoubleMod, 1473971007) \ 54 V(_Double, _modulo, DoubleMod, 1473971007) \
49 V(_Double, _add, DoubleAdd, 1570715125) \ 55 V(_Double, _add, DoubleAdd, 1570715125) \
50 V(_Double, _sub, DoubleSub, 1466395310) \ 56 V(_Double, _sub, DoubleSub, 1466395310) \
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 V(_StringBase, [], StringBaseCharAt, 1512210677) \ 193 V(_StringBase, [], StringBaseCharAt, 1512210677) \
188 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 1111837929) \ 194 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 1111837929) \
189 V(_OneByteString, _substringUncheckedNative, \ 195 V(_OneByteString, _substringUncheckedNative, \
190 OneByteString_substringUnchecked, 1527498975) \ 196 OneByteString_substringUnchecked, 1527498975) \
191 V(_OneByteString, _setAt, OneByteStringSetAt, 468605749) \ 197 V(_OneByteString, _setAt, OneByteStringSetAt, 468605749) \
192 V(_OneByteString, _allocate, OneByteString_allocate, 2035417022) \ 198 V(_OneByteString, _allocate, OneByteString_allocate, 2035417022) \
193 V(_OneByteString, ==, OneByteString_equality, 1727047023) \ 199 V(_OneByteString, ==, OneByteString_equality, 1727047023) \
194 V(_TwoByteString, ==, TwoByteString_equality, 951149689) \ 200 V(_TwoByteString, ==, TwoByteString_equality, 951149689) \
195 201
196 202
203 // TODO(jgruber): Remove this list and add _ExecuteMatch to
204 // CORE_LIB_INTRINSIC_LIST once irregexp code has been implemented for all
205 // architectures and JSCRE has been removed.
206 #if defined(USE_JSCRE)
207 #define CORE_REGEXP_LIB_INTRINSIC_LIST(V)
208 #else
209 #define CORE_REGEXP_LIB_INTRINSIC_LIST(V) \
210 V(_JSSyntaxRegExp, _ExecuteMatch, JSRegExp_ExecuteMatch, 1654250896)
211 #endif
212
213
197 #define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \ 214 #define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \
198 V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \ 215 V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \
199 438687793) \ 216 438687793) \
200 V(_IntegerImplementation, +, Integer_add, 501253666) \ 217 V(_IntegerImplementation, +, Integer_add, 501253666) \
201 V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \ 218 V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \
202 562800077) \ 219 562800077) \
203 V(_IntegerImplementation, -, Integer_sub, 1819430179) \ 220 V(_IntegerImplementation, -, Integer_sub, 1819430179) \
204 V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \ 221 V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \
205 67891834) \ 222 67891834) \
206 V(_IntegerImplementation, *, Integer_mul, 1787870724) \ 223 V(_IntegerImplementation, *, Integer_mul, 1787870724) \
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 GRAPH_CORE_INTRINSICS_LIST(V) \ 306 GRAPH_CORE_INTRINSICS_LIST(V) \
290 GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \ 307 GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
291 308
292 #define PROFILER_LIB_INTRINSIC_LIST(V) \ 309 #define PROFILER_LIB_INTRINSIC_LIST(V) \
293 V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \ 310 V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \
294 V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \ 311 V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \
295 V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \ 312 V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \
296 313
297 #define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \ 314 #define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
298 CORE_LIB_INTRINSIC_LIST(V) \ 315 CORE_LIB_INTRINSIC_LIST(V) \
316 CORE_REGEXP_LIB_INTRINSIC_LIST(V) \
299 MATH_LIB_INTRINSIC_LIST(V) \ 317 MATH_LIB_INTRINSIC_LIST(V) \
300 TYPED_DATA_LIB_INTRINSIC_LIST(V) \ 318 TYPED_DATA_LIB_INTRINSIC_LIST(V) \
301 PROFILER_LIB_INTRINSIC_LIST(V) 319 PROFILER_LIB_INTRINSIC_LIST(V)
302 320
303 #define ALL_INTRINSICS_LIST(V) \ 321 #define ALL_INTRINSICS_LIST(V) \
304 ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \ 322 ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
305 CORE_INTEGER_LIB_INTRINSIC_LIST(V) 323 CORE_INTEGER_LIB_INTRINSIC_LIST(V)
306 324
307 #define RECOGNIZED_LIST(V) \ 325 #define RECOGNIZED_LIST(V) \
308 OTHER_RECOGNIZED_LIST(V) \ 326 OTHER_RECOGNIZED_LIST(V) \
309 ALL_INTRINSICS_LIST(V) \ 327 ALL_INTRINSICS_LIST(V) \
310 GRAPH_INTRINSICS_LIST(V) 328 GRAPH_INTRINSICS_LIST(V)
311 329
312 // A list of core function that should always be inlined. 330 // A list of core function that should always be inlined.
313 #define INLINE_WHITE_LIST(V) \ 331 #define INLINE_WHITE_LIST(V) \
314 V(Object, ==, ObjectEquals, 1068471689) \ 332 V(Object, ==, ObjectEquals, 1068471689) \
315 V(_List, get:length, ObjectArrayLength, 1181352729) \ 333 V(_List, get:length, ObjectArrayLength, 1181352729) \
316 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \ 334 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \
317 V(_TypedList, get:length, TypedDataLength, 522565357) \ 335 V(_TypedList, get:length, TypedDataLength, 522565357) \
318 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \ 336 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \
319 V(_StringBase, get:length, StringBaseLength, 784399628) \ 337 V(_StringBase, get:length, StringBaseLength, 784399628) \
338 V(_GrowableList, add, GrowableListAdd, 1899133961) \
339 V(_GrowableList, removeLast, GrowableListRemoveLast, 1274907639) \
340 V(_OneByteString, _oneCodeUnitAt, OneByteString_oneCodeUnitAt, 1042963962) \
341 V(_OneByteString, _twoCodeUnitsAt, OneByteString_twoCodeUnitsAt, 1094453328) \
342 V(_OneByteString, _fourCodeUnitsAt, OneByteString_fourCodeUnitsAt, \
343 1600083803) \
344 V(_TwoByteString, _oneCodeUnitAt, TwoByteString_oneCodeUnitAt, 1205041289) \
345 V(_TwoByteString, _twoCodeUnitsAt, TwoByteString_twoCodeUnitsAt, 1256530655) \
320 V(ListIterator, moveNext, ListIteratorMoveNext, 210829138) \ 346 V(ListIterator, moveNext, ListIteratorMoveNext, 210829138) \
321 V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 1147271335) \ 347 V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 1147271335) \
322 V(_GrowableList, get:iterator, GrowableArrayIterator, 1812933946) \ 348 V(_GrowableList, get:iterator, GrowableArrayIterator, 1812933946) \
323 V(_GrowableList, forEach, GrowableArrayForEach, 2085943947) \ 349 V(_GrowableList, forEach, GrowableArrayForEach, 2085943947) \
324 V(_List, ., ObjectArrayAllocate, 1595327584) \ 350 V(_List, ., ObjectArrayAllocate, 1595327584) \
325 V(_List, [], ObjectArrayGetIndexed, 795612476) \ 351 V(_List, [], ObjectArrayGetIndexed, 795612476) \
326 V(_List, []=, ObjectArraySetIndexed, 1288827575) \ 352 V(_List, []=, ObjectArraySetIndexed, 1288827575) \
327 V(_List, get:isEmpty, ObjectArrayIsEmpty, 2130247737) \ 353 V(_List, get:isEmpty, ObjectArrayIsEmpty, 2130247737) \
328 V(_List, get:iterator, ObjectArrayIterator, 458612415) \ 354 V(_List, get:iterator, ObjectArrayIterator, 458612415) \
329 V(_List, forEach, ObjectArrayForEach, 592525445) \ 355 V(_List, forEach, ObjectArrayForEach, 592525445) \
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 static Kind RecognizeKind(const Function& function); 442 static Kind RecognizeKind(const Function& function);
417 static bool AlwaysInline(const Function& function); 443 static bool AlwaysInline(const Function& function);
418 static bool PolymorphicTarget(const Function& function); 444 static bool PolymorphicTarget(const Function& function);
419 static const char* KindToCString(Kind kind); 445 static const char* KindToCString(Kind kind);
420 static void InitializeState(); 446 static void InitializeState();
421 }; 447 };
422 448
423 } // namespace dart 449 } // namespace dart
424 450
425 #endif // VM_METHOD_RECOGNIZER_H_ 451 #endif // VM_METHOD_RECOGNIZER_H_
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_x64.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698