OLD | NEW |
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 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 V(_GrowableObjectArray, []=, GrowableArray_setIndexed, 1048007636) \ | 71 V(_GrowableObjectArray, []=, GrowableArray_setIndexed, 1048007636) \ |
72 V(_GrowableObjectArray, _setLength, GrowableArray_setLength, 796709584) \ | 72 V(_GrowableObjectArray, _setLength, GrowableArray_setLength, 796709584) \ |
73 V(_GrowableObjectArray, _setData, GrowableArray_setData, 477312179) \ | 73 V(_GrowableObjectArray, _setData, GrowableArray_setData, 477312179) \ |
74 V(_GrowableObjectArray, add, GrowableArray_add, 1367698386) \ | 74 V(_GrowableObjectArray, add, GrowableArray_add, 1367698386) \ |
75 V(_ImmutableArray, [], ImmutableArray_getIndexed, 486821199) \ | 75 V(_ImmutableArray, [], ImmutableArray_getIndexed, 486821199) \ |
76 V(_ImmutableArray, get:length, ImmutableArray_getLength, 433698233) \ | 76 V(_ImmutableArray, get:length, ImmutableArray_getLength, 433698233) \ |
77 V(::, sqrt, Math_sqrt, 1662640002) \ | 77 V(::, sqrt, Math_sqrt, 1662640002) \ |
78 V(::, sin, Math_sin, 1273932041) \ | 78 V(::, sin, Math_sin, 1273932041) \ |
79 V(::, cos, Math_cos, 1749547468) \ | 79 V(::, cos, Math_cos, 1749547468) \ |
80 V(Object, ==, Object_equal, 2126956595) \ | 80 V(Object, ==, Object_equal, 2126956595) \ |
81 V(_FixedSizeArrayIterator, get:hasNext, \ | |
82 FixedSizeArrayIterator_getHasNext, 682147711) \ | |
83 V(_FixedSizeArrayIterator, next, FixedSizeArrayIterator_next, 1283926262) \ | |
84 V(_StringBase, get:hashCode, String_getHashCode, 320803993) \ | 81 V(_StringBase, get:hashCode, String_getHashCode, 320803993) \ |
85 V(_StringBase, get:isEmpty, String_getIsEmpty, 711547329) \ | 82 V(_StringBase, get:isEmpty, String_getIsEmpty, 711547329) \ |
86 V(_StringBase, get:length, String_getLength, 320803993) \ | 83 V(_StringBase, get:length, String_getLength, 320803993) \ |
87 V(_StringBase, charCodeAt, String_charCodeAt, 984449525) \ | 84 V(_StringBase, charCodeAt, String_charCodeAt, 984449525) \ |
88 V(_ByteArrayBase, get:length, ByteArrayBase_getLength, 1098081765) \ | 85 V(_ByteArrayBase, get:length, ByteArrayBase_getLength, 1098081765) \ |
89 V(_Int8Array, [], Int8Array_getIndexed, 1295306322) \ | 86 V(_Int8Array, [], Int8Array_getIndexed, 1295306322) \ |
90 V(_Int8Array, []=, Int8Array_setIndexed, 1709956322) \ | 87 V(_Int8Array, []=, Int8Array_setIndexed, 1709956322) \ |
91 V(_Uint8Array, [], Uint8Array_getIndexed, 578331916) \ | 88 V(_Uint8Array, [], Uint8Array_getIndexed, 578331916) \ |
92 V(_Uint8Array, []=, Uint8Array_setIndexed, 121509844) \ | 89 V(_Uint8Array, []=, Uint8Array_setIndexed, 121509844) \ |
93 V(_Uint8ClampedArray, [], UintClamped8Array_getIndexed, 327062422) \ | 90 V(_Uint8ClampedArray, [], UintClamped8Array_getIndexed, 327062422) \ |
94 V(_Uint8ClampedArray, []=, Uint8ClampedArray_setIndexed, 2054663547) \ | 91 V(_Uint8ClampedArray, []=, Uint8ClampedArray_setIndexed, 2054663547) \ |
95 V(_Int16Array, [], Int16Array_getIndexed, 870098766) \ | 92 V(_Int16Array, [], Int16Array_getIndexed, 870098766) \ |
96 V(_Uint16Array, [], Uint16Array_getIndexed, 1019828411) \ | 93 V(_Uint16Array, [], Uint16Array_getIndexed, 1019828411) \ |
97 V(_Int32Array, [], Int32Array_getIndexed, 1999321436) \ | 94 V(_Int32Array, [], Int32Array_getIndexed, 1999321436) \ |
98 V(_Uint32Array, [], Uint32Array_getIndexed, 1750764660) \ | 95 V(_Uint32Array, [], Uint32Array_getIndexed, 1750764660) \ |
99 V(_Int64Array, [], Int64Array_getIndexed, 504894128) \ | 96 V(_Int64Array, [], Int64Array_getIndexed, 504894128) \ |
100 V(_Uint64Array, [], Uint64Array_getIndexed, 31272531) \ | 97 V(_Uint64Array, [], Uint64Array_getIndexed, 31272531) \ |
101 V(_Float32Array, [], Float32Array_getIndexed, 147582932) \ | 98 V(_Float32Array, [], Float32Array_getIndexed, 147582932) \ |
102 V(_Float32Array, []=, Float32Array_setIndexed, 664454270) \ | 99 V(_Float32Array, []=, Float32Array_setIndexed, 664454270) \ |
103 V(_Float64Array, [], Float64Array_getIndexed, 638830526) \ | 100 V(_Float64Array, [], Float64Array_getIndexed, 638830526) \ |
104 V(_Float64Array, []=, Float64Array_setIndexed, 1948811847) \ | 101 V(_Float64Array, []=, Float64Array_setIndexed, 1948811847) \ |
105 V(_ExternalUint8Array, [], ExternalUint8Array_getIndexed, 753790851) \ | 102 V(_ExternalUint8Array, [], ExternalUint8Array_getIndexed, 753790851) \ |
106 | 103 |
| 104 // TODO(srdjan): Implement _FixedSizeArrayIterator, get:current and |
| 105 // _FixedSizeArrayIterator, moveNext. |
| 106 |
107 // Forward declarations. | 107 // Forward declarations. |
108 class Assembler; | 108 class Assembler; |
109 class Function; | 109 class Function; |
110 | 110 |
111 class Intrinsifier : public AllStatic { | 111 class Intrinsifier : public AllStatic { |
112 public: | 112 public: |
113 // Try to intrinsify 'function'. Returns true if the function intrinsified | 113 // Try to intrinsify 'function'. Returns true if the function intrinsified |
114 // completely and the code does not need to be generated (i.e., no slow | 114 // completely and the code does not need to be generated (i.e., no slow |
115 // path possible). | 115 // path possible). |
116 static bool Intrinsify(const Function& function, Assembler* assembler); | 116 static bool Intrinsify(const Function& function, Assembler* assembler); |
117 static bool CanIntrinsify(const Function& function); | 117 static bool CanIntrinsify(const Function& function); |
118 | 118 |
119 private: | 119 private: |
120 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ | 120 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ |
121 static bool destination(Assembler* assembler); | 121 static bool destination(Assembler* assembler); |
122 | 122 |
123 INTRINSIC_LIST(DECLARE_FUNCTION) | 123 INTRINSIC_LIST(DECLARE_FUNCTION) |
124 #undef DECLARE_FUNCTION | 124 #undef DECLARE_FUNCTION |
125 }; | 125 }; |
126 | 126 |
127 } // namespace dart | 127 } // namespace dart |
128 | 128 |
129 #endif // VM_INTRINSIFIER_H_ | 129 #endif // VM_INTRINSIFIER_H_ |
OLD | NEW |