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

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

Issue 22916006: Move the begin token of explicit functions to the start of the function declaration. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Class for intrinsifying functions. 4 // Class for intrinsifying functions.
5 5
6 #ifndef VM_INTRINSIFIER_H_ 6 #ifndef VM_INTRINSIFIER_H_
7 #define VM_INTRINSIFIER_H_ 7 #define VM_INTRINSIFIER_H_
8 8
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 // List of intrinsics: 13 // List of intrinsics:
14 // (class-name, function-name, intrinsification method, fingerprint). 14 // (class-name, function-name, intrinsification method, fingerprint).
15 // 15 //
16 // When adding a new function for intrinsification add a 0 as fingerprint, 16 // When adding a new function for intrinsification add a 0 as fingerprint,
17 // build and run to get the correct fingerprint from the mismatch error. 17 // build and run to get the correct fingerprint from the mismatch error.
18 #define CORE_LIB_INTRINSIC_LIST(V) \ 18 #define CORE_LIB_INTRINSIC_LIST(V) \
19 V(_Smi, ~, Smi_bitNegate, 2098673794) \ 19 V(_Smi, ~, Smi_bitNegate, 824551298) \
20 V(_Double, >, Double_greaterThan, 498448864) \ 20 V(_Double, >, Double_greaterThan, 1021232334) \
21 V(_Double, >=, Double_greaterEqualThan, 1322959863) \ 21 V(_Double, >=, Double_greaterEqualThan, 324955595) \
22 V(_Double, <, Double_lessThan, 1595326820) \ 22 V(_Double, <, Double_lessThan, 978151157) \
23 V(_Double, <=, Double_lessEqualThan, 1322930072) \ 23 V(_Double, <=, Double_lessEqualThan, 1169397675) \
24 V(_Double, ==, Double_equal, 1012968674) \ 24 V(_Double, ==, Double_equal, 223604237) \
25 V(_Double, +, Double_add, 407090160) \ 25 V(_Double, +, Double_add, 295873577) \
26 V(_Double, -, Double_sub, 1801868246) \ 26 V(_Double, -, Double_sub, 1180117486) \
27 V(_Double, *, Double_mul, 984784342) \ 27 V(_Double, *, Double_mul, 1999983053) \
28 V(_Double, /, Double_div, 1399344917) \ 28 V(_Double, /, Double_div, 1904009451) \
29 V(_Double, get:isNaN, Double_getIsNaN, 54462366) \ 29 V(_Double, get:isNaN, Double_getIsNaN, 266197199) \
30 V(_Double, get:isNegative, Double_getIsNegative, 54462366) \ 30 V(_Double, get:isNegative, Double_getIsNegative, 264643149) \
31 V(_Double, _mulFromInteger, Double_mulFromInteger, 550294258) \ 31 V(_Double, _mulFromInteger, Double_mulFromInteger, 930284178) \
32 V(_Double, .fromInteger, Double_fromInteger, 881555713) \ 32 V(_Double, .fromInteger, Double_fromInteger, 1488487599) \
33 V(_ObjectArray, ., ObjectArray_Allocate, 1149848530) \ 33 V(_ObjectArray, ., ObjectArray_Allocate, 712468799) \
34 V(_ObjectArray, get:length, Array_getLength, 405297088) \ 34 V(_ObjectArray, get:length, Array_getLength, 1441000484) \
35 V(_ObjectArray, [], Array_getIndexed, 1573881683) \ 35 V(_ObjectArray, [], Array_getIndexed, 658292540) \
36 V(_ObjectArray, []=, Array_setIndexed, 1644545484) \ 36 V(_ObjectArray, []=, Array_setIndexed, 134661366) \
37 V(_GrowableObjectArray, .withData, GrowableArray_Allocate, 569069682) \ 37 V(_GrowableObjectArray, .withData, GrowableArray_Allocate, 917195627) \
38 V(_GrowableObjectArray, get:length, GrowableArray_getLength, 725548050) \ 38 V(_GrowableObjectArray, get:length, GrowableArray_getLength, 767561362) \
39 V(_GrowableObjectArray, get:_capacity, GrowableArray_getCapacity, 725548050) \ 39 V(_GrowableObjectArray, get:_capacity, GrowableArray_getCapacity, 874559046) \
40 V(_GrowableObjectArray, [], GrowableArray_getIndexed, 1889032295) \ 40 V(_GrowableObjectArray, [], GrowableArray_getIndexed, 1020883940) \
41 V(_GrowableObjectArray, []=, GrowableArray_setIndexed, 934874427) \ 41 V(_GrowableObjectArray, []=, GrowableArray_setIndexed, 366077215) \
42 V(_GrowableObjectArray, _setLength, GrowableArray_setLength, 279007375) \ 42 V(_GrowableObjectArray, _setLength, GrowableArray_setLength, 1016226171) \
43 V(_GrowableObjectArray, _setData, GrowableArray_setData, 588108129) \ 43 V(_GrowableObjectArray, _setData, GrowableArray_setData, 1302055339) \
44 V(_GrowableObjectArray, add, GrowableArray_add, 112207566) \ 44 V(_GrowableObjectArray, add, GrowableArray_add, 1442410650) \
45 V(_ImmutableArray, [], ImmutableArray_getIndexed, 1456194617) \ 45 V(_ImmutableArray, [], ImmutableArray_getIndexed, 1483706518) \
46 V(_ImmutableArray, get:length, ImmutableArray_getLength, 433698233) \ 46 V(_ImmutableArray, get:length, ImmutableArray_getLength, 1430953867) \
47 V(Object, ==, Object_equal, 2126867222) \ 47 V(Object, ==, Object_equal, 677817295) \
48 V(_StringBase, get:hashCode, String_getHashCode, 320803993) \ 48 V(_StringBase, get:hashCode, String_getHashCode, 1654013013) \
49 V(_StringBase, get:isEmpty, String_getIsEmpty, 110631520) \ 49 V(_StringBase, get:isEmpty, String_getIsEmpty, 1588094430) \
50 V(_StringBase, get:length, String_getLength, 320803993) \ 50 V(_StringBase, get:length, String_getLength, 1158042795) \
51 V(_StringBase, codeUnitAt, String_codeUnitAt, 1574843871) \ 51 V(_StringBase, codeUnitAt, String_codeUnitAt, 1452213966) \
52 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 682660413) \ 52 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 1350708273) \
53 V(_OneByteString, _substringUncheckedNative, \ 53 V(_OneByteString, _substringUncheckedNative, \
54 OneByteString_substringUnchecked, 756784624) \ 54 OneByteString_substringUnchecked, 1409543330) \
55 V(_OneByteString, _setAt, OneByteString_setAt, 1038132016) \ 55 V(_OneByteString, _setAt, OneByteString_setAt, 456985263) \
56 V(_OneByteString, _allocate, OneByteString_allocate, 716379334) \ 56 V(_OneByteString, _allocate, OneByteString_allocate, 1842287414) \
57 57
58 58
59 #define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \ 59 #define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \
60 V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \ 60 V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \
61 1074291215) \ 61 1061271878) \
62 V(_IntegerImplementation, +, Integer_add, 25837296) \ 62 V(_IntegerImplementation, +, Integer_add, 714540399) \
63 V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \ 63 V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \
64 1074291215) \ 64 585090868) \
65 V(_IntegerImplementation, -, Integer_sub, 1697139934) \ 65 V(_IntegerImplementation, -, Integer_sub, 1880284412) \
66 V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \ 66 V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \
67 1074291215) \ 67 1145805333) \
68 V(_IntegerImplementation, *, Integer_mul, 110370751) \ 68 V(_IntegerImplementation, *, Integer_mul, 1935440252) \
69 V(_IntegerImplementation, %, Integer_modulo, 980686435) \ 69 V(_IntegerImplementation, %, Integer_modulo, 1121942909) \
70 V(_IntegerImplementation, remainder, Integer_remainder, 1536426035) \ 70 V(_IntegerImplementation, remainder, Integer_remainder, 2140653009) \
71 V(_IntegerImplementation, ~/, Integer_truncDivide, 2059401166) \ 71 V(_IntegerImplementation, ~/, Integer_truncDivide, 250357385) \
72 V(_IntegerImplementation, unary-, Integer_negate, 675709702) \ 72 V(_IntegerImplementation, unary-, Integer_negate, 732448114) \
73 V(_IntegerImplementation, _bitAndFromInteger, \ 73 V(_IntegerImplementation, _bitAndFromInteger, \
74 Integer_bitAndFromInteger, 1074291215) \ 74 Integer_bitAndFromInteger, 1957162220) \
75 V(_IntegerImplementation, &, Integer_bitAnd, 759019505) \ 75 V(_IntegerImplementation, &, Integer_bitAnd, 1677634910) \
76 V(_IntegerImplementation, _bitOrFromInteger, \ 76 V(_IntegerImplementation, _bitOrFromInteger, \
77 Integer_bitOrFromInteger, 1074291215) \ 77 Integer_bitOrFromInteger, 331026365) \
78 V(_IntegerImplementation, |, Integer_bitOr, 1280367298) \ 78 V(_IntegerImplementation, |, Integer_bitOr, 1062616305) \
79 V(_IntegerImplementation, _bitXorFromInteger, \ 79 V(_IntegerImplementation, _bitXorFromInteger, \
80 Integer_bitXorFromInteger, 1074291215) \ 80 Integer_bitXorFromInteger, 1884970526) \
81 V(_IntegerImplementation, ^, Integer_bitXor, 686827811) \ 81 V(_IntegerImplementation, ^, Integer_bitXor, 2111001841) \
82 V(_IntegerImplementation, \ 82 V(_IntegerImplementation, \
83 _greaterThanFromInteger, \ 83 _greaterThanFromInteger, \
84 Integer_greaterThanFromInt, 2056270230) \ 84 Integer_greaterThanFromInt, 1634594614) \
85 V(_IntegerImplementation, >, Integer_greaterThan, 866987265) \ 85 V(_IntegerImplementation, >, Integer_greaterThan, 195542579) \
86 V(_IntegerImplementation, ==, Integer_equal, 1763184121) \ 86 V(_IntegerImplementation, ==, Integer_equal, 288044426) \
87 V(_IntegerImplementation, _equalToInteger, Integer_equalToInteger, \ 87 V(_IntegerImplementation, _equalToInteger, Integer_equalToInteger, \
88 2056270230) \ 88 45967303) \
89 V(_IntegerImplementation, <, Integer_lessThan, 1423913958) \ 89 V(_IntegerImplementation, <, Integer_lessThan, 1133694259) \
90 V(_IntegerImplementation, <=, Integer_lessEqualThan, 1087447066) \ 90 V(_IntegerImplementation, <=, Integer_lessEqualThan, 1724243945) \
91 V(_IntegerImplementation, >=, Integer_greaterEqualThan, 1087476857) \ 91 V(_IntegerImplementation, >=, Integer_greaterEqualThan, 879801865) \
92 V(_IntegerImplementation, <<, Integer_shl, 1600590181) \ 92 V(_IntegerImplementation, <<, Integer_shl, 1508088336) \
93 V(_IntegerImplementation, >>, Integer_sar, 237416447) \ 93 V(_IntegerImplementation, >>, Integer_sar, 1786839625) \
94 V(_Double, toInt, Double_toInt, 630286253) 94 V(_Double, toInt, Double_toInt, 1580473283)
95 95
96 96
97 #define MATH_LIB_INTRINSIC_LIST(V) \ 97 #define MATH_LIB_INTRINSIC_LIST(V) \
98 V(::, sqrt, Math_sqrt, 1662640002) \ 98 V(::, sqrt, Math_sqrt, 465520247) \
99 V(::, sin, Math_sin, 1273932041) \ 99 V(::, sin, Math_sin, 730107143) \
100 V(::, cos, Math_cos, 1749547468) \ 100 V(::, cos, Math_cos, 1282146521) \
101 V(_Random, _nextState, Random_nextState, 776416255) \ 101 V(_Random, _nextState, Random_nextState, 755413621) \
102 102
103 103
104 #define TYPED_DATA_LIB_INTRINSIC_LIST(V) \ 104 #define TYPED_DATA_LIB_INTRINSIC_LIST(V) \
105 V(_TypedList, get:length, TypedData_getLength, 1004567191) \ 105 V(_TypedList, get:length, TypedData_getLength, 117589485) \
106 V(_Int8Array, _new, TypedData_Int8Array_new, 1708300323) \ 106 V(_Int8Array, _new, TypedData_Int8Array_new, 1133705629) \
107 V(_Uint8Array, _new, TypedData_Uint8Array_new, 280387497) \ 107 V(_Uint8Array, _new, TypedData_Uint8Array_new, 1643490889) \
108 V(_Uint8ClampedArray, _new, TypedData_Uint8ClampedArray_new, 1035267417) \ 108 V(_Uint8ClampedArray, _new, TypedData_Uint8ClampedArray_new, 1212601488) \
109 V(_Int16Array, _new, TypedData_Int16Array_new, 1460383283) \ 109 V(_Int16Array, _new, TypedData_Int16Array_new, 1241260890) \
110 V(_Uint16Array, _new, TypedData_Uint16Array_new, 737997883) \ 110 V(_Uint16Array, _new, TypedData_Uint16Array_new, 337798210) \
111 V(_Int32Array, _new, TypedData_Int32Array_new, 1608749233) \ 111 V(_Int32Array, _new, TypedData_Int32Array_new, 845463081) \
112 V(_Uint32Array, _new, TypedData_Uint32Array_new, 1955293459) \ 112 V(_Uint32Array, _new, TypedData_Uint32Array_new, 1406929599) \
113 V(_Int64Array, _new, TypedData_Int64Array_new, 1992227270) \ 113 V(_Int64Array, _new, TypedData_Int64Array_new, 408710474) \
114 V(_Uint64Array, _new, TypedData_Uint64Array_new, 291118076) \ 114 V(_Uint64Array, _new, TypedData_Uint64Array_new, 202576356) \
115 V(_Float32Array, _new, TypedData_Float32Array_new, 962527805) \ 115 V(_Float32Array, _new, TypedData_Float32Array_new, 224632748) \
116 V(_Float64Array, _new, TypedData_Float64Array_new, 1871142667) \ 116 V(_Float64Array, _new, TypedData_Float64Array_new, 364786883) \
117 V(_Float32x4Array, _new, TypedData_Float32x4Array_new, 1873359556) \ 117 V(_Float32x4Array, _new, TypedData_Float32x4Array_new, 255992094) \
118 V(_Int8Array, ., TypedData_Int8Array_factory, 1139775342) \ 118 V(_Int8Array, ., TypedData_Int8Array_factory, 1340298556) \
119 V(_Uint8Array, ., TypedData_Uint8Array_factory, 2065936658) \ 119 V(_Uint8Array, ., TypedData_Uint8Array_factory, 1775618642) \
120 V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 1420655937) \ 120 V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 264668024) \
121 V(_Int16Array, ., TypedData_Int16Array_factory, 1401847016) \ 121 V(_Int16Array, ., TypedData_Int16Array_factory, 1095249987) \
122 V(_Uint16Array, ., TypedData_Uint16Array_factory, 967612741) \ 122 V(_Uint16Array, ., TypedData_Uint16Array_factory, 1275304272) \
123 V(_Int32Array, ., TypedData_Int32Array_factory, 332168564) \ 123 V(_Int32Array, ., TypedData_Int32Array_factory, 523449884) \
124 V(_Uint32Array, ., TypedData_Uint32Array_factory, 966424258) \ 124 V(_Uint32Array, ., TypedData_Uint32Array_factory, 458531362) \
125 V(_Int64Array, ., TypedData_Int64Array_factory, 541618991) \ 125 V(_Int64Array, ., TypedData_Int64Array_factory, 1753070829) \
126 V(_Uint64Array, ., TypedData_Uint64Array_factory, 1085703705) \ 126 V(_Uint64Array, ., TypedData_Uint64Array_factory, 1561660391) \
127 V(_Float32Array, ., TypedData_Float32Array_factory, 1691006880) \ 127 V(_Float32Array, ., TypedData_Float32Array_factory, 368082071) \
128 V(_Float64Array, ., TypedData_Float64Array_factory, 1867705160) \ 128 V(_Float64Array, ., TypedData_Float64Array_factory, 245916452) \
129 V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1739837241) \ 129 V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1674296969) \
130 130
131 // TODO(srdjan): Implement _FixedSizeArrayIterator, get:current and 131 // TODO(srdjan): Implement _FixedSizeArrayIterator, get:current and
132 // _FixedSizeArrayIterator, moveNext. 132 // _FixedSizeArrayIterator, moveNext.
133 133
134 // Forward declarations. 134 // Forward declarations.
135 class Assembler; 135 class Assembler;
136 class Function; 136 class Function;
137 137
138 class Intrinsifier : public AllStatic { 138 class Intrinsifier : public AllStatic {
139 public: 139 public:
(...skipping 12 matching lines...) Expand all
152 CORE_INTEGER_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) 152 CORE_INTEGER_LIB_INTRINSIC_LIST(DECLARE_FUNCTION)
153 MATH_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) 153 MATH_LIB_INTRINSIC_LIST(DECLARE_FUNCTION)
154 TYPED_DATA_LIB_INTRINSIC_LIST(DECLARE_FUNCTION) 154 TYPED_DATA_LIB_INTRINSIC_LIST(DECLARE_FUNCTION)
155 155
156 #undef DECLARE_FUNCTION 156 #undef DECLARE_FUNCTION
157 }; 157 };
158 158
159 } // namespace dart 159 } // namespace dart
160 160
161 #endif // VM_INTRINSIFIER_H_ 161 #endif // VM_INTRINSIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698