| 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 #include "vm/flow_graph_type_propagator.h" | 5 #include "vm/flow_graph_type_propagator.h" |
| 6 | 6 |
| 7 #include "vm/cha.h" | 7 #include "vm/cha.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/il_printer.h" | 9 #include "vm/il_printer.h" |
| 10 | 10 |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 return value()->Type(); | 923 return value()->Type(); |
| 924 } | 924 } |
| 925 | 925 |
| 926 | 926 |
| 927 CompileType CreateArrayInstr::ComputeType() const { | 927 CompileType CreateArrayInstr::ComputeType() const { |
| 928 // TODO(fschneider): Add abstract type and type arguments to the compile type. | 928 // TODO(fschneider): Add abstract type and type arguments to the compile type. |
| 929 return CompileType::FromCid(kArrayCid); | 929 return CompileType::FromCid(kArrayCid); |
| 930 } | 930 } |
| 931 | 931 |
| 932 | 932 |
| 933 CompileType CreateClosureInstr::ComputeType() const { | |
| 934 const Function& fun = function(); | |
| 935 const Class& signature_class = Class::Handle(fun.signature_class()); | |
| 936 return CompileType::FromAbstractType( | |
| 937 Type::ZoneHandle(signature_class.SignatureType()), | |
| 938 CompileType::kNonNullable); | |
| 939 } | |
| 940 | |
| 941 | |
| 942 CompileType AllocateObjectInstr::ComputeType() const { | 933 CompileType AllocateObjectInstr::ComputeType() const { |
| 943 if (!closure_function().IsNull()) { | 934 if (!closure_function().IsNull()) { |
| 944 ASSERT(cls().raw() == closure_function().signature_class()); | 935 ASSERT(cls().raw() == closure_function().signature_class()); |
| 945 return CompileType(CompileType::kNonNullable, | 936 return CompileType(CompileType::kNonNullable, |
| 946 cls().id(), | 937 cls().id(), |
| 947 &Type::ZoneHandle(cls().SignatureType())); | 938 &Type::ZoneHandle(cls().SignatureType())); |
| 948 } | 939 } |
| 949 // TODO(vegorov): Incorporate type arguments into the returned type. | 940 // TODO(vegorov): Incorporate type arguments into the returned type. |
| 950 return CompileType::FromCid(cls().id()); | 941 return CompileType::FromCid(cls().id()); |
| 951 } | 942 } |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 return CompileType::FromCid(kArrayCid); | 1243 return CompileType::FromCid(kArrayCid); |
| 1253 } else if (kind() == MergedMathInstr::kSinCos) { | 1244 } else if (kind() == MergedMathInstr::kSinCos) { |
| 1254 return CompileType::FromCid(kTypedDataFloat64ArrayCid); | 1245 return CompileType::FromCid(kTypedDataFloat64ArrayCid); |
| 1255 } else { | 1246 } else { |
| 1256 UNIMPLEMENTED(); | 1247 UNIMPLEMENTED(); |
| 1257 return CompileType::Dynamic(); | 1248 return CompileType::Dynamic(); |
| 1258 } | 1249 } |
| 1259 } | 1250 } |
| 1260 | 1251 |
| 1261 } // namespace dart | 1252 } // namespace dart |
| OLD | NEW |