| 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, 1018911876) \ | 41 V(::, identical, ObjectIdentical, 101186973) \ |
| 42 V(Object, Object., ObjectConstructor, 2030609793) \ | 42 V(Object, Object., ObjectConstructor, 1099442980) \ |
| 43 V(Object, get:_cid, ObjectCid, 732498573) \ | 43 V(Object, get:_cid, ObjectCid, 2099568593) \ |
| 44 V(_ObjectArray, get:length, ObjectArrayLength, 405297088) \ | 44 V(_ObjectArray, get:length, ObjectArrayLength, 1441000484) \ |
| 45 V(_ImmutableArray, get:length, ImmutableArrayLength, 433698233) \ | 45 V(_ImmutableArray, get:length, ImmutableArrayLength, 1430953867) \ |
| 46 V(_TypedList, get:length, TypedDataLength, 1004567191) \ | 46 V(_TypedList, get:length, TypedDataLength, 117589485) \ |
| 47 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 1219036864) \ | 47 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 788387678) \ |
| 48 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 1219036864) \ | 48 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 1137892349) \ |
| 49 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1219036864) \ | 49 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 464167270) \ |
| 50 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1219036864) \ | 50 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 673378812) \ |
| 51 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 1219036864) \ | 51 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 1230275232) \ |
| 52 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1219036864) \ | 52 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 976951843) \ |
| 53 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 1465214182) \ | 53 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 215932309) \ |
| 54 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1465214182) \ | 54 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 450032954) \ |
| 55 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 2133963445) \ | 55 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1602836552) \ |
| 56 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 1865947547) \ | 56 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 250049637) \ |
| 57 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 1865947547) \ | 57 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 1792593311) \ |
| 58 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 1865947547) \ | 58 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 1958159284) \ |
| 59 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 1865947547) \ | 59 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 1244907090) \ |
| 60 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1865947547) \ | 60 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1058956549) \ |
| 61 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1865947547) \ | 61 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1054500835) \ |
| 62 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 2034634179) \ | 62 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1426038329) \ |
| 63 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 2034634179) \ | 63 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 1289924817) \ |
| 64 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 773019010) \ | 64 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 370513644) \ |
| 65 V(_GrowableObjectArray, get:length, GrowableArrayLength, 725548050) \ | 65 V(_GrowableObjectArray, get:length, GrowableArrayLength, 767561362) \ |
| 66 V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 725548050) \ | 66 V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 874559046) \ |
| 67 V(_GrowableObjectArray, _setData, GrowableArraySetData, 588108129) \ | 67 V(_GrowableObjectArray, _setData, GrowableArraySetData, 1302055339) \ |
| 68 V(_GrowableObjectArray, _setLength, GrowableArraySetLength, 279007375) \ | 68 V(_GrowableObjectArray, _setLength, GrowableArraySetLength, 1016226171) \ |
| 69 V(_StringBase, get:length, StringBaseLength, 320803993) \ | 69 V(_StringBase, get:length, StringBaseLength, 1158042795) \ |
| 70 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 110631520) \ | 70 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 1588094430) \ |
| 71 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 1574843871) \ | 71 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 1452213966) \ |
| 72 V(_StringBase, [], StringBaseCharAt, 2105190389) \ | 72 V(_StringBase, [], StringBaseCharAt, 924930519) \ |
| 73 V(_OneByteString, _setAt, OneByteStringSetAt, 1038132016) \ | 73 V(_OneByteString, _setAt, OneByteStringSetAt, 456985263) \ |
| 74 V(_IntegerImplementation, toDouble, IntegerToDouble, 1331752138) \ | 74 V(_IntegerImplementation, toDouble, IntegerToDouble, 2141284842) \ |
| 75 V(_Double, toInt, DoubleToInteger, 630286253) \ | 75 V(_Double, toInt, DoubleToInteger, 1580473283) \ |
| 76 V(_Double, truncateToDouble, DoubleTruncate, 1804056693) \ | 76 V(_Double, truncateToDouble, DoubleTruncate, 849350203) \ |
| 77 V(_Double, roundToDouble, DoubleRound, 1804056693) \ | 77 V(_Double, roundToDouble, DoubleRound, 500368418) \ |
| 78 V(_Double, floorToDouble, DoubleFloor, 1804056693) \ | 78 V(_Double, floorToDouble, DoubleFloor, 763548522) \ |
| 79 V(_Double, ceilToDouble, DoubleCeil, 1804056693) \ | 79 V(_Double, ceilToDouble, DoubleCeil, 976697019) \ |
| 80 V(_Double, pow, DoublePow, 102305574) \ | 80 V(_Double, pow, DoublePow, 1240251670) \ |
| 81 V(_Double, _modulo, DoubleMod, 663439671) \ | 81 V(_Double, _modulo, DoubleMod, 1850917533) \ |
| 82 V(::, sqrt, MathSqrt, 1662640002) \ | 82 V(::, sqrt, MathSqrt, 465520247) \ |
| 83 V(::, sin, MathSin, 1273932041) \ | 83 V(::, sin, MathSin, 730107143) \ |
| 84 V(::, cos, MathCos, 1749547468) \ | 84 V(::, cos, MathCos, 1282146521) \ |
| 85 V(::, min, MathMin, 269896129) \ | 85 V(::, min, MathMin, 1584022354) \ |
| 86 V(::, max, MathMax, 1286442186) \ | 86 V(::, max, MathMax, 328632232) \ |
| 87 V(Float32x4, Float32x4., Float32x4Constructor, 1492157358) \ | 87 V(Float32x4, Float32x4., Float32x4Constructor, 1876089990) \ |
| 88 V(Float32x4, Float32x4.zero, Float32x4Zero, 444339161) \ | 88 V(Float32x4, Float32x4.zero, Float32x4Zero, 1903586222) \ |
| 89 V(Float32x4, Float32x4.splat, Float32x4Splat, 1843231403) \ | 89 V(Float32x4, Float32x4.splat, Float32x4Splat, 38462589) \ |
| 90 V(_Float32x4, _shuffle, Float32x4Shuffle, 1618450134) \ | 90 V(_Float32x4, _shuffle, Float32x4Shuffle, 2044955136) \ |
| 91 V(_Float32x4, get:x, Float32x4ShuffleX, 211144022) \ | 91 V(_Float32x4, get:x, Float32x4ShuffleX, 1019523296) \ |
| 92 V(_Float32x4, get:y, Float32x4ShuffleY, 211144022) \ | 92 V(_Float32x4, get:y, Float32x4ShuffleY, 710282243) \ |
| 93 V(_Float32x4, get:z, Float32x4ShuffleZ, 211144022) \ | 93 V(_Float32x4, get:z, Float32x4ShuffleZ, 1612806041) \ |
| 94 V(_Float32x4, get:w, Float32x4ShuffleW, 211144022) \ | 94 V(_Float32x4, get:w, Float32x4ShuffleW, 1113701403) \ |
| 95 V(_Float32x4, _cmpequal, Float32x4Equal, 2103153736) \ | 95 V(_Float32x4, _cmpequal, Float32x4Equal, 1559121703) \ |
| 96 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 2103153736) \ | 96 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 1959692892) \ |
| 97 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 2103153736) \ | 97 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 2128251808) \ |
| 98 V(_Float32x4, _cmplt, Float32x4LessThan, 2103153736) \ | 98 V(_Float32x4, _cmplt, Float32x4LessThan, 405464198) \ |
| 99 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 2103153736) \ | 99 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 1217836152) \ |
| 100 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 2103153736) \ | 100 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 498820440) \ |
| 101 V(_Float32x4, _min, Float32x4Min, 465519415) \ | 101 V(_Float32x4, _min, Float32x4Min, 1354880316) \ |
| 102 V(_Float32x4, _max, Float32x4Max, 465519415) \ | 102 V(_Float32x4, _max, Float32x4Max, 171574145) \ |
| 103 V(_Float32x4, _scale, Float32x4Scale, 42272341) \ | 103 V(_Float32x4, _scale, Float32x4Scale, 1553559438) \ |
| 104 V(_Float32x4, _sqrt, Float32x4Sqrt, 157194268) \ | 104 V(_Float32x4, _sqrt, Float32x4Sqrt, 612006112) \ |
| 105 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 157194268) \ | 105 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 606139302) \ |
| 106 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 157194268) \ | 106 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 606284658) \ |
| 107 V(_Float32x4, _negate, Float32x4Negate, 157194268) \ | 107 V(_Float32x4, _negate, Float32x4Negate, 1391098465) \ |
| 108 V(_Float32x4, _abs, Float32x4Absolute, 157194268) \ | 108 V(_Float32x4, _abs, Float32x4Absolute, 1255666131) \ |
| 109 V(_Float32x4, _clamp, Float32x4Clamp, 1553901850) \ | 109 V(_Float32x4, _clamp, Float32x4Clamp, 736513790) \ |
| 110 V(_Float32x4, withX, Float32x4WithX, 1816943014) \ | 110 V(_Float32x4, withX, Float32x4WithX, 1812990172) \ |
| 111 V(_Float32x4, withY, Float32x4WithY, 820404963) \ | 111 V(_Float32x4, withY, Float32x4WithY, 870795583) \ |
| 112 V(_Float32x4, withZ, Float32x4WithZ, 881355277) \ | 112 V(_Float32x4, withZ, Float32x4WithZ, 784227740) \ |
| 113 V(_Float32x4, withW, Float32x4WithW, 441497035) \ | 113 V(_Float32x4, withW, Float32x4WithW, 868173303) \ |
| 114 V(_Float32x4, _toUint32x4, Float32x4ToUint32x4, 802289205) \ | 114 V(_Float32x4, _toUint32x4, Float32x4ToUint32x4, 147627074) \ |
| 115 V(_Float32x4, withZWInXY, Float32x4WithZWInXY, 465519415) \ | 115 V(_Float32x4, withZWInXY, Float32x4WithZWInXY, 1850941421) \ |
| 116 V(_Float32x4, interleaveXY, Float32x4InterleaveXY, 465519415) \ | 116 V(_Float32x4, interleaveXY, Float32x4InterleaveXY, 1789523505) \ |
| 117 V(_Float32x4, interleaveZW, Float32x4InterleaveZW, 465519415) \ | 117 V(_Float32x4, interleaveZW, Float32x4InterleaveZW, 1137302773) \ |
| 118 V(_Float32x4, interleaveXYPairs, Float32x4InterleaveXYPairs, 465519415) \ | 118 V(_Float32x4, interleaveXYPairs, Float32x4InterleaveXYPairs, 2138669236) \ |
| 119 V(_Float32x4, interleaveZWPairs, Float32x4InterleaveZWPairs, 465519415) \ | 119 V(_Float32x4, interleaveZWPairs, Float32x4InterleaveZWPairs, 1541966446) \ |
| 120 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 487876159) \ | 120 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 733327933) \ |
| 121 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 782547529) \ | 121 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 765894409) \ |
| 122 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 782547529) \ | 122 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 1226233321) \ |
| 123 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 782547529) \ | 123 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 1455452476) \ |
| 124 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 782547529) \ | 124 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 1608549245) \ |
| 125 V(_Uint32x4, select, Uint32x4Select, 810336099) \ | 125 V(_Uint32x4, select, Uint32x4Select, 881590808) \ |
| 126 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 25547408) \ | 126 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 1987921054) \ |
| 127 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 1176493005) \ | 127 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 831632614) \ |
| 128 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 1237443319) \ | 128 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 465765612) \ |
| 129 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 797585077) \ | 129 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 1545009993) \ |
| 130 V(_Uint32x4, _toFloat32x4, Uint32x4ToUint32x4, 912844231) \ | 130 V(_Uint32x4, _toFloat32x4, Uint32x4ToUint32x4, 1545735523) \ |
| 131 | 131 |
| 132 | 132 |
| 133 // A list of core function that should always be inlined. | 133 // A list of core function that should always be inlined. |
| 134 #define INLINE_WHITE_LIST(V) \ | 134 #define INLINE_WHITE_LIST(V) \ |
| 135 V(ListIterator, moveNext, ListIteratorMoveNext, 203118278) \ | 135 V(ListIterator, moveNext, ListIteratorMoveNext, 657540761) \ |
| 136 V(_GrowableObjectArray, get:iterator, GrowableArrayIterator, 810824939) \ | 136 V(_GrowableObjectArray, get:iterator, GrowableArrayIterator, 281980741) \ |
| 137 V(_GrowableObjectArray, forEach, GrowableArrayForEach, 619038738) | 137 V(_GrowableObjectArray, forEach, GrowableArrayForEach, 334448248) |
| 138 | 138 |
| 139 | 139 |
| 140 // Class that recognizes the name and owner of a function and returns the | 140 // Class that recognizes the name and owner of a function and returns the |
| 141 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable | 141 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable |
| 142 // functions. | 142 // functions. |
| 143 class MethodRecognizer : public AllStatic { | 143 class MethodRecognizer : public AllStatic { |
| 144 public: | 144 public: |
| 145 enum Kind { | 145 enum Kind { |
| 146 kUnknown, | 146 kUnknown, |
| 147 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, | 147 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, |
| (...skipping 6471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6619 ForwardInstructionIterator* current_iterator_; | 6619 ForwardInstructionIterator* current_iterator_; |
| 6620 | 6620 |
| 6621 private: | 6621 private: |
| 6622 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6622 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6623 }; | 6623 }; |
| 6624 | 6624 |
| 6625 | 6625 |
| 6626 } // namespace dart | 6626 } // namespace dart |
| 6627 | 6627 |
| 6628 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6628 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |