OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 11443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11454 return HasResolvedTypeClass() && | 11454 return HasResolvedTypeClass() && |
11455 (type_class() == Type::Handle(Type::Function()).type_class()); | 11455 (type_class() == Type::Handle(Type::Function()).type_class()); |
11456 } | 11456 } |
11457 | 11457 |
11458 | 11458 |
11459 bool AbstractType::TypeTest(TypeTestKind test_kind, | 11459 bool AbstractType::TypeTest(TypeTestKind test_kind, |
11460 const AbstractType& other, | 11460 const AbstractType& other, |
11461 Error* bound_error) const { | 11461 Error* bound_error) const { |
11462 ASSERT(IsResolved()); | 11462 ASSERT(IsResolved()); |
11463 ASSERT(other.IsResolved()); | 11463 ASSERT(other.IsResolved()); |
11464 ASSERT(!IsMalformed()); | 11464 if (IsMalformed() || other.IsMalformed()) { |
11465 ASSERT(!other.IsMalformed()); | 11465 // Malformed types involved in subtype tests should be handled specially |
| 11466 // by the caller. Malformed types should only be encountered here in a |
| 11467 // more specific than test. |
| 11468 ASSERT(test_kind == kIsMoreSpecificThan); |
| 11469 return false; |
| 11470 } |
11466 // In case the type checked in a type test is malbounded, the code generator | 11471 // In case the type checked in a type test is malbounded, the code generator |
11467 // may compile a throw instead of a run time call performing the type check. | 11472 // may compile a throw instead of a run time call performing the type check. |
11468 // However, in checked mode, a function type may include malbounded result | 11473 // However, in checked mode, a function type may include malbounded result |
11469 // type and/or malbounded parameter types, which will then be encountered here | 11474 // type and/or malbounded parameter types, which will then be encountered here |
11470 // at run time. | 11475 // at run time. |
11471 if (IsMalbounded()) { | 11476 if (IsMalbounded()) { |
11472 ASSERT(FLAG_enable_type_checks); | 11477 ASSERT(FLAG_enable_type_checks); |
11473 if ((bound_error != NULL) && bound_error->IsNull()) { | 11478 if ((bound_error != NULL) && bound_error->IsNull()) { |
11474 const bool is_malbounded = IsMalboundedWithError(bound_error); | 11479 const bool is_malbounded = IsMalboundedWithError(bound_error); |
11475 ASSERT(is_malbounded); | 11480 ASSERT(is_malbounded); |
(...skipping 4263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15739 return "_MirrorReference"; | 15744 return "_MirrorReference"; |
15740 } | 15745 } |
15741 | 15746 |
15742 | 15747 |
15743 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 15748 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
15744 JSONObject jsobj(stream); | 15749 JSONObject jsobj(stream); |
15745 } | 15750 } |
15746 | 15751 |
15747 | 15752 |
15748 } // namespace dart | 15753 } // namespace dart |
OLD | NEW |