| 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" |
| 11 #include "vm/handles_impl.h" | 11 #include "vm/handles_impl.h" |
| 12 #include "vm/locations.h" | 12 #include "vm/locations.h" |
| 13 #include "vm/method_recognizer.h" |
| 13 #include "vm/object.h" | 14 #include "vm/object.h" |
| 14 #include "vm/parser.h" | 15 #include "vm/parser.h" |
| 15 | 16 |
| 16 namespace dart { | 17 namespace dart { |
| 17 | 18 |
| 18 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 19 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| 19 | 20 |
| 20 class BitVector; | 21 class BitVector; |
| 21 class BlockEntryInstr; | 22 class BlockEntryInstr; |
| 22 class BufferFormatter; | 23 class BufferFormatter; |
| 23 class CatchBlockEntryInstr; | 24 class CatchBlockEntryInstr; |
| 24 class ComparisonInstr; | 25 class ComparisonInstr; |
| 25 class Definition; | 26 class Definition; |
| 26 class Environment; | 27 class Environment; |
| 27 class FlowGraph; | 28 class FlowGraph; |
| 28 class FlowGraphBuilder; | 29 class FlowGraphBuilder; |
| 29 class FlowGraphCompiler; | 30 class FlowGraphCompiler; |
| 30 class FlowGraphVisitor; | 31 class FlowGraphVisitor; |
| 31 class Instruction; | 32 class Instruction; |
| 32 class LocalVariable; | 33 class LocalVariable; |
| 33 class ParsedFunction; | 34 class ParsedFunction; |
| 34 class Range; | 35 class Range; |
| 35 class RangeAnalysis; | 36 class RangeAnalysis; |
| 36 class RangeBoundary; | 37 class RangeBoundary; |
| 37 | 38 |
| 38 | |
| 39 // TODO(srdjan): Unify with INTRINSIC_LIST. | |
| 40 // (class-name, function-name, recognized enum, fingerprint). | |
| 41 // See intrinsifier for fingerprint computation. | |
| 42 #define RECOGNIZED_LIST(V) \ | |
| 43 V(::, identical, ObjectIdentical, 496869842) \ | |
| 44 V(ClassID, getID, ClassIDgetID, 1322490980) \ | |
| 45 V(Object, ==, ObjectEquals, 1068471689) \ | |
| 46 V(Object, Object., ObjectConstructor, 1066669787) \ | |
| 47 V(_List, get:length, ObjectArrayLength, 1181352729) \ | |
| 48 V(_List, _List., ObjectArrayConstructor, 1595327584) \ | |
| 49 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \ | |
| 50 V(_TypedList, get:length, TypedDataLength, 522565357) \ | |
| 51 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 1541411498) \ | |
| 52 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 1032404349) \ | |
| 53 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 381073990) \ | |
| 54 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1142676276) \ | |
| 55 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 330269934) \ | |
| 56 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 59490554) \ | |
| 57 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 393003933) \ | |
| 58 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1792407200) \ | |
| 59 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1338379857) \ | |
| 60 V(_TypedList, _getInt32x4, ByteArrayBaseGetInt32x4, 1469917805) \ | |
| 61 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 433348464) \ | |
| 62 V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 149406583) \ | |
| 63 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 805477162) \ | |
| 64 V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 888580944) \ | |
| 65 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1708248181) \ | |
| 66 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1863152792) \ | |
| 67 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1148703855) \ | |
| 68 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 972883980) \ | |
| 69 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 950522310) \ | |
| 70 V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 1301138078) \ | |
| 71 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \ | |
| 72 V(_GrowableList, get:_capacity, GrowableArrayCapacity, 555140075) \ | |
| 73 V(_GrowableList, _setData, GrowableArraySetData, 2126927509) \ | |
| 74 V(_GrowableList, _setLength, GrowableArraySetLength, 89389299) \ | |
| 75 V(_StringBase, get:length, StringBaseLength, 784399628) \ | |
| 76 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 49873871) \ | |
| 77 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 397735324) \ | |
| 78 V(_StringBase, [], StringBaseCharAt, 1512210677) \ | |
| 79 V(_StringBase, _interpolate, StringBaseInterpolate, 1758627989) \ | |
| 80 V(_OneByteString, _setAt, OneByteStringSetAt, 468605749) \ | |
| 81 V(_IntegerImplementation, toDouble, IntegerToDouble, 1084977108) \ | |
| 82 V(_IntegerImplementation, _leftShiftWithMask32, IntegerLeftShiftWithMask32, \ | |
| 83 597111055) \ | |
| 84 V(_Double, toInt, DoubleToInteger, 1547535151) \ | |
| 85 V(_Double, truncateToDouble, DoubleTruncate, 2117801967) \ | |
| 86 V(_Double, roundToDouble, DoubleRound, 2124216110) \ | |
| 87 V(_Double, floorToDouble, DoubleFloor, 968600699) \ | |
| 88 V(_Double, ceilToDouble, DoubleCeil, 1779929274) \ | |
| 89 V(_Double, _modulo, DoubleMod, 1473971007) \ | |
| 90 V(::, sqrt, MathSqrt, 101545548) \ | |
| 91 V(::, sin, MathSin, 1741396147) \ | |
| 92 V(::, cos, MathCos, 1951197905) \ | |
| 93 V(::, min, MathMin, 1022567780) \ | |
| 94 V(::, max, MathMax, 612058870) \ | |
| 95 V(::, _doublePow, MathDoublePow, 823139975) \ | |
| 96 V(Float32x4, Float32x4., Float32x4Constructor, 1755873079) \ | |
| 97 V(Float32x4, Float32x4.zero, Float32x4Zero, 1494069379) \ | |
| 98 V(Float32x4, Float32x4.splat, Float32x4Splat, 916211464) \ | |
| 99 V(Float32x4, Float32x4.fromInt32x4Bits, Float32x4FromInt32x4Bits, \ | |
| 100 640076216) \ | |
| 101 V(Float32x4, Float32x4.fromFloat64x2, Float32x4FromFloat64x2, 1279591344) \ | |
| 102 V(_Float32x4, shuffle, Float32x4Shuffle, 1636488139) \ | |
| 103 V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 597555927) \ | |
| 104 V(_Float32x4, get:x, Float32x4ShuffleX, 384850558) \ | |
| 105 V(_Float32x4, get:y, Float32x4ShuffleY, 1398002778) \ | |
| 106 V(_Float32x4, get:z, Float32x4ShuffleZ, 1178056441) \ | |
| 107 V(_Float32x4, get:w, Float32x4ShuffleW, 480831839) \ | |
| 108 V(_Float32x4, get:signMask, Float32x4GetSignMask, 630761511) \ | |
| 109 V(_Float32x4, _cmpequal, Float32x4Equal, 571062952) \ | |
| 110 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 1613543295) \ | |
| 111 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 589402909) \ | |
| 112 V(_Float32x4, _cmplt, Float32x4LessThan, 1502332656) \ | |
| 113 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 1069848031) \ | |
| 114 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 1334574472) \ | |
| 115 V(_Float32x4, _min, Float32x4Min, 2036349551) \ | |
| 116 V(_Float32x4, _max, Float32x4Max, 571688115) \ | |
| 117 V(_Float32x4, _scale, Float32x4Scale, 1311297761) \ | |
| 118 V(_Float32x4, _sqrt, Float32x4Sqrt, 1709659395) \ | |
| 119 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 2043980962) \ | |
| 120 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 739405237) \ | |
| 121 V(_Float32x4, _negate, Float32x4Negate, 445839777) \ | |
| 122 V(_Float32x4, _abs, Float32x4Absolute, 1152777608) \ | |
| 123 V(_Float32x4, _clamp, Float32x4Clamp, 353415442) \ | |
| 124 V(_Float32x4, withX, Float32x4WithX, 1446546696) \ | |
| 125 V(_Float32x4, withY, Float32x4WithY, 309844761) \ | |
| 126 V(_Float32x4, withZ, Float32x4WithZ, 971921505) \ | |
| 127 V(_Float32x4, withW, Float32x4WithW, 1759699726) \ | |
| 128 V(Float64x2, Float64x2., Float64x2Constructor, 1399581872) \ | |
| 129 V(Float64x2, Float64x2.zero, Float64x2Zero, 1836770587) \ | |
| 130 V(Float64x2, Float64x2.splat, Float64x2Splat, 939291159) \ | |
| 131 V(Float64x2, Float64x2.fromFloat32x4, Float64x2FromFloat32x4, 1499726406) \ | |
| 132 V(_Float64x2, get:x, Float64x2GetX, 261044094) \ | |
| 133 V(_Float64x2, get:y, Float64x2GetY, 1942257886) \ | |
| 134 V(_Float64x2, _negate, Float64x2Negate, 2133212774) \ | |
| 135 V(_Float64x2, abs, Float64x2Abs, 1224776282) \ | |
| 136 V(_Float64x2, sqrt, Float64x2Sqrt, 1037569520) \ | |
| 137 V(_Float64x2, get:signMask, Float64x2GetSignMask, 252936800) \ | |
| 138 V(_Float64x2, scale, Float64x2Scale, 1199438744) \ | |
| 139 V(_Float64x2, withX, Float64x2WithX, 1042725932) \ | |
| 140 V(_Float64x2, withY, Float64x2WithY, 1496958947) \ | |
| 141 V(_Float64x2, min, Float64x2Min, 485240583) \ | |
| 142 V(_Float64x2, max, Float64x2Max, 2146148204) \ | |
| 143 V(Int32x4, Int32x4., Int32x4Constructor, 665986284) \ | |
| 144 V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 87082660) \ | |
| 145 V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, \ | |
| 146 372517418) \ | |
| 147 V(_Int32x4, get:flagX, Int32x4GetFlagX, 1077555238) \ | |
| 148 V(_Int32x4, get:flagY, Int32x4GetFlagY, 779160284) \ | |
| 149 V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 181912283) \ | |
| 150 V(_Int32x4, get:flagW, Int32x4GetFlagW, 977675534) \ | |
| 151 V(_Int32x4, get:signMask, Int32x4GetSignMask, 1929271914) \ | |
| 152 V(_Int32x4, shuffle, Int32x4Shuffle, 1870018702) \ | |
| 153 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 967644870) \ | |
| 154 V(_Int32x4, select, Int32x4Select, 1696037681) \ | |
| 155 V(_Int32x4, withFlagX, Int32x4WithFlagX, 467852789) \ | |
| 156 V(_Int32x4, withFlagY, Int32x4WithFlagY, 1903359978) \ | |
| 157 V(_Int32x4, withFlagZ, Int32x4WithFlagZ, 862460960) \ | |
| 158 V(_Int32x4, withFlagW, Int32x4WithFlagW, 1095242907) \ | |
| 159 V(_List, [], ObjectArrayGetIndexed, 795612476) \ | |
| 160 V(_List, []=, ObjectArraySetIndexed, 1288827575) \ | |
| 161 V(_ImmutableList, [], ImmutableArrayGetIndexed, 1990177341) \ | |
| 162 V(_GrowableList, [], GrowableArrayGetIndexed, 919108233) \ | |
| 163 V(_GrowableList, []=, GrowableArraySetIndexed, 1218649853) \ | |
| 164 V(_Float32Array, [], Float32ArrayGetIndexed, 856653338) \ | |
| 165 V(_Float32Array, []=, Float32ArraySetIndexed, 2086166464) \ | |
| 166 V(_Float64Array, [], Float64ArrayGetIndexed, 1779054297) \ | |
| 167 V(_Float64Array, []=, Float64ArraySetIndexed, 243929230) \ | |
| 168 V(_Int8Array, [], Int8ArrayGetIndexed, 321230586) \ | |
| 169 V(_Int8Array, []=, Int8ArraySetIndexed, 2050598685) \ | |
| 170 V(_Uint8Array, [], Uint8ArrayGetIndexed, 16125140) \ | |
| 171 V(_Uint8Array, []=, Uint8ArraySetIndexed, 2018064553) \ | |
| 172 V(_Uint8ClampedArray, [], Uint8ClampedArrayGetIndexed, 430672063) \ | |
| 173 V(_Uint8ClampedArray, []=, Uint8ClampedArraySetIndexed, 821294340) \ | |
| 174 V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 1678777951) \ | |
| 175 V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 918478513) \ | |
| 176 V(_ExternalUint8ClampedArray, [], ExternalUint8ClampedArrayGetIndexed, \ | |
| 177 1346536303) \ | |
| 178 V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \ | |
| 179 1794849214) \ | |
| 180 V(_Int16Array, [], Int16ArrayGetIndexed, 74127855) \ | |
| 181 V(_Int16Array, []=, Int16ArraySetIndexed, 1610252345) \ | |
| 182 V(_Uint16Array, [], Uint16ArrayGetIndexed, 470411953) \ | |
| 183 V(_Uint16Array, []=, Uint16ArraySetIndexed, 1648929040) \ | |
| 184 V(_Int32Array, [], Int32ArrayGetIndexed, 203101370) \ | |
| 185 V(_Int32Array, []=, Int32ArraySetIndexed, 338968571) \ | |
| 186 V(_Uint32Array, [], Uint32ArrayGetIndexed, 1640672852) \ | |
| 187 V(_Uint32Array, []=, Uint32ArraySetIndexed, 1472976717) \ | |
| 188 V(_Float32x4Array, [], Float32x4ArrayGetIndexed, 1466627059) \ | |
| 189 V(_Float32x4Array, []=, Float32x4ArraySetIndexed, 2141660076) \ | |
| 190 V(_Int32x4Array, [], Int32x4ArrayGetIndexed, 818792056) \ | |
| 191 V(_Int32x4Array, []=, Int32x4ArraySetIndexed, 1021474038) \ | |
| 192 V(_Float64x2Array, [], Float64x2ArrayGetIndexed, 288114492) \ | |
| 193 V(_Float64x2Array, []=, Float64x2ArraySetIndexed, 941746736) \ | |
| 194 | |
| 195 | |
| 196 // A list of core function that should always be inlined. | |
| 197 #define INLINE_WHITE_LIST(V) \ | |
| 198 V(Object, ==, ObjectEquals, 1068471689) \ | |
| 199 V(_List, get:length, ObjectArrayLength, 1181352729) \ | |
| 200 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \ | |
| 201 V(_TypedList, get:length, TypedDataLength, 522565357) \ | |
| 202 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \ | |
| 203 V(_StringBase, get:length, StringBaseLength, 784399628) \ | |
| 204 V(ListIterator, moveNext, ListIteratorMoveNext, 210829138) \ | |
| 205 V(_GrowableList, get:iterator, GrowableArrayIterator, 1812933946) \ | |
| 206 V(_GrowableList, forEach, GrowableArrayForEach, 2085943947) \ | |
| 207 V(_List, [], ObjectArrayGetIndexed, 795612476) \ | |
| 208 V(_List, []=, ObjectArraySetIndexed, 1288827575) \ | |
| 209 V(_List, get:isEmpty, ObjectArrayIsEmpty, 2130247737) \ | |
| 210 V(_ImmutableList, [], ImmutableArrayGetIndexed, 1990177341) \ | |
| 211 V(_GrowableList, [], GrowableArrayGetIndexed, 919108233) \ | |
| 212 V(_GrowableList, []=, GrowableArraySetIndexed, 1218649853) \ | |
| 213 V(_Float32Array, [], Float32ArrayGetIndexed, 856653338) \ | |
| 214 V(_Float32Array, []=, Float32ArraySetIndexed, 2086166464) \ | |
| 215 V(_Float64Array, [], Float64ArrayGetIndexed, 1779054297) \ | |
| 216 V(_Float64Array, []=, Float64ArraySetIndexed, 243929230) \ | |
| 217 V(_Int8Array, [], Int8ArrayGetIndexed, 321230586) \ | |
| 218 V(_Int8Array, []=, Int8ArraySetIndexed, 2050598685) \ | |
| 219 V(_Uint8Array, [], Uint8ArrayGetIndexed, 16125140) \ | |
| 220 V(_Uint8Array, []=, Uint8ArraySetIndexed, 2018064553) \ | |
| 221 V(_Uint8ClampedArray, [], Uint8ClampedArrayGetIndexed, 430672063) \ | |
| 222 V(_Uint8ClampedArray, []=, Uint8ClampedArraySetIndexed, 821294340) \ | |
| 223 V(_Uint16Array, [], Uint16ArrayGetIndexed, 470411953) \ | |
| 224 V(_Uint16Array, []=, Uint16ArraySetIndexed, 1648929040) \ | |
| 225 V(_Int16Array, [], Int16ArrayGetIndexed, 74127855) \ | |
| 226 V(_Int16Array, []=, Int16ArraySetIndexed, 1610252345) \ | |
| 227 V(_Int32Array, [], Int32ArrayGetIndexed, 203101370) \ | |
| 228 V(_Int32Array, []=, Int32ArraySetIndexed, 338968571) \ | |
| 229 V(_Uint8ArrayView, [], Uint8ArrayViewGetIndexed, 1543480955) \ | |
| 230 V(_Uint8ArrayView, []=, Uint8ArrayViewSetIndexed, 936729641) \ | |
| 231 V(_Int8ArrayView, [], Int8ArrayViewGetIndexed, 1898018934) \ | |
| 232 V(_Int8ArrayView, []=, Int8ArrayViewSetIndexed, 111684506) \ | |
| 233 V(::, asin, MathASin, 1651042633) \ | |
| 234 V(::, acos, MathACos, 1139647090) \ | |
| 235 V(::, atan, MathATan, 1668754384) \ | |
| 236 V(::, atan2, MathATan2, 1845649456) \ | |
| 237 V(::, cos, MathCos, 1951197905) \ | |
| 238 V(::, exp, MathExp, 1809210829) \ | |
| 239 V(::, log, MathLog, 1620336448) \ | |
| 240 V(::, max, MathMax, 612058870) \ | |
| 241 V(::, min, MathMin, 1022567780) \ | |
| 242 V(::, pow, MathPow, 930962530) \ | |
| 243 V(::, sin, MathSin, 1741396147) \ | |
| 244 V(::, sqrt, MathSqrt, 101545548) \ | |
| 245 V(::, tan, MathTan, 982072809) \ | |
| 246 | |
| 247 | |
| 248 // A list of core functions that internally dispatch based on received id. | |
| 249 #define POLYMORPHIC_TARGET_LIST(V) \ | |
| 250 V(_StringBase, [], StringBaseCharAt, 1512210677) \ | |
| 251 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 397735324) \ | |
| 252 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 1541411498) \ | |
| 253 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 1032404349) \ | |
| 254 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 381073990) \ | |
| 255 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1142676276) \ | |
| 256 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 330269934) \ | |
| 257 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 59490554) \ | |
| 258 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 393003933) \ | |
| 259 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1792407200) \ | |
| 260 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1338379857) \ | |
| 261 V(_TypedList, _getInt32x4, ByteArrayBaseGetInt32x4, 1469917805) \ | |
| 262 V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 433348464) \ | |
| 263 V(_TypedList, _setUint8, ByteArrayBaseSetInt8, 149406583) \ | |
| 264 V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 805477162) \ | |
| 265 V(_TypedList, _setUint16, ByteArrayBaseSetInt16, 888580944) \ | |
| 266 V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 1708248181) \ | |
| 267 V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 1863152792) \ | |
| 268 V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1148703855) \ | |
| 269 V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 972883980) \ | |
| 270 V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 950522310) \ | |
| 271 V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 1301138078) \ | |
| 272 | |
| 273 // Class that recognizes the name and owner of a function and returns the | |
| 274 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable | |
| 275 // functions. | |
| 276 class MethodRecognizer : public AllStatic { | |
| 277 public: | |
| 278 enum Kind { | |
| 279 kUnknown, | |
| 280 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, | |
| 281 RECOGNIZED_LIST(DEFINE_ENUM_LIST) | |
| 282 #undef DEFINE_ENUM_LIST | |
| 283 }; | |
| 284 | |
| 285 static Kind RecognizeKind(const Function& function); | |
| 286 static bool AlwaysInline(const Function& function); | |
| 287 static bool PolymorphicTarget(const Function& function); | |
| 288 static const char* KindToCString(Kind kind); | |
| 289 static void InitializeState(); | |
| 290 }; | |
| 291 | |
| 292 | |
| 293 // CompileType describes type of the value produced by the definition. | 39 // CompileType describes type of the value produced by the definition. |
| 294 // | 40 // |
| 295 // It captures the following properties: | 41 // It captures the following properties: |
| 296 // - whether value can potentially be null or it is definitely not null; | 42 // - whether value can potentially be null or it is definitely not null; |
| 297 // - concrete class id of the value or kDynamicCid if unknown statically; | 43 // - concrete class id of the value or kDynamicCid if unknown statically; |
| 298 // - abstract super type of the value, concrete type of the value in runtime | 44 // - abstract super type of the value, concrete type of the value in runtime |
| 299 // is guaranteed to be sub type of this type. | 45 // is guaranteed to be sub type of this type. |
| 300 // | 46 // |
| 301 // Values of CompileType form a lattice with a None type as a bottom and a | 47 // Values of CompileType form a lattice with a None type as a bottom and a |
| 302 // nullable Dynamic type as a top element. Method Union provides a join | 48 // nullable Dynamic type as a top element. Method Union provides a join |
| (...skipping 8092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8395 ForwardInstructionIterator* current_iterator_; | 8141 ForwardInstructionIterator* current_iterator_; |
| 8396 | 8142 |
| 8397 private: | 8143 private: |
| 8398 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 8144 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 8399 }; | 8145 }; |
| 8400 | 8146 |
| 8401 | 8147 |
| 8402 } // namespace dart | 8148 } // namespace dart |
| 8403 | 8149 |
| 8404 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8150 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |