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

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

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

Powered by Google App Engine
This is Rietveld 408576698