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

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: Port remaining V8 regexp tests and fix exposed bugs. 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
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, 1758627989) \ 40 V(_StringBase, _interpolate, StringBaseInterpolate, 1758627989) \
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 V(_StringBase, [], StringBaseCharAt, 1512210677) \ 188 V(_StringBase, [], StringBaseCharAt, 1512210677) \
183 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 1111837929) \ 189 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 1111837929) \
184 V(_OneByteString, _substringUncheckedNative, \ 190 V(_OneByteString, _substringUncheckedNative, \
185 OneByteString_substringUnchecked, 1527498975) \ 191 OneByteString_substringUnchecked, 1527498975) \
186 V(_OneByteString, _setAt, OneByteStringSetAt, 468605749) \ 192 V(_OneByteString, _setAt, OneByteStringSetAt, 468605749) \
187 V(_OneByteString, _allocate, OneByteString_allocate, 2035417022) \ 193 V(_OneByteString, _allocate, OneByteString_allocate, 2035417022) \
188 V(_OneByteString, ==, OneByteString_equality, 1727047023) \ 194 V(_OneByteString, ==, OneByteString_equality, 1727047023) \
189 V(_TwoByteString, ==, TwoByteString_equality, 951149689) \ 195 V(_TwoByteString, ==, TwoByteString_equality, 951149689) \
190 196
191 197
198 // TODO(jgruber): Remove this list and add _ExecuteMatch to
199 // CORE_LIB_INTRINSIC_LIST once irregexp code has been implemented for all
200 // architectures and JSCRE has been removed.
201 #if defined(USE_JSCRE)
202 #define CORE_REGEXP_LIB_INTRINSIC_LIST(V)
203 #else
204 #define CORE_REGEXP_LIB_INTRINSIC_LIST(V) \
205 V(_JSSyntaxRegExp, _ExecuteMatch, JSRegExp_ExecuteMatch, 1654250896)
206 #endif
207
208
192 #define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \ 209 #define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \
193 V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \ 210 V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \
194 438687793) \ 211 438687793) \
195 V(_IntegerImplementation, +, Integer_add, 501253666) \ 212 V(_IntegerImplementation, +, Integer_add, 501253666) \
196 V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \ 213 V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \
197 562800077) \ 214 562800077) \
198 V(_IntegerImplementation, -, Integer_sub, 1819430179) \ 215 V(_IntegerImplementation, -, Integer_sub, 1819430179) \
199 V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \ 216 V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \
200 67891834) \ 217 67891834) \
201 V(_IntegerImplementation, *, Integer_mul, 1787870724) \ 218 V(_IntegerImplementation, *, Integer_mul, 1787870724) \
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 GRAPH_CORE_INTRINSICS_LIST(V) \ 301 GRAPH_CORE_INTRINSICS_LIST(V) \
285 GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \ 302 GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
286 303
287 #define PROFILER_LIB_INTRINSIC_LIST(V) \ 304 #define PROFILER_LIB_INTRINSIC_LIST(V) \
288 V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \ 305 V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \
289 V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \ 306 V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \
290 V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \ 307 V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \
291 308
292 #define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \ 309 #define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
293 CORE_LIB_INTRINSIC_LIST(V) \ 310 CORE_LIB_INTRINSIC_LIST(V) \
311 CORE_REGEXP_LIB_INTRINSIC_LIST(V) \
294 MATH_LIB_INTRINSIC_LIST(V) \ 312 MATH_LIB_INTRINSIC_LIST(V) \
295 TYPED_DATA_LIB_INTRINSIC_LIST(V) \ 313 TYPED_DATA_LIB_INTRINSIC_LIST(V) \
296 PROFILER_LIB_INTRINSIC_LIST(V) 314 PROFILER_LIB_INTRINSIC_LIST(V)
297 315
298 #define ALL_INTRINSICS_LIST(V) \ 316 #define ALL_INTRINSICS_LIST(V) \
299 ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \ 317 ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
300 CORE_INTEGER_LIB_INTRINSIC_LIST(V) 318 CORE_INTEGER_LIB_INTRINSIC_LIST(V)
301 319
302 #define RECOGNIZED_LIST(V) \ 320 #define RECOGNIZED_LIST(V) \
303 OTHER_RECOGNIZED_LIST(V) \ 321 OTHER_RECOGNIZED_LIST(V) \
304 ALL_INTRINSICS_LIST(V) \ 322 ALL_INTRINSICS_LIST(V) \
305 GRAPH_INTRINSICS_LIST(V) 323 GRAPH_INTRINSICS_LIST(V)
306 324
307 // A list of core function that should always be inlined. 325 // A list of core function that should always be inlined.
308 #define INLINE_WHITE_LIST(V) \ 326 #define INLINE_WHITE_LIST(V) \
309 V(Object, ==, ObjectEquals, 1068471689) \ 327 V(Object, ==, ObjectEquals, 1068471689) \
310 V(_List, get:length, ObjectArrayLength, 1181352729) \ 328 V(_List, get:length, ObjectArrayLength, 1181352729) \
311 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \ 329 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \
312 V(_TypedList, get:length, TypedDataLength, 522565357) \ 330 V(_TypedList, get:length, TypedDataLength, 522565357) \
313 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \ 331 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \
314 V(_StringBase, get:length, StringBaseLength, 784399628) \ 332 V(_StringBase, get:length, StringBaseLength, 784399628) \
333 V(_GrowableList, add, GrowableListAdd, 1899133961) \
334 V(_GrowableList, removeLast, GrowableListRemoveLast, 1274907639) \
335 V(_OneByteString, _oneCodeUnitAt, OneByteString_oneCodeUnitAt, 1042963962) \
336 V(_OneByteString, _twoCodeUnitsAt, OneByteString_twoCodeUnitsAt, 1094453328) \
337 V(_OneByteString, _fourCodeUnitsAt, OneByteString_fourCodeUnitsAt, \
338 1600083803) \
339 V(_TwoByteString, _oneCodeUnitAt, TwoByteString_oneCodeUnitAt, 1205041289) \
340 V(_TwoByteString, _twoCodeUnitsAt, TwoByteString_twoCodeUnitsAt, 1256530655) \
315 V(ListIterator, moveNext, ListIteratorMoveNext, 210829138) \ 341 V(ListIterator, moveNext, ListIteratorMoveNext, 210829138) \
316 V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 1147271335) \ 342 V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 1147271335) \
317 V(_GrowableList, get:iterator, GrowableArrayIterator, 1812933946) \ 343 V(_GrowableList, get:iterator, GrowableArrayIterator, 1812933946) \
318 V(_GrowableList, forEach, GrowableArrayForEach, 2085943947) \ 344 V(_GrowableList, forEach, GrowableArrayForEach, 2085943947) \
319 V(_List, ., ObjectArrayAllocate, 1595327584) \ 345 V(_List, ., ObjectArrayAllocate, 1595327584) \
320 V(_List, [], ObjectArrayGetIndexed, 795612476) \ 346 V(_List, [], ObjectArrayGetIndexed, 795612476) \
321 V(_List, []=, ObjectArraySetIndexed, 1288827575) \ 347 V(_List, []=, ObjectArraySetIndexed, 1288827575) \
322 V(_List, get:isEmpty, ObjectArrayIsEmpty, 2130247737) \ 348 V(_List, get:isEmpty, ObjectArrayIsEmpty, 2130247737) \
323 V(_List, get:iterator, ObjectArrayIterator, 458612415) \ 349 V(_List, get:iterator, ObjectArrayIterator, 458612415) \
324 V(_List, forEach, ObjectArrayForEach, 592525445) \ 350 V(_List, forEach, ObjectArrayForEach, 592525445) \
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 static Kind RecognizeKind(const Function& function); 437 static Kind RecognizeKind(const Function& function);
412 static bool AlwaysInline(const Function& function); 438 static bool AlwaysInline(const Function& function);
413 static bool PolymorphicTarget(const Function& function); 439 static bool PolymorphicTarget(const Function& function);
414 static const char* KindToCString(Kind kind); 440 static const char* KindToCString(Kind kind);
415 static void InitializeState(); 441 static void InitializeState();
416 }; 442 };
417 443
418 } // namespace dart 444 } // namespace dart
419 445
420 #endif // VM_METHOD_RECOGNIZER_H_ 446 #endif // VM_METHOD_RECOGNIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698