| 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 18 matching lines...) Expand all Loading... |
| 29 class Instruction; | 29 class Instruction; |
| 30 class LocalVariable; | 30 class LocalVariable; |
| 31 class ParsedFunction; | 31 class ParsedFunction; |
| 32 class Range; | 32 class Range; |
| 33 | 33 |
| 34 | 34 |
| 35 // TODO(srdjan): Unify with INTRINSIC_LIST. | 35 // TODO(srdjan): Unify with INTRINSIC_LIST. |
| 36 // (class-name, function-name, recognized enum, fingerprint). | 36 // (class-name, function-name, recognized enum, fingerprint). |
| 37 // See intrinsifier for fingerprint computation. | 37 // See intrinsifier for fingerprint computation. |
| 38 #define RECOGNIZED_LIST(V) \ | 38 #define RECOGNIZED_LIST(V) \ |
| 39 V(Object, Object., ObjectConstructor, 464682336) \ | 39 V(Object, Object., ObjectConstructor, 2030609793) \ |
| 40 V(Object, get:_cid, ObjectCid, 732498573) \ | 40 V(Object, get:_cid, ObjectCid, 732498573) \ |
| 41 V(_ObjectArray, get:length, ObjectArrayLength, 405297088) \ | 41 V(_ObjectArray, get:length, ObjectArrayLength, 405297088) \ |
| 42 V(_ImmutableArray, get:length, ImmutableArrayLength, 433698233) \ | 42 V(_ImmutableArray, get:length, ImmutableArrayLength, 433698233) \ |
| 43 V(_TypedList, get:length, TypedDataLength, 1004567191) \ | 43 V(_TypedList, get:length, TypedDataLength, 1004567191) \ |
| 44 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 728842615) \ | 44 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 1219036864) \ |
| 45 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 728842615) \ | 45 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 1219036864) \ |
| 46 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 728842615) \ | 46 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1219036864) \ |
| 47 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 728842615) \ | 47 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1219036864) \ |
| 48 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 728842615) \ | 48 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 1219036864) \ |
| 49 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 728842615) \ | 49 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1219036864) \ |
| 50 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 1067360925) \ | 50 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 1465214182) \ |
| 51 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1067360925) \ | 51 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1465214182) \ |
| 52 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 279982060) \ | 52 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 2133963445) \ |
| 53 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 427754869) \ | 53 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 1865947547) \ |
| 54 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 427754869) \ | 54 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 1865947547) \ |
| 55 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 427754869) \ | 55 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 1865947547) \ |
| 56 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 427754869) \ | 56 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 1865947547) \ |
| 57 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 427754869) \ | 57 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1865947547) \ |
| 58 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 427754869) \ | 58 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1865947547) \ |
| 59 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 637235443) \ | 59 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 2034634179) \ |
| 60 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 637235443) \ | 60 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 2034634179) \ |
| 61 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 780994886) \ | 61 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 773019010) \ |
| 62 V(_GrowableObjectArray, get:length, GrowableArrayLength, 725548050) \ | 62 V(_GrowableObjectArray, get:length, GrowableArrayLength, 725548050) \ |
| 63 V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 725548050) \ | 63 V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 725548050) \ |
| 64 V(_GrowableObjectArray, _setData, GrowableArraySetData, 629110947) \ | 64 V(_GrowableObjectArray, _setData, GrowableArraySetData, 588108129) \ |
| 65 V(_GrowableObjectArray, _setLength, GrowableArraySetLength, 796709584) \ | 65 V(_GrowableObjectArray, _setLength, GrowableArraySetLength, 279007375) \ |
| 66 V(_StringBase, get:length, StringBaseLength, 320803993) \ | 66 V(_StringBase, get:length, StringBaseLength, 320803993) \ |
| 67 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 110631520) \ | 67 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 110631520) \ |
| 68 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 984449525) \ | 68 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 1574843871) \ |
| 69 V(_StringBase, [], StringBaseCharAt, 1062366987) \ | 69 V(_StringBase, [], StringBaseCharAt, 2105190389) \ |
| 70 V(_OneByteString, _setAt, OneByteStringSetAt, 342452817) \ | 70 V(_OneByteString, _setAt, OneByteStringSetAt, 1038132016) \ |
| 71 V(_IntegerImplementation, toDouble, IntegerToDouble, 1331752138) \ | 71 V(_IntegerImplementation, toDouble, IntegerToDouble, 1331752138) \ |
| 72 V(_Double, toInt, DoubleToInteger, 362666636) \ | 72 V(_Double, toInt, DoubleToInteger, 630286253) \ |
| 73 V(_Double, truncateToDouble, DoubleTruncate, 620870996) \ | 73 V(_Double, truncateToDouble, DoubleTruncate, 1804056693) \ |
| 74 V(_Double, roundToDouble, DoubleRound, 620870996) \ | 74 V(_Double, roundToDouble, DoubleRound, 1804056693) \ |
| 75 V(_Double, floorToDouble, DoubleFloor, 620870996) \ | 75 V(_Double, floorToDouble, DoubleFloor, 1804056693) \ |
| 76 V(_Double, ceilToDouble, DoubleCeil, 620870996) \ | 76 V(_Double, ceilToDouble, DoubleCeil, 1804056693) \ |
| 77 V(_Double, pow, DoublePow, 102305574) \ | 77 V(_Double, pow, DoublePow, 102305574) \ |
| 78 V(_Double, _modulo, DoubleMod, 437099337) \ | 78 V(_Double, _modulo, DoubleMod, 663439671) \ |
| 79 V(::, sqrt, MathSqrt, 1662640002) \ | 79 V(::, sqrt, MathSqrt, 1662640002) \ |
| 80 V(Float32x4, Float32x4., Float32x4Constructor, 1492157358) \ | 80 V(Float32x4, Float32x4., Float32x4Constructor, 1492157358) \ |
| 81 V(Float32x4, Float32x4.zero, Float32x4Zero, 444339161) \ | 81 V(Float32x4, Float32x4.zero, Float32x4Zero, 444339161) \ |
| 82 V(Float32x4, Float32x4.splat, Float32x4Splat, 1843231403) \ | 82 V(Float32x4, Float32x4.splat, Float32x4Splat, 1843231403) \ |
| 83 V(_Float32x4, get:xxxx, Float32x4ShuffleXXXX, 42621627) \ | 83 V(_Float32x4, get:xxxx, Float32x4ShuffleXXXX, 42621627) \ |
| 84 V(_Float32x4, get:yyyy, Float32x4ShuffleYYYY, 42621627) \ | 84 V(_Float32x4, get:yyyy, Float32x4ShuffleYYYY, 42621627) \ |
| 85 V(_Float32x4, get:zzzz, Float32x4ShuffleZZZZ, 42621627) \ | 85 V(_Float32x4, get:zzzz, Float32x4ShuffleZZZZ, 42621627) \ |
| 86 V(_Float32x4, get:wwww, Float32x4ShuffleWWWW, 42621627) \ | 86 V(_Float32x4, get:wwww, Float32x4ShuffleWWWW, 42621627) \ |
| 87 V(_Float32x4, get:x, Float32x4ShuffleX, 211144022) \ | 87 V(_Float32x4, get:x, Float32x4ShuffleX, 211144022) \ |
| 88 V(_Float32x4, get:y, Float32x4ShuffleY, 211144022) \ | 88 V(_Float32x4, get:y, Float32x4ShuffleY, 211144022) \ |
| 89 V(_Float32x4, get:z, Float32x4ShuffleZ, 211144022) \ | 89 V(_Float32x4, get:z, Float32x4ShuffleZ, 211144022) \ |
| 90 V(_Float32x4, get:w, Float32x4ShuffleW, 211144022) \ | 90 V(_Float32x4, get:w, Float32x4ShuffleW, 211144022) \ |
| 91 V(_Float32x4, _cmpequal, Float32x4Equal, 548944488) \ | 91 V(_Float32x4, _cmpequal, Float32x4Equal, 2103153736) \ |
| 92 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 548944488) \ | 92 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 2103153736) \ |
| 93 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 548944488) \ | 93 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 2103153736) \ |
| 94 V(_Float32x4, _cmplt, Float32x4LessThan, 548944488) \ | 94 V(_Float32x4, _cmplt, Float32x4LessThan, 2103153736) \ |
| 95 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 548944488) \ | 95 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 2103153736) \ |
| 96 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 548944488) \ | 96 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 2103153736) \ |
| 97 V(_Float32x4, _min, Float32x4Min, 342800599) \ | 97 V(_Float32x4, _min, Float32x4Min, 465519415) \ |
| 98 V(_Float32x4, _max, Float32x4Max, 342800599) \ | 98 V(_Float32x4, _max, Float32x4Max, 465519415) \ |
| 99 V(_Float32x4, _scale, Float32x4Scale, 219466242) \ | 99 V(_Float32x4, _scale, Float32x4Scale, 42272341) \ |
| 100 V(_Float32x4, _sqrt, Float32x4Sqrt, 42621627) \ | 100 V(_Float32x4, _sqrt, Float32x4Sqrt, 157194268) \ |
| 101 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 42621627) \ | 101 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 157194268) \ |
| 102 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 42621627) \ | 102 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 157194268) \ |
| 103 V(_Float32x4, _negate, Float32x4Negate, 42621627) \ | 103 V(_Float32x4, _negate, Float32x4Negate, 157194268) \ |
| 104 V(_Float32x4, _abs, Float32x4Absolute, 42621627) \ | 104 V(_Float32x4, _abs, Float32x4Absolute, 157194268) \ |
| 105 V(_Float32x4, _clamp, Float32x4Clamp, 615895313) \ | 105 V(_Float32x4, _clamp, Float32x4Clamp, 1553901850) \ |
| 106 V(_Float32x4, withX, Float32x4WithX, 219466242) \ | 106 V(_Float32x4, withX, Float32x4WithX, 1816943014) \ |
| 107 V(_Float32x4, withY, Float32x4WithY, 219466242) \ | 107 V(_Float32x4, withY, Float32x4WithY, 820404963) \ |
| 108 V(_Float32x4, withZ, Float32x4WithZ, 219466242) \ | 108 V(_Float32x4, withZ, Float32x4WithZ, 881355277) \ |
| 109 V(_Float32x4, withW, Float32x4WithW, 219466242) \ | 109 V(_Float32x4, withW, Float32x4WithW, 441497035) \ |
| 110 V(_Float32x4, _toUint32x4, Float32x4ToUint32x4, 1044409108) \ | 110 V(_Float32x4, _toUint32x4, Float32x4ToUint32x4, 802289205) \ |
| 111 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 487876159) \ | 111 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 487876159) \ |
| 112 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 782547529) \ | 112 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 782547529) \ |
| 113 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 782547529) \ | 113 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 782547529) \ |
| 114 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 782547529) \ | 114 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 782547529) \ |
| 115 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 782547529) \ | 115 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 782547529) \ |
| 116 V(_Uint32x4, select, Uint32x4Select, 810336099) \ | 116 V(_Uint32x4, select, Uint32x4Select, 810336099) \ |
| 117 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 980864994) \ | 117 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 25547408) \ |
| 118 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 980864994) \ | 118 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 1176493005) \ |
| 119 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 980864994) \ | 119 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 1237443319) \ |
| 120 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 980864994) \ | 120 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 797585077) \ |
| 121 V(_Uint32x4, _toFloat32x4, Uint32x4ToUint32x4, 311564070) \ | 121 V(_Uint32x4, _toFloat32x4, Uint32x4ToUint32x4, 912844231) \ |
| 122 | 122 |
| 123 | 123 |
| 124 // Class that recognizes the name and owner of a function and returns the | 124 // Class that recognizes the name and owner of a function and returns the |
| 125 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable | 125 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable |
| 126 // functions. | 126 // functions. |
| 127 class MethodRecognizer : public AllStatic { | 127 class MethodRecognizer : public AllStatic { |
| 128 public: | 128 public: |
| 129 enum Kind { | 129 enum Kind { |
| 130 kUnknown, | 130 kUnknown, |
| 131 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, | 131 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, |
| (...skipping 6381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6513 ForwardInstructionIterator* current_iterator_; | 6513 ForwardInstructionIterator* current_iterator_; |
| 6514 | 6514 |
| 6515 private: | 6515 private: |
| 6516 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6516 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6517 }; | 6517 }; |
| 6518 | 6518 |
| 6519 | 6519 |
| 6520 } // namespace dart | 6520 } // namespace dart |
| 6521 | 6521 |
| 6522 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6522 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |