| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 V(_TypedList, get:length, TypedDataLength, 26616328) \ | 46 V(_TypedList, get:length, TypedDataLength, 26616328) \ |
| 47 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \ | 47 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \ |
| 48 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 831354841) \ | 48 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 831354841) \ |
| 49 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1832126257) \ | 49 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1832126257) \ |
| 50 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1762714698) \ | 50 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1762714698) \ |
| 51 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 48785449) \ | 51 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 48785449) \ |
| 52 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1392579206) \ | 52 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1392579206) \ |
| 53 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 185163470) \ | 53 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 185163470) \ |
| 54 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1356392173) \ | 54 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1356392173) \ |
| 55 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1239681356) \ | 55 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1239681356) \ |
| 56 V(_TypedList, _getUint32x4, ByteArrayBaseGetUint32x4, 1499091330) \ |
| 56 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 1443265945) \ | 57 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 1443265945) \ |
| 57 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 1864204733) \ | 58 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 1864204733) \ |
| 58 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 1807419109) \ | 59 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 1807419109) \ |
| 59 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 1246454605) \ | 60 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 1246454605) \ |
| 60 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 517505240) \ | 61 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 517505240) \ |
| 61 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1425812717) \ | 62 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1425812717) \ |
| 62 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1457395244) \ | 63 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1457395244) \ |
| 63 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 49127618) \ | 64 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 49127618) \ |
| 64 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 1261559935) \ | 65 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 1261559935) \ |
| 66 V(_TypedList, _setUint32x4, ByteArrayBaseSetUint32x4, 691480480) \ |
| 65 V(_GrowableList, get:length, GrowableArrayLength, 1654225242) \ | 67 V(_GrowableList, get:length, GrowableArrayLength, 1654225242) \ |
| 66 V(_GrowableList, get:_capacity, GrowableArrayCapacity, 817090003) \ | 68 V(_GrowableList, get:_capacity, GrowableArrayCapacity, 817090003) \ |
| 67 V(_GrowableList, _setData, GrowableArraySetData, 1375509957) \ | 69 V(_GrowableList, _setData, GrowableArraySetData, 1375509957) \ |
| 68 V(_GrowableList, _setLength, GrowableArraySetLength, 1227678442) \ | 70 V(_GrowableList, _setLength, GrowableArraySetLength, 1227678442) \ |
| 69 V(_StringBase, get:length, StringBaseLength, 1483520063) \ | 71 V(_StringBase, get:length, StringBaseLength, 1483520063) \ |
| 70 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 879849436) \ | 72 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 879849436) \ |
| 71 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 1958436584) \ | 73 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 1958436584) \ |
| 72 V(_StringBase, [], StringBaseCharAt, 990046076) \ | 74 V(_StringBase, [], StringBaseCharAt, 990046076) \ |
| 73 V(_StringBase, _interpolate, StringBaseInterpolate, 1824308855) \ | 75 V(_StringBase, _interpolate, StringBaseInterpolate, 1824308855) \ |
| 74 V(_OneByteString, _setAt, OneByteStringSetAt, 308408714) \ | 76 V(_OneByteString, _setAt, OneByteStringSetAt, 308408714) \ |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 V(_Int16Array, [], Int16ArrayGetIndexed, 1191799443) \ | 161 V(_Int16Array, [], Int16ArrayGetIndexed, 1191799443) \ |
| 160 V(_Int16Array, []=, Int16ArraySetIndexed, 1182335435) \ | 162 V(_Int16Array, []=, Int16ArraySetIndexed, 1182335435) \ |
| 161 V(_Uint16Array, [], Uint16ArrayGetIndexed, 814177144) \ | 163 V(_Uint16Array, [], Uint16ArrayGetIndexed, 814177144) \ |
| 162 V(_Uint16Array, []=, Uint16ArraySetIndexed, 663508528) \ | 164 V(_Uint16Array, []=, Uint16ArraySetIndexed, 663508528) \ |
| 163 V(_Int32Array, [], Int32ArrayGetIndexed, 787321640) \ | 165 V(_Int32Array, [], Int32ArrayGetIndexed, 787321640) \ |
| 164 V(_Int32Array, []=, Int32ArraySetIndexed, 1515238594) \ | 166 V(_Int32Array, []=, Int32ArraySetIndexed, 1515238594) \ |
| 165 V(_Uint32Array, [], Uint32ArrayGetIndexed, 1421922726) \ | 167 V(_Uint32Array, [], Uint32ArrayGetIndexed, 1421922726) \ |
| 166 V(_Uint32Array, []=, Uint32ArraySetIndexed, 1980947178) \ | 168 V(_Uint32Array, []=, Uint32ArraySetIndexed, 1980947178) \ |
| 167 V(_Float32x4Array, [], Float32x4ArrayGetIndexed, 1901126825) \ | 169 V(_Float32x4Array, [], Float32x4ArrayGetIndexed, 1901126825) \ |
| 168 V(_Float32x4Array, []=, Float32x4ArraySetIndexed, 1419416331) \ | 170 V(_Float32x4Array, []=, Float32x4ArraySetIndexed, 1419416331) \ |
| 171 V(_Uint32x4Array, [], Uint32x4ArrayGetIndexed, 1340743913) \ |
| 172 V(_Uint32x4Array, []=, Uint32x4ArraySetIndexed, 1326924628) \ |
| 169 | 173 |
| 170 | 174 |
| 171 // A list of core function that should always be inlined. | 175 // A list of core function that should always be inlined. |
| 172 #define INLINE_WHITE_LIST(V) \ | 176 #define INLINE_WHITE_LIST(V) \ |
| 173 V(_List, get:length, ObjectArrayLength, 215153395) \ | 177 V(_List, get:length, ObjectArrayLength, 215153395) \ |
| 174 V(_ImmutableList, get:length, ImmutableArrayLength, 578733070) \ | 178 V(_ImmutableList, get:length, ImmutableArrayLength, 578733070) \ |
| 175 V(_TypedList, get:length, TypedDataLength, 26616328) \ | 179 V(_TypedList, get:length, TypedDataLength, 26616328) \ |
| 176 V(_GrowableList, get:length, GrowableArrayLength, 1654225242) \ | 180 V(_GrowableList, get:length, GrowableArrayLength, 1654225242) \ |
| 177 V(_StringBase, get:length, StringBaseLength, 1483520063) \ | 181 V(_StringBase, get:length, StringBaseLength, 1483520063) \ |
| 178 V(ListIterator, moveNext, ListIteratorMoveNext, 90930587) \ | 182 V(ListIterator, moveNext, ListIteratorMoveNext, 90930587) \ |
| 179 V(_GrowableList, get:iterator, GrowableArrayIterator, 1305127405) \ | 183 V(_GrowableList, get:iterator, GrowableArrayIterator, 1305127405) \ |
| 180 V(_GrowableList, forEach, GrowableArrayForEach, 1675430533) \ | 184 V(_GrowableList, forEach, GrowableArrayForEach, 1675430533) \ |
| 181 | 185 |
| 182 // A list of core functions that internally dispatch based on received id. | 186 // A list of core functions that internally dispatch based on received id. |
| 183 #define POLYMORPHC_TARGET_LIST(V) \ | 187 #define POLYMORPHC_TARGET_LIST(V) \ |
| 184 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \ | 188 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \ |
| 185 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 831354841) \ | 189 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 831354841) \ |
| 186 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1832126257) \ | 190 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1832126257) \ |
| 187 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1762714698) \ | 191 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1762714698) \ |
| 188 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 48785449) \ | 192 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 48785449) \ |
| 189 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1392579206) \ | 193 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1392579206) \ |
| 190 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 185163470) \ | 194 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 185163470) \ |
| 191 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1356392173) \ | 195 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1356392173) \ |
| 192 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1239681356) \ | 196 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1239681356) \ |
| 197 V(_TypedList, _getUint32x4, ByteArrayBaseGetUint32x4, 1239681356) \ |
| 193 | 198 |
| 194 // Class that recognizes the name and owner of a function and returns the | 199 // Class that recognizes the name and owner of a function and returns the |
| 195 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable | 200 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable |
| 196 // functions. | 201 // functions. |
| 197 class MethodRecognizer : public AllStatic { | 202 class MethodRecognizer : public AllStatic { |
| 198 public: | 203 public: |
| 199 enum Kind { | 204 enum Kind { |
| 200 kUnknown, | 205 kUnknown, |
| 201 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, | 206 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, |
| 202 RECOGNIZED_LIST(DEFINE_ENUM_LIST) | 207 RECOGNIZED_LIST(DEFINE_ENUM_LIST) |
| (...skipping 6698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6901 ForwardInstructionIterator* current_iterator_; | 6906 ForwardInstructionIterator* current_iterator_; |
| 6902 | 6907 |
| 6903 private: | 6908 private: |
| 6904 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6909 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6905 }; | 6910 }; |
| 6906 | 6911 |
| 6907 | 6912 |
| 6908 } // namespace dart | 6913 } // namespace dart |
| 6909 | 6914 |
| 6910 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6915 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |