| 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 20 matching lines...) Expand all Loading... |
| 31 class Instruction; | 31 class Instruction; |
| 32 class LocalVariable; | 32 class LocalVariable; |
| 33 class ParsedFunction; | 33 class ParsedFunction; |
| 34 class Range; | 34 class Range; |
| 35 | 35 |
| 36 | 36 |
| 37 // TODO(srdjan): Unify with INTRINSIC_LIST. | 37 // TODO(srdjan): Unify with INTRINSIC_LIST. |
| 38 // (class-name, function-name, recognized enum, fingerprint). | 38 // (class-name, function-name, recognized enum, fingerprint). |
| 39 // See intrinsifier for fingerprint computation. | 39 // See intrinsifier for fingerprint computation. |
| 40 #define RECOGNIZED_LIST(V) \ | 40 #define RECOGNIZED_LIST(V) \ |
| 41 V(::, identical, ObjectIdentical, 101186973) \ | 41 V(::, identical, ObjectIdentical, 496869842) \ |
| 42 V(Object, Object., ObjectConstructor, 1058525712) \ | 42 V(Object, Object., ObjectConstructor, 1058525712) \ |
| 43 V(Object, get:_cid, ObjectCid, 2099568593) \ | 43 V(Object, get:_cid, ObjectCid, 1498661928) \ |
| 44 V(_ObjectArray, get:length, ObjectArrayLength, 1441000484) \ | 44 V(_ObjectArray, get:length, ObjectArrayLength, 259323113) \ |
| 45 V(_ImmutableArray, get:length, ImmutableArrayLength, 1430953867) \ | 45 V(_ImmutableArray, get:length, ImmutableArrayLength, 1341942416) \ |
| 46 V(_TypedList, get:length, TypedDataLength, 117589485) \ | 46 V(_TypedList, get:length, TypedDataLength, 26556746) \ |
| 47 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 788387678) \ | 47 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \ |
| 48 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 1137892349) \ | 48 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 831354841) \ |
| 49 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 464167270) \ | 49 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1832126257) \ |
| 50 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 673378812) \ | 50 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1762714698) \ |
| 51 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 1230275232) \ | 51 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 48785449) \ |
| 52 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 976951843) \ | 52 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1392579206) \ |
| 53 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 215932309) \ | 53 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 185163470) \ |
| 54 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 450032954) \ | 54 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1356392173) \ |
| 55 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1602836552) \ | 55 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1239681356) \ |
| 56 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 250049637) \ | 56 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 742201367) \ |
| 57 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 1792593311) \ | 57 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 1163140155) \ |
| 58 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 1958159284) \ | 58 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 1106354531) \ |
| 59 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 1244907090) \ | 59 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 545390027) \ |
| 60 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1058956549) \ | 60 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1963924310) \ |
| 61 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1054500835) \ | 61 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 724748139) \ |
| 62 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1426038329) \ | 62 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 756330666) \ |
| 63 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 1289924817) \ | 63 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 1495546688) \ |
| 64 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 370513644) \ | 64 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 560495357) \ |
| 65 V(_GrowableObjectArray, get:length, GrowableArrayLength, 767561362) \ | 65 V(_GrowableObjectArray, get:length, GrowableArrayLength, 1160357614) \ |
| 66 V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 874559046) \ | 66 V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 1509781988) \ |
| 67 V(_GrowableObjectArray, _setData, GrowableArraySetData, 1302055339) \ | 67 V(_GrowableObjectArray, _setData, GrowableArraySetData, 236295352) \ |
| 68 V(_GrowableObjectArray, _setLength, GrowableArraySetLength, 1016226171) \ | 68 V(_GrowableObjectArray, _setLength, GrowableArraySetLength, 1922121178) \ |
| 69 V(_StringBase, get:length, StringBaseLength, 1158042795) \ | 69 V(_StringBase, get:length, StringBaseLength, 1483460481) \ |
| 70 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 1588094430) \ | 70 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 1588094430) \ |
| 71 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 1452213966) \ | 71 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 1958436584) \ |
| 72 V(_StringBase, [], StringBaseCharAt, 924930519) \ | 72 V(_StringBase, [], StringBaseCharAt, 539412735) \ |
| 73 V(_OneByteString, _setAt, OneByteStringSetAt, 456985263) \ | 73 V(_OneByteString, _setAt, OneByteStringSetAt, 1754827784) \ |
| 74 V(_IntegerImplementation, toDouble, IntegerToDouble, 2141284842) \ | 74 V(_IntegerImplementation, toDouble, IntegerToDouble, 2141284842) \ |
| 75 V(_IntegerImplementation, _leftShiftWithMask32, IntegerLeftShiftWithMask32, \ | 75 V(_IntegerImplementation, _leftShiftWithMask32, IntegerLeftShiftWithMask32, \ |
| 76 964472615) \ | 76 2095943661) \ |
| 77 V(_Double, toInt, DoubleToInteger, 1580473283) \ | 77 V(_Double, toInt, DoubleToInteger, 1328149975) \ |
| 78 V(_Double, truncateToDouble, DoubleTruncate, 849350203) \ | 78 V(_Double, truncateToDouble, DoubleTruncate, 615732263) \ |
| 79 V(_Double, roundToDouble, DoubleRound, 500368418) \ | 79 V(_Double, roundToDouble, DoubleRound, 622146406) \ |
| 80 V(_Double, floorToDouble, DoubleFloor, 763548522) \ | 80 V(_Double, floorToDouble, DoubleFloor, 1614014643) \ |
| 81 V(_Double, ceilToDouble, DoubleCeil, 976697019) \ | 81 V(_Double, ceilToDouble, DoubleCeil, 277859570) \ |
| 82 V(_Double, _modulo, DoubleMod, 1850917533) \ | 82 V(_Double, _modulo, DoubleMod, 1443289156) \ |
| 83 V(::, sqrt, MathSqrt, 465520247) \ | 83 V(::, sqrt, MathSqrt, 465520247) \ |
| 84 V(::, sin, MathSin, 730107143) \ | 84 V(::, sin, MathSin, 730107143) \ |
| 85 V(::, cos, MathCos, 1282146521) \ | 85 V(::, cos, MathCos, 1282146521) \ |
| 86 V(::, min, MathMin, 1584022354) \ | 86 V(::, min, MathMin, 1584022354) \ |
| 87 V(::, max, MathMax, 328632232) \ | 87 V(::, max, MathMax, 328632232) \ |
| 88 V(::, _doublePow, MathDoublePow, 2002448359) \ | 88 V(::, _doublePow, MathDoublePow, 2002448359) \ |
| 89 V(Float32x4, Float32x4., Float32x4Constructor, 1876089990) \ | 89 V(Float32x4, Float32x4., Float32x4Constructor, 1876089990) \ |
| 90 V(Float32x4, Float32x4.zero, Float32x4Zero, 1903586222) \ | 90 V(Float32x4, Float32x4.zero, Float32x4Zero, 1903586222) \ |
| 91 V(Float32x4, Float32x4.splat, Float32x4Splat, 38462589) \ | 91 V(Float32x4, Float32x4.splat, Float32x4Splat, 38462589) \ |
| 92 V(_Float32x4, shuffle, Float32x4Shuffle, 713523911) \ | 92 V(_Float32x4, shuffle, Float32x4Shuffle, 1178727105) \ |
| 93 V(_Float32x4, get:x, Float32x4ShuffleX, 1019523296) \ | 93 V(_Float32x4, get:x, Float32x4ShuffleX, 1351658256) \ |
| 94 V(_Float32x4, get:y, Float32x4ShuffleY, 710282243) \ | 94 V(_Float32x4, get:y, Float32x4ShuffleY, 217326828) \ |
| 95 V(_Float32x4, get:z, Float32x4ShuffleZ, 1612806041) \ | 95 V(_Float32x4, get:z, Float32x4ShuffleZ, 2144864139) \ |
| 96 V(_Float32x4, get:w, Float32x4ShuffleW, 1113701403) \ | 96 V(_Float32x4, get:w, Float32x4ShuffleW, 1447639537) \ |
| 97 V(_Float32x4, get:signMask, Float32x4GetSignMask, 465347632) \ | 97 V(_Float32x4, get:signMask, Float32x4GetSignMask, 1198789765) \ |
| 98 V(_Float32x4, _cmpequal, Float32x4Equal, 1559121703) \ | 98 V(_Float32x4, _cmpequal, Float32x4Equal, 2141256163) \ |
| 99 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 1959692892) \ | 99 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 696292270) \ |
| 100 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 2128251808) \ | 100 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 1199333164) \ |
| 101 V(_Float32x4, _cmplt, Float32x4LessThan, 405464198) \ | 101 V(_Float32x4, _cmplt, Float32x4LessThan, 943396590) \ |
| 102 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 1217836152) \ | 102 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 57211241) \ |
| 103 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 498820440) \ | 103 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 1234888884) \ |
| 104 V(_Float32x4, _min, Float32x4Min, 1354880316) \ | 104 V(_Float32x4, _min, Float32x4Min, 1166664658) \ |
| 105 V(_Float32x4, _max, Float32x4Max, 171574145) \ | 105 V(_Float32x4, _max, Float32x4Max, 343968921) \ |
| 106 V(_Float32x4, _scale, Float32x4Scale, 1553559438) \ | 106 V(_Float32x4, _scale, Float32x4Scale, 803505531) \ |
| 107 V(_Float32x4, _sqrt, Float32x4Sqrt, 612006112) \ | 107 V(_Float32x4, _sqrt, Float32x4Sqrt, 2092250151) \ |
| 108 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 606139302) \ | 108 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 965252704) \ |
| 109 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 606284658) \ | 109 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 1262202915) \ |
| 110 V(_Float32x4, _negate, Float32x4Negate, 1391098465) \ | 110 V(_Float32x4, _negate, Float32x4Negate, 1203192635) \ |
| 111 V(_Float32x4, _abs, Float32x4Absolute, 1255666131) \ | 111 V(_Float32x4, _abs, Float32x4Absolute, 386324188) \ |
| 112 V(_Float32x4, _clamp, Float32x4Clamp, 736513790) \ | 112 V(_Float32x4, _clamp, Float32x4Clamp, 1454612345) \ |
| 113 V(_Float32x4, withX, Float32x4WithX, 1812990172) \ | 113 V(_Float32x4, withX, Float32x4WithX, 795284225) \ |
| 114 V(_Float32x4, withY, Float32x4WithY, 870795583) \ | 114 V(_Float32x4, withY, Float32x4WithY, 1806065938) \ |
| 115 V(_Float32x4, withZ, Float32x4WithZ, 784227740) \ | 115 V(_Float32x4, withZ, Float32x4WithZ, 320659034) \ |
| 116 V(_Float32x4, withW, Float32x4WithW, 868173303) \ | 116 V(_Float32x4, withW, Float32x4WithW, 1108437255) \ |
| 117 V(_Float32x4, _toUint32x4, Float32x4ToUint32x4, 147627074) \ | 117 V(_Float32x4, _toUint32x4, Float32x4ToUint32x4, 754564339) \ |
| 118 V(_Float32x4, withZWInXY, Float32x4WithZWInXY, 1850941421) \ | 118 V(_Float32x4, withZWInXY, Float32x4WithZWInXY, 1198101679) \ |
| 119 V(_Float32x4, interleaveXY, Float32x4InterleaveXY, 1789523505) \ | 119 V(_Float32x4, interleaveXY, Float32x4InterleaveXY, 2001324072) \ |
| 120 V(_Float32x4, interleaveZW, Float32x4InterleaveZW, 1137302773) \ | 120 V(_Float32x4, interleaveZW, Float32x4InterleaveZW, 928280031) \ |
| 121 V(_Float32x4, interleaveXYPairs, Float32x4InterleaveXYPairs, 2138669236) \ | 121 V(_Float32x4, interleaveXYPairs, Float32x4InterleaveXYPairs, 1046078993) \ |
| 122 V(_Float32x4, interleaveZWPairs, Float32x4InterleaveZWPairs, 1541966446) \ | 122 V(_Float32x4, interleaveZWPairs, Float32x4InterleaveZWPairs, 1001751955) \ |
| 123 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 733327933) \ | 123 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 733327933) \ |
| 124 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 765894409) \ | 124 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 1674637210) \ |
| 125 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 1226233321) \ | 125 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 2013140570) \ |
| 126 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 1455452476) \ | 126 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 944674353) \ |
| 127 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 1608549245) \ | 127 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 22686587) \ |
| 128 V(_Uint32x4, get:signMask, Uint32x4GetSignMask, 231202664) \ | 128 V(_Uint32x4, get:signMask, Uint32x4GetSignMask, 1858084501) \ |
| 129 V(_Uint32x4, select, Uint32x4Select, 881590808) \ | 129 V(_Uint32x4, select, Uint32x4Select, 881590808) \ |
| 130 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 1987921054) \ | 130 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 1475542073) \ |
| 131 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 831632614) \ | 131 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 830610988) \ |
| 132 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 465765612) \ | 132 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 1714792414) \ |
| 133 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 1545009993) \ | 133 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 1516924162) \ |
| 134 V(_Uint32x4, _toFloat32x4, Uint32x4ToUint32x4, 1545735523) \ | 134 V(_Uint32x4, _toFloat32x4, Uint32x4ToUint32x4, 2054503505) \ |
| 135 | 135 |
| 136 | 136 |
| 137 // A list of core function that should always be inlined. | 137 // A list of core function that should always be inlined. |
| 138 #define INLINE_WHITE_LIST(V) \ | 138 #define INLINE_WHITE_LIST(V) \ |
| 139 V(_ObjectArray, get:length, ObjectArrayLength, 1441000484) \ | 139 V(_ObjectArray, get:length, ObjectArrayLength, 259323113) \ |
| 140 V(_ImmutableArray, get:length, ImmutableArrayLength, 1430953867) \ | 140 V(_ImmutableArray, get:length, ImmutableArrayLength, 1341942416) \ |
| 141 V(_TypedList, get:length, TypedDataLength, 117589485) \ | 141 V(_TypedList, get:length, TypedDataLength, 26556746) \ |
| 142 V(_GrowableObjectArray, get:length, GrowableArrayLength, 767561362) \ | 142 V(_GrowableObjectArray, get:length, GrowableArrayLength, 1160357614) \ |
| 143 V(_StringBase, get:length, StringBaseLength, 1158042795) \ | 143 V(_StringBase, get:length, StringBaseLength, 1483460481) \ |
| 144 V(ListIterator, moveNext, ListIteratorMoveNext, 657540761) \ | 144 V(ListIterator, moveNext, ListIteratorMoveNext, 657540761) \ |
| 145 V(_GrowableObjectArray, get:iterator, GrowableArrayIterator, 281980741) \ | 145 V(_GrowableObjectArray, get:iterator, GrowableArrayIterator, 281980741) \ |
| 146 V(_GrowableObjectArray, forEach, GrowableArrayForEach, 334448248) | 146 V(_GrowableObjectArray, forEach, GrowableArrayForEach, 334448248) |
| 147 | 147 |
| 148 | 148 |
| 149 // Class that recognizes the name and owner of a function and returns the | 149 // Class that recognizes the name and owner of a function and returns the |
| 150 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable | 150 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable |
| 151 // functions. | 151 // functions. |
| 152 class MethodRecognizer : public AllStatic { | 152 class MethodRecognizer : public AllStatic { |
| 153 public: | 153 public: |
| (...skipping 6594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6748 ForwardInstructionIterator* current_iterator_; | 6748 ForwardInstructionIterator* current_iterator_; |
| 6749 | 6749 |
| 6750 private: | 6750 private: |
| 6751 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6751 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6752 }; | 6752 }; |
| 6753 | 6753 |
| 6754 | 6754 |
| 6755 } // namespace dart | 6755 } // namespace dart |
| 6756 | 6756 |
| 6757 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6757 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |